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