#include #include #include #include "TRandom3.h" #include "JMath/JMath.hh" #include "JMath/JSVD3D.hh" #include "JMath/JMathTestkit.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" int main(int argc, char**argv) { using namespace std; using namespace JPP; double precision; int debug; try { JParser<> zap; zap['e'] = make_field(precision) = 1.0e-3; zap['d'] = make_field(debug) = 3; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } gRandom->SetSeed(0); JMatrix3D A = getRandom(); JSVD3D svd; svd.decompose(A); DEBUG("A" << endl << A << endl); DEBUG("U" << endl << svd.U << endl); DEBUG("S" << endl << svd.S << endl); DEBUG("V" << endl << svd.V << endl); JMatrix3D C = svd.invert(); C *= A; DEBUG("C" << endl << C << endl); ASSERT(C.isIdentity(precision)); return 0; }