# HG changeset patch # User michelemartone # Date 1364746914 0 # Node ID dbc62fd394236d2824d558a092aad901776b70f5 # Parent 4c91dd3872e018eb809606ecca82c17fd7f701a7 small bugfix to the tester. the obench program will also benchmark colamd-preordered matrices. diff -r 4c91dd3872e0 -r dbc62fd39423 main/sparsersb/src/obench.m --- a/main/sparsersb/src/obench.m Sun Mar 31 15:57:29 2013 +0000 +++ b/main/sparsersb/src/obench.m Sun Mar 31 16:21:54 2013 +0000 @@ -1,7 +1,8 @@ # once complete, this program will benchmark our matrix implementation against octave's - +cmt="#"; #for n_=1:6*0+1 for n_=1:6 +for ro=0:1 n=n_*1000; m=k=n; # making vectors @@ -11,13 +12,26 @@ # making matrices r=(rand(n)>.6); om=sparse(r); + nz=nnz(om); + M=10^6; + if ro==1 + printf("%s%s\n",cmt,"reordering with colamd"); + pct=-time; + p=colamd(om); + pct+=time; + pat=-time; + om=om(:,p); + pat+=time; + # TODO: use an array to select/specify the different reordering algorithms + printf("%g\t%g\t(%s)\n",(nz/M)/pct,(nz/M)/pat,"mflops for pct/pat"); + else + printf("%s%s\n",cmt,"no reordering"); + end #bm=sparsevbr(om); bm=sparsersb(sparse(om)); #bm=sparsersb3(sparse(om)); # stats - nz=nnz(om); flops=2*nz; - M=10^6; ## spmv ot=-time; ox=om*b; ot+=time; # @@ -45,3 +59,4 @@ t=bt; p=["RSB"]; mflops=n*(flops/M)/t; printf("%s\t%d\t%d\t%d\t%g\t%s\n","RSB_SPGEMM",m,k,nz,mflops, p); endfor +endfor diff -r 4c91dd3872e0 -r dbc62fd39423 main/sparsersb/src/sparsersbtester.m --- a/main/sparsersb/src/sparsersbtester.m Sun Mar 31 15:57:29 2013 +0000 +++ b/main/sparsersb/src/sparsersbtester.m Sun Mar 31 16:21:54 2013 +0000 @@ -280,7 +280,9 @@ function match=testnorm(OM,XM) match=1; - match&=isequal(normest(OM),normest(XM)); + if(isreal(OM)) + match&=isequal(full(normest(OM)),full(normest(XM))); + end testmsg(match,"norms"); end