Ignore:
Timestamp:
Nov 12, 2017, 8:48:40 AM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
ForceAnnealing_with_BondGraph_continued_betteresults
Children:
30e1a4
Parents:
982e6d
git-author:
Frederik Heber <frederik.heber@…> (07/18/17 22:24:12)
git-committer:
Frederik Heber <frederik.heber@…> (11/12/17 08:48:40)
Message:

We now obtain weights via levmar minimization.

  • this should yield the best possible weights within the interval of [1/n,1.].
  • note that we cannot always get an exact solution because of this constraint.
Location:
src/Dynamics/unittests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Dynamics/unittests/BondVectorsUnitTest.cpp

    r982e6d r06b7d9  
    197197  CPPUNIT_ASSERT( fabs(weight_sum - 1.) < MYEPSILON );
    198198  // check weight
    199   CPPUNIT_ASSERT_EQUAL( weights[0], 1. );
     199  CPPUNIT_ASSERT( fabs(weight_sum - 1.) < 1e-10 );
    200200}
    201201
     
    289289  // check number of weights
    290290  CPPUNIT_ASSERT_EQUAL( weights.size(), (size_t)5 );
    291   // check sum of weights: one linear independent, two dependent vectors = 1 + 2*0.5
    292   const double weight_sum = std::accumulate(weights.begin(), weights.end(), 0.);
    293   CPPUNIT_ASSERT( fabs(weight_sum - 2.) < 1e-10 );
    294 }
     291  // check sum of weights
     292  const double weight_sum = std::accumulate(weights.begin(), weights.end(), 0.);
     293  CPPUNIT_ASSERT( fabs(weights[0] - .372244) < 1e-6 );
     294  CPPUNIT_ASSERT( fabs(weights[1] - .529694) < 1e-6 );
     295  CPPUNIT_ASSERT( fabs(weights[2] - .2) < 1e-6 );
     296  CPPUNIT_ASSERT( fabs(weights[3] - .248464) < 1e-6 );
     297  CPPUNIT_ASSERT( fabs(weights[4] - .248464) < 1e-6 );
     298}
  • src/Dynamics/unittests/Makefile.am

    r982e6d r06b7d9  
    1111  BondVectorsUnitTest
    1212
    13 XFAIL_TESTS += BondVectorsUnitTest
    14  
    1513TESTS += $(DYNAMICSTESTS)
    1614check_PROGRAMS += $(DYNAMICSTESTS)
Note: See TracChangeset for help on using the changeset viewer.