diff --git a/test/householder.cpp b/test/householder.cpp index 2d025e702..b7a1cadf9 100644 --- a/test/householder.cpp +++ b/test/householder.cpp @@ -59,7 +59,7 @@ template void householder(const MatrixType& m) v1.makeHouseholder(essential, beta, alpha); v1.applyHouseholderOnTheLeft(essential,beta,tmp); VERIFY_IS_APPROX(v1.norm(), v2.norm()); - VERIFY_IS_MUCH_SMALLER_THAN(v1.tail(rows-1).norm(), v1.norm()); + if(rows>=2) VERIFY_IS_MUCH_SMALLER_THAN(v1.tail(rows-1).norm(), v1.norm()); v1 = VectorType::Random(rows); v2 = v1; v1.applyHouseholderOnTheLeft(essential,beta,tmp); @@ -75,7 +75,7 @@ template void householder(const MatrixType& m) m1.col(0).makeHouseholder(essential, beta, alpha); m1.applyHouseholderOnTheLeft(essential,beta,tmp); VERIFY_IS_APPROX(m1.norm(), m2.norm()); - VERIFY_IS_MUCH_SMALLER_THAN(m1.block(1,0,rows-1,cols).norm(), m1.norm()); + if(rows>=2) VERIFY_IS_MUCH_SMALLER_THAN(m1.block(1,0,rows-1,cols).norm(), m1.norm()); VERIFY_IS_MUCH_SMALLER_THAN(ei_imag(m1(0,0)), ei_real(m1(0,0))); VERIFY_IS_APPROX(ei_real(m1(0,0)), alpha); @@ -87,7 +87,7 @@ template void householder(const MatrixType& m) m3.row(0).makeHouseholder(essential, beta, alpha); m3.applyHouseholderOnTheRight(essential,beta,tmp); VERIFY_IS_APPROX(m3.norm(), m4.norm()); - VERIFY_IS_MUCH_SMALLER_THAN(m3.block(0,1,rows,rows-1).norm(), m3.norm()); + if(rows>=2) VERIFY_IS_MUCH_SMALLER_THAN(m3.block(0,1,rows,rows-1).norm(), m3.norm()); VERIFY_IS_MUCH_SMALLER_THAN(ei_imag(m3(0,0)), ei_real(m3(0,0))); VERIFY_IS_APPROX(ei_real(m3(0,0)), alpha); @@ -127,5 +127,6 @@ void test_householder() CALL_SUBTEST_5( householder(MatrixXd(10,12)) ); CALL_SUBTEST_6( householder(MatrixXcf(16,17)) ); CALL_SUBTEST_7( householder(MatrixXf(25,7)) ); + CALL_SUBTEST_8( householder(Matrix()) ); } } diff --git a/test/product_notemporary.cpp b/test/product_notemporary.cpp index 543020398..0c9785f43 100644 --- a/test/product_notemporary.cpp +++ b/test/product_notemporary.cpp @@ -86,6 +86,7 @@ template void product_notemporary(const MatrixType& m) VERIFY_EVALUATION_COUNT( rm3.noalias() = (s1 * m1.adjoint()).template triangularView() * (m2+m2), 1); VERIFY_EVALUATION_COUNT( rm3.noalias() = (s1 * m1.adjoint()).template triangularView() * m2.adjoint(), 0); +// FIXME this used to work but was broken by the eigen-storageorders fork. Why? // VERIFY_EVALUATION_COUNT( rm3.col(c0).noalias() = (s1 * m1.adjoint()).template triangularView() * (s2*m2.row(c0)).adjoint(), 0); VERIFY_EVALUATION_COUNT( m1.template triangularView().solveInPlace(m3), 0); @@ -95,7 +96,9 @@ template void product_notemporary(const MatrixType& m) VERIFY_EVALUATION_COUNT( m3.noalias() = s2 * m2.adjoint() * (s1 * m1.adjoint()).template selfadjointView(), 0); VERIFY_EVALUATION_COUNT( rm3.noalias() = (s1 * m1.adjoint()).template selfadjointView() * m2.adjoint(), 0); +// FIXME this used to work but was broken by the eigen-storageorders fork. Why? // VERIFY_EVALUATION_COUNT( m3.col(c0).noalias() = (s1 * m1).adjoint().template selfadjointView() * (-m2.row(c0)*s3).adjoint(), 0); +// FIXME this used to work but was broken by the eigen-storageorders fork. Why? // VERIFY_EVALUATION_COUNT( m3.col(c0).noalias() -= (s1 * m1).adjoint().template selfadjointView() * (-m2.row(c0)*s3).adjoint(), 0); VERIFY_EVALUATION_COUNT( m3.block(r0,c0,r1,c1).noalias() += m1.block(r0,r0,r1,r1).template selfadjointView() * (s1*m2.block(r0,c0,r1,c1)), 0); diff --git a/test/qr_colpivoting.cpp b/test/qr_colpivoting.cpp index 96cc66316..0ca897b52 100644 --- a/test/qr_colpivoting.cpp +++ b/test/qr_colpivoting.cpp @@ -68,9 +68,9 @@ template void qr_fixedsize() ColPivHouseholderQR > qr(m1); VERIFY_IS_APPROX(rank, qr.rank()); VERIFY(Cols - qr.rank() == qr.dimensionOfKernel()); - VERIFY(!qr.isInjective()); - VERIFY(!qr.isInvertible()); - VERIFY(!qr.isSurjective()); + VERIFY(qr.isInjective() == (rank == Rows)); + VERIFY(qr.isSurjective() == (rank == Cols)); + VERIFY(qr.isInvertible() == (qr.isInjective() && qr.isSurjective())); Matrix r = qr.matrixQR().template triangularView(); Matrix c = qr.householderQ() * r * qr.colsPermutation().inverse(); @@ -141,6 +141,7 @@ void test_qr_colpivoting() CALL_SUBTEST_3( qr() ); CALL_SUBTEST_4(( qr_fixedsize, 4 >() )); CALL_SUBTEST_5(( qr_fixedsize, 3 >() )); + CALL_SUBTEST_5(( qr_fixedsize, 1 >() )); } for(int i = 0; i < g_repeat; i++) {