Ignore:
Timestamp:
Apr 15, 2010, 10:54:26 AM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
32842d8
Parents:
1f591b
Message:

Changed implementation of Vector to forward operations to contained objects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/unittests/ActOnAllUnitTest.cpp

    r1f591b re7ea64  
    7070
    7171  // scaling by value
    72   VL.ActOnAll( (void (Vector::*)(const double)) &Vector::Scale, 2. );
     72  VL.ActOnAll( (void (Vector::*)(const double)) &Vector::Scale, factor );
    7373  CPPUNIT_ASSERT_EQUAL( VL == Ref , false );
    7474
    75   VL.ActOnAll( (void (Vector::*)(const double)) &Vector::Scale, 0.5 );
    76   CPPUNIT_ASSERT_EQUAL( VL == Ref , true );
    77 
    78   // scaling by ref
    79   VL.ActOnAll( (void (Vector::*)(const double * const)) &Vector::Scale, (const double * const)&factor );
    80   CPPUNIT_ASSERT_EQUAL( VL == Ref , false );
    81 
    82   VL.ActOnAll( (void (Vector::*)(const double * const)) &Vector::Scale, (const double * const)&inverse );
     75  VL.ActOnAll( (void (Vector::*)(const double)) &Vector::Scale, inverse );
    8376  CPPUNIT_ASSERT_EQUAL( VL == Ref , true );
    8477
     
    9083    inverses[i] = 1./factors[i];
    9184  }
    92   VL.ActOnAll( (void (Vector::*)(const double ** const)) &Vector::Scale, (const double ** const)&factors );
     85  VL.ActOnAll<Vector,void,const double*>(&Vector::ScaleAll, factors );
    9386  CPPUNIT_ASSERT_EQUAL( VL == Ref , false );
    9487
    95   VL.ActOnAll( (void (Vector::*)(const double ** const)) &Vector::Scale, (const double ** const)&inverses );
     88  VL.ActOnAll<Vector,void,const double*>(&Vector::ScaleAll, inverses );
    9689  CPPUNIT_ASSERT_EQUAL( VL == Ref , true );
    9790  Free(factors);
Note: See TracChangeset for help on using the changeset viewer.