comparison test/build_sparse_tests.sh @ 7326:fcc6d853df9e

[project @ 2007-12-19 21:27:23 by jwe]
author jwe
date Wed, 19 Dec 2007 21:27:23 +0000
parents 40a17a87155e
children f5005d9510f4
comparison
equal deleted inserted replaced
7325:67aef14de9c2 7326:fcc6d853df9e
788 } 788 }
789 789
790 # ======================================================= 790 # =======================================================
791 # sparse selection tests 791 # sparse selection tests
792 792
793 gen_scalar_select_tests () {
794 cat >>$TESTS <<EOF
795 %!assert (sparse(42)([1,1]),sparse([42,42]))
796 %!assert (sparse(42*1i)([1,1]),sparse([42,42].*1i))
797 EOF
798 }
799
793 gen_select_tests() { 800 gen_select_tests() {
794 cat >>$TESTS <<EOF 801 cat >>$TESTS <<EOF
795 %!test as=sparse(af); 802 %!test as=sparse(af);
796 803
797 %% Point tests 804 %% Point tests
1224 %! as=sprandn(m,n,0.3); af = full(as+1i*sprandn(as)); 1231 %! as=sprandn(m,n,0.3); af = full(as+1i*sprandn(as));
1225 %! ridx = ceil(m*rand(1,ceil(rand*m)) 1232 %! ridx = ceil(m*rand(1,ceil(rand*m))
1226 %! cidx = ceil(n*rand(1,ceil(rand*n)) 1233 %! cidx = ceil(n*rand(1,ceil(rand*n))
1227 EOF 1234 EOF
1228 fi 1235 fi
1236 gen_scalar_select_tests
1229 gen_select_tests 1237 gen_select_tests
1230 echo '%!test af=real(af);' >> $TESTS 1238 echo '%!test af=real(af);' >> $TESTS
1231 gen_select_tests 1239 gen_select_tests
1232 gen_section 1240 gen_section
1233 echo '%!shared alpha,beta,df,pdf,lf,plf,uf,puf,bf,cf,bcf,tf,tcf,xf,ds,pds,ls,pls,us,pus,bs,cs,bcs,ts,tcs,xs' >>$TESTS 1241 echo '%!shared alpha,beta,df,pdf,lf,plf,uf,puf,bf,cf,bcf,tf,tcf,xf,ds,pds,ls,pls,us,pus,bs,cs,bcs,ts,tcs,xs' >>$TESTS