本文整理汇总了C++中NumericalDifferentiation::calculate_central_differences_Hessian_form方法的典型用法代码示例。如果您正苦于以下问题:C++ NumericalDifferentiation::calculate_central_differences_Hessian_form方法的具体用法?C++ NumericalDifferentiation::calculate_central_differences_Hessian_form怎么用?C++ NumericalDifferentiation::calculate_central_differences_Hessian_form使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NumericalDifferentiation
的用法示例。
在下文中一共展示了NumericalDifferentiation::calculate_central_differences_Hessian_form方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_calculate_central_differences_Hessian_form
void NumericalDifferentiationTest::test_calculate_central_differences_Hessian_form(void)
{
message += "test_calculate_central_differences_Hessian_form\n";
NumericalDifferentiation nd;
Vector<double> x(2, 0.0);
Vector< Matrix<double> > Hessian = nd.calculate_central_differences_Hessian_form(*this, &NumericalDifferentiationTest::f3, x);
assert_true(Hessian.size() == 2, LOG);
assert_true(Hessian[0].get_rows_number() == 2, LOG);
assert_true(Hessian[0].get_columns_number() == 2, LOG);
assert_true(Hessian[0] == 0.0, LOG);
assert_true(Hessian[1].get_rows_number() == 2, LOG);
assert_true(Hessian[1].get_columns_number() == 2, LOG);
assert_true(Hessian[1] == 0.0, LOG);
}