Mercurial > octave
comparison test/mk-sparse-tst.sh @ 32063:3b9305e62bb7
avoid LU warnings in sparse tests (bug #64117)
* mk-sparse-tst.sh: Avoid warnings from LU in sparse tests.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 27 Apr 2023 13:25:01 -0400 |
parents | bade9602c5a1 |
children | 5f5d8edbeb4f |
comparison
equal
deleted
inserted
replaced
32062:ada96a467a28 | 32063:3b9305e62bb7 |
---|---|
651 cat <<EOF | 651 cat <<EOF |
652 %!testif HAVE_UMFPACK | 652 %!testif HAVE_UMFPACK |
653 %! assert(det(bs+speye(size(bs))), det(bf+eye(size(bf))), 100*eps*abs(det(bf+eye(size(bf))))); | 653 %! assert(det(bs+speye(size(bs))), det(bf+eye(size(bf))), 100*eps*abs(det(bf+eye(size(bf))))); |
654 | 654 |
655 %!testif HAVE_UMFPACK | 655 %!testif HAVE_UMFPACK |
656 %! ## Yes, we want to test lu with fewer than 4 output arguments | |
657 %! ## and sparse input while also avoiding the warning. So use | |
658 %! ## warning ("off", ...) insetead of additional outputs. | |
659 %! warning ("off", "Octave:lu:sparse_input", "local"); | |
656 %! [l,u] = lu (sparse ([1,1;1,1])); | 660 %! [l,u] = lu (sparse ([1,1;1,1])); |
657 %! assert (l*u, [1,1;1,1], 10*eps); | 661 %! assert (l*u, [1,1;1,1], 10*eps); |
658 | 662 |
659 %!testif HAVE_UMFPACK | 663 %!testif HAVE_UMFPACK |
664 %! ## Yes, we want to test lu with fewer than 4 output arguments | |
665 %! ## and sparse input while also avoiding the warning. So use | |
666 %! ## warning ("off", ...) insetead of additional outputs. | |
667 %! warning ("off", "Octave:lu:sparse_input", "local"); | |
660 %! [l,u] = lu (sparse ([1,1;1,1+i])); | 668 %! [l,u] = lu (sparse ([1,1;1,1+i])); |
661 %! assert (l, sparse ([1,2,2],[1,1,2],1), 10*eps); | 669 %! assert (l, sparse ([1,2,2],[1,1,2],1), 10*eps); |
662 %! assert (u, sparse ([1,1,2],[1,2,2],[1,1,1i]), 10*eps); | 670 %! assert (u, sparse ([1,1,2],[1,2,2],[1,1,1i]), 10*eps); |
663 | 671 |
664 %!testif HAVE_UMFPACK # permuted LU | 672 %!testif HAVE_UMFPACK # permuted LU |
673 %! ## Yes, we want to test lu with fewer than 4 output arguments | |
674 %! ## and sparse input while also avoiding the warning. So use | |
675 %! ## warning ("off", ...) insetead of additional outputs. | |
676 %! warning ("off", "Octave:lu:sparse_input", "local"); | |
665 %! [L,U] = lu (bs); | 677 %! [L,U] = lu (bs); |
666 %! assert (L*U, bs, 1e-10); | 678 %! assert (L*U, bs, 1e-10); |
667 | 679 |
668 %!testif HAVE_UMFPACK # simple LU + row permutations | 680 %!testif HAVE_UMFPACK # simple LU + row permutations |
681 %! ## Yes, we want to test lu with fewer than 4 output arguments | |
682 %! ## and sparse input while also avoiding the warning. So use | |
683 %! ## warning ("off", ...) insetead of additional outputs. | |
684 %! warning ("off", "Octave:lu:sparse_input", "local"); | |
669 %! [L,U,P] = lu (bs); | 685 %! [L,U,P] = lu (bs); |
670 %! assert (P'*L*U, bs, 1e-10); | 686 %! assert (P'*L*U, bs, 1e-10); |
671 %! ## triangularity | 687 %! ## triangularity |
672 %! [i,j,v] = find (L); | 688 %! [i,j,v] = find (L); |
673 %! assert (i-j>=0); | 689 %! assert (i-j>=0); |
764 # gen_divop_tests # Disable rectangular \ and / for now | 780 # gen_divop_tests # Disable rectangular \ and / for now |
765 gen_matrixdiag_tests | 781 gen_matrixdiag_tests |
766 gen_matrixreshape_tests | 782 gen_matrixreshape_tests |
767 cat <<EOF | 783 cat <<EOF |
768 %!testif HAVE_UMFPACK # permuted LU | 784 %!testif HAVE_UMFPACK # permuted LU |
785 %! ## Yes, we want to test lu with fewer than 4 output arguments | |
786 %! ## and sparse input while also avoiding the warning. So use | |
787 %! ## warning ("off", ...) insetead of additional outputs. | |
788 %! warning ("off", "Octave:lu:sparse_input", "local"); | |
769 %! [L,U] = lu (bs); | 789 %! [L,U] = lu (bs); |
770 %! assert (L*U, bs, 1e-10); | 790 %! assert (L*U, bs, 1e-10); |
771 | 791 |
772 %!testif HAVE_UMFPACK # simple LU + row permutations | 792 %!testif HAVE_UMFPACK # simple LU + row permutations |
793 %! ## Yes, we want to test lu with fewer than 4 output arguments | |
794 %! ## and sparse input while also avoiding the warning. So use | |
795 %! ## warning ("off", ...) insetead of additional outputs. | |
796 %! warning ("off", "Octave:lu:sparse_input", "local"); | |
773 %! [L,U,P] = lu (bs); | 797 %! [L,U,P] = lu (bs); |
774 %! assert (P'*L*U, bs, 1e-10); | 798 %! assert (P'*L*U, bs, 1e-10); |
775 %! ## triangularity | 799 %! ## triangularity |
776 %! [i,j,v] = find (L); | 800 %! [i,j,v] = find (L); |
777 %! assert (i-j>=0); | 801 %! assert (i-j>=0); |