26 #ifndef CASADI_IO_INSTRUCTION_HPP
27 #define CASADI_IO_INSTRUCTION_HPP
29 #include "mx_node.hpp"
51 : ind_(ind), segment_(segment), offset_(offset) {}
58 casadi_int
ind()
const override {
return ind_;}
61 casadi_int
segment()
const override {
return segment_;}
64 casadi_int
offset()
const override {
return offset_;}
87 Input(
const Sparsity& sp, casadi_int ind, casadi_int segment, casadi_int offset);
95 casadi_int
op()
const override {
return OP_INPUT;}
100 std::string
disp(
const std::vector<std::string>& arg)
const override;
106 const std::vector<casadi_int>& arg,
107 const std::vector<casadi_int>& res)
const override;
127 Output(
const MX& x, casadi_int ind, casadi_int segment, casadi_int offset);
135 casadi_int
nout()
const override {
return 0;}
140 casadi_int
op()
const override {
return OP_OUTPUT;}
145 std::string
disp(
const std::vector<std::string>& arg)
const override;
151 const std::vector<casadi_int>& arg,
152 const std::vector<casadi_int>& res)
const override;
Helper class for C code generation.
Helper class for Serialization.
An input or output instruction.
IOInstruction(DeserializingStream &s)
Deserializing constructor.
IOInstruction(casadi_int ind, casadi_int segment, casadi_int offset)
void serialize_body(SerializingStream &s) const override
Serialize an object without type information.
Dict info() const override
casadi_int segment() const override
casadi_int ind() const override
~IOInstruction() override
Destructor.
casadi_int offset() const override
Node class for MX objects.
Output(DeserializingStream &s)
Deserializing constructor.
static MXNode * deserialize(DeserializingStream &s)
Deserialize without type information.
casadi_int nout() const override
Number of outputs.
Output(const MX &x, casadi_int ind, casadi_int segment, casadi_int offset)
std::string disp(const std::vector< std::string > &arg) const override
Print expression.
casadi_int op() const override
Get the operation.
void generate(CodeGenerator &g, const std::vector< casadi_int > &arg, const std::vector< casadi_int > &res) const override
Generate code for the operation.
~Output() override
Destructor.
Helper class for Serialization.
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.