26 #ifndef CASADI_OUTPUT_SX_HPP
27 #define CASADI_OUTPUT_SX_HPP
29 #include "sx_node.hpp"
30 #include "generic_shared_internal.hpp"
31 #include "generic_shared.hpp"
87 std::string
class_name()
const override {
return "OutputSX";}
92 std::string
print(
const std::string& arg1,
const std::string& arg2)
const override {
93 return arg1 +
"{" +
str(oind_) +
"}";
106 casadi_int
op()
const override {
return -1;}
111 casadi_int
n_dep()
const override {
return 1;}
116 const SXElem&
dep(casadi_int i)
const override {
return dep_; }
140 std::vector<SXElem> ret(n);
141 for (casadi_int i=0;i<n;++i) {
148 s.
pack(
"OutputSX::dep", dep_);
149 s.
pack(
"OutputSX::oind", oind_);
155 s.
unpack(
"OutputSX::dep", dep);
156 s.
unpack(
"OutputSX::oind", oind);
Helper class for Serialization.
void unpack(Sparsity &e)
Reconstruct an object from the input stream.
static std::vector< SXElem > split(const SXElem &e, casadi_int n)
casadi_int op() const override
Get the operation.
std::string class_name() const override
Get type name.
SXElem & dep(casadi_int i) override
get the reference of a child
const SXElem & dep(casadi_int i) const override
get the reference of a dependency
casadi_int which_output() const override
Get the index of evaluation output.
static SXNode * deserialize(DeserializingStream &s)
SXElem dep_
The dependencies of the node.
OutputSX(const SXElem &dep, int oind)
Constructor.
bool is_output() const override
Is the node an output node?
std::string print(const std::string &arg1, const std::string &arg2) const override
Print expression.
void serialize_node(SerializingStream &s) const override
OutputSX()
Empty constructor.
~OutputSX() override
Destructor.
casadi_int n_dep() const override
Number of dependencies.
The basic scalar symbolic class of CasADi.
SXElem get_output(casadi_int oind) const
Get an output.
Internal node class for SX.
Helper class for Serialization.
void pack(const Sparsity &e)
Serializes an object to the output stream.
GenericShared implements a reference counting framework similar for efficient and.
static bool test_cast(const OutputSX *ptr)
WeakRefSXElem(int dummy=0)
std::string str(const T &v)
String representation, any type.
GenericWeakRefInternal< SharedSXElem, OutputSX > WeakRefInternalSXElem