List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
casadi::GenericExpression< ExType > Class Template Reference

Expression interface. More...

#include <generic_expression.hpp>

Detailed Description

template<typename ExType>
class casadi::GenericExpression< ExType >

This is a common base class for SX, MX and Matrix<>, introducing a uniform syntax and implementing common functionality using the curiously recurring template pattern (CRTP) idiom.

Author
Joel Andersson
Date
2012
Extra doc: https://github.com/casadi/casadi/wiki/L_om 

Definition at line 51 of file generic_expression.hpp.

Inheritance diagram for casadi::GenericExpression< ExType >:
Inheritance graph
[legend]
Collaboration diagram for casadi::GenericExpression< ExType >:
Collaboration graph
[legend]

Public Member Functions

ExType & operator+= (const ExType &y)
 

Static Public Member Functions

static ExType plus (const ExType &x, const ExType &y)
 Addition: (x,y) -> x + y. More...
 

Protected Member Functions

const ExType & self () const
 
ExType & self ()
 

Friends

ExType plus (const ExType &x, const ExType &y)
 
ExType operator+ (const ExType &x, const ExType &y)
 
bool is_equal (const ExType &x, const ExType &y, casadi_int depth=0)
 Check if two nodes are equivalent up to a given depth. More...
 
static ExType minus (const ExType &x, const ExType &y)
 Subtraction: (x,y) -> x - y. More...
 
ExType minus (const ExType &x, const ExType &y)
 Subtraction: (x,y) -> x - y. More...
 
ExType operator- (const ExType &x, const ExType &y)
 Subtraction: (x,y) -> x - y. More...
 
ExType & operator-= (const ExType &y)
 Subtraction: (x,y) -> x - y. More...
 
static ExType times (const ExType &x, const ExType &y)
 Elementwise multiplication: (x,y) -> x .* y. More...
 
ExType times (const ExType &x, const ExType &y)
 Elementwise multiplication: (x,y) -> x .* y. More...
 
ExType operator* (const ExType &x, const ExType &y)
 Elementwise multiplication: (x,y) -> x .* y. More...
 
ExType & operator*= (const ExType &y)
 Elementwise multiplication: (x,y) -> x .* y. More...
 
static ExType rdivide (const ExType &x, const ExType &y)
 Elementwise division: (x,y) -> x ./ y. More...
 
ExType rdivide (const ExType &x, const ExType &y)
 Elementwise division: (x,y) -> x ./ y. More...
 
ExType operator/ (const ExType &x, const ExType &y)
 Elementwise division: (x,y) -> x ./ y. More...
 
ExType & operator/= (const ExType &y)
 Elementwise division: (x,y) -> x ./ y. More...
 
static ExType lt (const ExType &x, const ExType &y)
 Logical less than: (x,y) -> x < y. More...
 
ExType lt (const ExType &x, const ExType &y)
 Logical less than: (x,y) -> x < y. More...
 
ExType operator< (const ExType &x, const ExType &y)
 Logical less than: (x,y) -> x < y. More...
 
static ExType le (const ExType &x, const ExType &y)
 Logical less or equal to: (x,y) -> x <= y. More...
 
ExType le (const ExType &x, const ExType &y)
 Logical less or equal to: (x,y) -> x <= y. More...
 
ExType operator<= (const ExType &x, const ExType &y)
 Logical less or equal to: (x,y) -> x <= y. More...
 
static ExType gt (const ExType &x, const ExType &y)
 Logical greater than: (x,y) -> x > y. More...
 
ExType gt (const ExType &x, const ExType &y)
 Logical greater than: (x,y) -> x > y. More...
 
ExType operator> (const ExType &x, const ExType &y)
 Logical greater than: (x,y) -> x > y. More...
 
static ExType ge (const ExType &x, const ExType &y)
 Logical greater or equal to: (x,y) -> x >= y. More...
 
ExType ge (const ExType &x, const ExType &y)
 Logical greater or equal to: (x,y) -> x >= y. More...
 
ExType operator>= (const ExType &x, const ExType &y)
 Logical greater or equal to: (x,y) -> x >= y. More...
 
static ExType eq (const ExType &x, const ExType &y)
 Logical equal to: (x,y) -> x == y. More...
 
ExType eq (const ExType &x, const ExType &y)
 Logical equal to: (x,y) -> x == y. More...
 
ExType operator== (const ExType &x, const ExType &y)
 Logical equal to: (x,y) -> x == y. More...
 
static ExType ne (const ExType &x, const ExType &y)
 Logical not equal to: (x,y) -> x != y. More...
 
ExType ne (const ExType &x, const ExType &y)
 Logical not equal to: (x,y) -> x != y. More...
 
ExType operator!= (const ExType &x, const ExType &y)
 Logical not equal to: (x,y) -> x != y. More...
 
static ExType logic_and (const ExType &x, const ExType &y)
 Logical and More...
 
ExType logic_and (const ExType &x, const ExType &y)
 Logical and More...
 
ExType operator&& (const ExType &x, const ExType &y)
 Logical and More...
 
static ExType logic_or (const ExType &x, const ExType &y)
 Logical or More...
 
ExType logic_or (const ExType &x, const ExType &y)
 Logical or More...
 
ExType operator|| (const ExType &x, const ExType &y)
 Logical or More...
 
static ExType logic_not (const ExType &x)
 Logical not x -> !x. More...
 
ExType logic_not (const ExType &x)
 Logical not x -> !x. More...
 
ExType operator! () const
 Logical not x -> !x. More...
 
static ExType abs (const ExType &x)
 Absolute value: x -> abs(x) More...
 
ExType abs (const ExType &x)
 Absolute value: x -> abs(x) More...
 
ExType fabs (const ExType &x)
 Absolute value: x -> abs(x) More...
 
static ExType sqrt (const ExType &x)
 Square root: x -> sqrt(x) More...
 
ExType sqrt (const ExType &x)
 Square root: x -> sqrt(x) More...
 
static ExType sq (const ExType &x)
 Square: x -> x^2. More...
 
ExType sq (const ExType &x)
 Square: x -> x^2. More...
 
static ExType sin (const ExType &x)
 Sine: x -> sin(x) More...
 
ExType sin (const ExType &x)
 Sine: x -> sin(x) More...
 
static ExType cos (const ExType &x)
 Cosine: x -> cos(x) More...
 
ExType cos (const ExType &x)
 Cosine: x -> cos(x) More...
 
static ExType tan (const ExType &x)
 Tangent: x -> tan(x) More...
 
ExType tan (const ExType &x)
 Tangent: x -> tan(x) More...
 
static ExType atan (const ExType &x)
 Arc tangent: x -> atan(x) More...
 
ExType atan (const ExType &x)
 Arc tangent: x -> atan(x) More...
 
static ExType asin (const ExType &x)
 Arc sine: x -> asin(x) More...
 
ExType asin (const ExType &x)
 Arc sine: x -> asin(x) More...
 
static ExType acos (const ExType &x)
 Arc cosine: x -> acos(x) More...
 
ExType acos (const ExType &x)
 Arc cosine: x -> acos(x) More...
 
static ExType tanh (const ExType &x)
 Hyperbolic tangent: x -> tanh(x) More...
 
ExType tanh (const ExType &x)
 Hyperbolic tangent: x -> tanh(x) More...
 
static ExType sinh (const ExType &x)
 Hyperbolic sin: x -> sinh(x) More...
 
ExType sinh (const ExType &x)
 Hyperbolic sin: x -> sinh(x) More...
 
static ExType cosh (const ExType &x)
 Hyperbolic cosine: x -> cosh(x) More...
 
ExType cosh (const ExType &x)
 Hyperbolic cosine: x -> cosh(x) More...
 
static ExType atanh (const ExType &x)
 Inverse hyperbolic tangent: x -> atanh(x) More...
 
ExType atanh (const ExType &x)
 Inverse hyperbolic tangent: x -> atanh(x) More...
 
static ExType asinh (const ExType &x)
 Inverse hyperbolic sin: x -> asinh(x) More...
 
ExType asinh (const ExType &x)
 Inverse hyperbolic sin: x -> asinh(x) More...
 
static ExType acosh (const ExType &x)
 Inverse hyperbolic cosine: x -> acosh(x) More...
 
ExType acosh (const ExType &x)
 Inverse hyperbolic cosine: x -> acosh(x) More...
 
static ExType exp (const ExType &x)
 Elementwise exponential: x -> exp(x) More...
 
ExType exp (const ExType &x)
 Elementwise exponential: x -> exp(x) More...
 
static ExType log (const ExType &x)
 Natural logarithm: x -> log(x) More...
 
ExType log (const ExType &x)
 Natural logarithm: x -> log(x) More...
 
static ExType log10 (const ExType &x)
 Base-10 logarithm: x -> log10(x) More...
 
ExType log10 (const ExType &x)
 Base-10 logarithm: x -> log10(x) More...
 
static ExType log1p (const ExType &x)
 Precision variant for natural logarithm: x -> log(x+1) More...
 
ExType log1p (const ExType &x)
 Precision variant for natural logarithm: x -> log(x+1) More...
 
static ExType expm1 (const ExType &x)
 Precision variant for elementwise exponential: x -> exp(x)-1. More...
 
ExType expm1 (const ExType &x)
 Precision variant for elementwise exponential: x -> exp(x)-1. More...
 
static ExType floor (const ExType &x)
 Round down to nearest integer: x -> floor(x) More...
 
ExType floor (const ExType &x)
 Round down to nearest integer: x -> floor(x) More...
 
static ExType ceil (const ExType &x)
 Round up to nearest integer: x -> ceil(x) More...
 
ExType ceil (const ExType &x)
 Round up to nearest integer: x -> ceil(x) More...
 
static ExType erf (const ExType &x)
 Error function: x -> erf(x) More...
 
ExType erf (const ExType &x)
 Error function: x -> erf(x) More...
 
static ExType erfinv (const ExType &x)
 Inverse error function: x -> erfinv(x) More...
 
ExType erfinv (const ExType &x)
 Inverse error function: x -> erfinv(x) More...
 
static ExType sign (const ExType &x)
 Sign function: More...
 
ExType sign (const ExType &x)
 Sign function: More...
 
static ExType pow (const ExType &x, const ExType &y)
 Elementwise power: (x,y) -> x.^y. More...
 
ExType pow (const ExType &x, const ExType &y)
 Elementwise power: (x,y) -> x.^y. More...
 
static ExType mod (const ExType &x, const ExType &y)
 Remainder after division: (x,y) -> fmod(x,y) More...
 
ExType mod (const ExType &x, const ExType &y)
 Remainder after division: (x,y) -> fmod(x,y) More...
 
ExType fmod (const ExType &x, const ExType &y)
 Remainder after division: (x,y) -> fmod(x,y) More...
 
static ExType remainder (const ExType &x, const ExType &y)
 Remainder after division: (x,y) -> remainder(x,y) More...
 
ExType remainder (const ExType &x, const ExType &y)
 Remainder after division: (x,y) -> remainder(x,y) More...
 
static ExType atan2 (const ExType &y, const ExType &x)
 Two argument arc tangent: (y,x) -> atan2(y,x) More...
 
ExType atan2 (const ExType &y, const ExType &x)
 Two argument arc tangent: (y,x) -> atan2(y,x) More...
 
static ExType if_else_zero (const ExType &x, const ExType &y)
 Conditional assignment: (x,y) -> x ? y : 0. More...
 
ExType if_else_zero (const ExType &x, const ExType &y)
 Conditional assignment: (x,y) -> x ? y : 0. More...
 
static ExType fmin (const ExType &x, const ExType &y)
 Smallest of two values: (x,y) -> min(x,y) More...
 
ExType fmin (const ExType &x, const ExType &y)
 Smallest of two values: (x,y) -> min(x,y) More...
 
static ExType fmax (const ExType &x, const ExType &y)
 Largest of two values: (x,y) -> max(x,y) More...
 
ExType fmax (const ExType &x, const ExType &y)
 Largest of two values: (x,y) -> max(x,y) More...
 
static ExType copysign (const ExType &x, const ExType &y)
 
ExType copysign (const ExType &x, const ExType &y)
 
static ExType constpow (const ExType &x, const ExType &y)
 
ExType constpow (const ExType &x, const ExType &y)
 
static ExType printme (const ExType &x, const ExType &y)
 
ExType printme (const ExType &x, const ExType &y)
 
static ExType hypot (const ExType &x, const ExType &y)
 Precision variant for 2 norm: (x,y) -> sqrt(x^2+y^2) More...
 
ExType hypot (const ExType &x, const ExType &y)
 Precision variant for 2 norm: (x,y) -> sqrt(x^2+y^2) More...
 

Member Function Documentation

◆ self() [1/2]

template<typename ExType >
ExType& casadi::GenericExpression< ExType >::self ( )
inlineprotected

Definition at line 55 of file generic_expression.hpp.

55 { return static_cast<ExType&>(*this); }

◆ self() [2/2]

template<typename ExType >
const ExType& casadi::GenericExpression< ExType >::self ( ) const
inlineprotected

Definition at line 54 of file generic_expression.hpp.

54 { return static_cast<const ExType&>(*this); }

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