7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Test matrix inverter"
10 #include <boost/test/unit_test.hpp>
11 #include <boost/foreach.hpp>
22 using namespace boost;
29 using namespace Eigen;
79 JacobiSVD<RealMatrix> svd(A, ComputeThinU | ComputeThinV);
82 BOOST_CHECK_CLOSE(svd.singularValues()[0],12.,tol[0]);
83 BOOST_CHECK_CLOSE(svd.singularValues()[1],6.,tol[0]);
84 BOOST_CHECK_CLOSE(svd.singularValues()[2]+1.,0.+1.,tol[0]);
89 for (
Uint i=0; i<3; ++i)
94 * svd.matrixU().leftCols(s_inv.size()).adjoint()
100 for (
Uint i=0; i<x.size(); i++)
101 BOOST_CHECK_CLOSE(x[i]+1.,xCheck[i]+1.,tol[i]);
107 BOOST_AUTO_TEST_SUITE_END()
external boost library namespace
~MatrixInverter_Fixture()
common tear-down for each test case
MatrixInverter_Fixture()
common setup for each test case
Static functions for mathematical constants.
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealVector
Dynamic sized column vector.
Top-level namespace for coolfluid.
Static functions for checking Real numbers.
unsigned int Uint
typedef for unsigned int
Eigen::Matrix< Real, 4, 1 > RealVector4
Fixed size 4x1 column vector.
bool is_equal_with_error(const Real &x, const Real &y, const Real &fuzz)
Most basic kernel library.
BOOST_AUTO_TEST_CASE(SVDInverterTest)
Eigen::Matrix< Real, 3, 1 > RealVector3
Fixed size 3x1 column vector.