26 #ifndef CASADI_BINARY_SX_HPP
27 #define CASADI_BINARY_SX_HPP
29 #include "sx_node.hpp"
30 #include "serializing_stream.hpp"
58 double dep0_val(dep0);
59 double dep1_val(dep1);
81 std::string
class_name()
const override {
return "BinarySX";}
83 bool is_smooth()
const override {
return operation_checker<SmoothChecker>(
op_);}
92 if (n==
nullptr)
return false;
93 if (n->
op_ !=
op_)
return false;
96 if (operation_checker<CommChecker>(
op_)
105 casadi_int
n_dep()
const override {
return 2;}
116 casadi_int
op()
const override {
return op_;}
121 std::string
print(
const std::string& arg1,
const std::string& arg2)
const override {
145 s.
unpack(
"UnarySX::dep0", dep0);
146 s.
unpack(
"UnarySX::dep1", dep1);
Represents a basic binary operation on two SXElem nodes.
void serialize_node(SerializingStream &s) const override
bool is_smooth() const override
Check if smooth.
bool is_op(casadi_int op) const override
check properties of a node
static SXNode * deserialize(DeserializingStream &s, casadi_int op)
Deserialize without type information.
bool is_equal(const SXNode *node, casadi_int depth) const override
Check if two nodes are equivalent up to a given depth.
SXElem dep0_
The dependencies of the node.
casadi_int n_dep() const override
Number of dependencies.
unsigned char op_
The binary operation as an 1 byte integer (allows 256 values)
SXElem & dep(casadi_int i) override
get the reference of a child
std::string class_name() const override
Get type name.
const SXElem & dep(casadi_int i) const override
get the reference of a dependency
~BinarySX() override
Destructor.
std::string print(const std::string &arg1, const std::string &arg2) const override
Print expression.
static SXElem create(unsigned char op, const SXElem &dep0, const SXElem &dep1)
Create a binary expression.
casadi_int op() const override
Get the operation.
Helper class for Serialization.
void unpack(Sparsity &e)
Reconstruct an object from the input stream.
The basic scalar symbolic class of CasADi.
static SXElem create(SXNode *node)
SXNode * assignNoDelete(const SXElem &scalar)
Assign the node to something, without invoking the deletion of the node,.
static bool is_equal(const SXElem &x, const SXElem &y, casadi_int depth=0)
Check equality up to a given depth.
Internal node class for SX.
static void safe_delete(SXNode *n)
Non-recursive delete.
Helper class for Serialization.
void pack(const Sparsity &e)
Serializes an object to the output stream.
static std::string print(unsigned char op, const std::string &x, const std::string &y)
Print.
static void fun(unsigned char op, const T &x, const T &y, T &f)
Evaluate a built in function (scalar-scalar)