MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Definition at line 68 of file ObjectiveFunctionTest.cpp.
ObjectiveFunctionTest::ObjectiveFunctionTest | ( | ) | [inline] |
Definition at line 163 of file ObjectiveFunctionTest.cpp.
{}
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_eval_OF_value_LInf | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_eval_OF_value_max | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LInf_invalid_qm_eval | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_max_invalid_qm_eval | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_qm_error_eval | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_qm_error_grad | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_qm_error_diag | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_qm_error_hess | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LInf_qm_error_eval | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_max_qm_error_eval | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_eval_calc | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_eval_accum | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_eval_save | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_eval_update | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_eval_temp | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_grad_calc | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_grad_save | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_grad_update | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_grad_temp | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_diag_calc | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_diag_save | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_diag_update | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_diag_temp | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_hess_calc | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_hess_save | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_hess_update | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_hess_temp | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_clone_L1 | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LPtoP_clone_L2 | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_LInf_clone | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_max_clone | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST | ( | test_max_negate_flag_eval | ) | [private] |
ObjectiveFunctionTest::CPPUNIT_TEST_SUITE_END | ( | ) | [private] |
void ObjectiveFunctionTest::setUp | ( | ) | [inline] |
Definition at line 165 of file ObjectiveFunctionTest.cpp.
Definition at line 551 of file ObjectiveFunctionTest.cpp.
References ASSERT_NO_ERROR, MBMesquite::ObjectiveFunction::CALCULATE, CPPUNIT_ASSERT, CPPUNIT_ASSERT_EQUAL, CPPUNIT_ASSERT_MATRICES_EQUAL, MBMesquite::create_qm_two_tet_patch(), MBMesquite::LPtoPTemplate::evaluate_with_Hessian(), MBMesquite::MsqHessian::get_block(), MBMesquite::MsqHessian::initialize(), MBMesquite::PatchData::num_free_vertices(), MBMesquite::AveragingQM::set_averaging_method(), and MBMesquite::QualityMetric::SUM.
{ MsqPrintError err( cout ); PatchData tetPatch; create_qm_two_tet_patch( tetPatch, err ); ASSERT_NO_ERROR( err ); // creates a mean ratio quality metric ... IdealWeightInverseMeanRatio* mean_ratio = new IdealWeightInverseMeanRatio( err ); CPPUNIT_ASSERT( !err ); mean_ratio->set_averaging_method( QualityMetric::SUM ); // ... and builds an objective function with it LPtoPTemplate LP2( mean_ratio, 2, err ); MsqHessian H; std::vector< Vector3D > g; double dummy; H.initialize( tetPatch, err ); CPPUNIT_ASSERT( !err ); LP2.evaluate_with_Hessian( ObjectiveFunction::CALCULATE, tetPatch, dummy, g, H, err ); CPPUNIT_ASSERT( !err ); CPPUNIT_ASSERT_EQUAL( tetPatch.num_free_vertices(), g.size() ); Matrix3D mat00( " 2.44444 0.2566 0.181444 " " 0.2566 2.14815 0.104757 " " 0.181444 0.104757 2.07407 " ); Matrix3D mat13( " 5.47514 3.16659 9.83479 " " -1.11704 -5.29718 -3.67406 " " 10.3635 -13.5358 -15.5638 " ); CPPUNIT_ASSERT_MATRICES_EQUAL( mat00, *H.get_block( 0, 0 ), 1e-4 ); CPPUNIT_ASSERT_MATRICES_EQUAL( mat13, *H.get_block( 1, 3 ), 1e-4 ); delete mean_ratio; }
Definition at line 589 of file ObjectiveFunctionTest.cpp.
References ASSERT_NO_ERROR, MBMesquite::ObjectiveFunction::CALCULATE, CPPUNIT_ASSERT, CPPUNIT_ASSERT_EQUAL, CPPUNIT_ASSERT_MATRICES_EQUAL, MBMesquite::create_qm_two_tet_patch(), MBMesquite::LPtoPTemplate::evaluate_with_Hessian(), MBMesquite::MsqHessian::get_block(), MBMesquite::MsqHessian::initialize(), MBMesquite::PatchData::num_free_vertices(), MBMesquite::AveragingQM::set_averaging_method(), MBMesquite::LPtoPTemplate::set_dividing_by_n(), and MBMesquite::QualityMetric::SUM.
{ MsqPrintError err( cout ); PatchData tetPatch; create_qm_two_tet_patch( tetPatch, err ); ASSERT_NO_ERROR( err ); // creates a mean ratio quality metric ... IdealWeightInverseMeanRatio* mean_ratio = new IdealWeightInverseMeanRatio( err ); CPPUNIT_ASSERT( !err ); mean_ratio->set_averaging_method( QualityMetric::SUM ); // ... and builds an objective function with it LPtoPTemplate LP2( mean_ratio, 2, err ); LP2.set_dividing_by_n( true ); MsqHessian H; std::vector< Vector3D > g; double dummy; H.initialize( tetPatch, err ); CPPUNIT_ASSERT( !err ); LP2.evaluate_with_Hessian( ObjectiveFunction::CALCULATE, tetPatch, dummy, g, H, err ); CPPUNIT_ASSERT( !err ); CPPUNIT_ASSERT_EQUAL( tetPatch.num_free_vertices(), g.size() ); Matrix3D mat00( " 2.44444 0.2566 0.181444 " " 0.2566 2.14815 0.104757 " " 0.181444 0.104757 2.07407 " ); mat00 *= .5; Matrix3D mat13( " 5.47514 3.16659 9.83479 " " -1.11704 -5.29718 -3.67406 " " 10.3635 -13.5358 -15.5638 " ); mat13 *= .5; CPPUNIT_ASSERT_MATRICES_EQUAL( mat00, *H.get_block( 0, 0 ), 1e-4 ); CPPUNIT_ASSERT_MATRICES_EQUAL( mat13, *H.get_block( 1, 3 ), 1e-4 ); // cout << H <<endl; delete mean_ratio; }
void ObjectiveFunctionTest::test_compute_gradient_LPtoPTemplate_L1 | ( | ) | [inline] |
Definition at line 257 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP1( 1, NULL ); compare_numerical_gradient( &LP1 ); }
void ObjectiveFunctionTest::test_compute_gradient_LPtoPTemplate_L2 | ( | ) | [inline] |
Definition at line 263 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP1( 2, NULL ); compare_numerical_gradient( &LP1 ); }
void ObjectiveFunctionTest::test_compute_gradient_LPtoPTemplate_L2_scaled | ( | ) | [inline] |
Definition at line 269 of file ObjectiveFunctionTest.cpp.
References MBMesquite::LPtoPTemplate::set_dividing_by_n().
{ LPtoPTemplate LP1( 2, NULL ); LP1.set_dividing_by_n( true ); compare_numerical_gradient( &LP1 ); }
void ObjectiveFunctionTest::test_diag_OF_value_LPtoP_L1 | ( | ) | [inline] |
Definition at line 185 of file ObjectiveFunctionTest.cpp.
{ test_LPtoP_value( 1, false, values1, DIAG ); test_LPtoP_value( 1, false, values2, DIAG ); }
void ObjectiveFunctionTest::test_diag_OF_value_LPtoP_L2 | ( | ) | [inline] |
Definition at line 209 of file ObjectiveFunctionTest.cpp.
{ test_LPtoP_value( 2, false, values1, DIAG ); test_LPtoP_value( 2, false, values2, DIAG ); }
void ObjectiveFunctionTest::test_diag_OF_value_LPtoP_scaled | ( | ) | [inline] |
Definition at line 233 of file ObjectiveFunctionTest.cpp.
{ test_LPtoP_value( 2, true, values1, DIAG ); test_LPtoP_value( 2, true, values2, DIAG ); }
void ObjectiveFunctionTest::test_diagonal_gradient_LPtoPTemplate_L1 | ( | ) | [inline] |
Definition at line 295 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP1( 1, NULL ); compare_diagonal_gradient( &LP1 ); }
void ObjectiveFunctionTest::test_diagonal_gradient_LPtoPTemplate_L2 | ( | ) | [inline] |
Definition at line 301 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP1( 2, NULL ); compare_diagonal_gradient( &LP1 ); }
void ObjectiveFunctionTest::test_diagonal_gradient_LPtoPTemplate_L2_scaled | ( | ) | [inline] |
Definition at line 307 of file ObjectiveFunctionTest.cpp.
References MBMesquite::LPtoPTemplate::set_dividing_by_n().
{ LPtoPTemplate LP1( 2, NULL ); LP1.set_dividing_by_n( true ); compare_diagonal_gradient( &LP1 ); }
void ObjectiveFunctionTest::test_eval_OF_value_LInf | ( | ) | [inline] |
Definition at line 245 of file ObjectiveFunctionTest.cpp.
{ test_LInf_value( values1 ); test_LInf_value( values2 ); }
void ObjectiveFunctionTest::test_eval_OF_value_LPtoP_L1 | ( | ) | [inline] |
Definition at line 173 of file ObjectiveFunctionTest.cpp.
{ test_LPtoP_value( 1, false, values1, EVAL ); test_LPtoP_value( 1, false, values2, EVAL ); }
void ObjectiveFunctionTest::test_eval_OF_value_LPtoP_L2 | ( | ) | [inline] |
Definition at line 197 of file ObjectiveFunctionTest.cpp.
{ test_LPtoP_value( 2, false, values1, EVAL ); test_LPtoP_value( 2, false, values2, EVAL ); }
void ObjectiveFunctionTest::test_eval_OF_value_LPtoP_scaled | ( | ) | [inline] |
Definition at line 221 of file ObjectiveFunctionTest.cpp.
{ test_LPtoP_value( 2, true, values1, EVAL ); test_LPtoP_value( 2, true, values2, EVAL ); }
void ObjectiveFunctionTest::test_eval_OF_value_max | ( | ) | [inline] |
Definition at line 251 of file ObjectiveFunctionTest.cpp.
{ test_max_value( values1 ); test_max_value( values2 ); }
void ObjectiveFunctionTest::test_grad_OF_value_LPtoP_L1 | ( | ) | [inline] |
Definition at line 179 of file ObjectiveFunctionTest.cpp.
{ test_LPtoP_value( 1, false, values1, GRAD ); test_LPtoP_value( 1, false, values2, GRAD ); }
void ObjectiveFunctionTest::test_grad_OF_value_LPtoP_L2 | ( | ) | [inline] |
Definition at line 203 of file ObjectiveFunctionTest.cpp.
{ test_LPtoP_value( 2, false, values1, GRAD ); test_LPtoP_value( 2, false, values2, GRAD ); }
void ObjectiveFunctionTest::test_grad_OF_value_LPtoP_scaled | ( | ) | [inline] |
Definition at line 227 of file ObjectiveFunctionTest.cpp.
{ test_LPtoP_value( 2, true, values1, GRAD ); test_LPtoP_value( 2, true, values2, GRAD ); }
void ObjectiveFunctionTest::test_hess_OF_value_LPtoP_L1 | ( | ) | [inline] |
Definition at line 191 of file ObjectiveFunctionTest.cpp.
{ test_LPtoP_value( 1, false, values1, HESS ); test_LPtoP_value( 1, false, values2, HESS ); }
void ObjectiveFunctionTest::test_hess_OF_value_LPtoP_L2 | ( | ) | [inline] |
Definition at line 215 of file ObjectiveFunctionTest.cpp.
{ test_LPtoP_value( 2, false, values1, HESS ); test_LPtoP_value( 2, false, values2, HESS ); }
void ObjectiveFunctionTest::test_hess_OF_value_LPtoP_scaled | ( | ) | [inline] |
Definition at line 239 of file ObjectiveFunctionTest.cpp.
{ test_LPtoP_value( 2, true, values1, EVAL ); test_LPtoP_value( 2, true, values2, EVAL ); }
void ObjectiveFunctionTest::test_hessian_diagonal_LPtoPTemplate_L1 | ( | ) | [inline] |
Definition at line 314 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP1( 1, NULL ); compare_hessian_diagonal( &LP1 ); }
void ObjectiveFunctionTest::test_hessian_diagonal_LPtoPTemplate_L2 | ( | ) | [inline] |
Definition at line 320 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP1( 2, NULL ); compare_hessian_diagonal( &LP1 ); }
void ObjectiveFunctionTest::test_hessian_diagonal_LPtoPTemplate_L2_scaled | ( | ) | [inline] |
Definition at line 326 of file ObjectiveFunctionTest.cpp.
References MBMesquite::LPtoPTemplate::set_dividing_by_n().
{ LPtoPTemplate LP1( 2, NULL ); LP1.set_dividing_by_n( true ); compare_hessian_diagonal( &LP1 ); }
void ObjectiveFunctionTest::test_hessian_gradient_LPtoPTemplate_L1 | ( | ) | [inline] |
Definition at line 276 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP1( 1, NULL ); compare_hessian_gradient( &LP1 ); }
void ObjectiveFunctionTest::test_hessian_gradient_LPtoPTemplate_L2 | ( | ) | [inline] |
Definition at line 282 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP1( 2, NULL ); compare_hessian_gradient( &LP1 ); }
void ObjectiveFunctionTest::test_hessian_gradient_LPtoPTemplate_L2_scaled | ( | ) | [inline] |
Definition at line 288 of file ObjectiveFunctionTest.cpp.
References MBMesquite::LPtoPTemplate::set_dividing_by_n().
{ LPtoPTemplate LP1( 2, NULL ); LP1.set_dividing_by_n( true ); compare_hessian_gradient( &LP1 ); }
void ObjectiveFunctionTest::test_LInf_clone | ( | ) | [inline] |
Definition at line 498 of file ObjectiveFunctionTest.cpp.
{ LInfTemplate OF( NULL ); test_clone( &OF ); }
void ObjectiveFunctionTest::test_LInf_invalid_qm_eval | ( | ) | [inline] |
Definition at line 357 of file ObjectiveFunctionTest.cpp.
{ LInfTemplate OF( NULL ); test_handles_invalid_qm( EVAL, &OF ); }
void ObjectiveFunctionTest::test_LInf_negate_flag_eval | ( | ) | [inline] |
Definition at line 536 of file ObjectiveFunctionTest.cpp.
{ LInfTemplate OF( NULL ); test_max_negate_flag( OF ); }
void ObjectiveFunctionTest::test_LInf_qm_error_eval | ( | ) | [inline] |
Definition at line 388 of file ObjectiveFunctionTest.cpp.
{ LInfTemplate OF( NULL ); test_handles_qm_error( EVAL, &OF ); }
void ObjectiveFunctionTest::test_LInf_value | ( | const std::vector< double > & | values | ) | [private] |
Definition at line 651 of file ObjectiveFunctionTest.cpp.
References MBMesquite::arrptr(), CPPUNIT_ASSERT, and test_value().
{ CPPUNIT_ASSERT( !values.empty() ); LInfTemplate OF( NULL ); double expected = fabs( values[0] ); for( unsigned i = 1; i < values.size(); ++i ) if( fabs( values[i] ) > expected ) expected = fabs( values[i] ); test_value( arrptr( values ), values.size(), expected, EVAL, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_clone_L1 | ( | ) | [inline] |
Definition at line 488 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate OF( 1, NULL ); test_clone( &OF ); }
void ObjectiveFunctionTest::test_LPtoP_clone_L2 | ( | ) | [inline] |
Definition at line 493 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate OF( 2, NULL ); test_clone( &OF ); }
void ObjectiveFunctionTest::test_LPtoP_diag_calc | ( | ) | [inline] |
Definition at line 446 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::CALCULATE.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::CALCULATE, DIAG, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_diag_save | ( | ) | [inline] |
Definition at line 451 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::SAVE.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::SAVE, DIAG, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_diag_temp | ( | ) | [inline] |
Definition at line 461 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::TEMPORARY.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::TEMPORARY, DIAG, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_diag_update | ( | ) | [inline] |
Definition at line 456 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::UPDATE.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::UPDATE, DIAG, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_eval_accum | ( | ) | [inline] |
Definition at line 404 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::ACCUMULATE.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::ACCUMULATE, EVAL, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_eval_calc | ( | ) | [inline] |
Definition at line 399 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::CALCULATE.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::CALCULATE, EVAL, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_eval_save | ( | ) | [inline] |
Definition at line 409 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::SAVE.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::SAVE, EVAL, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_eval_temp | ( | ) | [inline] |
Definition at line 419 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::TEMPORARY.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::TEMPORARY, EVAL, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_eval_update | ( | ) | [inline] |
Definition at line 414 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::UPDATE.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::UPDATE, EVAL, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_grad_calc | ( | ) | [inline] |
Definition at line 425 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::CALCULATE.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::CALCULATE, GRAD, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_grad_save | ( | ) | [inline] |
Definition at line 430 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::SAVE.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::SAVE, GRAD, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_grad_temp | ( | ) | [inline] |
Definition at line 440 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::TEMPORARY.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::TEMPORARY, GRAD, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_grad_update | ( | ) | [inline] |
Definition at line 435 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::UPDATE.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::UPDATE, GRAD, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_hess_calc | ( | ) | [inline] |
Definition at line 467 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::CALCULATE.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::CALCULATE, HESS, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_hess_save | ( | ) | [inline] |
Definition at line 472 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::SAVE.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::SAVE, HESS, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_hess_temp | ( | ) | [inline] |
Definition at line 482 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::TEMPORARY.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::TEMPORARY, HESS, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_hess_update | ( | ) | [inline] |
Definition at line 477 of file ObjectiveFunctionTest.cpp.
References MBMesquite::ObjectiveFunction::UPDATE.
{ LPtoPTemplate OF( 1, NULL ); test_eval_type( ObjectiveFunction::UPDATE, HESS, &OF ); }
void ObjectiveFunctionTest::test_LPtoP_invalid_qm_diag | ( | ) | [inline] |
Definition at line 347 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP1( 1, NULL ); test_handles_invalid_qm( DIAG, &LP1 ); }
void ObjectiveFunctionTest::test_LPtoP_invalid_qm_eval | ( | ) | [inline] |
Definition at line 337 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP1( 1, NULL ); test_handles_invalid_qm( EVAL, &LP1 ); }
void ObjectiveFunctionTest::test_LPtoP_invalid_qm_grad | ( | ) | [inline] |
Definition at line 342 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP1( 1, NULL ); test_handles_invalid_qm( GRAD, &LP1 ); }
void ObjectiveFunctionTest::test_LPtoP_invalid_qm_hess | ( | ) | [inline] |
Definition at line 352 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP1( 1, NULL ); test_handles_invalid_qm( HESS, &LP1 ); }
void ObjectiveFunctionTest::test_LPtoP_negate_flag_diag | ( | ) | [inline] |
Definition at line 526 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP( 2, NULL ); test_negate_flag( DIAG, &LP ); }
void ObjectiveFunctionTest::test_LPtoP_negate_flag_eval | ( | ) | [inline] |
Definition at line 516 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP( 2, NULL ); test_negate_flag( EVAL, &LP ); }
void ObjectiveFunctionTest::test_LPtoP_negate_flag_grad | ( | ) | [inline] |
Definition at line 521 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP( 2, NULL ); test_negate_flag( GRAD, &LP ); }
void ObjectiveFunctionTest::test_LPtoP_negate_flag_hess | ( | ) | [inline] |
Definition at line 531 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP( 2, NULL ); test_negate_flag( HESS, &LP ); }
void ObjectiveFunctionTest::test_LPtoP_qm_error_diag | ( | ) | [inline] |
Definition at line 378 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP1( 1, NULL ); test_handles_qm_error( DIAG, &LP1 ); }
void ObjectiveFunctionTest::test_LPtoP_qm_error_eval | ( | ) | [inline] |
Definition at line 368 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP1( 1, NULL ); test_handles_qm_error( EVAL, &LP1 ); }
void ObjectiveFunctionTest::test_LPtoP_qm_error_grad | ( | ) | [inline] |
Definition at line 373 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP1( 1, NULL ); test_handles_qm_error( GRAD, &LP1 ); }
void ObjectiveFunctionTest::test_LPtoP_qm_error_hess | ( | ) | [inline] |
Definition at line 383 of file ObjectiveFunctionTest.cpp.
{ LPtoPTemplate LP1( 1, NULL ); test_handles_qm_error( HESS, &LP1 ); }
void ObjectiveFunctionTest::test_LPtoP_value | ( | short | P, |
bool | scale, | ||
const std::vector< double > & | values, | ||
OFTestMode | mode | ||
) | [private] |
Definition at line 633 of file ObjectiveFunctionTest.cpp.
References MBMesquite::arrptr(), CPPUNIT_ASSERT, MBMesquite::P, and test_value().
{ CPPUNIT_ASSERT( !values.empty() ); LPtoPTemplate OF( P, NULL ); OF.set_dividing_by_n( scale ); double expected = 0.0; for( std::vector< double >::const_iterator i = values.begin(); i != values.end(); ++i ) expected += std::pow( fabs( *i ), P ); if( scale ) expected /= values.size(); test_value( arrptr( values ), values.size(), expected, mode, &OF ); }
void ObjectiveFunctionTest::test_max_clone | ( | ) | [inline] |
Definition at line 503 of file ObjectiveFunctionTest.cpp.
{ MaxTemplate OF( NULL ); test_clone( &OF ); }
void ObjectiveFunctionTest::test_max_invalid_qm_eval | ( | ) | [inline] |
Definition at line 362 of file ObjectiveFunctionTest.cpp.
{ MaxTemplate OF( NULL ); test_handles_invalid_qm( EVAL, &OF ); }
void ObjectiveFunctionTest::test_max_negate_flag | ( | ObjectiveFunctionTemplate & | OF | ) | [private] |
Definition at line 677 of file ObjectiveFunctionTest.cpp.
References ASSERT_NO_ERROR, MBMesquite::ObjectiveFunction::CALCULATE, CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, MBMesquite::ObjectiveFunction::evaluate(), OFTestQM::set_negate_flag(), MBMesquite::ObjectiveFunctionTemplate::set_quality_metric(), and value().
{ // use only positive values so this test works for both // MaxTemplate and LInfTemplate const double some_vals[] = { 1, 2, 3, 4, 5, 6, 0.5 }; const unsigned num_vals = sizeof( some_vals ) / sizeof( some_vals[0] ); OFTestQM metric( some_vals, num_vals ); metric.set_negate_flag( -1 ); of.set_quality_metric( &metric ); // get OF value MsqPrintError err( cout ); bool rval; double value; rval = of.evaluate( ObjectiveFunction::CALCULATE, patch(), value, false, err ); ASSERT_NO_ERROR( err ); CPPUNIT_ASSERT( rval ); // find min value double expected = *std::min_element( some_vals, some_vals + num_vals ); CPPUNIT_ASSERT_DOUBLES_EQUAL( -expected, value, 1e-6 ); }
void ObjectiveFunctionTest::test_max_negate_flag_eval | ( | ) | [inline] |
Definition at line 541 of file ObjectiveFunctionTest.cpp.
{ MaxTemplate OF( NULL ); test_max_negate_flag( OF ); }
void ObjectiveFunctionTest::test_max_qm_error_eval | ( | ) | [inline] |
Definition at line 393 of file ObjectiveFunctionTest.cpp.
{ MaxTemplate OF( NULL ); test_handles_qm_error( EVAL, &OF ); }
void ObjectiveFunctionTest::test_max_value | ( | const std::vector< double > & | values | ) | [private] |
Definition at line 664 of file ObjectiveFunctionTest.cpp.
References MBMesquite::arrptr(), CPPUNIT_ASSERT, and test_value().
{ CPPUNIT_ASSERT( !values.empty() ); MaxTemplate OF( NULL ); double expected = fabs( values[0] ); for( unsigned i = 1; i < values.size(); ++i ) if( values[i] > expected ) expected = values[i]; test_value( arrptr( values ), values.size(), expected, EVAL, &OF ); }
std::vector< double > ObjectiveFunctionTest::values1 [private] |
Definition at line 160 of file ObjectiveFunctionTest.cpp.
std::vector< double > ObjectiveFunctionTest::values2 [private] |
Definition at line 160 of file ObjectiveFunctionTest.cpp.