List of all members | Static Public Member Functions
casadi::DerBinaryOperation< I > Struct Template Reference

Calculate function and derivative. More...

#include <calculus.hpp>

Detailed Description

template<casadi_int I>
struct casadi::DerBinaryOperation< I >

Definition at line 367 of file calculus.hpp.

Static Public Member Functions

template<typename T >
static void derf (const T &x, const T &y, T &f, T *d)
 Perform the operation. More...
 

Member Function Documentation

◆ derf()

template<casadi_int I>
template<typename T >
static void casadi::DerBinaryOperation< I >::derf ( const T &  x,
const T &  y,
T &  f,
T *  d 
)
inlinestatic

First save to temp since f might have the same address as x or y, in which case it will be incorrect in the second call

Evaluate the function

Evaluate the partial derivatives

Now save f

Definition at line 369 of file calculus.hpp.

369  {
370 
374  T tmp;
375 
377  BinaryOperation<I>::fcn(x, y, tmp);
378 
380  BinaryOperation<I>::der(x, y, tmp, d);
381 
383  f = tmp;
384  }
static void der(const T &x, const T &y, const T &f, T *d)
Partial derivatives - binary function.
Definition: calculus.hpp:351
static void fcn(const T &x, const T &y, T &f)
Function evaluation.
Definition: calculus.hpp:347

References casadi::BinaryOperation< I >::der(), casadi::BinaryOperation< I >::fcn(), and casadi::T.


The documentation for this struct was generated from the following file: