Ignore:
Timestamp:
Nov 4, 2009, 6:15:10 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
ec70ec
Parents:
20895b
git-author:
Frederik Heber <heber@…> (11/04/09 18:11:09)
git-committer:
Frederik Heber <heber@…> (11/04/09 18:15:10)
Message:

Periodic variants of AnalysisPair...() implemented.

  • BUGFIX: Vector::DistanceToPlane() - we did not check whether sign is 0.
  • NOTE: Due to changes in Vector::DistanceToPlane() with sign, Unit test AnalysisCorrelationToSurfaceUnitTest had to be changed:
    • we now have bin -0.5 filled with 1 (instead of 0.) and -0.288 instead of 0.288
    • find() replaced by lower_bound
  • new functions: PeriodicPairCorrelation(), PeriodicCorrelationToPoint(), PeriodicCorrelationToSurface()
    • each has a ranges[NDIM] argument with specifies the neighbours to scan: [ -ranges[i], ranges[i] ]
    • the atom::node is periodically translated to each periodic cell and the distance calculated.
  • NOTE: make check was broken before due to implementation of Periodic variants as normal ones (yielding more points that expected in unit test).

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

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

    r20895b r5f1d021  
    186186  CPPUNIT_ASSERT_EQUAL( 3, tester->second );
    187187  // inner point
    188   tester = binmap->lower_bound(0.);
     188  tester = binmap->lower_bound(-0.5);
    189189  CPPUNIT_ASSERT( tester != binmap->end() );
    190190  CPPUNIT_ASSERT_EQUAL( 1, tester->second );
     
    200200  OutputCorrelation ( (ofstream *)&cout, binmap );
    201201  // three outside points
    202   tester = binmap->find(3.);
     202  tester = binmap->lower_bound(3.);
    203203  CPPUNIT_ASSERT( tester != binmap->end() );
    204204  CPPUNIT_ASSERT_EQUAL( 3, tester->second );
    205205  // inner point
    206   tester = binmap->find(0.);
     206  tester = binmap->lower_bound(-0.5);
    207207  CPPUNIT_ASSERT( tester != binmap->end() );
    208208  CPPUNIT_ASSERT_EQUAL( 1, tester->second );
Note: See TracChangeset for help on using the changeset viewer.