/** * @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; }
/** * @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); }
inline ActiveReal<Real, Tape>& operator=(const Expression<Real, R>& rhs){ globalTape.store(primalValue, gradientData, rhs.cast()); return *this; }
inline ActiveReal(const Expression<Real, R>& rhs) { globalTape.initGradientData(this->primalValue, gradientData); globalTape.store(primalValue, gradientData, rhs.cast()); }