Represents a basic binary operation on two SXElem nodes. More...
#include <binary_sx.hpp>
Extra doc: https://github.com/casadi/casadi/wiki/L_115
Definition at line 41 of file binary_sx.hpp.
Public Member Functions | |
~BinarySX () override | |
Destructor. More... | |
std::string | class_name () const override |
Get type name. More... | |
bool | is_smooth () const override |
Check if smooth. More... | |
bool | is_op (casadi_int op) const override |
check properties of a node More... | |
bool | is_equal (const SXNode *node, casadi_int depth) const override |
Check if two nodes are equivalent up to a given depth. More... | |
casadi_int | n_dep () const override |
Number of dependencies. More... | |
const SXElem & | dep (casadi_int i) const override |
get the reference of a dependency More... | |
SXElem & | dep (casadi_int i) override |
get the reference of a child More... | |
casadi_int | op () const override |
Get the operation. More... | |
std::string | print (const std::string &arg1, const std::string &arg2) const override |
Print expression. More... | |
void | serialize_node (SerializingStream &s) const override |
virtual const std::string & | name () const |
virtual Function | which_function () const |
Get called function. More... | |
virtual casadi_int | which_output () const |
Get function output. More... | |
virtual SXElem | get_output (casadi_int oind) const |
Get an output. More... | |
virtual void | disp (std::ostream &stream, bool more) const |
print More... | |
void | can_inline (std::map< const SXNode *, casadi_int > &nodeind) const |
Find out which nodes can be inlined. More... | |
std::string | print_compact (std::map< const SXNode *, casadi_int > &nodeind, std::vector< std::string > &intermed) const |
Print compact. More... | |
bool | marked () const |
void | mark () const |
SXElem | shared_from_this () |
Get a shared object from the current internal object. More... | |
const SXElem | shared_from_this () const |
Get a shared object from the current internal object. More... | |
void | serialize (SerializingStream &s) const |
Serialize an object. More... | |
virtual bool | is_constant () const |
check properties of a node More... | |
virtual bool | is_integer () const |
check properties of a node More... | |
virtual bool | is_symbolic () const |
check properties of a node More... | |
virtual bool | is_zero () const |
check properties of a node More... | |
virtual bool | is_almost_zero (double tol) const |
check properties of a node More... | |
virtual bool | is_one () const |
check properties of a node More... | |
virtual bool | is_minus_one () const |
check properties of a node More... | |
virtual bool | is_nan () const |
check properties of a node More... | |
virtual bool | is_inf () const |
check properties of a node More... | |
virtual bool | is_minus_inf () const |
check properties of a node More... | |
virtual bool | is_call () const |
check properties of a node More... | |
virtual bool | is_output () const |
check properties of a node More... | |
virtual bool | has_output () const |
check properties of a node More... | |
virtual double | to_double () const |
Get value of a constant node. More... | |
virtual casadi_int | to_int () const |
Get value of a constant node. More... | |
Static Public Member Functions | |
static SXElem | create (unsigned char op, const SXElem &dep0, const SXElem &dep1) |
Create a binary expression. More... | |
static SXNode * | deserialize (DeserializingStream &s, casadi_int op) |
Deserialize without type information. More... | |
static void | safe_delete (SXNode *n) |
Non-recursive delete. More... | |
static SXNode * | deserialize (DeserializingStream &s) |
Public Attributes | |
unsigned char | op_ |
The binary operation as an 1 byte integer (allows 256 values) More... | |
SXElem | dep0_ |
The dependencies of the node. More... | |
SXElem | dep1_ |
int | temp |
unsigned int | count |
Static Public Attributes | |
static casadi_int | eq_depth_ = 1 |
static std::map< casadi_int, SXNode *(*)(DeserializingStream &)> | deserialize_map |
|
inlineoverride |
This is a rather complex destructor which is necessary since the default destructor can cause stack overflow due to recursive calling.
Extra doc: https://github.com/casadi/casadi/wiki/L_118
Definition at line 75 of file binary_sx.hpp.
References casadi::SXElem::assignNoDelete(), dep0_, dep1_, and casadi::SXNode::safe_delete().
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_a6
Definition at line 113 of file sx_node.cpp.
References casadi::SXNode::can_inline(), casadi::SXNode::dep(), casadi::SXNode::n_dep(), casadi::SXNode::op(), and casadi::OP_PARAMETER.
Referenced by casadi::SXNode::can_inline(), and casadi::SXNode::disp().
|
inlineoverridevirtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_9y
Implements casadi::SXNode.
Definition at line 81 of file binary_sx.hpp.
|
inlinestatic |
Extra doc: https://github.com/casadi/casadi/wiki/L_117
Definition at line 55 of file binary_sx.hpp.
References casadi::SXElem::create(), casadi::casadi_math< T >::fun(), casadi::SXElem::is_constant(), and op().
Referenced by casadi::SXElem::binary().
|
inlineoverridevirtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_11b
Reimplemented from casadi::SXNode.
Definition at line 110 of file binary_sx.hpp.
|
inlineoverridevirtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_a3
Reimplemented from casadi::SXNode.
Definition at line 111 of file binary_sx.hpp.
|
staticinherited |
Definition at line 243 of file sx_node.cpp.
References deserialize(), casadi::UnarySX::deserialize(), casadi::SXNode::deserialize_map, casadi::SXNode::op(), casadi::str(), and casadi::DeserializingStream::unpack().
Referenced by casadi::SXElem::deserialize().
|
inlinestatic |
Extra doc: https://github.com/casadi/casadi/wiki/L_11g
Definition at line 143 of file binary_sx.hpp.
References op(), and casadi::DeserializingStream::unpack().
Referenced by casadi::SXNode::deserialize().
|
virtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_a5
Definition at line 88 of file sx_node.cpp.
References casadi::SXNode::can_inline(), and casadi::SXNode::print_compact().
Referenced by casadi::SXElem::disp().
|
virtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_293
Reimplemented in casadi::CallSX.
Definition at line 227 of file sx_node.cpp.
References casadi::SXNode::shared_from_this().
Referenced by casadi::SXElem::get_output().
|
inlinevirtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_9w
Reimplemented in casadi::CallSX.
Definition at line 82 of file sx_node.hpp.
Referenced by casadi::SXElem::has_output().
|
inlinevirtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_9w
Reimplemented in casadi::ZeroSX, and casadi::RealtypeSX.
Definition at line 74 of file sx_node.hpp.
Referenced by casadi::SXElem::is_almost_zero().
|
inlinevirtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_9w
Reimplemented in casadi::CallSX.
Definition at line 80 of file sx_node.hpp.
Referenced by casadi::SXElem::is_call().
|
inlinevirtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_9w
Reimplemented in casadi::ConstantSX.
Definition at line 69 of file sx_node.hpp.
Referenced by casadi::SXElem::binary(), casadi::SXFunction::init(), and casadi::SXElem::is_constant().
|
inlineoverridevirtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_119
Reimplemented from casadi::SXNode.
Definition at line 90 of file binary_sx.hpp.
References dep0_, dep1_, casadi::SXElem::is_equal(), and op_.
|
inlinevirtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_9w
Reimplemented in casadi::InfSX.
Definition at line 78 of file sx_node.hpp.
Referenced by casadi::SXElem::is_inf().
|
inlinevirtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_9w
Reimplemented in casadi::MinusOneSX, casadi::OneSX, casadi::ZeroSX, and casadi::IntegerSX.
Definition at line 70 of file sx_node.hpp.
Referenced by casadi::SXElem::binary(), and casadi::SXElem::is_integer().
|
inlinevirtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_9w
Reimplemented in casadi::MinusInfSX.
Definition at line 79 of file sx_node.hpp.
Referenced by casadi::SXElem::is_minus_inf().
|
inlinevirtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_9w
Reimplemented in casadi::MinusOneSX.
Definition at line 76 of file sx_node.hpp.
Referenced by casadi::SXElem::binary(), and casadi::SXElem::is_minus_one().
|
inlinevirtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_9w
Reimplemented in casadi::NanSX.
Definition at line 77 of file sx_node.hpp.
Referenced by casadi::SXElem::is_nan().
|
inlinevirtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_9w
Reimplemented in casadi::OneSX.
Definition at line 75 of file sx_node.hpp.
Referenced by casadi::SXElem::binary(), and casadi::SXElem::is_one().
|
inlineoverridevirtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_9w
Reimplemented from casadi::SXNode.
Definition at line 85 of file binary_sx.hpp.
|
inlinevirtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_9w
Reimplemented in casadi::OutputSX.
Definition at line 81 of file sx_node.hpp.
Referenced by casadi::SXElem::is_output().
|
inlineoverridevirtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_a4
Reimplemented from casadi::SXNode.
Definition at line 83 of file binary_sx.hpp.
References op_.
|
inlinevirtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_9w
Reimplemented in casadi::SymbolicSX.
Definition at line 71 of file sx_node.hpp.
Referenced by casadi::SXFunction::init(), and casadi::SXElem::is_symbolic().
|
inlinevirtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_9w
Reimplemented in casadi::ZeroSX.
Definition at line 72 of file sx_node.hpp.
Referenced by casadi::SXElem::binary(), and casadi::SXElem::is_zero().
|
inherited |
Definition at line 109 of file sx_node.cpp.
References casadi::SXNode::temp.
|
inherited |
Definition at line 105 of file sx_node.cpp.
References casadi::SXNode::temp.
|
inlineoverridevirtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_11a
Reimplemented from casadi::SXNode.
Definition at line 105 of file binary_sx.hpp.
|
virtualinherited |
Reimplemented in casadi::SymbolicSX.
Definition at line 76 of file sx_node.cpp.
References casadi::SXNode::class_name().
Referenced by casadi::SXElem::name().
|
inlineoverridevirtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_11c
Implements casadi::SXNode.
Definition at line 116 of file binary_sx.hpp.
References op_.
Referenced by create(), deserialize(), and is_op().
|
inlineoverridevirtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_11d
Implements casadi::SXNode.
Definition at line 121 of file binary_sx.hpp.
References op_, and casadi::casadi_math< T >::print().
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_a7
Definition at line 130 of file sx_node.cpp.
References casadi::SXNode::dep(), casadi::SXNode::n_dep(), casadi::Function::n_in(), casadi::Function::name(), casadi::Function::nnz_in(), casadi::SXNode::op(), casadi::OP_CALL, casadi::SXNode::print(), casadi::SXNode::print_compact(), and casadi::SXNode::which_function().
Referenced by casadi::SXNode::disp(), and casadi::SXNode::print_compact().
|
staticinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_a9
Definition at line 184 of file sx_node.cpp.
References casadi::SXElem::assignNoDelete(), casadi::SXNode::count, casadi::SXNode::dep(), and casadi::SXNode::n_dep().
Referenced by ~BinarySX(), and casadi::UnarySX::~UnarySX().
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_aa
Definition at line 238 of file sx_node.cpp.
References casadi::SXNode::op(), casadi::SerializingStream::pack(), and casadi::SXNode::serialize_node().
|
inlineoverridevirtual |
Reimplemented from casadi::SXNode.
Definition at line 135 of file binary_sx.hpp.
References dep0_, dep1_, and casadi::SerializingStream::pack().
|
inherited |
Definition at line 261 of file sx_node.cpp.
References casadi::SXNode::SXElem.
Referenced by casadi::SXNode::get_output(), and casadi::CallSX::get_output().
|
inherited |
Definition at line 265 of file sx_node.cpp.
References casadi::SXNode::SXElem.
|
virtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_9x
Reimplemented in casadi::ConstantSX, casadi::NanSX, casadi::MinusInfSX, casadi::InfSX, casadi::MinusOneSX, casadi::OneSX, casadi::ZeroSX, casadi::IntegerSX, and casadi::RealtypeSX.
Definition at line 56 of file sx_node.cpp.
Referenced by casadi::SXElem::binary(), and casadi::SXFunction::init().
|
virtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_9x
Reimplemented in casadi::MinusOneSX, casadi::OneSX, casadi::ZeroSX, casadi::IntegerSX, and casadi::RealtypeSX.
Definition at line 60 of file sx_node.cpp.
References casadi::SXNode::class_name().
Referenced by casadi::SXElem::binary().
|
virtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_291
Reimplemented in casadi::CallSX.
Definition at line 64 of file sx_node.cpp.
References casadi::SXNode::class_name().
Referenced by casadi::SXNode::print_compact(), and casadi::SXElem::which_function().
|
virtualinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_292
Reimplemented in casadi::OutputSX.
Definition at line 68 of file sx_node.cpp.
References casadi::SXNode::class_name().
Referenced by casadi::SXElem::which_output().
|
inherited |
Definition at line 197 of file sx_node.hpp.
Referenced by casadi::SXElem::assignNoDelete(), casadi::SXElem::operator=(), casadi::SXNode::safe_delete(), casadi::SXElem::SXElem(), casadi::SXNode::SXNode(), casadi::UniversalNodeOwner::UniversalNodeOwner(), casadi::InfSX::~InfSX(), casadi::MinusInfSX::~MinusInfSX(), casadi::MinusOneSX::~MinusOneSX(), casadi::NanSX::~NanSX(), casadi::OneSX::~OneSX(), casadi::SXElem::~SXElem(), casadi::SXNode::~SXNode(), and casadi::ZeroSX::~ZeroSX().
SXElem casadi::BinarySX::dep0_ |
Extra doc: https://github.com/casadi/casadi/wiki/L_11f
Definition at line 133 of file binary_sx.hpp.
Referenced by dep(), is_equal(), serialize_node(), and ~BinarySX().
SXElem casadi::BinarySX::dep1_ |
Definition at line 133 of file binary_sx.hpp.
Referenced by dep(), is_equal(), serialize_node(), and ~BinarySX().
|
staticinherited |
Definition at line 209 of file sx_node.hpp.
Referenced by casadi::SXNode::deserialize().
|
staticinherited |
Definition at line 179 of file sx_node.hpp.
Referenced by casadi::SXElem::binary(), casadi::Matrix< Scalar >::get_max_depth(), casadi::SXElem::is_doubled(), and casadi::Matrix< Scalar >::set_max_depth().
unsigned char casadi::BinarySX::op_ |
Extra doc: https://github.com/casadi/casadi/wiki/L_11e
Definition at line 128 of file binary_sx.hpp.
Referenced by is_equal(), is_op(), is_smooth(), op(), and print().
|
mutableinherited |
Temporary variables to be used in user algorithms like sorting, the user is responsible of making sure that use is thread-safe The variable is initialized to zero
Definition at line 191 of file sx_node.hpp.
Referenced by casadi::SXFunction::init(), casadi::SXNode::mark(), casadi::SXNode::marked(), and casadi::SXNode::SXNode().