Mercurial > octave-libgccjit
comparison test/build_sparse_tests.sh @ 8954:97c84c4c2247
Make the column permutation vector in sparse LU cols()-long.
author | Jason Riedy <jason@acm.org> |
---|---|
date | Tue, 10 Mar 2009 21:54:34 -0400 |
parents | eb63fbe60fab |
children | 25417bd9a3c7 |
comparison
equal
deleted
inserted
replaced
8953:a6945f92b868 | 8954:97c84c4c2247 |
---|---|
663 %! assert(i-j>=0); | 663 %! assert(i-j>=0); |
664 %! [i,j,v]=find(U); | 664 %! [i,j,v]=find(U); |
665 %! assert(j-i>=0); | 665 %! assert(j-i>=0); |
666 | 666 |
667 %!testif HAVE_UMFPACK ;# LU with vector permutations | 667 %!testif HAVE_UMFPACK ;# LU with vector permutations |
668 %! [L,U,P] = lu(bs,'vector'); | 668 %! [L,U,P,Q] = lu(bs,'vector'); |
669 %! assert(L(P,:)*U,bs,1e-10); | 669 %! assert(L(P,:)*U(:,Q),bs,1e-10); |
670 %! # triangularity | 670 %! # triangularity |
671 %! [i,j,v]=find(L); | 671 %! [i,j,v]=find(L); |
672 %! assert(i-j>=0); | 672 %! assert(i-j>=0); |
673 %! [i,j,v]=find(U); | 673 %! [i,j,v]=find(U); |
674 %! assert(j-i>=0); | 674 %! assert(j-i>=0); |
743 gen_sparsesparse_elementop_tests | 743 gen_sparsesparse_elementop_tests |
744 gen_matrixop_tests | 744 gen_matrixop_tests |
745 # gen_divop_tests # Disable rectangular \ and / for now | 745 # gen_divop_tests # Disable rectangular \ and / for now |
746 gen_matrixdiag_tests | 746 gen_matrixdiag_tests |
747 gen_matrixreshape_tests | 747 gen_matrixreshape_tests |
748 cat >>$TESTS <<EOF | |
749 %!testif HAVE_UMFPACK ;# permuted LU | |
750 %! [L,U] = lu(bs); | |
751 %! assert(L*U,bs,1e-10); | |
752 | |
753 %!testif HAVE_UMFPACK ;# simple LU + row permutations | |
754 %! [L,U,P] = lu(bs); | |
755 %! assert(P'*L*U,bs,1e-10); | |
756 %! # triangularity | |
757 %! [i,j,v]=find(L); | |
758 %! assert(i-j>=0); | |
759 %! [i,j,v]=find(U); | |
760 %! assert(j-i>=0); | |
761 | |
762 %!testif HAVE_UMFPACK ;# simple LU + row/col permutations | |
763 %! [L,U,P,Q] = lu(bs); | |
764 %! assert(P'*L*U*Q',bs,1e-10); | |
765 %! # triangularity | |
766 %! [i,j,v]=find(L); | |
767 %! assert(i-j>=0); | |
768 %! [i,j,v]=find(U); | |
769 %! assert(j-i>=0); | |
770 | |
771 %!testif HAVE_UMFPACK ;# LU with vector permutations | |
772 %! [L,U,P,Q] = lu(bs,'vector'); | |
773 %! assert(L(P,:)*U(:,Q),bs,1e-10); | |
774 %! # triangularity | |
775 %! [i,j,v]=find(L); | |
776 %! assert(i-j>=0); | |
777 %! [i,j,v]=find(U); | |
778 %! assert(j-i>=0); | |
779 | |
780 %!testif HAVE_UMFPACK ;# LU with scaling | |
781 %! [L,U,P,Q,R] = lu(bs); | |
782 %! assert(R*P'*L*U*Q',bs,1e-10); | |
783 %! # triangularity | |
784 %! [i,j,v]=find(L); | |
785 %! assert(i-j>=0); | |
786 %! [i,j,v]=find(U); | |
787 %! assert(j-i>=0); | |
788 | |
789 EOF | |
748 } | 790 } |
749 | 791 |
750 | 792 |
751 # ======================================================= | 793 # ======================================================= |
752 # sparse assembly tests | 794 # sparse assembly tests |