Ignore:
Timestamp:
Apr 10, 2018, 6:43:30 AM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Exclude_Hydrogens_annealWithBondGraph, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, PythonUI_with_named_parameters, StoppableMakroAction, TremoloParser_IncreasedPrecision
Children:
07d4b1
Parents:
7b4e67
git-author:
Frederik Heber <frederik.heber@…> (07/18/17 22:24:12)
git-committer:
Frederik Heber <frederik.heber@…> (04/10/18 06:43:30)
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.
File:
1 edited

Legend:

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

    r7b4e67 rf433ec  
    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}
Note: See TracChangeset for help on using the changeset viewer.