Permalink
Browse files

Changed tabs for mst_prim, dijkstra

  • Loading branch information...
1 parent e3ae208 commit 240a447e928d94db03a3b6bf6c9ff44fa843076a David Gleich committed Apr 30, 2009
Showing with 11 additions and 4 deletions.
  1. +5 −2 dijkstra.m
  2. +6 −2 mst_prim.m
View
@@ -6,8 +6,11 @@
% History
% 2008-04-09: Initial coding
-if isstruct(A), rp=A.rp; ci=A.ci; ai=A.ai; check=0;
-else [rp ci ai]=sparse_to_csr(A); check=1;
+if isstruct(A),
+ rp=A.rp; ci=A.ci; ai=A.ai;
+ check=0;
+else
+ [rp ci ai]=sparse_to_csr(A); check=1;
end
if check && any(ai)<0, error('gaimc:dijkstra', ...
'dijkstra''s algorithm cannot handle negative edge weights.'); end
View
@@ -15,8 +15,12 @@
if ~exist('full','var') || isempty(full), full=0; end
if ~exist('target','var') || isempty(full), u=1; end
-if isstruct(A), rp=A.rp; ci=A.ci; ai=A.ai; check=0;
-else [rp ci ai]=sparse_to_csr(A); check=1;
+if isstruct(A),
+ rp=A.rp; ci=A.ci; ai=A.ai;
+ check=0;
+else
+ [rp ci ai]=sparse_to_csr(A);
+ check=1;
end
if check && any(ai)<0, error('gaimc:prim', ...
'prim''s algorithm cannot handle negative edge weights.'); end

0 comments on commit 240a447

Please sign in to comment.