本文整理汇总了C++中Tape::store方法的典型用法代码示例。如果您正苦于以下问题:C++ Tape::store方法的具体用法?C++ Tape::store怎么用?C++ Tape::store使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tape
的用法示例。
在下文中一共展示了Tape::store方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/**
* @brief Assignment for an ActiveReal on the rhs. E.g a = x;
*
* The logic is handled by the tape. The tape is required to set the primal value of
* the rhs to the primal value of this instance.
*
* @param[in] rhs The other value on the rhs.
* @return Reference to this.
*/
inline ActiveReal<Real, Tape>& operator=(const ActiveReal<Real, Tape>& rhs) {
globalTape.store(primalValue, gradientData, rhs);
return *this;
}
示例2: ActiveReal
/**
* @brief Copy Constructor. The logic is handled by the tape.
*
* The tape is required to set the primal value of v to the primal value
* of this type.
*
* @param[in] v The value to copy.
*/
inline ActiveReal(const ActiveReal<Real, Tape>& v) {
globalTape.initGradientData(this->primalValue, gradientData);
globalTape.store(primalValue, gradientData, v);
}