Changeset 9b410d


Ignore:
Timestamp:
Apr 6, 2011, 1:10:31 PM (14 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
06aedc
Parents:
1be8a5
git-author:
Frederik Heber <heber@…> (03/14/11 13:54:08)
git-committer:
Frederik Heber <heber@…> (04/06/11 13:10:31)
Message:

Replace MYEPSILON in LinearAlgebra/ by LINALG_MYEPSILON.

  • this is preparatory for external use lib libmolecuilderLinearAlgebra.
  • new file LinearAlgebra/defs.hpp.
Location:
src/LinearAlgebra
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • src/LinearAlgebra/Line.cpp

    r1be8a5 r9b410d  
    2424#include <cmath>
    2525#include <iostream>
    26 
    27 #include "LinearAlgebra/Vector.hpp"
     26#include <limits>
     27
     28#include "CodePatterns/Info.hpp"
    2829#include "CodePatterns/Log.hpp"
    2930#include "CodePatterns/Verbose.hpp"
    30 #include "LinearAlgebra/MatrixContent.hpp"
    31 #include "CodePatterns/Info.hpp"
    3231#include "Exceptions/LinearDependenceException.hpp"
    3332#include "Exceptions/SkewException.hpp"
     33#include "LinearAlgebra/defs.hpp"
     34#include "LinearAlgebra/MatrixContent.hpp"
    3435#include "LinearAlgebra/Plane.hpp"
     36#include "LinearAlgebra/Vector.hpp"
    3537
    3638using namespace std;
     
    132134  //  cout << endl;
    133135  //}
    134   if (fabs(M->Determinant()) > MYEPSILON) {
     136  if (fabs(M->Determinant()) > LINALG_MYEPSILON) {
    135137    Log() << Verbose(1) << "Determinant of coefficient matrix is NOT zero." << endl;
    136138    throw SkewException(__FILE__,__LINE__);
     
    146148  Vector d = Line2b - Line1b;
    147149  Log() << Verbose(1) << "INFO: a = " << a << ", b = " << b << ", c = " << c << "." << endl;
    148   if ((a.NormSquared() < MYEPSILON) || (b.NormSquared() < MYEPSILON)) {
     150  if ((a.NormSquared() <= LINALG_MYEPSILON) || (b.NormSquared() <= LINALG_MYEPSILON)) {
    149151   res.Zero();
    150152   Log() << Verbose(1) << "At least one of the lines is ill-defined, i.e. offset equals second vector." << endl;
     
    155157  Vector parallel;
    156158  double factor = 0.;
    157   if (fabs(a.ScalarProduct(b)*a.ScalarProduct(b)/a.NormSquared()/b.NormSquared() - 1.) < MYEPSILON) {
     159  if (fabs(a.ScalarProduct(b)*a.ScalarProduct(b)/a.NormSquared()/b.NormSquared() - 1.) <= LINALG_MYEPSILON) {
    158160    parallel = Line1a - Line2a;
    159161    factor = parallel.ScalarProduct(a)/a.Norm();
    160     if ((factor >= -MYEPSILON) && (factor - 1. < MYEPSILON)) {
     162    if ((factor > -LINALG_MYEPSILON) && (factor - 1. <= LINALG_MYEPSILON)) {
    161163      res = Line2a;
    162164      Log() << Verbose(1) << "Lines conincide." << endl;
     
    165167      parallel = Line1a - Line2b;
    166168      factor = parallel.ScalarProduct(a)/a.Norm();
    167       if ((factor >= -MYEPSILON) && (factor - 1. < MYEPSILON)) {
     169      if ((factor > -LINALG_MYEPSILON) && (factor - 1. <= LINALG_MYEPSILON)) {
    168170        res = Line2b;
    169171        Log() << Verbose(1) << "Lines conincide." << endl;
     
    184186  temp2.VectorProduct(b);
    185187  Log() << Verbose(1) << "INFO: temp1 = " << temp1 << ", temp2 = " << temp2 << "." << endl;
    186   if (fabs(temp2.NormSquared()) > MYEPSILON)
     188  if (fabs(temp2.NormSquared()) > LINALG_MYEPSILON)
    187189    s = temp1.ScalarProduct(temp2)/temp2.NormSquared();
    188190  else
  • src/LinearAlgebra/Makefile.am

    r1be8a5 r9b410d  
    2828LINALGHEADER = \
    2929  BoxVector.hpp \
     30  defs.hpp \
    3031  Eigenspace.hpp \
    3132  leastsquaremin.hpp \
  • src/LinearAlgebra/MatrixContent.cpp

    r1be8a5 r9b410d  
    1414#include "CodePatterns/MemDebug.hpp"
    1515
    16 #include "LinearAlgebra/RealSpaceMatrix.hpp"
     16#include "CodePatterns/Assert.hpp"
    1717#include "Exceptions/NotInvertibleException.hpp"
    18 #include "CodePatterns/Assert.hpp"
    1918#include "Helpers/defs.hpp"
    2019#include "Helpers/fast_functions.hpp"
     20#include "LinearAlgebra/defs.hpp"
     21#include "LinearAlgebra/MatrixContent.hpp"
     22#include "LinearAlgebra/RealSpaceMatrix.hpp"
    2123#include "LinearAlgebra/Vector.hpp"
    2224#include "LinearAlgebra/VectorContent.hpp"
    23 #include "LinearAlgebra/MatrixContent.hpp"
    2425
    2526#include <gsl/gsl_blas.h>
     
    3233#include <cassert>
    3334#include <iostream>
     35#include <limits>
    3436#include <set>
    3537
     
    513515    size_t I=0;
    514516    for (size_t i=0; i<greaterDimension; i++) { // only copy real space part
    515       if (fabs(GSL_REAL(gsl_vector_complex_get(eval,i))) > MYEPSILON) { // only take eigenvectors with value > 0
     517      if (fabs(GSL_REAL(gsl_vector_complex_get(eval,i))) > LINALG_MYEPSILON) { // only take eigenvectors with value > 0
    516518        std::cout << i << "th eigenvalue is (" << GSL_REAL(gsl_vector_complex_get(eval,i)) << "," << GSL_IMAG(gsl_vector_complex_get(eval,i)) << ")" << std::endl;
    517519        for (size_t j=0; j<greaterDimension; j++) {
    518           if (fabs(GSL_IMAG(gsl_matrix_complex_get(evec,j,i))) > MYEPSILON)
     520          if (fabs(GSL_IMAG(gsl_matrix_complex_get(evec,j,i))) > LINALG_MYEPSILON)
    519521            std::cerr << "MatrixContent::transformToEigenbasis() - WARNING: eigenvectors are complex-valued!" << std::endl;
    520522          gsl_matrix_set(content, j,I, GSL_REAL(gsl_matrix_complex_get(evec,j,i)));
    521523        }
    522         if (fabs(GSL_IMAG(gsl_vector_complex_get(eval,I))) > MYEPSILON)
     524        if (fabs(GSL_IMAG(gsl_vector_complex_get(eval,I))) > LINALG_MYEPSILON)
    523525          std::cerr << "MatrixContent::transformToEigenbasis() - WARNING: eigenvectors are complex-valued!" << std::endl;
    524526        gsl_vector_set(eval_real, I, GSL_REAL(gsl_vector_complex_get(eval, i)));
     
    640642
    641643/** Equality operator.
    642  * Note that we use numerical sensible checking, i.e. with threshold MYEPSILON.
     644 * Note that we use numerical sensible checking, i.e. with threshold LINALG_MYEPSILON.
    643645 * \param &rhs MatrixContent to checks against
    644646 */
     
    648650    for(int i=rows;i--;){
    649651      for(int j=columns;j--;){
    650         if(fabs(at(i,j)-rhs.at(i,j))>MYEPSILON){
     652        if(fabs(at(i,j)-rhs.at(i,j))>LINALG_MYEPSILON){
    651653          return false;
    652654        }
  • src/LinearAlgebra/Plane.cpp

    r1be8a5 r9b410d  
    2121
    2222#include <cmath>
    23 
    24 #include "Exceptions/MultipleSolutionsException.hpp"
     23#include <limits>
     24
    2525#include "CodePatterns/Assert.hpp"
    26 #include "Helpers/defs.hpp"
    27 #include "Helpers/helpers.hpp"
    2826#include "CodePatterns/Info.hpp"
    2927#include "CodePatterns/Log.hpp"
    3028#include "CodePatterns/Verbose.hpp"
     29#include "Exceptions/MultipleSolutionsException.hpp"
     30#include "Helpers/defs.hpp"
     31#include "Helpers/helpers.hpp"
     32#include "LinearAlgebra/defs.hpp"
    3133#include "LinearAlgebra/Line.hpp"
    3234#include "LinearAlgebra/Plane.hpp"
     
    4143  Vector x1 = y1 -y2;
    4244  Vector x2 = y3 -y2;
    43   if ((fabs(x1.Norm()) < MYEPSILON) || (fabs(x2.Norm()) < MYEPSILON) || (fabs(x1.Angle(x2)) < MYEPSILON)) {
     45  if ((fabs(x1.Norm()) <= LINALG_MYEPSILON) || (fabs(x2.Norm()) <= LINALG_MYEPSILON) || (fabs(x1.Angle(x2)) <= LINALG_MYEPSILON)) {
    4446    throw LinearDependenceException(__FILE__,__LINE__);
    4547  }
     
    6769  Vector x1 = y1;
    6870  Vector x2 = y2;
    69   if ((fabs(x1.Norm()) < MYEPSILON) || (fabs(x2.Norm()) < MYEPSILON)) {
     71  if ((fabs(x1.Norm()) <= LINALG_MYEPSILON) || (fabs(x2.Norm()) <= LINALG_MYEPSILON)) {
    7072    throw ZeroVectorException(__FILE__,__LINE__);
    7173  }
    7274
    73   if((fabs(x1.Angle(x2)) < MYEPSILON)) {
     75  if((fabs(x1.Angle(x2)) <= LINALG_MYEPSILON)) {
    7476    throw LinearDependenceException(__FILE__,__LINE__);
    7577  }
     
    178180
    179181  double factor1 = getNormal().ScalarProduct(line.getDirection());
    180   if(fabs(factor1)<MYEPSILON){
     182  if(fabs(factor1) <= LINALG_MYEPSILON){
    181183    // the plane is parallel... under all circumstances this is bad luck
    182184    // we no have either no or infinite solutions
     
    224226Vector Plane::getClosestPoint(const Vector &point) const{
    225227  double factor = point.ScalarProduct(*normalVector)-offset;
    226   if(fabs(factor) < MYEPSILON){
     228  if(fabs(factor) <= LINALG_MYEPSILON){
    227229    // the point itself lies on the plane
    228230    return point;
  • src/LinearAlgebra/RealSpaceMatrix.cpp

    r1be8a5 r9b410d  
    2424#include "Helpers/defs.hpp"
    2525#include "Helpers/fast_functions.hpp"
     26#include "LinearAlgebra/defs.hpp"
    2627#include "LinearAlgebra/MatrixContent.hpp"
    2728#include "LinearAlgebra/RealSpaceMatrix.hpp"
     
    3839#include <cmath>
    3940#include <iostream>
     41#include <limits>
    4042
    4143using namespace std;
     
    256258RealSpaceMatrix RealSpaceMatrix::invert() const{
    257259  double det = determinant();
    258   if(fabs(det)<MYEPSILON){
     260  if(fabs(det) <= LINALG_MYEPSILON){
    259261    throw NotInvertibleException(__FILE__,__LINE__);
    260262  }
  • src/LinearAlgebra/Space.cpp

    r1be8a5 r9b410d  
    2020#include "CodePatterns/MemDebug.hpp"
    2121
     22#include <limits>
     23
    2224#include "Helpers/defs.hpp"
     25#include "LinearAlgebra/defs.hpp"
    2326#include "LinearAlgebra/Space.hpp"
    2427#include "LinearAlgebra/Vector.hpp"
     
    4043
    4144bool Space::isContained(const Vector &point) const{
    42   return (distance(point)) < MYEPSILON;
     45  return (distance(point)) <= LINALG_MYEPSILON;
    4346}
  • src/LinearAlgebra/Vector.cpp

    r1be8a5 r9b410d  
    1919#include "CodePatterns/MemDebug.hpp"
    2020
     21#include "CodePatterns/Assert.hpp"
     22#include "CodePatterns/Verbose.hpp"
    2123#include "Exceptions/MathException.hpp"
     24#include "Helpers/defs.hpp"
     25#include "Helpers/fast_functions.hpp"
     26#include "LinearAlgebra/defs.hpp"
    2227#include "LinearAlgebra/Vector.hpp"
    2328#include "LinearAlgebra/VectorContent.hpp"
    24 #include "CodePatterns/Assert.hpp"
    25 #include "Helpers/defs.hpp"
    26 #include "Helpers/fast_functions.hpp"
    27 #include "CodePatterns/Verbose.hpp"
    2829
    2930#include <cmath>
  • src/LinearAlgebra/VectorContent.cpp

    r1be8a5 r9b410d  
    2424#include <cmath>
    2525#include <iostream>
     26#include <limits>
    2627
    2728#include "CodePatterns/Assert.hpp"
    2829#include "Helpers/defs.hpp"
     30#include "LinearAlgebra/defs.hpp"
    2931#include "LinearAlgebra/Vector.hpp"
    3032#include "LinearAlgebra/VectorContent.hpp"
     
    249251  ASSERT(dimension == b.dimension, "Dimenions of VectorContents to compare differ");
    250252  for (size_t i=0;i<dimension;i++)
    251     status = status && (fabs(at(i) - b.at(i)) < MYEPSILON);
     253    status = status && (fabs(at(i) - b.at(i)) <= LINALG_MYEPSILON);
    252254  return status;
    253255};
     
    368370  for (size_t i = dimension; i--; )
    369371    result += fabs(at(i));
    370   return (result < MYEPSILON);
     372  return (result <= LINALG_MYEPSILON);
    371373};
    372374
     
    379381  for (size_t i=dimension;--i;)
    380382    NormValue += at(i)*at(i);
    381   return (fabs(NormValue - 1.) < MYEPSILON);
     383  return (fabs(NormValue - 1.) <= LINALG_MYEPSILON);
    382384};
    383385
     
    444446  double norm1 = Norm(), norm2 = y.Norm();
    445447  double angle = -1;
    446   if ((fabs(norm1) > MYEPSILON) && (fabs(norm2) > MYEPSILON))
     448  if ((fabs(norm1) > LINALG_MYEPSILON) && (fabs(norm2) > LINALG_MYEPSILON))
    447449    angle = this->ScalarProduct(y)/norm1/norm2;
    448   // -1-MYEPSILON occured due to numerical imprecision, catch ...
    449   //Log() << Verbose(2) << "INFO: acos(-1) = " << acos(-1) << ", acos(-1+MYEPSILON) = " << acos(-1+MYEPSILON) << ", acos(-1-MYEPSILON) = " << acos(-1-MYEPSILON) << "." << endl;
     450  // -1-LINALG_MYEPSILON occured due to numerical imprecision, catch ...
     451  //Log() << Verbose(2) << "INFO: acos(-1) = " << acos(-1) << ", acos(-1+LINALG_MYEPSILON) = " << acos(-1+LINALG_MYEPSILON) << ", acos(-1-LINALG_MYEPSILON) = " << acos(-1-LINALG_MYEPSILON) << "." << endl;
    450452  if (angle < -1)
    451453    angle = -1;
  • src/LinearAlgebra/unittests/LinearSystemOfEquationsUnitTest.cpp

    r1be8a5 r9b410d  
    2020using namespace std;
    2121
    22 #include <iomanip>
     22#include <limits>
    2323#include <cppunit/CompilerOutputter.h>
    2424#include <cppunit/extensions/TestFactoryRegistry.h>
     
    2626#include <cmath>
    2727
     28#include "LinearAlgebra/defs.hpp"
    2829#include "LinearAlgebra/Vector.hpp"
    2930
     
    117118  s->GetSolutionAsArray(array);
    118119  for (int i=0;i<4;i++) {
    119     CPPUNIT_ASSERT( fabs(x_array[i] - array[i]) < MYEPSILON );
     120    CPPUNIT_ASSERT( fabs(x_array[i] - array[i]) <= LINALG_MYEPSILON );
    120121  }
    121122  delete[](array);
  • src/LinearAlgebra/unittests/MatrixUnitTest.cpp

    r1be8a5 r9b410d  
    2323
    2424#include <cmath>
     25#include <limits>
    2526
    2627#include "MatrixUnitTest.hpp"
     28#include "LinearAlgebra/defs.hpp"
     29#include "LinearAlgebra/RealSpaceMatrix.hpp"
    2730#include "LinearAlgebra/Vector.hpp"
    28 #include "LinearAlgebra/RealSpaceMatrix.hpp"
    2931#include "Exceptions/NotInvertibleException.hpp"
    3032
     
    190192
    191193  res =(*zero) *(*zero);
    192   std::cout << *zero << " times " << *zero << " is " << res << std::endl;
     194  //std::cout << *zero << " times " << *zero << " is " << res << std::endl;
    193195  CPPUNIT_ASSERT_EQUAL(res,*zero);
    194196  res =(*zero) *(*one);
     
    269271  // arbitrary rotation matrix has det = 1
    270272  res.setRotation(M_PI/3.,1.,M_PI/7.);
    271   CPPUNIT_ASSERT(fabs(fabs(res.determinant()) -1.) < MYEPSILON);
     273  CPPUNIT_ASSERT(fabs(fabs(res.determinant()) -1.) <= LINALG_MYEPSILON);
    272274
    273275  // inverse is rotation matrix with negative angles
  • src/LinearAlgebra/unittests/PlaneUnitTest.cpp

    r1be8a5 r9b410d  
    2323
    2424#include <cmath>
    25 
     25#include <limits>
     26
     27#include "LinearAlgebra/defs.hpp"
     28#include "LinearAlgebra/Line.hpp"
    2629#include "LinearAlgebra/Vector.hpp"
    27 #include "LinearAlgebra/Line.hpp"
    2830
    2931#include "PlaneUnitTest.hpp"
     
    158160  {
    159161    Vector t = (1./3.)*(unitVec[0]+unitVec[1]+unitVec[2]);
    160     CPPUNIT_ASSERT(fabs(p1->distance(zeroVec)-t.Norm()) < MYEPSILON);
     162    CPPUNIT_ASSERT(fabs(p1->distance(zeroVec)-t.Norm()) <= LINALG_MYEPSILON);
    161163    CPPUNIT_ASSERT_EQUAL(t,p1->getClosestPoint(zeroVec));
    162164  }
    163165
    164   CPPUNIT_ASSERT(fabs(p2->distance(unitVec[2])-1) < MYEPSILON);
     166  CPPUNIT_ASSERT(fabs(p2->distance(unitVec[2])-1) <= LINALG_MYEPSILON);
    165167  CPPUNIT_ASSERT_EQUAL(zeroVec,p2->getClosestPoint(unitVec[2]));
    166   CPPUNIT_ASSERT(fabs(p3->distance(unitVec[1])-1) < MYEPSILON);
     168  CPPUNIT_ASSERT(fabs(p3->distance(unitVec[1])-1) <= LINALG_MYEPSILON);
    167169  CPPUNIT_ASSERT_EQUAL(zeroVec,p3->getClosestPoint(unitVec[1]));
    168   CPPUNIT_ASSERT(fabs(p4->distance(unitVec[0])-1) < MYEPSILON);
     170  CPPUNIT_ASSERT(fabs(p4->distance(unitVec[0])-1) <= LINALG_MYEPSILON);
    169171  CPPUNIT_ASSERT_EQUAL(zeroVec,p4->getClosestPoint(unitVec[0]));
    170172}
  • src/LinearAlgebra/unittests/VectorUnitTest.cpp

    r1be8a5 r9b410d  
    2424#include <cppunit/ui/text/TestRunner.h>
    2525
     26#include <limits>
     27
     28#include "CodePatterns/Log.hpp"
     29#include "Exceptions/LinearDependenceException.hpp"
    2630#include "Helpers/defs.hpp"
    27 #include "CodePatterns/Log.hpp"
     31#include "LinearAlgebra/defs.hpp"
     32#include "LinearAlgebra/Plane.hpp"
     33#include "LinearAlgebra/RealSpaceMatrix.hpp"
    2834#include "LinearAlgebra/Vector.hpp"
    2935#include "LinearAlgebra/vector_ops.hpp"
    30 #include "LinearAlgebra/Plane.hpp"
    31 #include "Exceptions/LinearDependenceException.hpp"
    32 #include "LinearAlgebra/RealSpaceMatrix.hpp"
    3336
    3437#include "VectorUnitTest.hpp"
     
    230233  CPPUNIT_ASSERT_EQUAL( M_PI, zero.Angle(unit) );
    231234  CPPUNIT_ASSERT_EQUAL( 0., unit.Angle(unit) );
    232   CPPUNIT_ASSERT_EQUAL( true, fabs(M_PI/2. - otherunit.Angle(unit)) < MYEPSILON );
    233   CPPUNIT_ASSERT_EQUAL( true, fabs(M_PI/2. - unit.Angle(notunit)) < MYEPSILON );
    234   CPPUNIT_ASSERT_EQUAL( true, fabs(M_PI/4. - otherunit.Angle(notunit)) < MYEPSILON );
     235  CPPUNIT_ASSERT_EQUAL( true, fabs(M_PI/2. - otherunit.Angle(unit)) <= LINALG_MYEPSILON );
     236  CPPUNIT_ASSERT_EQUAL( true, fabs(M_PI/2. - unit.Angle(notunit)) <= LINALG_MYEPSILON );
     237  CPPUNIT_ASSERT_EQUAL( true, fabs(M_PI/4. - otherunit.Angle(notunit)) <= LINALG_MYEPSILON );
    235238};
    236239
     
    255258  // first one-component system
    256259  CPPUNIT_ASSERT(testVector.GetOneNormalVector(unit));
    257   CPPUNIT_ASSERT(testVector.ScalarProduct(unit) < MYEPSILON);
     260  CPPUNIT_ASSERT(testVector.ScalarProduct(unit) <= LINALG_MYEPSILON);
    258261
    259262  // second one-component system
    260263  CPPUNIT_ASSERT(testVector.GetOneNormalVector(otherunit));
    261   CPPUNIT_ASSERT(testVector.ScalarProduct(otherunit) < MYEPSILON);
     264  CPPUNIT_ASSERT(testVector.ScalarProduct(otherunit) <= LINALG_MYEPSILON);
    262265
    263266  // first two-component system
    264267  CPPUNIT_ASSERT(testVector.GetOneNormalVector(notunit));
    265   CPPUNIT_ASSERT(testVector.ScalarProduct(notunit) < MYEPSILON);
     268  CPPUNIT_ASSERT(testVector.ScalarProduct(notunit) <= LINALG_MYEPSILON);
    266269
    267270  // second two-component system
    268271  CPPUNIT_ASSERT(testVector.GetOneNormalVector(two));
    269   CPPUNIT_ASSERT(testVector.ScalarProduct(two) < MYEPSILON);
     272  CPPUNIT_ASSERT(testVector.ScalarProduct(two) <= LINALG_MYEPSILON);
    270273
    271274  // three component system
    272275  CPPUNIT_ASSERT(testVector.GetOneNormalVector(three));
    273   CPPUNIT_ASSERT(testVector.ScalarProduct(three) < MYEPSILON);
    274 }
     276  CPPUNIT_ASSERT(testVector.ScalarProduct(three) <= LINALG_MYEPSILON);
     277}
Note: See TracChangeset for help on using the changeset viewer.