29 #include "sx_node.hpp"
30 #include "serializing_stream.hpp"
76 std::string
class_name()
const override {
return "UnarySX";}
78 bool is_smooth()
const override {
return operation_checker<SmoothChecker>(
op_);}
93 casadi_int
n_dep()
const override {
return 1;}
104 casadi_int
op()
const override {
return op_;}
109 std::string
print(
const std::string& arg1,
const std::string& arg2)
const override {
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.
Represents a basic unary operation on an SXElem node.
casadi_int op() const override
Get the operation.
casadi_int n_dep() const override
Number of dependencies.
SXElem dep_
The dependencies of the node.
void serialize_node(SerializingStream &s) const override
bool is_smooth() const override
Check if smooth.
SXElem & dep(casadi_int i) override
get the reference of a child
static SXElem create(unsigned char op, const SXElem &dep)
Create a unary expression.
std::string print(const std::string &arg1, const std::string &arg2) const override
Print expression.
bool is_op(casadi_int op) const override
check properties of a node
unsigned char op_
The binary operation as an 1 byte integer (allows 256 values)
~UnarySX() override
Destructor.
static SXNode * deserialize(DeserializingStream &s, casadi_int op)
bool is_equal(const SXNode *node, casadi_int depth) const override
Check if two nodes are equivalent up to a given depth.
std::string class_name() const override
Get type name.
const SXElem & dep(casadi_int i) const override
get the reference of a dependency
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)