diff --git a/Eigen/src/Core/Dot.h b/Eigen/src/Core/Dot.h index 4f185ea5b..c5f2e8505 100644 --- a/Eigen/src/Core/Dot.h +++ b/Eigen/src/Core/Dot.h @@ -394,7 +394,7 @@ MatrixBase::blueNorm() const { ax = ei_abs(coeff(j)); if(ax > b2) abig += ei_abs2(ax*s2m); - else if(ax < b2) asml += ei_abs2(ax*s1m); + else if(ax < b1) asml += ei_abs2(ax*s1m); else amed += ei_abs2(ax); } if(abig > Scalar(0)) diff --git a/test/adjoint.cpp b/test/adjoint.cpp index 14ee44a0f..403f16a45 100644 --- a/test/adjoint.cpp +++ b/test/adjoint.cpp @@ -114,29 +114,15 @@ template void adjoint(const MatrixType& m) void test_adjoint() { -// for(int i = 0; i < g_repeat; i++) { -// CALL_SUBTEST( adjoint(Matrix()) ); -// CALL_SUBTEST( adjoint(Matrix3d()) ); -// CALL_SUBTEST( adjoint(Matrix4f()) ); -// CALL_SUBTEST( adjoint(MatrixXcf(4, 4)) ); -// CALL_SUBTEST( adjoint(MatrixXi(8, 12)) ); -// CALL_SUBTEST( adjoint(MatrixXf(21, 21)) ); -// } - // test a large matrix only once -// CALL_SUBTEST( adjoint(Matrix()) ); - for(int i = 0; i < g_repeat; i++) - { - std::cerr.precision(20); - int s = 1000000; - double y = 1.131242353467546478463457843445677435233e23 * ei_abs(ei_random()); - VectorXf v = VectorXf::Ones(s) * y; -// Vector4f x(v.segment(0,s/4).blueNorm(), v.segment(s/4+1,s/4).blueNorm(), -// v.segment((s/2)+1,s/4).blueNorm(), v.segment(3*s/4+1,s - 3*s/4-1).blueNorm()); -// std::cerr << v.norm() << " == " << v.stableNorm() << " == " << v.blueNorm() << " == " << x.norm() << "\n"; - std::cerr << v.norm() << "\n" << v.stableNorm() << "\n" << v.blueNorm() << "\n" << ei_sqrt(double(s)) * y << "\n\n\n"; - -// VectorXd d = VectorXd::Ones(s) * y;//v.cast(); -// std::cerr << d.norm() << "\n" << d.stableNorm() << "\n" << d.blueNorm() << "\n" << ei_sqrt(double(s)) * y << "\n\n\n"; + for(int i = 0; i < g_repeat; i++) { + CALL_SUBTEST( adjoint(Matrix()) ); + CALL_SUBTEST( adjoint(Matrix3d()) ); + CALL_SUBTEST( adjoint(Matrix4f()) ); + CALL_SUBTEST( adjoint(MatrixXcf(4, 4)) ); + CALL_SUBTEST( adjoint(MatrixXi(8, 12)) ); + CALL_SUBTEST( adjoint(MatrixXf(21, 21)) ); } + // test a large matrix only once + CALL_SUBTEST( adjoint(Matrix()) ); }