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 373 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 375 of file calculus.hpp.

375  {
376 
380  T tmp;
381 
383  BinaryOperation<I>::fcn(x, y, tmp);
384 
386  BinaryOperation<I>::der(x, y, tmp, d);
387 
389  f = tmp;
390  }
static void der(const T &x, const T &y, const T &f, T *d)
Partial derivatives - binary function.
Definition: calculus.hpp:357
static void fcn(const T &x, const T &y, T &f)
Function evaluation.
Definition: calculus.hpp:353

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


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