MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Definition at line 47 of file PMeanPTemplateTest.cpp.
void PMeanPTemplateTest::check_result | ( | PatchData & | pd, |
double | power, | ||
double | value, | ||
Vector3D * | gradient = 0 , |
||
Matrix3D * | Hessian = 0 |
||
) | [private] |
Definition at line 553 of file PMeanPTemplateTest.cpp.
References ASSERT_NO_ERROR, CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, CPPUNIT_ASSERT_EQUAL, CPPUNIT_ASSERT_MATRICES_EQUAL, CPPUNIT_ASSERT_VECTORS_EQUAL, MBMesquite::EPSILON, MBMesquite::QualityMetric::evaluate_with_Hessian(), MBMesquite::VertexQM::get_evaluations(), MSQ_CHKERR, MBMesquite::OF_FREE_EVALS_ONLY, MBMesquite::Matrix3D::outer_product(), moab::sum(), and value().
{ MsqPrintError err( cout ); double mvalue, sum = 0; bool rval; vector< Vector3D > grads; vector< Matrix3D > Hess; vector< size_t > indices; DistTestMetric metric; vector< size_t > handles; metric.get_evaluations( pd, handles, OF_FREE_EVALS_ONLY, err ); ASSERT_NO_ERROR( err ); for( size_t i = 0; i < handles.size(); ++i ) { rval = metric.evaluate_with_Hessian( pd, handles[i], mvalue, indices, grads, Hess, err ); CPPUNIT_ASSERT( !MSQ_CHKERR( err ) && rval ); sum += pow( mvalue, power ); // if (!OF_FREE_EVALS_ONLY && indices.empty()) // continue; CPPUNIT_ASSERT_EQUAL( (size_t)1, indices.size() ); CPPUNIT_ASSERT_EQUAL( handles[i], indices[0] ); CPPUNIT_ASSERT_EQUAL( (size_t)1, grads.size() ); CPPUNIT_ASSERT_EQUAL( (size_t)1, Hess.size() ); if( gradient ) { double f = power * pow( mvalue, power - 1 ) / handles.size(); CPPUNIT_ASSERT_VECTORS_EQUAL( f * grads[0], gradient[i], EPSILON ); } if( Hessian ) { double f = power / handles.size(); double p2 = ( power - 1 ) * pow( mvalue, power - 2 ); double p1 = pow( mvalue, power - 1 ); Matrix3D m; m.outer_product( grads[0], grads[0] ); m *= p2; m += p1 * Hess[0]; m *= f; CPPUNIT_ASSERT_MATRICES_EQUAL( m, Hessian[i], EPSILON ); } } CPPUNIT_ASSERT_DOUBLES_EQUAL( sum / handles.size(), value, EPSILON ); }
void PMeanPTemplateTest::compare_diagonal_gradient_arithmatic | ( | ) | [inline] |
Definition at line 298 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 1, NULL ); compare_diagonal_gradient( &of ); }
void PMeanPTemplateTest::compare_diagonal_gradient_rms | ( | ) | [inline] |
Definition at line 303 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 2, NULL ); compare_diagonal_gradient( &of ); }
void PMeanPTemplateTest::compare_gradient_arithmatic | ( | ) | [inline] |
Definition at line 287 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 1, NULL ); compare_numerical_gradient( &of ); }
void PMeanPTemplateTest::compare_gradient_rms | ( | ) | [inline] |
Definition at line 292 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 2, NULL ); compare_numerical_gradient( &of ); }
void PMeanPTemplateTest::compare_hessian_arithmatic | ( | ) | [inline] |
Definition at line 331 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 1, NULL ); compare_numerical_hessian( &of ); }
void PMeanPTemplateTest::compare_hessian_diag_arithmatic | ( | ) | [inline] |
Definition at line 342 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 1, NULL ); compare_numerical_hessian_diagonal( &of ); }
void PMeanPTemplateTest::compare_hessian_diag_rms | ( | ) | [inline] |
Definition at line 347 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 2, NULL ); compare_numerical_hessian_diagonal( &of ); }
void PMeanPTemplateTest::compare_hessian_diagonal_arithmatic | ( | ) | [inline] |
Definition at line 320 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 1, NULL ); compare_hessian_diagonal( &of ); }
void PMeanPTemplateTest::compare_hessian_diagonal_rms | ( | ) | [inline] |
Definition at line 325 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 2, NULL ); compare_hessian_diagonal( &of ); }
void PMeanPTemplateTest::compare_hessian_gradient_arithmatic | ( | ) | [inline] |
Definition at line 309 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 1, NULL ); compare_hessian_gradient( &of ); }
void PMeanPTemplateTest::compare_hessian_gradient_rms | ( | ) | [inline] |
Definition at line 314 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 2, NULL ); compare_hessian_gradient( &of ); }
void PMeanPTemplateTest::compare_hessian_rms | ( | ) | [inline] |
Definition at line 336 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 2, NULL ); compare_numerical_hessian( &of ); }
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_eval_calc | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_eval_accum | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_eval_save | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_eval_update | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_eval_temp | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_grad_calc | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_grad_save | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_grad_update | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_grad_temp | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_diag_calc | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_diag_save | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_diag_update | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_diag_temp | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_Hess_calc | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_Hess_save | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_Hess_update | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_Hess_temp | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_clone | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_failed_metric_in_eval | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_failed_metric_in_grad | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_failed_metric_in_diag | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_failed_metric_in_Hess | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_false_metric_in_eval | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_false_metric_in_grad | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_false_metric_in_diag | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_false_metric_in_Hess | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_evaluate_arithmatic | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_evaluate_rms | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_gradient_arithmatic | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_gradient_rms | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_Hessian_arithmatic | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_Hessian_rms | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | compare_gradient_arithmatic | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | compare_gradient_rms | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | compare_hessian_gradient_rms | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | compare_hessian_diagonal_rms | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | compare_hessian_arithmatic | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | compare_hessian_rms | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | compare_hessian_diag_rms | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_negate_eval | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_negate_grad | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_negate_diag | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST | ( | test_negate_hess | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST_SUITE | ( | PMeanPTemplateTest | ) | [private] |
PMeanPTemplateTest::CPPUNIT_TEST_SUITE_END | ( | ) | [private] |
void PMeanPTemplateTest::setUp | ( | ) |
Definition at line 378 of file PMeanPTemplateTest.cpp.
References CPPUNIT_ASSERT, MSQ_CHKERR, and MBMesquite::TRIANGLE.
{ MsqPrintError err( std::cout ); // Create a triangle mesh with three free vertices const double coords[] = { 1, 1, 0, 2, 1, 0, 3, 1, 0, 2, 2, 0, 1, 3, 0, 1, 2, 0 }; const bool fixed_vtx[] = { true, false, true, false, true, false }; const size_t tri_conn[] = { 0, 1, 5, 1, 2, 3, 3, 4, 5, 1, 3, 5 }; mPatch.fill( 6, coords, 4, TRIANGLE, tri_conn, fixed_vtx, err ); CPPUNIT_ASSERT( !MSQ_CHKERR( err ) ); }
void PMeanPTemplateTest::test_clone | ( | ) | [inline] |
Definition at line 203 of file PMeanPTemplateTest.cpp.
References ObjectiveFunctionTests::test_clone().
{ PMeanPTemplate of( 1, NULL ); ObjectiveFunctionTests::test_clone( &of ); }
void PMeanPTemplateTest::test_diag_calc | ( | ) | [inline] |
Definition at line 169 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::CALCULATE.
{ test_eval_type( DIAG, ObjectiveFunction::CALCULATE ); }
void PMeanPTemplateTest::test_diag_save | ( | ) | [inline] |
Definition at line 173 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::SAVE.
{ test_eval_type( DIAG, ObjectiveFunction::SAVE ); }
void PMeanPTemplateTest::test_diag_temp | ( | ) | [inline] |
Definition at line 181 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::TEMPORARY.
{ test_eval_type( DIAG, ObjectiveFunction::TEMPORARY ); }
void PMeanPTemplateTest::test_diag_update | ( | ) | [inline] |
Definition at line 177 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::UPDATE.
{ test_eval_type( DIAG, ObjectiveFunction::UPDATE ); }
void PMeanPTemplateTest::test_diagonal | ( | double | power | ) | [private] |
Definition at line 491 of file PMeanPTemplateTest.cpp.
References MBMesquite::arrptr(), MBMesquite::ObjectiveFunction::CALCULATE, CPPUNIT_ASSERT, CPPUNIT_ASSERT_EQUAL, MBMesquite::PMeanPTemplate::evaluate_with_Hessian_diagonal(), MBMesquite::grad(), MSQ_CHKERR, n, and value().
{ MsqPrintError err( cout ); double value; bool rval; vector< Vector3D > grad; vector< SymMatrix3D > Hess; CPPUNIT_ASSERT( !MSQ_CHKERR( err ) ); DistTestMetric metric; PMeanPTemplate func( power, &metric ); rval = func.evaluate_with_Hessian_diagonal( ObjectiveFunction::CALCULATE, mPatch, value, grad, Hess, err ); CPPUNIT_ASSERT( !MSQ_CHKERR( err ) ); CPPUNIT_ASSERT( rval ); size_t n = mPatch.num_free_vertices(); CPPUNIT_ASSERT_EQUAL( n, grad.size() ); CPPUNIT_ASSERT_EQUAL( n, Hess.size() ); vector< Matrix3D > Hessians( n ); for( size_t r = 0; r < n; ++r ) Hessians[r] = Hess[r]; if( !grad.empty() ) check_result( mPatch, power, value, arrptr( grad ), arrptr( Hessians ) ); }
void PMeanPTemplateTest::test_diagonal_arithmatic | ( | ) | [inline] |
Definition at line 269 of file PMeanPTemplateTest.cpp.
{ test_diagonal( 1 ); }
void PMeanPTemplateTest::test_diagonal_rms | ( | ) | [inline] |
Definition at line 273 of file PMeanPTemplateTest.cpp.
{ test_diagonal( 2 ); }
void PMeanPTemplateTest::test_eval_accum | ( | ) | [inline] |
Definition at line 135 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::ACCUMULATE.
{ test_eval_type( EVAL, ObjectiveFunction::ACCUMULATE ); }
void PMeanPTemplateTest::test_eval_calc | ( | ) | [inline] |
Definition at line 131 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::CALCULATE.
{ test_eval_type( EVAL, ObjectiveFunction::CALCULATE ); }
void PMeanPTemplateTest::test_eval_save | ( | ) | [inline] |
Definition at line 139 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::SAVE.
{ test_eval_type( EVAL, ObjectiveFunction::SAVE ); }
void PMeanPTemplateTest::test_eval_temp | ( | ) | [inline] |
Definition at line 147 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::TEMPORARY.
{ test_eval_type( EVAL, ObjectiveFunction::TEMPORARY ); }
void PMeanPTemplateTest::test_eval_type | ( | OFTestMode | eval_func, |
ObjectiveFunction::EvalType | type | ||
) | [private] |
Definition at line 453 of file PMeanPTemplateTest.cpp.
References ObjectiveFunctionTests::test_eval_type().
{ PMeanPTemplate func( 1, NULL ); ObjectiveFunctionTests::test_eval_type( type, eval_func, &func ); }
void PMeanPTemplateTest::test_eval_update | ( | ) | [inline] |
Definition at line 143 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::UPDATE.
{ test_eval_type( EVAL, ObjectiveFunction::UPDATE ); }
void PMeanPTemplateTest::test_evaluate | ( | double | power | ) | [private] |
Definition at line 459 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::CALCULATE, CPPUNIT_ASSERT, MBMesquite::PMeanPTemplate::evaluate(), MSQ_CHKERR, MBMesquite::OF_FREE_EVALS_ONLY, and value().
{ MsqPrintError err( cout ); double value; bool rval; DistTestMetric metric; PMeanPTemplate func( power, &metric ); rval = func.evaluate( ObjectiveFunction::CALCULATE, mPatch, value, OF_FREE_EVALS_ONLY, err ); CPPUNIT_ASSERT( !MSQ_CHKERR( err ) ); CPPUNIT_ASSERT( rval ); check_result( mPatch, power, value ); }
void PMeanPTemplateTest::test_evaluate_arithmatic | ( | ) | [inline] |
Definition at line 251 of file PMeanPTemplateTest.cpp.
References test_evaluate().
{ test_evaluate( 1 ); }
void PMeanPTemplateTest::test_evaluate_rms | ( | ) | [inline] |
Definition at line 255 of file PMeanPTemplateTest.cpp.
References test_evaluate().
{ test_evaluate( 2 ); }
void PMeanPTemplateTest::test_failed_metric_in_diag | ( | ) | [inline] |
Definition at line 219 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 1, NULL ); test_handles_qm_error( DIAG, &of ); }
void PMeanPTemplateTest::test_failed_metric_in_eval | ( | ) | [inline] |
Definition at line 209 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 1, NULL ); test_handles_qm_error( EVAL, &of ); }
void PMeanPTemplateTest::test_failed_metric_in_grad | ( | ) | [inline] |
Definition at line 214 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 1, NULL ); test_handles_qm_error( GRAD, &of ); }
void PMeanPTemplateTest::test_failed_metric_in_Hess | ( | ) | [inline] |
Definition at line 224 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 1, NULL ); test_handles_qm_error( HESS, &of ); }
void PMeanPTemplateTest::test_false_metric_in_diag | ( | ) | [inline] |
Definition at line 240 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 1, NULL ); test_handles_invalid_qm( DIAG, &of ); }
void PMeanPTemplateTest::test_false_metric_in_eval | ( | ) | [inline] |
Definition at line 230 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 1, NULL ); test_handles_invalid_qm( EVAL, &of ); }
void PMeanPTemplateTest::test_false_metric_in_grad | ( | ) | [inline] |
Definition at line 235 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 1, NULL ); test_handles_invalid_qm( GRAD, &of ); }
void PMeanPTemplateTest::test_false_metric_in_Hess | ( | ) | [inline] |
Definition at line 245 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 1, NULL ); test_handles_invalid_qm( HESS, &of ); }
void PMeanPTemplateTest::test_grad_calc | ( | ) | [inline] |
Definition at line 152 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::CALCULATE.
{ test_eval_type( GRAD, ObjectiveFunction::CALCULATE ); }
void PMeanPTemplateTest::test_grad_save | ( | ) | [inline] |
Definition at line 156 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::SAVE.
{ test_eval_type( GRAD, ObjectiveFunction::SAVE ); }
void PMeanPTemplateTest::test_grad_temp | ( | ) | [inline] |
Definition at line 164 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::TEMPORARY.
{ test_eval_type( GRAD, ObjectiveFunction::TEMPORARY ); }
void PMeanPTemplateTest::test_grad_update | ( | ) | [inline] |
Definition at line 160 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::UPDATE.
{ test_eval_type( GRAD, ObjectiveFunction::UPDATE ); }
void PMeanPTemplateTest::test_gradient | ( | double | power | ) | [private] |
Definition at line 474 of file PMeanPTemplateTest.cpp.
References MBMesquite::arrptr(), MBMesquite::ObjectiveFunction::CALCULATE, CPPUNIT_ASSERT, CPPUNIT_ASSERT_EQUAL, MBMesquite::PMeanPTemplate::evaluate_with_gradient(), MBMesquite::grad(), MSQ_CHKERR, and value().
{ MsqPrintError err( cout ); double value; bool rval; vector< Vector3D > grad; DistTestMetric metric; PMeanPTemplate func( power, &metric ); rval = func.evaluate_with_gradient( ObjectiveFunction::CALCULATE, mPatch, value, grad, err ); CPPUNIT_ASSERT( !MSQ_CHKERR( err ) ); CPPUNIT_ASSERT( rval ); CPPUNIT_ASSERT_EQUAL( mPatch.num_free_vertices(), grad.size() ); if( !grad.empty() ) check_result( mPatch, power, value, arrptr( grad ) ); }
void PMeanPTemplateTest::test_gradient_arithmatic | ( | ) | [inline] |
Definition at line 260 of file PMeanPTemplateTest.cpp.
{ test_gradient( 1 ); }
void PMeanPTemplateTest::test_gradient_rms | ( | ) | [inline] |
Definition at line 264 of file PMeanPTemplateTest.cpp.
{ test_gradient( 2 ); }
void PMeanPTemplateTest::test_Hess_calc | ( | ) | [inline] |
Definition at line 186 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::CALCULATE.
{ test_eval_type( HESS, ObjectiveFunction::CALCULATE ); }
void PMeanPTemplateTest::test_Hess_save | ( | ) | [inline] |
Definition at line 190 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::SAVE.
{ test_eval_type( HESS, ObjectiveFunction::SAVE ); }
void PMeanPTemplateTest::test_Hess_temp | ( | ) | [inline] |
Definition at line 198 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::TEMPORARY.
{ test_eval_type( HESS, ObjectiveFunction::TEMPORARY ); }
void PMeanPTemplateTest::test_Hess_update | ( | ) | [inline] |
Definition at line 194 of file PMeanPTemplateTest.cpp.
References MBMesquite::ObjectiveFunction::UPDATE.
{ test_eval_type( HESS, ObjectiveFunction::UPDATE ); }
void PMeanPTemplateTest::test_Hessian | ( | double | power | ) | [private] |
Definition at line 516 of file PMeanPTemplateTest.cpp.
References MBMesquite::arrptr(), MBMesquite::ObjectiveFunction::CALCULATE, CPPUNIT_ASSERT, CPPUNIT_ASSERT_EQUAL, CPPUNIT_ASSERT_MATRICES_EQUAL, MBMesquite::EPSILON, MBMesquite::PMeanPTemplate::evaluate_with_Hessian(), MBMesquite::MsqHessian::get_block(), MBMesquite::grad(), MBMesquite::MsqHessian::initialize(), MSQ_CHKERR, n, MBMesquite::MsqHessian::size(), and value().
{ MsqPrintError err( cout ); double value; bool rval; vector< Vector3D > grad; MsqHessian Hess; Hess.initialize( mPatch, err ); CPPUNIT_ASSERT( !MSQ_CHKERR( err ) ); DistTestMetric metric; PMeanPTemplate func( power, &metric ); rval = func.evaluate_with_Hessian( ObjectiveFunction::CALCULATE, mPatch, value, grad, Hess, err ); CPPUNIT_ASSERT( !MSQ_CHKERR( err ) ); CPPUNIT_ASSERT( rval ); size_t n = mPatch.num_free_vertices(); CPPUNIT_ASSERT_EQUAL( n, grad.size() ); CPPUNIT_ASSERT_EQUAL( n, Hess.size() ); Matrix3D zero( 0, 0, 0, 0, 0, 0, 0, 0, 0 ); vector< Matrix3D > Hessians( n ); for( size_t r = 0; r < n; ++r ) { Matrix3D* mat = Hess.get_block( r, r ); CPPUNIT_ASSERT( mat != 0 ); Hessians[r] = *mat; for( size_t c = r + 1; c < n; ++c ) { mat = Hess.get_block( r, c ); if( mat ) CPPUNIT_ASSERT_MATRICES_EQUAL( zero, *mat, EPSILON ); } } if( !grad.empty() ) check_result( mPatch, power, value, arrptr( grad ), arrptr( Hessians ) ); }
void PMeanPTemplateTest::test_Hessian_arithmatic | ( | ) | [inline] |
Definition at line 278 of file PMeanPTemplateTest.cpp.
{ test_Hessian( 1 ); }
void PMeanPTemplateTest::test_Hessian_rms | ( | ) | [inline] |
Definition at line 282 of file PMeanPTemplateTest.cpp.
{ test_Hessian( 2 ); }
void PMeanPTemplateTest::test_negate_diag | ( | ) | [inline] |
Definition at line 363 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 2, NULL ); test_negate_flag( DIAG, &of ); }
void PMeanPTemplateTest::test_negate_eval | ( | ) | [inline] |
Definition at line 353 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 2, NULL ); test_negate_flag( EVAL, &of ); }
void PMeanPTemplateTest::test_negate_grad | ( | ) | [inline] |
Definition at line 358 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 2, NULL ); test_negate_flag( GRAD, &of ); }
void PMeanPTemplateTest::test_negate_hess | ( | ) | [inline] |
Definition at line 368 of file PMeanPTemplateTest.cpp.
{ PMeanPTemplate of( 2, NULL ); test_negate_flag( HESS, &of ); }
PatchData PMeanPTemplateTest::mPatch [private] |
Definition at line 126 of file PMeanPTemplateTest.cpp.