26 #ifndef CASADI_UNARY_MX_HPP
27 #define CASADI_UNARY_MX_HPP
29 #include "mx_node.hpp"
55 std::string disp(
const std::vector<std::string>& arg)
const override;
58 int eval(
const double** arg,
double** res, casadi_int* iw,
double* w)
const override;
61 int eval_sx(
const SXElem** arg,
SXElem** res, casadi_int* iw,
SXElem* w)
const override;
66 void eval_mx(
const std::vector<MX>& arg, std::vector<MX>& res)
const override;
71 void eval_linear(
const std::vector<std::array<MX, 3> >& arg,
72 std::vector<std::array<MX, 3> >& res)
const override;
77 void ad_forward(
const std::vector<std::vector<MX> >& fseed,
78 std::vector<std::vector<MX> >& fsens)
const override;
83 void ad_reverse(
const std::vector<std::vector<MX> >& aseed,
84 std::vector<std::vector<MX> >& asens)
const override;
89 int sp_forward(
const bvec_t** arg,
bvec_t** res, casadi_int* iw,
bvec_t* w)
const override;
104 casadi_int
op()
const override {
return op_;}
110 const std::vector<casadi_int>& arg,
111 const std::vector<casadi_int>& res,
112 const std::vector<bool>& arg_is_ref,
113 std::vector<bool>& res_is_ref)
const override;
119 MX get_unary(casadi_int op)
const override;
122 MX _get_binary(casadi_int op,
const MX& y,
bool scX,
bool scY)
const override;
128 return sameOpAndDeps(node, depth);
Helper class for C code generation.
Helper class for Serialization.
Node class for MX objects.
The basic scalar symbolic class of CasADi.
Helper class for Serialization.
Represents a general unary operation on an MX.
static MXNode * deserialize(DeserializingStream &s)
Deserialize without type information.
casadi_int op() const override
Get the operation.
casadi_int n_inplace() const override
Can the operation be performed inplace (i.e. overwrite the result)
bool is_unary() const override
Check if unary operation.
~UnaryMX() override
Destructor.
bool is_equal(const MXNode *node, casadi_int depth) const override
Check if two nodes are equivalent up to a given depth.
unsigned long long bvec_t
Operation
Enum for quick access to any node.