File perl-Algorithm-Graphs-TransitiveClosure.spec of Package perl-Algorithm-Graphs-TransitiveClosure
#
# spec file for package perl-Algorithm-Graphs-TransitiveClosure
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: perl-Algorithm-Graphs-TransitiveClosure
Version: 2009110901
Release: 0
%define cpan_name Algorithm-Graphs-TransitiveClosure
Summary: Calculate the transitive closure
License: MIT
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Algorithm-Graphs-TransitiveClosure/
Source0: http://www.cpan.org/authors/id/A/AB/ABIGAIL/%{cpan_name}-%{version}.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
%{perl_requires}
%description
This is an implementation of the well known _Floyd-Warshall_ algorithm.
[1,2]
The subroutine 'floyd_warshall' takes a directed graph, and calculates its
transitive closure, which will be returned. The given graph is actually
modified, so be sure to pass a copy of the graph to the routine if you need
to keep the original graph.
The subroutine takes graphs in one of the two following formats:
* floyd_warshall ARRAYREF
The graph _G = (V, E)_ is described with a list of lists, '$graph',
representing _V x V_. If there is an edge between vertices '$i' and '$j'
(or if '$i == $j'), then '$graph -> [$i] -> [$j] == 1'. For all other pairs
'($k, $l)' from _V x V_, '$graph -> [$k] -> [$l] == 0'.
The resulting '$graph' will have '$graph -> [$i] -> [$j] == 1' iff '$i ==
$j' or there is a path in _G_ from '$i' to '$j', and '$graph -> [$i] ->
[$j] == 0' otherwise.
* floyd_warshall HASHREF
The graph _G = (V, E)_, with labeled vertices, is described with a hash of
hashes, '$graph', representing _V x V_. If there is an edge between
vertices '$label1' and '$label2' (or if '$label1 eq $label2'), then '$graph
-> {$label1} -> {$label2} == 1'. For all other pairs '($label3, $label4)'
from _V x V_, '$graph -> {$label3} -> {$label4}' does not exist.
The resulting '$graph' will have '$graph -> {$label1} -> {$label2} == 1'
iff '$label1 eq $label2' or there is a path in _G_ from '$label1' to
'$label2', and '$graph -> {$label1} -> {$label2}' does not exist otherwise.
%prep
%setup -q -n %{cpan_name}-%{version}
find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
%{__make} %{?_smp_mflags}
%check
%{__make} test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%defattr(-,root,root,755)
%doc Changes README
%changelog