Internal node class for SX. More...
#include <sx_node.hpp>
Extra doc: https://github.com/casadi/casadi/wiki/L_9t
Definition at line 49 of file sx_node.hpp.
Public Member Functions | |
SXNode () | |
constructor More... | |
virtual | ~SXNode () |
destructor More... | |
virtual const std::string & | name () const |
virtual std::string | class_name () const =0 |
Get type name. More... | |
virtual casadi_int | op () const =0 |
get the operation More... | |
virtual Function | which_function () const |
Get called function. More... | |
virtual casadi_int | which_output () const |
Get function output. More... | |
virtual bool | is_equal (const SXNode *node, casadi_int depth) const |
Check if two nodes are equivalent up to a given depth. More... | |
virtual casadi_int | n_dep () const |
Number of dependencies. More... | |
virtual SXElem | get_output (casadi_int oind) const |
Get an output. More... | |
virtual const SXElem & | dep (casadi_int i) const |
get the reference of a child More... | |
virtual SXElem & | dep (casadi_int i) |
get the reference of a child More... | |
virtual bool | is_smooth () const |
Check if smooth. 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... | |
virtual std::string | print (const std::string &arg1, const std::string &arg2) const =0 |
Print expression. 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 void | serialize_node (SerializingStream &s) const |
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_op (casadi_int op) 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 void | safe_delete (SXNode *n) |
Non-recursive delete. More... | |
static SXNode * | deserialize (DeserializingStream &s) |
Public Attributes | |
int | temp |
unsigned int | count |
Static Public Attributes | |
static casadi_int | eq_depth_ = 1 |
static std::map< casadi_int, SXNode *(*)(DeserializingStream &)> | deserialize_map |
Friends | |
class | SXElem |
class | Matrix< SXElem > |
class | UniversalNodeOwner |
casadi::SXNode::SXNode | ( | ) |
|
virtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_9v
Definition at line 45 of file sx_node.cpp.
References count.
void casadi::SXNode::can_inline | ( | std::map< const SXNode *, casadi_int > & | nodeind | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_a6
Definition at line 113 of file sx_node.cpp.
References can_inline(), dep(), n_dep(), op(), and casadi::OP_PARAMETER.
Referenced by can_inline(), and disp().
|
pure virtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_9y
Implemented in casadi::UnarySX, casadi::SymbolicSX, casadi::OutputSX, casadi::ConstantSX, casadi::CallSX, and casadi::BinarySX.
Referenced by dep(), name(), serialize_node(), to_int(), which_function(), and which_output().
|
virtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_a3
Reimplemented in casadi::UnarySX, casadi::OutputSX, casadi::CallSX, and casadi::BinarySX.
Definition at line 84 of file sx_node.cpp.
References class_name().
|
virtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_a2
Reimplemented in casadi::UnarySX, casadi::OutputSX, casadi::CallSX, and casadi::BinarySX.
Definition at line 80 of file sx_node.cpp.
References class_name().
Referenced by casadi::SXFunction::ad_forward(), casadi::SXFunction::ad_reverse(), casadi::SXElem::binary(), can_inline(), casadi::SXElem::dep(), casadi::LinsolCall< Tr >::eval_sx(), casadi::SXFunction::eval_sx(), casadi::SXFunction::init(), print_compact(), and safe_delete().
|
static |
Definition at line 243 of file sx_node.cpp.
References casadi::BinarySX::deserialize(), casadi::UnarySX::deserialize(), deserialize_map, op(), casadi::str(), and casadi::DeserializingStream::unpack().
Referenced by casadi::SXElem::deserialize().
|
virtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_a5
Definition at line 88 of file sx_node.cpp.
References can_inline(), and print_compact().
Referenced by casadi::SXElem::disp().
|
virtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_293
Reimplemented in casadi::CallSX.
Definition at line 227 of file sx_node.cpp.
References shared_from_this().
Referenced by casadi::SXElem::get_output().
|
inlinevirtual |
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().
|
inlinevirtual |
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().
|
inlinevirtual |
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().
|
inlinevirtual |
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().
|
virtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_a0
Reimplemented in casadi::UnarySX, casadi::ConstantSX, and casadi::BinarySX.
Definition at line 72 of file sx_node.cpp.
Referenced by casadi::SXElem::is_equal().
|
inlinevirtual |
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().
|
inlinevirtual |
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().
|
inlinevirtual |
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().
|
inlinevirtual |
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().
|
inlinevirtual |
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().
|
inlinevirtual |
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().
|
inlinevirtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_9w
Reimplemented in casadi::UnarySX, casadi::SymbolicSX, casadi::CallSX, and casadi::BinarySX.
Definition at line 73 of file sx_node.hpp.
Referenced by casadi::SXElem::is_op().
|
inlinevirtual |
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().
|
inlinevirtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_a4
Reimplemented in casadi::UnarySX, and casadi::BinarySX.
Definition at line 144 of file sx_node.hpp.
|
inlinevirtual |
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().
|
inlinevirtual |
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().
void casadi::SXNode::mark | ( | ) | const |
bool casadi::SXNode::marked | ( | ) | const |
|
inlinevirtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_a1
Reimplemented in casadi::UnarySX, casadi::OutputSX, casadi::CallSX, and casadi::BinarySX.
Definition at line 124 of file sx_node.hpp.
Referenced by can_inline(), casadi::SXElem::n_dep(), print_compact(), and safe_delete().
|
virtual |
Reimplemented in casadi::SymbolicSX.
Definition at line 76 of file sx_node.cpp.
References class_name().
Referenced by casadi::SXElem::name().
|
pure virtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_9z
Implemented in casadi::UnarySX, casadi::SymbolicSX, casadi::OutputSX, casadi::ConstantSX, casadi::CallSX, and casadi::BinarySX.
Referenced by can_inline(), deserialize(), casadi::SXFunction::init(), casadi::SXElem::op(), print_compact(), and serialize().
|
pure virtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_a8
Implemented in casadi::UnarySX, casadi::SymbolicSX, casadi::OutputSX, casadi::ConstantSX, casadi::CallSX, and casadi::BinarySX.
Referenced by print_compact().
std::string casadi::SXNode::print_compact | ( | std::map< const SXNode *, casadi_int > & | nodeind, |
std::vector< std::string > & | intermed | ||
) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_a7
Definition at line 130 of file sx_node.cpp.
References dep(), n_dep(), casadi::Function::n_in(), casadi::Function::name(), casadi::Function::nnz_in(), op(), casadi::OP_CALL, print(), print_compact(), and which_function().
Referenced by disp(), and print_compact().
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_a9
Definition at line 184 of file sx_node.cpp.
References casadi::SXElem::assignNoDelete(), count, dep(), and n_dep().
Referenced by casadi::BinarySX::~BinarySX(), and casadi::UnarySX::~UnarySX().
void casadi::SXNode::serialize | ( | SerializingStream & | s | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_aa
Definition at line 238 of file sx_node.cpp.
References op(), casadi::SerializingStream::pack(), and serialize_node().
|
virtual |
Reimplemented in casadi::UnarySX, casadi::SymbolicSX, casadi::OutputSX, casadi::NanSX, casadi::MinusInfSX, casadi::InfSX, casadi::MinusOneSX, casadi::OneSX, casadi::ZeroSX, casadi::IntegerSX, casadi::RealtypeSX, casadi::CallSX, and casadi::BinarySX.
Definition at line 234 of file sx_node.cpp.
References class_name().
Referenced by serialize().
SXElem casadi::SXNode::shared_from_this | ( | ) |
Definition at line 261 of file sx_node.cpp.
References SXElem.
Referenced by get_output(), and casadi::CallSX::get_output().
const SXElem casadi::SXNode::shared_from_this | ( | ) | const |
Definition at line 265 of file sx_node.cpp.
References SXElem.
|
virtual |
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().
|
virtual |
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 class_name().
Referenced by casadi::SXElem::binary().
|
virtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_291
Reimplemented in casadi::CallSX.
Definition at line 64 of file sx_node.cpp.
References class_name().
Referenced by print_compact(), and casadi::SXElem::which_function().
|
virtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_292
Reimplemented in casadi::OutputSX.
Definition at line 68 of file sx_node.cpp.
References class_name().
Referenced by casadi::SXElem::which_output().
Definition at line 50 of file sx_node.hpp.
|
friend |
Definition at line 50 of file sx_node.hpp.
Referenced by shared_from_this().
|
friend |
Definition at line 52 of file sx_node.hpp.
unsigned int casadi::SXNode::count |
Definition at line 197 of file sx_node.hpp.
Referenced by casadi::SXElem::assignNoDelete(), casadi::SXElem::operator=(), safe_delete(), casadi::SXElem::SXElem(), SXNode(), casadi::UniversalNodeOwner::UniversalNodeOwner(), casadi::InfSX::~InfSX(), casadi::MinusInfSX::~MinusInfSX(), casadi::MinusOneSX::~MinusOneSX(), casadi::NanSX::~NanSX(), casadi::OneSX::~OneSX(), casadi::SXElem::~SXElem(), ~SXNode(), and casadi::ZeroSX::~ZeroSX().
|
static |
Definition at line 209 of file sx_node.hpp.
Referenced by deserialize().
|
static |
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().
|
mutable |
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(), mark(), marked(), and SXNode().