本文整理汇总了C++中ADFun::compare_change_count方法的典型用法代码示例。如果您正苦于以下问题:C++ ADFun::compare_change_count方法的具体用法?C++ ADFun::compare_change_count怎么用?C++ ADFun::compare_change_count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ADFun
的用法示例。
在下文中一共展示了ADFun::compare_change_count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: x_tmp
checkpoint(const char* name,
Algo& algo, const ADVector& ax, ADVector& ay)
: atomic_base<Base>(name)
{ CheckSimpleVector< CppAD::AD<Base> , ADVector>();
// make a copy of ax because Independent modifies AD information
ADVector x_tmp(ax);
// delcare x_tmp as the independent variables
Independent(x_tmp);
// record mapping from x_tmp to ay
algo(x_tmp, ay);
// create function f_ : x -> y
f_.Dependent(ay);
// suppress checking for nan in f_ results
// (see optimize documentation for atomic functions)
f_.check_for_nan(false);
// now optimize (we expect to use this function many times).
f_.optimize();
// now disable checking of comparison opertaions
// 2DO: add a debugging mode that checks for changes and aborts
f_.compare_change_count(0);
}