The basic scalar symbolic class of CasADi. More...
#include <sx_elem.hpp>
SXElem is exposed only as an empty struct to SWIG
Extra doc: https://github.com/casadi/casadi/wiki/L_10i
Definition at line 74 of file sx_elem.hpp.


Public Member Functions | |
| SXElem () | |
| Default constructor (not-a-number) More... | |
| SXElem (double val) | |
| Numerical constant constructor. More... | |
| SXElem (SXNode *node, bool dummy) | |
| SXElem (const SXElem &scalar) | |
| Copy constructor. More... | |
| ~SXElem () | |
| Destructor. More... | |
| SXElem & | operator= (const SXElem &scalar) |
| Assignment. More... | |
| SXElem & | operator= (double scalar) |
| operator Matrix< SXElem > () const | |
| Convert to a 1-by-1 Matrix. More... | |
| void | disp (std::ostream &stream, bool more=false) const |
| Print a description of the object. More... | |
| SXNode * | get () const |
| Get a pointer to the node. More... | |
| const SXNode * | operator-> () const |
| Access functions of the node. More... | |
| SXNode * | operator-> () |
| bool | __nonzero__ () const |
| Check the truth value of this node. More... | |
| bool | is_leaf () const |
| check if this SXElem is a leaf of the SX graph More... | |
| bool | is_constant () const |
| bool | is_integer () const |
| bool | is_symbolic () const |
| bool | is_commutative () const |
| Check whether a binary SXElem is commutative. More... | |
| bool | is_zero () const |
| bool | is_almost_zero (double tol) const |
| bool | is_one () const |
| bool | is_minus_one () const |
| bool | is_half () const |
| bool | is_value (double val) const |
| bool | is_nan () const |
| bool | is_inf () const |
| bool | is_minus_inf () const |
| const std::string & | name () const |
| casadi_int | op () const |
| bool | is_op (casadi_int op) const |
| bool | is_call () const |
| bool | is_output () const |
| bool | has_output () const |
| Function | which_function () const |
| casadi_int | which_output () const |
| bool | is_regular () const |
| Checks if expression does not contain NaN or Inf. More... | |
| bool | is_nonnegative () const |
| Check if a value is always nonnegative (false negatives are allowed) More... | |
| bool | is_boolean () const |
| Check if a value is always 0 or 1 (false negatives are allowed) More... | |
| SXElem | dep (casadi_int ch=0) const |
| operator double () const | |
| Type conversion to double. More... | |
| operator casadi_int () const | |
| Type conversion to casadi_int. More... | |
| bool | is_doubled () const |
| Check if the node is the sum of two equal expressions. More... | |
| casadi_int | n_dep () const |
| Get the number of dependencies of a binary SXElem. More... | |
| SXElem | get_output (casadi_int oind) const |
| Get an output. More... | |
| std::vector< SXElem > | get_output (const std::vector< casadi_int > &oind) const |
| Get a batch of outputs. More... | |
| casadi_int | __hash__ () const |
| Returns a number that is unique for a given SXNode. More... | |
| SXElem | operator- () const |
| Negation. More... | |
| SXElem | inv () const |
| Element-wise inverse. More... | |
| int | get_temp () const |
| void | set_temp (int t) const |
| Set the temporary variable. More... | |
| bool | marked () const |
| Check if marked (i.e. temporary is negative) More... | |
| void | mark () const |
| Mark by flipping the sign of the temporary and decreasing by one. More... | |
| void | assignIfDuplicate (const SXElem &scalar, casadi_int depth=1) |
| Assign to another expression, if a duplicate. More... | |
| SXNode * | assignNoDelete (const SXElem &scalar) |
| Assign the node to something, without invoking the deletion of the node,. More... | |
| bool | is_null () |
| SXElem nodes are not allowed to be null. More... | |
| void | serialize (SerializingStream &s) const |
| Serialize an object. More... | |
| SXElem & | operator+= (const SXElem &y) |
Static Public Member Functions | |
| static SXElem | sym (const std::string &name) |
| Create a symbolic primitive. More... | |
| static SXElem | create (SXNode *node) |
| static std::string | type_name () |
| Type name. More... | |
| static SXElem | binary (casadi_int op, const SXElem &x, const SXElem &y, bool unique_x=false, bool unique_y=false) |
| Perform operations by ID. More... | |
| static SXElem | unary (casadi_int op, const SXElem &x, bool unique=false) |
| static std::vector< SXElem > | call (const Function &f, const std::vector< SXElem > &deps) |
| static bool | is_equal (const SXElem &x, const SXElem &y, casadi_int depth=0) |
| Check equality up to a given depth. More... | |
| static SXElem | deserialize (DeserializingStream &s) |
| static SXElem | plus (const SXElem &x, const SXElem &y) |
| Addition: (x,y) -> x + y. More... | |
| static SXElem | lt (const SXElem &x, const SXElem &y) |
| Logical less than: (x,y) -> x < y. More... | |
| static SXElem | le (const SXElem &x, const SXElem &y) |
| Logical less or equal to: (x,y) -> x <= y. More... | |
| static SXElem | gt (const SXElem &x, const SXElem &y) |
| Logical greater than: (x,y) -> x > y. More... | |
| static SXElem | ge (const SXElem &x, const SXElem &y) |
| Logical greater or equal to: (x,y) -> x >= y. More... | |
| static SXElem | eq (const SXElem &x, const SXElem &y) |
| Logical equal to: (x,y) -> x == y. More... | |
| static SXElem | ne (const SXElem &x, const SXElem &y) |
| Logical not equal to: (x,y) -> x != y. More... | |
| static SXElem | logic_and (const SXElem &x, const SXElem &y) |
Logical and More... | |
| static SXElem | logic_or (const SXElem &x, const SXElem &y) |
Logical or More... | |
| static SXElem | abs (const SXElem &x) |
| Absolute value: x -> abs(x) More... | |
| static SXElem | sqrt (const SXElem &x) |
| Square root: x -> sqrt(x) More... | |
| static SXElem | sq (const SXElem &x) |
| Square: x -> x^2. More... | |
| static SXElem | sin (const SXElem &x) |
| Sine: x -> sin(x) More... | |
| static SXElem | cos (const SXElem &x) |
| Cosine: x -> cos(x) More... | |
| static SXElem | tan (const SXElem &x) |
| Tangent: x -> tan(x) More... | |
| static SXElem | atan (const SXElem &x) |
| Arc tangent: x -> atan(x) More... | |
| static SXElem | asin (const SXElem &x) |
| Arc sine: x -> asin(x) More... | |
| static SXElem | acos (const SXElem &x) |
| Arc cosine: x -> acos(x) More... | |
| static SXElem | tanh (const SXElem &x) |
| Hyperbolic tangent: x -> tanh(x) More... | |
| static SXElem | sinh (const SXElem &x) |
| Hyperbolic sin: x -> sinh(x) More... | |
| static SXElem | cosh (const SXElem &x) |
| Hyperbolic cosine: x -> cosh(x) More... | |
| static SXElem | atanh (const SXElem &x) |
| Inverse hyperbolic tangent: x -> atanh(x) More... | |
| static SXElem | asinh (const SXElem &x) |
| Inverse hyperbolic sin: x -> asinh(x) More... | |
| static SXElem | acosh (const SXElem &x) |
| Inverse hyperbolic cosine: x -> acosh(x) More... | |
| static SXElem | exp (const SXElem &x) |
| Elementwise exponential: x -> exp(x) More... | |
| static SXElem | log (const SXElem &x) |
| Natural logarithm: x -> log(x) More... | |
| static SXElem | log10 (const SXElem &x) |
| Base-10 logarithm: x -> log10(x) More... | |
| static SXElem | log1p (const SXElem &x) |
| Precision variant for natural logarithm: x -> log(x+1) More... | |
| static SXElem | expm1 (const SXElem &x) |
| Precision variant for elementwise exponential: x -> exp(x)-1. More... | |
| static SXElem | floor (const SXElem &x) |
| Round down to nearest integer: x -> floor(x) More... | |
| static SXElem | ceil (const SXElem &x) |
| Round up to nearest integer: x -> ceil(x) More... | |
| static SXElem | erf (const SXElem &x) |
| Error function: x -> erf(x) More... | |
| static SXElem | erfinv (const SXElem &x) |
| Inverse error function: x -> erfinv(x) More... | |
| static SXElem | sign (const SXElem &x) |
| Sign function: More... | |
| static SXElem | pow (const SXElem &x, const SXElem &y) |
| Elementwise power: (x,y) -> x.^y. More... | |
| static SXElem | mod (const SXElem &x, const SXElem &y) |
| Remainder after division: (x,y) -> fmod(x,y) More... | |
| static SXElem | remainder (const SXElem &x, const SXElem &y) |
| Remainder after division: (x,y) -> remainder(x,y) More... | |
| static SXElem | atan2 (const SXElem &y, const SXElem &x) |
| Two argument arc tangent: (y,x) -> atan2(y,x) More... | |
| static SXElem | if_else_zero (const SXElem &x, const SXElem &y) |
| Conditional assignment: (x,y) -> x ? y : 0. More... | |
| static SXElem | fmin (const SXElem &x, const SXElem &y) |
| Smallest of two values: (x,y) -> min(x,y) More... | |
| static SXElem | fmax (const SXElem &x, const SXElem &y) |
| Largest of two values: (x,y) -> max(x,y) More... | |
| static SXElem | copysign (const SXElem &x, const SXElem &y) |
| Copy sign: (x,y) -> copysign(x,y) More... | |
| static SXElem | constpow (const SXElem &x, const SXElem &y) |
| Elementwise power with const power: (x,y) -> x^y with y constant. More... | |
| static SXElem | printme (const SXElem &x, const SXElem &y) |
| Debug printing: (x,y) -> x, printing x when evaluated. More... | |
| static SXElem | hypot (const SXElem &x, const SXElem &y) |
| Precision variant for 2 norm: (x,y) -> sqrt(x^2+y^2) More... | |
Protected Member Functions | |
| const SXElem & | self () const |
| SXElem & | self () |
Friends | |
| class | SXNode |
| class | BinarySXNode |
| class | Matrix< SXElem > |
| SXElem | if_else (const SXElem &x, const SXElem &y, const SXElem &z) |
| Ternary if_else: x ? y : z. More... | |
| SXElem & | operator-= (const SXElem &y) |
| Subtraction: (x,y) -> x - y. More... | |
| static SXElem | minus (const SXElem &x, const SXElem &y) |
| Subtraction: (x,y) -> x - y. More... | |
| SXElem & | operator*= (const SXElem &y) |
| Elementwise multiplication: (x,y) -> x .* y. More... | |
| static SXElem | times (const SXElem &x, const SXElem &y) |
| Elementwise multiplication: (x,y) -> x .* y. More... | |
| SXElem & | operator/= (const SXElem &y) |
| Elementwise division: (x,y) -> x ./ y. More... | |
| static SXElem | rdivide (const SXElem &x, const SXElem &y) |
| Elementwise division: (x,y) -> x ./ y. More... | |
| SXElem | operator! () const |
Logical not x -> !x. More... | |
| static SXElem | logic_not (const SXElem &x) |
Logical not x -> !x. More... | |
| casadi::SXElem::SXElem | ( | ) |
Object is initialized as not-a-number.
Extra doc: https://github.com/casadi/casadi/wiki/L_10j
Definition at line 53 of file sx_elem.cpp.
References casadi::SXNode::count.
Referenced by create(), and operator=().
| casadi::SXElem::SXElem | ( | double | val | ) |
| val | Numerical value |
Extra doc: https://github.com/casadi/casadi/wiki/L_10k
Definition at line 71 of file sx_elem.cpp.
References casadi::SXNode::count, casadi::IntegerSX::create(), and casadi::RealtypeSX::create().
| casadi::SXElem::SXElem | ( | SXNode * | node, |
| bool | dummy | ||
| ) |
Create an expression from a node: extra dummy argument to avoid ambiguity for 0/NULL
Definition at line 58 of file sx_elem.cpp.
References casadi::SXNode::count.
| casadi::SXElem::SXElem | ( | const SXElem & | scalar | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_10m
Definition at line 66 of file sx_elem.cpp.
References casadi::SXNode::count.
| casadi::SXElem::~SXElem | ( | ) |
Definition at line 99 of file sx_elem.cpp.
References casadi::SXNode::count.
| casadi_int casadi::SXElem::__hash__ | ( | ) | const |
If the SXElem does not point to any node, 0 is returned.
Extra doc: https://github.com/casadi/casadi/wiki/L_10w
Definition at line 412 of file sx_elem.cpp.
| bool casadi::SXElem::__nonzero__ | ( | ) | const |
Introduced to catch bool(x) situations in python
Extra doc: https://github.com/casadi/casadi/wiki/L_10q
Definition at line 164 of file sx_elem.cpp.
References is_constant(), and is_zero().
|
inlinestaticinherited |
Elementwise; structural zeros are preserved. The unary functions of this group operate on every entry, keep the shape and build a symbolic expression for SX and MX. Those that map 0 to 0 (abs, sqrt, sin, tan, atan, asin, sinh, tanh, asinh, atanh, floor, ceil, sign, erf, erfinv, log1p, expm1) keep the sparsity pattern; the others (cos, cosh, exp, log, log10, acos, acosh, logic_not) return a dense result. Named fabs in Python, where the built-in abs also applies.
>>> fabs(DM([-1, 0, 2]))
DM([1, 0, 2])
>>> fabs(DM.eye(2) * -1)
DM(
[[1, 00],
[00, 1]])
>>> abs(SX.sym("x"))
SX(fabs(x))
>> abs(DM([-1; 0; 2]))
[1, 0, 2]
>> abs(-DM.eye(2))
[[1, 00],
[00, 1]]
>> abs(SX.sym('x'))
fabs(x)
julia> abs.(ca.DM([-1, 0, 2]))
DM([1, 0, 2])
julia> abs(-ca.DM.eye(2))
DM(
[[1, 00],
[00, 1]])
julia> abs(ca.SX.sym("x"))
SX(fabs(x))
Extra doc: https://github.com/casadi/casadi/wiki/L_p0
Definition at line 925 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; the result is dense (acos(0) == pi/2). Arguments outside [-1, 1] give NaN.
>>> acos(DM([0, 1])) DM([1.5708, 0])
>> acos(DM([0; 1])) [1.5708, 0]
julia> acos.(ca.DM([0, 1])) DM([1.5708, 0])
Extra doc: https://github.com/casadi/casadi/wiki/L_p8
Definition at line 1261 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; the result is dense. Defined for x >= 1, NaN below.
>>> acosh(DM([1, 2])) DM([0, 1.31696])
>> acosh(DM([1; 2])) [0, 1.31696]
julia> acosh.(ca.DM([1, 2])) DM([0, 1.31696])
Extra doc: https://github.com/casadi/casadi/wiki/L_pe
Definition at line 1483 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; sparsity preserved. Arguments outside [-1, 1] give NaN.
>>> asin(DM([0, 1])) DM([0, 1.5708])
>> asin(DM([0; 1])) [0, 1.5708]
julia> asin.(ca.DM([0, 1])) DM([0, 1.5708])
Extra doc: https://github.com/casadi/casadi/wiki/L_p7
Definition at line 1224 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; sparsity preserved.
>>> asinh(DM([-1, 1])) DM([-0.881374, 0.881374])
>> asinh(DM([-1; 1])) [-0.881374, 0.881374]
julia> asinh.(ca.DM([-1, 1])) DM([-0.881374, 0.881374])
Extra doc: https://github.com/casadi/casadi/wiki/L_pd
Definition at line 1446 of file generic_expression.hpp.
| void casadi::SXElem::assignIfDuplicate | ( | const SXElem & | scalar, |
| casadi_int | depth = 1 |
||
| ) |
Check for equality up to a given depth
Extra doc: https://github.com/casadi/casadi/wiki/L_110
Definition at line 118 of file sx_elem.cpp.
References is_equal().
Referenced by casadi::SXFunction::eval_sx().
if the count reaches 0
Extra doc: https://github.com/casadi/casadi/wiki/L_111
Definition at line 125 of file sx_elem.cpp.
References casadi::SXNode::count.
Referenced by casadi::SXNode::safe_delete(), casadi::BinarySX::~BinarySX(), and casadi::UnarySX::~UnarySX().
|
inlinestaticinherited |
Elementwise; sparsity preserved. Result in (-pi/2, pi/2); use atan2 for a quadrant-aware angle.
>>> atan(DM([0, 1])) DM([0, 0.785398])
>> atan(DM([0; 1])) [0, 0.785398]
julia> atan.(ca.DM([0, 1])) DM([0, 0.785398])
Extra doc: https://github.com/casadi/casadi/wiki/L_p6
Definition at line 1187 of file generic_expression.hpp.
|
inlinestaticinherited |
theta = atan2(y,x) corresponds to x = r cos(theta), y = r sin(theta)
Angle in (-pi, pi] of the point (x, y), taking the quadrant into account; the first argument is the y coordinate, as in C and numpy. Elementwise, shape rules as for plus. atan2(0, 0) is 0.
>>> atan2(DM([1, -1, 0]), DM([-1, -1, 1]))
DM([2.35619, -2.35619, 0])
>>> atan2(SX.sym("y"), SX.sym("x"))
SX(atan2(y,x))
>> atan2(DM([1; -1; 0]), DM([-1; -1; 1]))
[2.35619, -2.35619, 0]
>> atan2(SX.sym('y'), SX.sym('x'))
atan2(y,x)
julia> atan.(ca.DM([1, -1, 0]), ca.DM([-1, -1, 1]))
DM([2.35619, -2.35619, 0])
julia> atan(ca.SX.sym("y"), ca.SX.sym("x"))
SX(atan2(y,x))
Extra doc: https://github.com/casadi/casadi/wiki/L_pr
Definition at line 2146 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; sparsity preserved. Defined for |x| < 1, infinite at +-1.
>>> atanh(DM([0, 0.5])) DM([0, 0.549306])
>> atanh(DM([0; 0.5])) [0, 0.549306]
julia> atanh.(ca.DM([0, 0.5])) DM([0, 0.549306])
Extra doc: https://github.com/casadi/casadi/wiki/L_pc
Definition at line 1409 of file generic_expression.hpp.
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_10p
Definition at line 190 of file sx_elem.cpp.
References casadi::common_simp_binary(), casadi::BinarySX::create(), dep(), casadi::SXNode::eq_depth_, casadi::GenericExpression< SXElem >::if_else_zero(), is_constant(), is_equal(), is_op(), is_zero(), op(), casadi::OP_ADD, casadi::OP_IF_ELSE_ZERO, casadi::OP_MUL, casadi::OP_TWICE, casadi::GlobalOptions::simplification_on_the_fly, and unary().
|
static |
Definition at line 236 of file sx_elem.cpp.
References casadi::CallSX::create(), casadi::Function::nnz_out(), and casadi::OutputSX::split().
Referenced by casadi::SXFunction::ad_forward(), casadi::SXFunction::ad_reverse(), casadi::CallSX::eval_sx(), and casadi::SXFunction::eval_sx().
|
inlinestaticinherited |
Elementwise, towards plus infinity; sparsity preserved. The derivative is zero everywhere.
>>> ceil(DM([-1.5, 1.5])) DM([-1, 2])
>> ceil(DM([-1.5; 1.5])) [-1, 2]
julia> ceil.(ca.DM([-1.5, 1.5])) DM([-1, 2])
Extra doc: https://github.com/casadi/casadi/wiki/L_pl
Definition at line 1789 of file generic_expression.hpp.
|
inlinestaticinherited |
Same value as pow, but the exponent is assumed constant: the derivative with respect to y is taken as zero. pow itself produces this operation for a non-integer constant exponent, so it is rarely needed directly. Passing a symbolic exponent gives a wrong derivative for MX; SX falls back to pow.
>>> constpow(DM(2), 3)
DM(8)
>>> x = MX.sym("x")
>>> constpow(x, 2.5), jacobian(constpow(x, 2.5), x)
(MX(pow(x,2.5)), MX((2.5*pow(x,1.5))))
>> constpow(DM(2), 3)
8
>> x = MX.sym('x');
>> constpow(x, 2.5), jacobian(constpow(x, 2.5), x)
pow(x,2.5)
(2.5*pow(x,1.5))
julia> ca.constpow(ca.DM(2), 3)
DM(8)
julia> x = ca.MX.sym("x");
julia> ca.constpow(x, 2.5), ca.jacobian(ca.constpow(x, 2.5), x)
(pow(x,2.5), (2.5*pow(x,1.5)))
Extra doc: https://github.com/casadi/casadi/wiki/L_2om
Definition at line 2467 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise value with the magnitude of x and the sign of y, as C copysign; a negative zero y counts as negative. Shape rules as for plus. The derivative with respect to y is zero.
>>> copysign(DM([1, -2]), DM([-1, 1]))
DM([-1, 2])
>>> copysign(DM(3), DM(-0.0))
DM(-3)
>>> copysign(SX.sym("x"), SX.sym("y"))
SX(copysign(x,y))
>> copysign(DM([1; -2]), DM([-1; 1]))
[-1, 2]
>> copysign(DM(3), DM(-0.0))
-3
>> copysign(SX.sym('x'), SX.sym('y'))
copysign(x,y)
julia> copysign.(ca.DM([1, -2]), ca.DM([-1, 1]))
DM([-1, 2])
julia> copysign.(ca.DM(3), ca.DM(-0.0))
DM(-3)
julia> ca.copysign(ca.SX.sym("x"), ca.SX.sym("y"))
SX(copysign(x,y))
Extra doc: https://github.com/casadi/casadi/wiki/L_2ol
Definition at line 2417 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; structural zeros become 1, so the result is dense.
>>> cos(DM.eye(2))
DM(
[[0.540302, 1],
[1, 0.540302]])
>>> cos(SX.sym("s", Sparsity.diag(2)))
SX(@1=1,
[[cos(s_0), @1],
[@1, cos(s_1)]])
>> cos(DM.eye(2))
[[0.540302, 1],
[1, 0.540302]]
>> cos(SX.sym('s', Sparsity.diag(2)))
@1=1,
[[cos(s_0), @1],
[@1, cos(s_1)]]
julia> cos.(ca.DM.eye(2))
DM(
[[0.540302, 1],
[1, 0.540302]])
julia> cos.(ca.SX.sym("s", ca.Sparsity.diag(2)))
SX(@1=1,
[[cos(s_0), @1],
[@1, cos(s_1)]])
Extra doc: https://github.com/casadi/casadi/wiki/L_p4
Definition at line 1112 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; the result is dense (cosh(0) == 1).
>>> cosh(DM([0, 1])) DM([1, 1.54308])
>> cosh(DM([0; 1])) [1, 1.54308]
julia> cosh.(ca.DM([0, 1])) DM([1, 1.54308])
Extra doc: https://github.com/casadi/casadi/wiki/L_pb
Definition at line 1372 of file generic_expression.hpp.
Create an object given a node
Definition at line 62 of file sx_elem.cpp.
References SXElem().
Referenced by casadi::CallSX::create(), casadi::UnarySX::create(), casadi::BinarySX::create(), deserialize(), casadi::CallSX::get_output(), casadi::SXFunction::init(), casadi::SXFunction::order(), and sym().
| SXElem casadi::SXElem::dep | ( | casadi_int | ch = 0 | ) | const |
Definition at line 395 of file sx_elem.cpp.
References casadi::SXNode::dep(), and n_dep().
Referenced by binary(), is_doubled(), operator-(), and unary().
|
static |
Definition at line 512 of file sx_elem.cpp.
References create(), and casadi::SXNode::deserialize().
| void casadi::SXElem::disp | ( | std::ostream & | stream, |
| bool | more = false |
||
| ) | const |
Definition at line 147 of file sx_elem.cpp.
References casadi::SXNode::disp().
|
inlinestaticinherited |
Elementwise comparison with 0/1 result, see lt: this is value equality of the entries, not identity of expressions; use is_equal to test whether two symbolic expressions are the same. For symbolic operands x == x with the same node simplifies to 1. NaN is not equal to anything, including itself.
>>> eq(DM([1, 2, 3]), 2)
DM([0, 1, 0])
>>> DM.eye(2) == DM([[1, 0], [0, 1]])
DM(
[[1, 1],
[1, 1]])
>>> x = SX.sym("x")
>>> x == x, x == SX.sym("x")
(SX(1), SX((x==x)))
>>> DM(float("nan")) == DM(float("nan"))
DM(0)
>> eq(DM([1; 2; 3]), 2)
[0, 1, 0]
>> DM.eye(2) == DM([1 0; 0 1])
[[1, 1],
[1, 1]]
>> x = SX.sym('x');
>> x == x, x == SX.sym('x')
1
(x==x)
>> DM(nan) == DM(nan)
0
julia> ca.eq(ca.DM([1, 2, 3]), 2)
DM([0, 1, 0])
julia> ca.DM.eye(2) == ca.DM([1 0; 0 1])
DM(
[[1, 1],
[1, 1]])
julia> x = ca.SX.sym("x");
julia> x == x, x == ca.SX.sym("x")
(1, (x==x))
julia> ca.DM(NaN) == ca.DM(NaN)
DM(0)
Extra doc: https://github.com/casadi/casadi/wiki/L_ov
Definition at line 641 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; sparsity preserved (erf(0) == 0). Range (-1, 1).
>>> erf(DM([0, 1])) DM([0, 0.842701])
>> erf(DM([0; 1])) [0, 0.842701]
julia> ca.erf(ca.DM([0, 1])) DM([0, 0.842701])
Extra doc: https://github.com/casadi/casadi/wiki/L_pm
Definition at line 1826 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; sparsity preserved. Defined on [-1, 1] with erfinv(+-1) infinite; arguments outside give NaN.
>>> erfinv(DM([0, 0.5, 1])) DM([0, 0.476936, inf])
>> erfinv(DM([0; 0.5; 1])) [0, 0.476936, inf]
julia> ca.erfinv(ca.DM([0, 0.5, 1])) DM([0, 0.476936, inf])
Extra doc: https://github.com/casadi/casadi/wiki/L_pn
Definition at line 1864 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; the result is dense (exp(0) == 1).
>>> exp(DM.eye(2))
DM(
[[2.71828, 1],
[1, 2.71828]])
>>> exp(MX.sym("m", Sparsity.diag(2)))
MX(exp(dense(m)))
>> exp(DM.eye(2))
[[2.71828, 1],
[1, 2.71828]]
>> exp(MX.sym('m', Sparsity.diag(2)))
exp(dense(m))
julia> exp.(ca.DM.eye(2))
DM(
[[2.71828, 1],
[1, 2.71828]])
julia> exp.(ca.MX.sym("m", ca.Sparsity.diag(2)))
MX(exp(dense(m)))
Extra doc: https://github.com/casadi/casadi/wiki/L_pf
Definition at line 1531 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; accurate for small x where exp(x) - 1 would lose digits. Sparsity preserved (expm1(0) == 0).
>>> expm1(DM([0, 1e-10])) DM([0, 1e-10])
>> expm1(DM([0; 1e-10])) [0, 1e-10]
julia> expm1.(ca.DM([0, 1e-10])) DM([0, 1e-10])
Extra doc: https://github.com/casadi/casadi/wiki/L_pj
Definition at line 1701 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise, towards minus infinity; sparsity preserved. The derivative is zero everywhere. Floor division x // y in Python is floor(x / y).
>>> floor(DM([-1.5, 1.5]))
DM([-2, 1])
>>> DM([7, -7]) // 2
DM([3, -4])
>>> SX.sym("x") // 2
SX(floor((x/2)))
>> floor(DM([-1.5; 1.5]))
[-2, 1]
>> floor(DM([7; -7]) ./ 2)
[3, -4]
>> floor(SX.sym('x') / 2)
floor((x/2))
julia> floor.(ca.DM([-1.5, 1.5]))
DM([-2, 1])
julia> fld.(ca.DM([7, -7]), 2)
DM([3, -4])
julia> floor(ca.SX.sym("x") / 2)
SX(floor((x/2)))
Extra doc: https://github.com/casadi/casadi/wiki/L_pk
Definition at line 1751 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise maximum; shape rules as for plus. Follows C fmax: when one operand is NaN the other is returned. The derivative is 1 with respect to the larger operand (split evenly on ties). For the maximum over the entries of one matrix use mmax.
>>> fmax(DM([1, 5]), DM([3, 2]))
DM([3, 5])
>>> fmax(DM([1, 5]), 3)
DM([3, 5])
>>> fmax(DM([1, float("nan")]), DM([float("nan"), 2]))
DM([1, 2])
>>> fmax(MX.sym("x"), MX.sym("y"))
MX(fmax(x,y))
>> fmax(DM([1; 5]), DM([3; 2]))
[3, 5]
>> max(DM([1; 5]), 3)
[3, 5]
>> fmax(DM([1; nan]), DM([nan; 2]))
[1, 2]
>> max(MX.sym('x'), MX.sym('y'))
fmax(x,y)
julia> max.(ca.DM([1, 5]), ca.DM([3, 2]))
DM([3, 5])
julia> max.(ca.DM([1, 5]), 3)
DM([3, 5])
julia> max.(ca.DM([1, NaN]), ca.DM([NaN, 2]))
DM([1, 2])
julia> max(ca.MX.sym("x"), ca.MX.sym("y"))
MX(fmax(x,y))
Extra doc: https://github.com/casadi/casadi/wiki/L_pu
Definition at line 2289 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise minimum; shape rules as for plus. Follows C fmin: when one operand is NaN the other is returned, NaN results only when both are NaN. The derivative is 1 with respect to the smaller operand (split evenly on ties). The sparsity pattern is kept where both operands are structurally zero; fmin with a negative scalar densifies. For the minimum over the entries of one matrix use mmin.
>>> fmin(DM([1, 5]), DM([3, 2]))
DM([1, 2])
>>> fmin(DM([1, float("nan")]), DM([float("nan"), 2]))
DM([1, 2])
>>> fmin(DM.eye(2), 1)
DM(
[[1, 00],
[00, 1]])
>>> fmin(SX.sym("x"), SX.sym("y"))
SX(fmin(x,y))
>> fmin(DM([1; 5]), DM([3; 2]))
[1, 2]
>> min(DM([1; 5]), DM([3; 2]))
[1, 2]
>> fmin(DM([1; nan]), DM([nan; 2]))
[1, 2]
>> fmin(DM.eye(2), 1)
[[1, 00],
[00, 1]]
>> min(SX.sym('x'), SX.sym('y'))
fmin(x,y)
julia> min.(ca.DM([1, 5]), ca.DM([3, 2]))
DM([1, 2])
julia> min.(ca.DM([1, NaN]), ca.DM([NaN, 2]))
DM([1, 2])
julia> min.(ca.DM.eye(2), 1)
DM(
[[1, 00],
[00, 1]])
julia> min(ca.SX.sym("x"), ca.SX.sym("y"))
SX(fmin(x,y))
Extra doc: https://github.com/casadi/casadi/wiki/L_pt
Definition at line 2232 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise comparison with 0/1 result, see lt. Implemented as y <= x.
>>> ge(DM([1, 2, 3]), 2)
DM([0, 1, 1])
>>> ge(MX.sym("x"), MX.sym("y"))
MX((y<=x))
>> ge(DM([1; 2; 3]), 2)
[0, 1, 1]
>> MX.sym('x') >= MX.sym('y')
(y<=x)
julia> ca.ge(ca.DM([1, 2, 3]), 2)
DM([0, 1, 1])
julia> ca.ge(ca.MX.sym("x"), ca.MX.sym("y"))
MX((y<=x))
Extra doc: https://github.com/casadi/casadi/wiki/L_ou
Definition at line 571 of file generic_expression.hpp.
| SXNode * casadi::SXElem::get | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_10n
Definition at line 178 of file sx_elem.cpp.
Referenced by casadi::SXFunction::init(), is_equal(), and casadi::register_symbol().
| SXElem casadi::SXElem::get_output | ( | casadi_int | oind | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_29f
Definition at line 404 of file sx_elem.cpp.
References casadi::SXNode::get_output().
Referenced by casadi::OutputSX::split().
| std::vector< SXElem > casadi::SXElem::get_output | ( | const std::vector< casadi_int > & | oind | ) | const |
Definition at line 408 of file sx_elem.cpp.
References casadi::SXNode::get_output().
| int casadi::SXElem::get_temp | ( | ) | const |
Get the temporary variable
Definition at line 484 of file sx_elem.cpp.
|
inlinestaticinherited |
Elementwise comparison with 0/1 result, see lt. Implemented as y < x, which is how a symbolic expression prints.
>>> gt(DM([1, 2, 3]), 2)
DM([0, 0, 1])
>>> gt(SX.sym("x"), SX.sym("y"))
SX((y<x))
>> gt(DM([1; 2; 3]), 2)
[0, 0, 1]
>> SX.sym('x') > SX.sym('y')
(y<x)
julia> ca.gt(ca.DM([1, 2, 3]), 2)
DM([0, 0, 1])
julia> ca.gt(ca.SX.sym("x"), ca.SX.sym("y"))
SX((y<x))
Extra doc: https://github.com/casadi/casadi/wiki/L_ot
Definition at line 525 of file generic_expression.hpp.
| bool casadi::SXElem::has_output | ( | ) | const |
Definition at line 291 of file sx_elem.cpp.
References casadi::SXNode::has_output().
|
inlinestaticinherited |
Elementwise; avoids the overflow and underflow of forming the squares, as C hypot. Shape rules as for plus; the result is structurally zero where both operands are.
>>> hypot(DM(3), DM(4))
DM(5)
>>> hypot(DM(1e200), DM(1e200))
DM(1.41421e+200)
>>> hypot(SX.sym("x"), SX.sym("y"))
SX(hypot(x,y))
>> hypot(DM(3), DM(4))
5
>> hypot(DM(1e200), DM(1e200))
1.41421e+200
>> hypot(SX.sym('x'), SX.sym('y'))
hypot(x,y)
julia> hypot(ca.DM(3), ca.DM(4))
DM(5)
julia> hypot(ca.DM(1e200), ca.DM(1e200))
DM(1.41421e+200)
julia> hypot(ca.SX.sym("x"), ca.SX.sym("y"))
SX(hypot(x,y))
Extra doc: https://github.com/casadi/casadi/wiki/L_pw
Definition at line 2565 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise: y where x is nonzero, 0 elsewhere; the result is structurally zero wherever either operand is. The value of y in the inactive branch does not propagate, so a NaN or inf there yields 0 rather than NaN, and the derivatives are treated accordingly. This is the building block of if_else; it is not exposed as a function in Python, use if_else(x, y, 0) there.
Extra doc: https://github.com/casadi/casadi/wiki/L_ps
Definition at line 2166 of file generic_expression.hpp.
| SXElem casadi::SXElem::inv | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_10y
Definition at line 174 of file sx_elem.cpp.
References casadi::OP_INV, and unary().
| bool casadi::SXElem::is_almost_zero | ( | double | tol | ) | const |
Definition at line 315 of file sx_elem.cpp.
References casadi::SXNode::is_almost_zero().
Referenced by casadi::casadi_limits< SXElem >::is_almost_zero().
| bool casadi::SXElem::is_boolean | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_2kj
Definition at line 370 of file sx_elem.cpp.
References is_constant(), and casadi::SXNode::op().
Referenced by unary().
| bool casadi::SXElem::is_call | ( | ) | const |
Definition at line 283 of file sx_elem.cpp.
References casadi::SXNode::is_call().
| bool casadi::SXElem::is_commutative | ( | ) | const |
| bool casadi::SXElem::is_constant | ( | ) | const |
Definition at line 279 of file sx_elem.cpp.
References casadi::SXNode::is_constant().
Referenced by __nonzero__(), binary(), casadi::UnarySX::create(), casadi::BinarySX::create(), is_boolean(), casadi::casadi_limits< SXElem >::is_constant(), is_leaf(), is_nonnegative(), casadi::Matrix< Scalar >::is_regular(), is_regular(), and unary().
| bool casadi::SXElem::is_doubled | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_10u
Definition at line 169 of file sx_elem.cpp.
References dep(), casadi::SXNode::eq_depth_, is_equal(), is_op(), casadi::OP_ADD, and casadi::OP_TWICE.
Extra doc: https://github.com/casadi/casadi/wiki/L_10z
Definition at line 359 of file sx_elem.cpp.
References get(), and casadi::SXNode::is_equal().
Referenced by assignIfDuplicate(), binary(), casadi::SXFunction::eval_sx(), is_doubled(), casadi::casadi_limits< SXElem >::is_equal(), casadi::BinarySX::is_equal(), and casadi::UnarySX::is_equal().
| bool casadi::SXElem::is_half | ( | ) | const |
Definition at line 327 of file sx_elem.cpp.
References casadi::SXNode::is_half().
Referenced by casadi::casadi_limits< SXElem >::is_half().
| bool casadi::SXElem::is_inf | ( | ) | const |
Definition at line 339 of file sx_elem.cpp.
References casadi::SXNode::is_inf().
Referenced by casadi::casadi_limits< SXElem >::is_inf(), casadi::Matrix< Scalar >::is_regular(), and is_regular().
| bool casadi::SXElem::is_integer | ( | ) | const |
Definition at line 303 of file sx_elem.cpp.
References casadi::SXNode::is_integer().
Referenced by casadi::casadi_limits< SXElem >::is_integer().
| bool casadi::SXElem::is_leaf | ( | ) | const |
An SXElem qualifies as leaf when it has no dependencies.
Extra doc: https://github.com/casadi/casadi/wiki/L_10r
Definition at line 269 of file sx_elem.cpp.
References is_constant(), and is_symbolic().
| bool casadi::SXElem::is_minus_inf | ( | ) | const |
Definition at line 343 of file sx_elem.cpp.
References casadi::SXNode::is_minus_inf().
Referenced by casadi::casadi_limits< SXElem >::is_minus_inf(), casadi::Matrix< Scalar >::is_regular(), and is_regular().
| bool casadi::SXElem::is_minus_one | ( | ) | const |
Definition at line 323 of file sx_elem.cpp.
References casadi::SXNode::is_minus_one().
Referenced by casadi::casadi_limits< SXElem >::is_minus_one(), and operator-().
| bool casadi::SXElem::is_nan | ( | ) | const |
Definition at line 335 of file sx_elem.cpp.
References casadi::SXNode::is_nan().
Referenced by casadi::casadi_limits< SXElem >::is_nan(), casadi::Matrix< Scalar >::is_regular(), and is_regular().
| bool casadi::SXElem::is_nonnegative | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_10t
Definition at line 379 of file sx_elem.cpp.
References is_constant(), and casadi::SXNode::op().
Referenced by casadi::casadi_limits< SXElem >::is_nonnegative().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_112
Definition at line 291 of file sx_elem.hpp.
| bool casadi::SXElem::is_one | ( | ) | const |
Definition at line 319 of file sx_elem.cpp.
References casadi::SXNode::is_one().
Referenced by casadi::casadi_limits< SXElem >::is_one(), and operator-().
| bool casadi::SXElem::is_op | ( | casadi_int | op | ) | const |
Definition at line 355 of file sx_elem.cpp.
References casadi::SXNode::is_op(), and op().
Referenced by binary(), is_doubled(), operator-(), and unary().
| bool casadi::SXElem::is_output | ( | ) | const |
Definition at line 287 of file sx_elem.cpp.
References casadi::SXNode::is_output().
| bool casadi::SXElem::is_regular | ( | ) | const |
Definition at line 500 of file sx_elem.cpp.
References is_constant(), is_inf(), is_minus_inf(), and is_nan().
| bool casadi::SXElem::is_symbolic | ( | ) | const |
Definition at line 307 of file sx_elem.cpp.
References casadi::SXNode::is_symbolic().
Referenced by is_leaf(), and casadi::register_symbol().
| bool casadi::SXElem::is_value | ( | double | val | ) | const |
Definition at line 331 of file sx_elem.cpp.
References casadi::SXNode::is_value().
Referenced by casadi::casadi_limits< SXElem >::is_value().
| bool casadi::SXElem::is_zero | ( | ) | const |
Definition at line 311 of file sx_elem.cpp.
References casadi::SXNode::is_zero().
Referenced by __nonzero__(), binary(), casadi::casadi_limits< SXElem >::is_zero(), and operator-().
|
inlinestaticinherited |
Elementwise comparison with 0/1 result, see lt. Chained inequalities such as lb <= (x <= ub) are recognised by Opti as bound constraints.
>>> le(DM([1, 2, 3]), 2)
DM([1, 1, 0])
>>> x = SX.sym("x")
>>> x <= x
SX(1)
>> le(DM([1; 2; 3]), 2)
[1, 1, 0]
>> x = SX.sym('x');
>> x <= x
1
julia> ca.le(ca.DM([1, 2, 3]), 2)
DM([1, 1, 0])
julia> x = ca.SX.sym("x");
julia> x <= x
SX(1)
Extra doc: https://github.com/casadi/casadi/wiki/L_os
Definition at line 478 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; the result is dense with -inf at structural zeros. Negative arguments give NaN; no error is raised.
>>> log(DM([1, 0]))
DM([0, -inf])
>>> log(SX.sym("x"))
SX(log(x))
>> log(DM([1; 0]))
[0, -inf]
>> log(SX.sym('x'))
log(x)
julia> log.(ca.DM([1, 0]))
DM([0, -inf])
julia> log(ca.SX.sym("x"))
SX(log(x))
Extra doc: https://github.com/casadi/casadi/wiki/L_pg
Definition at line 1575 of file generic_expression.hpp.
|
inlinestaticinherited |
Computed as log(x) * (1 / log(10)); there is no dedicated operation, which is visible in symbolic expressions. Dense result like log.
>>> log10(DM([1, 10, 1000]))
DM([0, 1, 3])
>>> log10(SX.sym("x"))
SX((0.434294*log(x)))
>> log10(DM([1; 10; 1000]))
[0, 1, 3]
>> log10(SX.sym('x'))
(0.434294*log(x))
julia> log10.(ca.DM([1, 10, 1000]))
DM([0, 1, 3])
julia> log10(ca.SX.sym("x"))
SX((0.434294*log(x)))
Extra doc: https://github.com/casadi/casadi/wiki/L_ph
Definition at line 1619 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; accurate for small x where log(1 + x) would lose digits. Sparsity preserved (log1p(0) == 0).
>>> log1p(DM([0, 1e-10]))
DM([0, 1e-10])
>>> log1p(SX.sym("x"))
SX(log1p(x))
>> log1p(DM([0; 1e-10]))
[0, 1e-10]
>> log1p(SX.sym('x'))
log1p(x)
julia> log1p.(ca.DM([0, 1e-10]))
DM([0, 1e-10])
julia> log1p(ca.SX.sym("x"))
SX(log1p(x))
Extra doc: https://github.com/casadi/casadi/wiki/L_pi
Definition at line 1663 of file generic_expression.hpp.
|
inlinestaticinherited |
Returns (an expression evaluating to) 1 where both entries are nonzero and 0 otherwise, elementwise
Any nonzero value, including NaN, counts as true. Shape rules as for plus; the result is structurally zero wherever either operand is. The Python keyword and does not work on matrices (it needs a single truth value); use this function.
>>> logic_and(DM([1, 2, 0]), DM([3, 0, 0]))
DM([1, 0, 0])
>>> logic_and(SX.sym("x"), SX.sym("y"))
SX((x&&y))
>>> logic_and(DM.eye(2), DM.ones(2, 2))
DM(
[[1, 00],
[00, 1]])
>> DM([1; 2; 0]) & DM([3; 0; 0])
[1, 0, 0]
>> SX.sym('x') & SX.sym('y')
(x&&y)
>> and(DM.eye(2), DM.ones(2, 2))
[[1, 00],
[00, 1]]
julia> ca.logic_and(ca.DM([1, 2, 0]), ca.DM([3, 0, 0]))
DM([1, 0, 0])
julia> ca.logic_and(ca.SX.sym("x"), ca.SX.sym("y"))
SX((x&&y))
julia> ca.logic_and(ca.DM.eye(2), ca.DM.ones(2, 2))
DM(
[[1, 00],
[00, 1]])
Extra doc: https://github.com/casadi/casadi/wiki/L_ox
Definition at line 753 of file generic_expression.hpp.
|
inlinestaticinherited |
Returns (an expression evaluating to) 1 where the entry is zero and 0 otherwise, elementwise
Structural zeros map to 1, so a sparse input gives a dense result. The Python keyword not does not work on matrices; use this function.
>>> logic_not(DM([1, 0, -1]))
DM([0, 1, 0])
>>> logic_not(DM.eye(2))
DM(
[[0, 1],
[1, 0]])
>>> logic_not(SX.sym("x"))
SX((!x))
>> ~DM([1; 0; -1])
[0, 1, 0]
>> not(DM.eye(2))
[[0, 1],
[1, 0]]
>> ~SX.sym('x')
(!x)
julia> ca.logic_not(ca.DM([1, 0, -1]))
DM([0, 1, 0])
julia> ca.logic_not(ca.DM.eye(2))
DM(
[[0, 1],
[1, 0]])
julia> ca.logic_not(ca.SX.sym("x"))
SX((!x))
Extra doc: https://github.com/casadi/casadi/wiki/L_oz
Definition at line 863 of file generic_expression.hpp.
|
inlinestaticinherited |
returns (an expression evaluating to) 1 where at least one entry is nonzero and 0 otherwise, elementwise
Shape rules as for plus; the result is structurally zero where both operands are.
>>> logic_or(DM([1, 0, 0]), DM([0, 0, 2]))
DM([1, 0, 1])
>>> logic_or(MX.sym("x"), MX.sym("y"))
MX((x||y))
>> DM([1; 0; 0]) | DM([0; 0; 2])
[1, 0, 1]
>> or(MX.sym('x'), MX.sym('y'))
(x||y)
julia> ca.logic_or(ca.DM([1, 0, 0]), ca.DM([0, 0, 2]))
DM([1, 0, 1])
julia> ca.logic_or(ca.MX.sym("x"), ca.MX.sym("y"))
MX((x||y))
Extra doc: https://github.com/casadi/casadi/wiki/L_oy
Definition at line 802 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise comparison; shape rules as for plus. Every comparison in this group returns a matrix of the same type as the operands with entries 1 (true) and 0 (false): for DM a numeric 0/1 matrix, not a boolean, and for SX and MX a symbolic expression that is only decided at evaluation time. Comparisons with NaN are false. The result is sparse where both operands are structurally zero (0 < 0 is false).
>>> lt(DM([1, 2, 3]), 2)
DM([1, 0, 0])
>>> DM([1, 2, 3]) < DM([3, 2, 1])
DM([1, 0, 0])
>>> SX.sym("x", 2) < SX.sym("y", 2)
SX([(x_0<y_0), (x_1<y_1)])
>>> DM.eye(2) < 1
DM(
[[0, 1],
[1, 0]])
>> lt(DM([1; 2; 3]), 2)
[1, 0, 0]
>> DM([1; 2; 3]) < DM([3; 2; 1])
[1, 0, 0]
>> SX.sym('x', 2) < SX.sym('y', 2)
[(x_0<y_0), (x_1<y_1)]
>> DM.eye(2) < 1
[[0, 1],
[1, 0]]
julia> ca.lt(ca.DM([1, 2, 3]), 2)
DM([1, 0, 0])
julia> ca.DM([1, 2, 3]) < ca.DM([3, 2, 1])
DM([1, 0, 0])
julia> ca.SX.sym("x", 2) < ca.SX.sym("y", 2)
SX([(x_0<y_0), (x_1<y_1)])
julia> ca.DM.eye(2) < 1
DM(
[[0, 1],
[1, 0]])
Extra doc: https://github.com/casadi/casadi/wiki/L_or
Definition at line 428 of file generic_expression.hpp.
| void casadi::SXElem::mark | ( | ) | const |
Definition at line 496 of file sx_elem.cpp.
| bool casadi::SXElem::marked | ( | ) | const |
Definition at line 492 of file sx_elem.cpp.
|
inlinestaticinherited |
Elementwise difference; shape and sparsity rules as for plus. For symbolic arguments, x - x with the same node simplifies to 0.
>>> minus(DM([5, 6]), DM([1, 2]))
DM([4, 4])
>>> DM.eye(2) - 1
DM(
[[0, -1],
[-1, 0]])
>>> x = SX.sym("x")
>>> x - x
SX(0)
>> minus(DM([5; 6]), DM([1; 2]))
[4, 4]
>> DM.eye(2) - 1
[[0, -1],
[-1, 0]]
>> x = SX.sym('x');
>> x - x
0
julia> ca.minus(ca.DM([5, 6]), ca.DM([1, 2]))
DM([4, 4])
julia> ca.DM.eye(2) - 1
DM(
[[0, -1],
[-1, 0]])
julia> x = ca.SX.sym("x");
julia> x - x
SX(0)
Extra doc: https://github.com/casadi/casadi/wiki/L_oo
Definition at line 221 of file generic_expression.hpp.
|
inlinestaticinherited |
This Function follows the convention of https://en.cppreference.com/w/c/numeric/math/fmod: the result has the sign of x and magnitude below |y|.
This is equivalent to Python's numpy.fmod and Matlab's rem. It differs from the Python operator x % y on these objects, which follows the Python convention x - y*floor(x/y) (result with the sign of y). Elementwise, shape rules as for plus; structural zeros of x stay zero. A zero divisor gives NaN.
>>> fmod(DM([5, 5, -5, -5]), DM([3, -3, 3, -3]))
DM([2, 2, -2, -2])
>>> DM([5, 5, -5, -5]) % DM([3, -3, 3, -3])
DM([2, -1, 1, -2])
>>> fmod(SX.sym("x"), 2), SX.sym("x") % 2
(SX(fmod(x,2)), SX((x-(2.*floor((x/2))))))
>> x = DM([5; 5; -5; -5]); y = DM([3; -3; 3; -3]);
>> fmod(x, y)
[2, 2, -2, -2]
>> rem(x, y)
[2, 2, -2, -2]
>> x - y .* floor(x ./ y)
[2, -1, 1, -2]
>> rem(SX.sym('x'), 2)
fmod(x,2)
julia> ca.fmod(ca.DM([5, 5, -5, -5]), ca.DM([3, -3, 3, -3]))
DM([2, 2, -2, -2])
julia> mod.(ca.DM([5, 5, -5, -5]), ca.DM([3, -3, 3, -3]))
DM([2, -1, 1, -2])
julia> ca.fmod(ca.SX.sym("x"), 2)
SX(fmod(x,2))
Definition at line 2036 of file generic_expression.hpp.
| casadi_int casadi::SXElem::n_dep | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_10v
Definition at line 400 of file sx_elem.cpp.
References casadi::SXNode::n_dep().
Referenced by dep(), and is_commutative().
| const std::string & casadi::SXElem::name | ( | ) | const |
|
inlinestaticinherited |
Elementwise comparison with 0/1 result, see lt and eq. For symbolic operands x != x with the same node simplifies to 0, so it cannot be used to detect NaN symbolically.
>>> ne(DM([1, 2, 3]), 2)
DM([1, 0, 1])
>>> x = MX.sym("x")
>>> x != x
MX(0)
>> ne(DM([1; 2; 3]), 2)
[1, 0, 1]
>> x = MX.sym('x');
>> x ~= x
0
julia> ca.ne(ca.DM([1, 2, 3]), 2)
DM([1, 0, 1])
julia> x = ca.MX.sym("x");
julia> x != x
MX(0)
Extra doc: https://github.com/casadi/casadi/wiki/L_ow
Definition at line 691 of file generic_expression.hpp.
| casadi_int casadi::SXElem::op | ( | ) | const |
Definition at line 351 of file sx_elem.cpp.
References casadi::SXNode::op().
Referenced by binary(), is_commutative(), is_op(), and unary().
|
explicit |
Definition at line 391 of file sx_elem.cpp.
|
explicit |
Definition at line 387 of file sx_elem.cpp.
|
inlineinherited |
Returns (an expression evaluating to) 1 where the entry is zero and 0 otherwise, elementwise
Structural zeros map to 1, so a sparse input gives a dense result. The Python keyword not does not work on matrices; use this function.
>>> logic_not(DM([1, 0, -1]))
DM([0, 1, 0])
>>> logic_not(DM.eye(2))
DM(
[[0, 1],
[1, 0]])
>>> logic_not(SX.sym("x"))
SX((!x))
>> ~DM([1; 0; -1])
[0, 1, 0]
>> not(DM.eye(2))
[[0, 1],
[1, 0]]
>> ~SX.sym('x')
(!x)
julia> ca.logic_not(ca.DM([1, 0, -1]))
DM([0, 1, 0])
julia> ca.logic_not(ca.DM.eye(2))
DM(
[[0, 1],
[1, 0]])
julia> ca.logic_not(ca.SX.sym("x"))
SX((!x))
Extra doc: https://github.com/casadi/casadi/wiki/L_oz
Definition at line 869 of file generic_expression.hpp.
|
inlineinherited |
Elementwise (Hadamard) product, not the matrix product; use mtimes for that. Shape rules as for plus. The result is structurally zero wherever either operand is, so the sparsity pattern is the intersection of the patterns.
>>> times(DM([1, 2]), DM([3, 4])) DM([3, 8]) >>> DM([[1, 2], [3, 4]]) * DM([[1, 2], [3, 4]]) DM( [[1, 4], [9, 16]]) >>> DM.eye(2) * DM.ones(2, 2) DM( [[1, 00], [00, 1]])
>> times(DM([1; 2]), DM([3; 4])) [3, 8] >> DM([1 2; 3 4]) .* DM([1 2; 3 4]) [[1, 4], [9, 16]] >> DM([1 2; 3 4]) * DM([1 2; 3 4]) [[7, 10], [15, 22]] >> DM.eye(2) .* DM.ones(2, 2) [[1, 00], [00, 1]]
julia> ca.times(ca.DM([1, 2]), ca.DM([3, 4])) DM([3, 8]) julia> ca.DM([1 2; 3 4]) .* ca.DM([1 2; 3 4]) DM( [[1, 4], [9, 16]]) julia> ca.DM.eye(2) .* ca.DM.ones(2, 2) DM( [[1, 00], [00, 1]])
Extra doc: https://github.com/casadi/casadi/wiki/L_op
Definition at line 298 of file generic_expression.hpp.
|
inlineinherited |
Definition at line 170 of file generic_expression.hpp.
| SXElem casadi::SXElem::operator- | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_10x
Definition at line 151 of file sx_elem.cpp.
References dep(), is_minus_one(), is_one(), is_op(), is_zero(), casadi::OP_NEG, and unary().
|
inlineinherited |
Elementwise difference; shape and sparsity rules as for plus. For symbolic arguments, x - x with the same node simplifies to 0.
>>> minus(DM([5, 6]), DM([1, 2]))
DM([4, 4])
>>> DM.eye(2) - 1
DM(
[[0, -1],
[-1, 0]])
>>> x = SX.sym("x")
>>> x - x
SX(0)
>> minus(DM([5; 6]), DM([1; 2]))
[4, 4]
>> DM.eye(2) - 1
[[0, -1],
[-1, 0]]
>> x = SX.sym('x');
>> x - x
0
julia> ca.minus(ca.DM([5, 6]), ca.DM([1, 2]))
DM([4, 4])
julia> ca.DM.eye(2) - 1
DM(
[[0, -1],
[-1, 0]])
julia> x = ca.SX.sym("x");
julia> x - x
SX(0)
Extra doc: https://github.com/casadi/casadi/wiki/L_oo
Definition at line 230 of file generic_expression.hpp.
| SXNode * casadi::SXElem::operator-> | ( | ) |
Definition at line 186 of file sx_elem.cpp.
| const SXNode * casadi::SXElem::operator-> | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_10o
Definition at line 182 of file sx_elem.cpp.
|
inlineinherited |
Elementwise quotient, not a linear solve; use solve or mldivide for that. Shape rules as for plus. Division by zero follows IEEE arithmetic (inf or nan), no error is raised. Structural zeros of x stay structural zeros; dividing by a sparse y densifies.
>>> rdivide(DM([1, 2]), 4) DM([0.25, 0.5]) >>> DM([1, 2]) / DM([4, 8]) DM([0.25, 0.25]) >>> 1 / DM.eye(2) DM( [[1, inf], [inf, 1]]) >>> DM.eye(2) / 2 DM( [[0.5, 00], [00, 0.5]])
>> rdivide(DM([1; 2]), 4) [0.25, 0.5] >> DM([1; 2]) ./ DM([4; 8]) [0.25, 0.25] >> 1 ./ DM.eye(2) [[1, inf], [inf, 1]] >> DM.eye(2) ./ 2 [[0.5, 00], [00, 0.5]]
julia> ca.rdivide(ca.DM([1, 2]), 4) DM([0.25, 0.5]) julia> ca.DM([1, 2]) ./ ca.DM([4, 8]) DM([0.25, 0.25]) julia> 1 ./ ca.DM.eye(2) DM( [[1, inf], [inf, 1]]) julia> ca.DM.eye(2) / 2 DM( [[0.5, 00], [00, 0.5]])
Extra doc: https://github.com/casadi/casadi/wiki/L_oq
Definition at line 369 of file generic_expression.hpp.
| SXElem & casadi::SXElem::operator= | ( | double | scalar | ) |
Definition at line 143 of file sx_elem.cpp.
References SXElem().
|
inlinestaticinherited |
Elementwise sum. The shape rules below hold for every binary operation in this group (minus, times, rdivide, the comparisons, logic_and, ...):
The result is sparse where both operands are structurally zero; an entry that is a structural zero in only one operand becomes an explicit value. Operations that map (0, y) or (x, 0) to a nonzero, such as x + 1 or cos, densify the result. Numeric (DM) operands are evaluated, symbolic ones (SX, MX) build an expression; DM and SX or MX can be mixed, SX and MX cannot.
>>> plus(DM([1, 2]), DM([10, 20]))
DM([11, 22])
>>> DM([1, 2]) + 1
DM([2, 3])
>>> DM.eye(2) + DM.eye(2)
DM(
[[2, 00],
[00, 2]])
>>> DM.eye(2) + 1
DM(
[[2, 1],
[1, 2]])
>>> SX.sym("x", 2, 2) + SX.sym("y", 2)
SX(
[[(x_0+y_0), (x_2+y_0)],
[(x_1+y_1), (x_3+y_1)]])
>>> (MX.sym("x", 2, 0) + 1).shape
(2, 0)
>>> DM.ones(2, 2) + DM.ones(1, 2)
Traceback (most recent call last):
...
RuntimeError: ...Dimension mismatch...
>> plus(DM([1; 2]), DM([10; 20]))
[11, 22]
>> DM([1; 2]) + 1
[2, 3]
>> DM.eye(2) + DM.eye(2)
[[2, 00],
[00, 2]]
>> DM.eye(2) + 1
[[2, 1],
[1, 2]]
>> SX.sym('x', 2, 2) + SX.sym('y', 2)
[[(x_0+y_0), (x_2+y_0)],
[(x_1+y_1), (x_3+y_1)]]
>> size(MX.sym('x', 2, 0) + 1)
2 0
>> try, DM.ones(2, 2) + DM.ones(1, 2); catch e, disp(e.message); end
...Dimension mismatch...
julia> ca.plus(ca.DM([1, 2]), ca.DM([10, 20]))
DM([11, 22])
julia> ca.DM([1, 2]) + 1
DM([2, 3])
julia> ca.DM.eye(2) + ca.DM.eye(2)
DM(
[[2, 00],
[00, 2]])
julia> ca.DM.eye(2) + 1
DM(
[[2, 1],
[1, 2]])
julia> ca.SX.sym("x", 2, 2) + ca.SX.sym("y", 2)
SX(
[[(x_0+y_0), (x_2+y_0)],
[(x_1+y_1), (x_3+y_1)]])
julia> size(ca.MX.sym("x", 2, 0) + 1)
(2, 0)
julia> try
ca.DM.ones(2, 2) + ca.DM.ones(1, 2)
catch e
println(occursin("Dimension mismatch", sprint(showerror, e)))
end
true
Extra doc: https://github.com/casadi/casadi/wiki/L_on
Definition at line 161 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; shape rules as for plus. Named power in Python, where the ** operator maps to it as well. A constant exponent is simplified symbolically: integer powers become repeated squaring and multiplication, 0.5 becomes sqrt, -1 a reciprocal, other constants a constpow operation. Structural zeros of x stay zero for a nonzero exponent; x**0 is dense (0**0 == 1).
>>> power(DM([1, 2, 3]), 2)
DM([1, 4, 9])
>>> DM([1, 2, 3])**DM([3, 2, 1]), 2**DM([1, 2, 3])
(DM([1, 4, 3]), DM([2, 4, 8]))
>>> x = SX.sym("x")
>>> x**2, x**3, x**-1, x**x
(SX(sq(x)), SX((x*sq(x))), SX((1./x)), SX(pow(x,x)))
>>> x**2.5
SX(pow(x,2.5))
>> power(DM([1; 2; 3]), 2)
[1, 4, 9]
>> DM([1; 2; 3]).^DM([3; 2; 1]), 2.^DM([1; 2; 3])
[1, 4, 3]
[2, 4, 8]
>> x = SX.sym('x');
>> x.^2, x.^3, x.^-1, x.^x
sq(x)
(x*sq(x))
(1./x)
pow(x,x)
>> x.^2.5
pow(x,2.5)
julia> ca.power(ca.DM([1, 2, 3]), 2)
DM([1, 4, 9])
julia> ca.DM([1, 2, 3]) .^ ca.DM([3, 2, 1]), 2 .^ ca.DM([1, 2, 3])
([1, 4, 3], [2, 4, 8])
julia> x = ca.SX.sym("x");
julia> x^2, x^3, x^-1, x^x
(sq(x), (x*sq(x)), (1./x), pow(x,x))
julia> x^2.5
SX(pow(x,2.5))
Extra doc: https://github.com/casadi/casadi/wiki/L_pp
Definition at line 1978 of file generic_expression.hpp.
|
inlinestaticinherited |
Identity operation with a side effect: whenever the expression is evaluated inside a Function (and hence inside a solver), every nonzero of x is printed on its own line as "|> y : value" in storage (column-major) order, with y an identifier of choice to tell several printme nodes apart. Available as a method x.printme(y) in Python; the derivative is that of x. Use monitor to print a whole matrix at once.
>>> x = MX.sym("x")
>>> f = Function("f", [x], [x.printme(7) * 2])
>>> f(3)
|> 7 : 3.0000000000000000e+00
DM(6)
>> x = MX.sym('x');
>> f = Function('f', {x}, {x.printme(7) * 2});
>> f(3)
|> 7 : 3.0000000000000000e+00
6
julia> x = ca.MX.sym("x");
julia> f = ca.Function("f", [x], [ca.printme(x, 7) * 2]);
julia> f(3)
|> 7 : 3.0000000000000000e+00
DM(6)
Extra doc: https://github.com/casadi/casadi/wiki/L_2on
Definition at line 2515 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise quotient, not a linear solve; use solve or mldivide for that. Shape rules as for plus. Division by zero follows IEEE arithmetic (inf or nan), no error is raised. Structural zeros of x stay structural zeros; dividing by a sparse y densifies.
>>> rdivide(DM([1, 2]), 4) DM([0.25, 0.5]) >>> DM([1, 2]) / DM([4, 8]) DM([0.25, 0.25]) >>> 1 / DM.eye(2) DM( [[1, inf], [inf, 1]]) >>> DM.eye(2) / 2 DM( [[0.5, 00], [00, 0.5]])
>> rdivide(DM([1; 2]), 4) [0.25, 0.5] >> DM([1; 2]) ./ DM([4; 8]) [0.25, 0.25] >> 1 ./ DM.eye(2) [[1, inf], [inf, 1]] >> DM.eye(2) ./ 2 [[0.5, 00], [00, 0.5]]
julia> ca.rdivide(ca.DM([1, 2]), 4) DM([0.25, 0.5]) julia> ca.DM([1, 2]) ./ ca.DM([4, 8]) DM([0.25, 0.25]) julia> 1 ./ ca.DM.eye(2) DM( [[1, inf], [inf, 1]]) julia> ca.DM.eye(2) / 2 DM( [[0.5, 00], [00, 0.5]])
Extra doc: https://github.com/casadi/casadi/wiki/L_oq
Definition at line 360 of file generic_expression.hpp.
|
inlinestaticinherited |
This Function follows the convention of https://en.cppreference.com/w/c/numeric/math/remainder: x - n*y with n the integer nearest to x/y (ties to even), so the result lies in [-|y|/2, |y|/2].
Notably:
This is equivalent to Python's math.remainder. There is no equivalence in Matlab. Elementwise, shape rules as for plus; structural zeros of x stay zero.
>>> remainder(DM([5, 5, -5, -5]), DM([3, -3, 3, -3]))
DM([-1, -1, 1, 1])
>>> remainder(DM([2.5, 3.5]), 2)
DM([0.5, -0.5])
>>> remainder(MX.sym("x"), 2)
MX(remainder(x,2))
>> remainder(DM([5; 5; -5; -5]), DM([3; -3; 3; -3]))
[-1, -1, 1, 1]
>> remainder(DM([2.5; 3.5]), 2)
[0.5, -0.5]
>> remainder(MX.sym('x'), 2)
remainder(x,2)
julia> ca.remainder(ca.DM([5, 5, -5, -5]), ca.DM([3, -3, 3, -3]))
DM([-1, -1, 1, 1])
julia> ca.remainder(ca.DM([2.5, 3.5]), 2)
DM([0.5, -0.5])
julia> ca.remainder(ca.MX.sym("x"), 2)
MX(remainder(x,2))
Extra doc: https://github.com/casadi/casadi/wiki/L_24x
Definition at line 2099 of file generic_expression.hpp.
|
inlineprotectedinherited |
Definition at line 55 of file generic_expression.hpp.
|
inlineprotectedinherited |
Definition at line 54 of file generic_expression.hpp.
| void casadi::SXElem::serialize | ( | SerializingStream & | s | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_114
Definition at line 508 of file sx_elem.cpp.
| void casadi::SXElem::set_temp | ( | int | t | ) | const |
Definition at line 488 of file sx_elem.cpp.
|
inlinestaticinherited |
sign(x) := -1 for x<0 sign(x) := 1 for x>0, sign(0) := 0 sign(NaN) := NaN
Elementwise; sparsity preserved. The derivative is zero everywhere.
>>> sign(DM([-2, 0, 3]))
DM([-1, 0, 1])
>>> sign(SX.sym("x"))
SX(sign(x))
>> sign(DM([-2; 0; 3]))
[-1, 0, 1]
>> sign(SX.sym('x'))
sign(x)
julia> sign.(ca.DM([-2, 0, 3]))
DM([-1, 0, 1])
julia> sign(ca.SX.sym("x"))
SX(sign(x))
Extra doc: https://github.com/casadi/casadi/wiki/L_po
Definition at line 1912 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; sparsity preserved (sin(0) == 0).
>>> sin(DM.eye(2))
DM(
[[0.841471, 00],
[00, 0.841471]])
>>> sin(MX.sym("x", 2))
MX(sin(x))
>> sin(DM.eye(2))
[[0.841471, 00],
[00, 0.841471]]
>> sin(MX.sym('x', 2))
sin(x)
julia> sin.(ca.DM.eye(2))
DM(
[[0.841471, 00],
[00, 0.841471]])
julia> sin.(ca.MX.sym("x", 2))
MX(sin(x))
Extra doc: https://github.com/casadi/casadi/wiki/L_p3
Definition at line 1058 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; sparsity preserved.
>>> sinh(DM([0, 1])) DM([0, 1.1752])
>> sinh(DM([0; 1])) [0, 1.1752]
julia> sinh.(ca.DM([0, 1])) DM([0, 1.1752])
Extra doc: https://github.com/casadi/casadi/wiki/L_pa
Definition at line 1335 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; sparsity preserved. Not exposed as a function in Python; a symbolic power with exponent 2 is turned into this operation.
>>> SX.sym("x")**2
SX(sq(x))
>> SX.sym('x').^2
sq(x)
julia> ca.SX.sym("x")^2
SX(sq(x))
Extra doc: https://github.com/casadi/casadi/wiki/L_p2
Definition at line 1010 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; sparsity preserved. A negative argument gives NaN, no error is raised. A symbolic power x**0.5 simplifies to sqrt(x).
>>> sqrt(DM([4, 9]))
DM([2, 3])
>>> SX.sym("x")**0.5
SX(sqrt(x))
>> sqrt(DM([4; 9]))
[2, 3]
>> SX.sym('x').^0.5
sqrt(x)
julia> sqrt.(ca.DM([4, 9]))
DM([2, 3])
julia> ca.SX.sym("x")^0.5
SX(sqrt(x))
Extra doc: https://github.com/casadi/casadi/wiki/L_p1
Definition at line 972 of file generic_expression.hpp.
|
static |
| name | Name of the symbolic primitive |
This is the name that will be used by the "operator<<" and "str" methods. The name is not used as identifier; you may construct distinct SXElem objects with non-unique names.
Extra doc: https://github.com/casadi/casadi/wiki/L_10l
Definition at line 95 of file sx_elem.cpp.
References create(), and name().
Referenced by casadi::Matrix< Scalar >::_sym(), and casadi::register_symbol().
|
inlinestaticinherited |
Elementwise; sparsity preserved.
>>> tan(DM([0, 1])) DM([0, 1.55741])
>> tan(DM([0; 1])) [0, 1.55741]
julia> tan.(ca.DM([0, 1])) DM([0, 1.55741])
Extra doc: https://github.com/casadi/casadi/wiki/L_p5
Definition at line 1149 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise; sparsity preserved.
>>> tanh(DM([0, 1])) DM([0, 0.761594])
>> tanh(DM([0; 1])) [0, 0.761594]
julia> tanh.(ca.DM([0, 1])) DM([0, 0.761594])
Extra doc: https://github.com/casadi/casadi/wiki/L_p9
Definition at line 1298 of file generic_expression.hpp.
|
inlinestaticinherited |
Elementwise (Hadamard) product, not the matrix product; use mtimes for that. Shape rules as for plus. The result is structurally zero wherever either operand is, so the sparsity pattern is the intersection of the patterns.
>>> times(DM([1, 2]), DM([3, 4])) DM([3, 8]) >>> DM([[1, 2], [3, 4]]) * DM([[1, 2], [3, 4]]) DM( [[1, 4], [9, 16]]) >>> DM.eye(2) * DM.ones(2, 2) DM( [[1, 00], [00, 1]])
>> times(DM([1; 2]), DM([3; 4])) [3, 8] >> DM([1 2; 3 4]) .* DM([1 2; 3 4]) [[1, 4], [9, 16]] >> DM([1 2; 3 4]) * DM([1 2; 3 4]) [[7, 10], [15, 22]] >> DM.eye(2) .* DM.ones(2, 2) [[1, 00], [00, 1]]
julia> ca.times(ca.DM([1, 2]), ca.DM([3, 4])) DM([3, 8]) julia> ca.DM([1 2; 3 4]) .* ca.DM([1 2; 3 4]) DM( [[1, 4], [9, 16]]) julia> ca.DM.eye(2) .* ca.DM.ones(2, 2) DM( [[1, 00], [00, 1]])
Extra doc: https://github.com/casadi/casadi/wiki/L_op
Definition at line 289 of file generic_expression.hpp.
|
inlinestatic |
Definition at line 135 of file sx_elem.hpp.
Definition at line 241 of file sx_elem.cpp.
References casadi::common_simp_unary(), casadi::UnarySX::create(), dep(), casadi::SXNode::eq_depth_, is_boolean(), is_constant(), is_op(), op(), casadi::OP_MUL, casadi::OP_NOT, casadi::OP_TWICE, and casadi::GlobalOptions::simplification_on_the_fly.
Referenced by binary(), inv(), and operator-().
| Function casadi::SXElem::which_function | ( | ) | const |
Definition at line 295 of file sx_elem.cpp.
References casadi::SXNode::which_function().
| casadi_int casadi::SXElem::which_output | ( | ) | const |
Definition at line 299 of file sx_elem.cpp.
References casadi::SXNode::which_output().
|
friend |
Definition at line 77 of file sx_elem.hpp.
Extra doc: https://github.com/casadi/casadi/wiki/L_113
Definition at line 296 of file sx_elem.hpp.
Definition at line 77 of file sx_elem.hpp.
|
friend |
Definition at line 76 of file sx_elem.hpp.