|
[Rivet-svn] r3290 - trunk/testblackhole at projects.hepforge.org blackhole at projects.hepforge.orgMon Aug 15 17:14:33 BST 2011
Author: buckley Date: Mon Aug 15 17:14:33 2011 New Revision: 3290 Log: Adding angle function tests Modified: trunk/test/testMatVec.cc Modified: trunk/test/testMatVec.cc ============================================================================== --- trunk/test/testMatVec.cc Mon Aug 15 14:56:59 2011 (r3289) +++ trunk/test/testMatVec.cc Mon Aug 15 17:14:33 2011 (r3290) @@ -41,8 +41,6 @@ m.set(2, 2, 9); cout << m << endl << endl; EigenSystem<3> es = diagonalize(m); - /// @todo Fix the EigenSystem operator<< and toString() function - //cout << "Eigensolns = " << endl << toString(es) << endl << endl; cout << "Matrices:" << endl; cout << Matrix3() << endl; @@ -142,5 +140,27 @@ cout << (ltY * ltX).boost() << endl; cout << (ltX * ltX.inverse()).boost() << endl; + //////////// + + // Angle tests + assert(fuzzyEquals(angle(FourMomentum(1,0,0,1), FourMomentum(1,0,0,1))/M_PI, 0.0)); + assert(fuzzyEquals(angle(FourMomentum(1,0,0,1), FourMomentum(1,0,1,0))/M_PI, 0.5)); + assert(fuzzyEquals(angle(FourMomentum(1,0,0,1), FourMomentum(1,0,0,-1))/M_PI, 1.0)); + // Test with vectors of different magnitude + assert(fuzzyEquals(angle(FourMomentum(3,0,0,3), FourMomentum(1,0,0,1))/M_PI, 0.0)); + assert(fuzzyEquals(angle(FourMomentum(5,0,0,5), FourMomentum(1,0,1,0))/M_PI, 0.5)); + assert(fuzzyEquals(angle(FourMomentum(7,0,0,7), FourMomentum(1,0,0,-1))/M_PI, 1.0)); + + //////////// + + linspace(0, 10, 50); + logspace(0.000001, 1.0, 50); + + assert(isZero(1e-15)); + assert(fuzzyEquals(1e-15, 0.0)); + assert(fuzzyEquals(2.0, 2.0)); + assert(!fuzzyEquals(1, 2.0)); + assert(fuzzyGtrEquals(1.0, 1.0 - 1e-15)); + return EXIT_SUCCESS; }
More information about the Rivet-svn mailing list |