26 #ifndef CASADI_PROJECT_HPP
27 #define CASADI_PROJECT_HPP
29 #include "mx_node.hpp"
55 std::string disp(
const std::vector<std::string>& arg)
const override;
59 int eval_gen(
const T** arg, T** res, casadi_int* iw, T* w)
const;
62 int eval(
const double** arg,
double** res, casadi_int* iw,
double* w)
const override;
65 int eval_sx(
const SXElem** arg,
SXElem** res, casadi_int* iw,
SXElem* w)
const override;
70 void eval_mx(
const std::vector<MX>& arg, std::vector<MX>& res,
71 const std::vector<bool>& unique={})
const override;
74 MX get_project(
const Sparsity& sp,
bool unique=
false)
const override;
83 MX get_nzref(
const Sparsity& sp,
const std::vector<casadi_int>& nz,
84 bool unique=
false)
const override;
90 std::vector<std::array<MX, 3> >& res)
const override {
91 eval_linear_rearrange(arg, res);
98 return sp_forward(arg, res, iw, w);
104 void ad_forward(
const std::vector<std::vector<MX> >& fseed,
105 std::vector<std::vector<MX> >& fsens)
const override;
110 void ad_reverse(
const std::vector<std::vector<MX> >& aseed,
111 std::vector<std::vector<MX> >& asens)
const override;
117 const std::vector<casadi_int>& arg,
118 const std::vector<casadi_int>& res,
119 const std::vector<bool>& arg_is_ref,
120 std::vector<bool>& res_is_ref)
const override;
125 int sp_forward(
const bvec_t** arg,
bvec_t** res, casadi_int* iw,
bvec_t* w)
const override;
140 size_t sz_w()
const override {
return size1();}
178 int eval_gen(
const T** arg, T** res, casadi_int* iw, T* w)
const;
181 int eval(
const double** arg,
double** res, casadi_int* iw,
double* w)
const override;
184 int eval_sx(
const SXElem** arg,
SXElem** res, casadi_int* iw,
SXElem* w)
const override;
190 const std::vector<casadi_int>& arg,
191 const std::vector<casadi_int>& res,
192 const std::vector<bool>& arg_is_ref,
193 std::vector<bool>& res_is_ref)
const override;
198 size_t sz_w()
const override {
return 0;}
228 int eval_gen(
const T** arg, T** res, casadi_int* iw, T* w)
const;
231 int eval(
const double** arg,
double** res, casadi_int* iw,
double* w)
const override;
234 int eval_sx(
const SXElem** arg,
SXElem** res, casadi_int* iw,
SXElem* w)
const override;
240 const std::vector<casadi_int>& arg,
241 const std::vector<casadi_int>& res,
242 const std::vector<bool>& arg_is_ref,
243 std::vector<bool>& res_is_ref)
const override;
248 size_t sz_w()
const override {
return 0;}
Helper class for C code generation.
Densify(DeserializingStream &s)
Deserializing constructor.
Densify(const MX &x, const Sparsity &sp)
Constructor.
size_t sz_w() const override
Get required length of iw field.
~Densify() override
Destructor.
Helper class for Serialization.
Node class for MX objects.
Change the sparsity of an expression.
casadi_int op() const override
Get the operation.
Project(DeserializingStream &s)
Deserializing constructor.
void eval_linear(const std::vector< std::array< MX, 3 > > &arg, std::vector< std::array< MX, 3 > > &res) const override
Evaluate the MX node on a const/linear/nonlinear partition.
int eval_activity(const bvec_t **arg, bvec_t **res, casadi_int *iw, bvec_t *w) const override
Propagate signal activity forward (bit set = active)
size_t sz_w() const override
Get required length of w field.
~Project() override
Destructor.
The basic scalar symbolic class of CasADi.
Helper class for Serialization.
Sparsify(const MX &x, const Sparsity &sp)
Constructor.
size_t sz_w() const override
Get required length of iw field.
Sparsify(DeserializingStream &s)
Deserializing constructor.
~Sparsify() override
Destructor.
unsigned long long bvec_t