Beispiel #1
0
 /**
  * @brief Set the value of the gradient of this instance.
  * @param gradient  The new gradient value.
  */
 inline void setGradient(const Real& gradient) {
   globalTape.setGradient(gradientData, gradient);
 }
Beispiel #2
0
 /**
  * @brief Sets the primal value of this ActiveReal and sets the gradient after it was initialized.
  *
  * @param[in]    value  The primal value for this type.
  * @param[in] gradient  The gradient value for this type.
  */
 inline ActiveReal(const Real& value, const Real& gradient) : primalValue(value) {
   globalTape.initGradientData(this->primalValue, gradientData);
   globalTape.setGradient(gradientData, gradient);
 }