22template <
unsigned int nrows,
unsigned int ncols>
55 this->casadi::MX::operator ()(0) = v0(0);
112 (*this)(0,0) = v00(0, 0);
113 (*this)(0,1) = v01(0, 0);
114 (*this)(0,2) = v02(0, 0);
115 (*this)(1,0) = v10(0, 0);
116 (*this)(1,1) = v11(0, 0);
117 (*this)(1,2) = v12(0, 0);
118 (*this)(2,0) = v20(0, 0);
119 (*this)(2,1) = v21(0, 0);
120 (*this)(2,2) = v22(0, 0);
129 (*this)(0,0) = v00(0, 0);
130 (*this)(0,1) = v01(0, 0);
131 (*this)(0,2) = v02(0, 0);
132 (*this)(0,3) = v03(0, 0);
133 (*this)(1,0) = v10(0, 0);
134 (*this)(1,1) = v11(0, 0);
135 (*this)(1,2) = v12(0, 0);
136 (*this)(1,3) = v13(0, 0);
137 (*this)(2,0) = v20(0, 0);
138 (*this)(2,1) = v21(0, 0);
139 (*this)(2,2) = v22(0, 0);
140 (*this)(2,3) = v23(0, 0);
141 (*this)(3,0) = v30(0, 0);
142 (*this)(3,1) = v31(0, 0);
143 (*this)(3,2) = v32(0, 0);
144 (*this)(3,3) = v33(0, 0);
155 (*this)(0,0) = v00(0, 0);
156 (*this)(0,1) = v01(0, 0);
157 (*this)(0,2) = v02(0, 0);
158 (*this)(0,3) = v03(0, 0);
159 (*this)(0,4) = v04(0, 0);
160 (*this)(0,5) = v05(0, 0);
162 (*this)(1,0) = v10(0, 0);
163 (*this)(1,1) = v11(0, 0);
164 (*this)(1,2) = v12(0, 0);
165 (*this)(1,3) = v13(0, 0);
166 (*this)(1,4) = v14(0, 0);
167 (*this)(1,5) = v15(0, 0);
169 (*this)(2,0) = v20(0, 0);
170 (*this)(2,1) = v21(0, 0);
171 (*this)(2,2) = v22(0, 0);
172 (*this)(2,3) = v23(0, 0);
173 (*this)(2,4) = v24(0, 0);
174 (*this)(2,5) = v25(0, 0);
176 (*this)(3,0) = v30(0, 0);
177 (*this)(3,1) = v31(0, 0);
178 (*this)(3,2) = v32(0, 0);
179 (*this)(3,3) = v33(0, 0);
180 (*this)(3,4) = v34(0, 0);
181 (*this)(3,5) = v35(0, 0);
183 (*this)(4,0) = v40(0, 0);
184 (*this)(4,1) = v41(0, 0);
185 (*this)(4,2) = v42(0, 0);
186 (*this)(4,3) = v43(0, 0);
187 (*this)(4,4) = v44(0, 0);
188 (*this)(4,5) = v45(0, 0);
190 (*this)(5,0) = v50(0, 0);
191 (*this)(5,1) = v51(0, 0);
192 (*this)(5,2) = v52(0, 0);
193 (*this)(5,3) = v53(0, 0);
194 (*this)(5,4) = v54(0, 0);
195 (*this)(5,5) = v55(0, 0);
254 return casadi::MX::eye(ncols);
257 *
this = casadi::MX::eye(ncols);
265 *
this = casadi::MX::zeros(this->
rows(), this->
cols());
273 *
this = casadi::MX::ones(this->
rows(), this->
cols());
279 return static_cast<unsigned int>(this->casadi::MX::rows());
283 return static_cast<unsigned int>(this->casadi::MX::columns());
290 template <
unsigned int row_count,
unsigned int col_count>
292 unsigned int row_start,
293 unsigned int col_start)
295 return this->casadi::MX::operator()(
296 casadi::Slice(
static_cast<casadi_int
>(row_start),
static_cast<casadi_int
>(row_start+row_count)),
297 casadi::Slice(
static_cast<casadi_int
>(col_start),
static_cast<casadi_int
>(col_start+col_count)));
299 template <
unsigned int row_count,
unsigned int col_count>
301 unsigned int row_start,
302 unsigned int col_start)
const
304 return this->casadi::MX::operator()(
305 casadi::Slice(
static_cast<casadi_int
>(row_start),
static_cast<casadi_int
>(row_start+row_count)),
306 casadi::Slice(
static_cast<casadi_int
>(col_start),
static_cast<casadi_int
>(col_start+col_count)));
309 unsigned int row_start,
310 unsigned int col_start,
311 unsigned int row_count,
312 unsigned int col_count)
314 return this->casadi::MX::operator()(
315 casadi::Slice(
static_cast<casadi_int
>(row_start),
static_cast<casadi_int
>(row_start+row_count)),
316 casadi::Slice(
static_cast<casadi_int
>(col_start),
static_cast<casadi_int
>(col_start+col_count)));
319 unsigned int row_start,
320 unsigned int col_start,
321 unsigned int row_count,
322 unsigned int col_count)
const
324 return this->casadi::MX::operator()(
325 casadi::Slice(
static_cast<casadi_int
>(row_start),
static_cast<casadi_int
>(row_start+row_count)),
326 casadi::Slice(
static_cast<casadi_int
>(col_start),
static_cast<casadi_int
>(col_start+col_count)));
333 return this->casadi::MX::operator()(
334 casadi::Slice(
static_cast<casadi_int
>(i),
static_cast<casadi_int
>(i+1)),
335 casadi::Slice(
static_cast<casadi_int
>(j),
static_cast<casadi_int
>(j+1)));
341 return this->casadi::MX::operator()(i, j);
346 return casadi::MX::dot(*
this, other_vector);
351 result[0] = (*this)[1] * other_vector[2] - (*this)[2] * other_vector[1];
352 result[1] = (*this)[2] * other_vector[0] - (*this)[0] * other_vector[2];
353 result[2] = (*this)[0] * other_vector[1] - (*this)[1] * other_vector[0];
362 if (ncols == 3 && nrows == 3){
364 MX_Xd_scalar det = (*this)(0, 0) * ((*
this)(1, 1) * (*
this)(2, 2) - (*
this)(2, 1) * (*
this)(1, 2)) -
365 (*this)(0, 1) * ((*
this)(1, 0) * (*
this)(2, 2) - (*
this)(1, 2) * (*
this)(2, 0)) +
366 (*this)(0, 2) * ((*
this)(1, 0) * (*
this)(2, 1) - (*
this)(1, 1) * (*
this)(2, 0));
371 minv(0, 0) = ((*this)(1, 1) * (*
this)(2, 2) - (*
this)(2, 1) * (*
this)(1, 2)) * invdet;
372 minv(0, 1) = ((*this)(0, 2) * (*
this)(2, 1) - (*
this)(0, 1) * (*
this)(2, 2)) * invdet;
373 minv(0, 2) = ((*this)(0, 1) * (*
this)(1, 2) - (*
this)(0, 2) * (*
this)(1, 1)) * invdet;
374 minv(1, 0) = ((*this)(1, 2) * (*
this)(2, 0) - (*
this)(1, 0) * (*
this)(2, 2)) * invdet;
375 minv(1, 1) = ((*this)(0, 0) * (*
this)(2, 2) - (*
this)(0, 2) * (*
this)(2, 0)) * invdet;
376 minv(1, 2) = ((*this)(1, 0) * (*
this)(0, 2) - (*
this)(0, 0) * (*
this)(1, 2)) * invdet;
377 minv(2, 0) = ((*this)(1, 0) * (*
this)(2, 1) - (*
this)(2, 0) * (*
this)(1, 1)) * invdet;
378 minv(2, 1) = ((*this)(2, 0) * (*
this)(0, 1) - (*
this)(0, 0) * (*
this)(2, 1)) * invdet;
379 minv(2, 2) = ((*this)(0, 0) * (*
this)(1, 1) - (*
this)(1, 0) * (*
this)(0, 1)) * invdet;
387 return casadi::MX::norm_2(*
this);
401 this->casadi::MX::operator+=(other);
406 return out.casadi::MX::operator+=(other);
410 this->casadi::MX::operator-=(other);
415 return out.casadi::MX::operator-=(other);
417 template <
unsigned int ncols2>
420 *
this = casadi::MX::mtimes(*
this, m2);
422 template <
unsigned int ncols2>
424 return casadi::MX::mtimes(*
this, other);
428 return casadi::MX::mtimes(*
this, other);
432 *
this = casadi::MX::mtimes(*
this, other);
436 this->casadi::MX::operator/=(scalar(0, 0));
440 for (
unsigned int i = 0; i < nrows * ncols; i++)
447 for (
unsigned int i = 0; i < nrows * ncols; i++)
unsigned int rows() const
unsigned int cols() const
static MX_Xd_static Identity()
MX_Xd_static< row_count, col_count > block(unsigned int row_start, unsigned int col_start) const
MX_Xd_static(const MX_Xd_scalar &v0, const MX_Xd_scalar &v1, const MX_Xd_scalar &v2, const MX_Xd_scalar &v3, const MX_Xd_scalar &v4, const MX_Xd_scalar &v5, const MX_Xd_scalar &v6, const MX_Xd_scalar &v7)
MX_Xd_static< ncols, nrows > transpose() const
MX_Xd_static(const casadi::MX &m)
void operator+=(const MX_Xd_static< nrows, ncols > &other)
MX_Xd_static< nrows, ncols > operator/(const MX_Xd_SubMatrix &scalar) const
MX_Xd_static(const MX_Xd_scalar &v0, const MX_Xd_scalar &v1, const MX_Xd_scalar &v2, const MX_Xd_scalar &v3, const MX_Xd_scalar &v4, const MX_Xd_scalar &v5)
MX_Xd_static< nrows, ncols2 > operator*(const MX_Xd_static< ncols, ncols2 > &other) const
MX_Xd_static(const MX_Xd_scalar &v0, const MX_Xd_scalar &v1, const MX_Xd_scalar &v2, const MX_Xd_scalar &v3)
MX_Xd_static & setIdentity()
MX_Xd_dynamic block(unsigned int row_start, unsigned int col_start, unsigned int row_count, unsigned int col_count) const
MX_Xd_static< ncols, nrows > inverse() const
void operator*=(const MX_Xd_scalar &other)
MX_Xd_scalar operator[](unsigned int i) const
void operator-=(const MX_Xd_static< nrows, ncols > &other)
MX_Xd_static< nrows, ncols > operator+(const MX_Xd_static< nrows, ncols > &other) const
unsigned int size() const
static MX_Xd_static One()
MX_Xd_SubMatrix operator()(unsigned int i, unsigned int j=0)
MX_Xd_static< nrows, ncols > operator/(const MX_Xd_scalar &scalar) const
MX_Xd_static(const MX_Xd_scalar &v00, const MX_Xd_scalar &v01, const MX_Xd_scalar &v02, const MX_Xd_scalar &v03, const MX_Xd_scalar &v10, const MX_Xd_scalar &v11, const MX_Xd_scalar &v12, const MX_Xd_scalar &v13, const MX_Xd_scalar &v20, const MX_Xd_scalar &v21, const MX_Xd_scalar &v22, const MX_Xd_scalar &v23, const MX_Xd_scalar &v30, const MX_Xd_scalar &v31, const MX_Xd_scalar &v32, const MX_Xd_scalar &v33)
void set(const MX_Xd_scalar &v0, const MX_Xd_scalar &v1, const MX_Xd_scalar &v2, const MX_Xd_scalar &v3)
set For Quaternion
MX_Xd_scalar dot(const MX_Xd_static< ncols, 1 > &other_vector) const
MX_Xd_static(const MX_Xd_scalar &v0, const MX_Xd_scalar &v1)
static MX_Xd_static Zero()
void operator/=(const MX_Xd_scalar &scalar)
MX_Xd_SubMatrix block(unsigned int row_start, unsigned int col_start, unsigned int row_count, unsigned int col_count)
void set(const MX_Xd_scalar &v0, const MX_Xd_scalar &v1, const MX_Xd_scalar &v2, const MX_Xd_scalar &v3, const MX_Xd_scalar &v4, const MX_Xd_scalar &v5)
set For SpatialVector
MX_Xd_static(const MX_Xd_scalar &v0, const MX_Xd_scalar &v1, const MX_Xd_scalar &v2)
MX_Xd_SubMatrix operator[](unsigned int i)
MX_Xd_scalar squaredNorm() const
MX_Xd_static(const MX_Xd_scalar &v00, const MX_Xd_scalar &v01, const MX_Xd_scalar &v02, const MX_Xd_scalar &v10, const MX_Xd_scalar &v11, const MX_Xd_scalar &v12, const MX_Xd_scalar &v20, const MX_Xd_scalar &v21, const MX_Xd_scalar &v22)
void set(const MX_Xd_scalar &v0, const MX_Xd_scalar &v1, const MX_Xd_scalar &v2)
set For 3d Vector
MX_Xd_scalar norm() const
MX_Xd_scalar operator()(unsigned int i, unsigned int j=0) const
MX_Xd_static< 3, 1 > cross(const MX_Xd_static< 3, 1 > &other_vector) const
MX_Xd_static< nrows, ncols > operator-(const MX_Xd_static< nrows, ncols > &other) const
MX_Xd_static(const MX_Xd_scalar &v00, const MX_Xd_scalar &v01, const MX_Xd_scalar &v02, const MX_Xd_scalar &v03, const MX_Xd_scalar &v04, const MX_Xd_scalar &v05, const MX_Xd_scalar &v10, const MX_Xd_scalar &v11, const MX_Xd_scalar &v12, const MX_Xd_scalar &v13, const MX_Xd_scalar &v14, const MX_Xd_scalar &v15, const MX_Xd_scalar &v20, const MX_Xd_scalar &v21, const MX_Xd_scalar &v22, const MX_Xd_scalar &v23, const MX_Xd_scalar &v24, const MX_Xd_scalar &v25, const MX_Xd_scalar &v30, const MX_Xd_scalar &v31, const MX_Xd_scalar &v32, const MX_Xd_scalar &v33, const MX_Xd_scalar &v34, const MX_Xd_scalar &v35, const MX_Xd_scalar &v40, const MX_Xd_scalar &v41, const MX_Xd_scalar &v42, const MX_Xd_scalar &v43, const MX_Xd_scalar &v44, const MX_Xd_scalar &v45, const MX_Xd_scalar &v50, const MX_Xd_scalar &v51, const MX_Xd_scalar &v52, const MX_Xd_scalar &v53, const MX_Xd_scalar &v54, const MX_Xd_scalar &v55)
void operator*=(const MX_Xd_static< ncols, ncols2 > &m2)
MX_Xd_SubMatrix block(unsigned int row_start, unsigned int col_start)
MX_Xd_static< nrows, ncols > operator*(const MX_Xd_scalar &other) const
MX_Xd_static(const double val)