1 #ifndef MEDUSA_BITS_TYPES_MATRIXADDONS_HPP_
2 #define MEDUSA_BITS_TYPES_MATRIXADDONS_HPP_
22 _init1alt<RowsAtCompileTime != Dynamic && ColsAtCompileTime != Dynamic>(s);
27 template <
bool is_fixed>
28 void _init1alt(
const Scalar& s,
29 typename std::enable_if<is_fixed>::type* =
nullptr) {
33 template <
bool is_fixed>
34 void _init1alt(
const Scalar& s,
typename std::enable_if<!is_fixed>::type* =
nullptr) {
35 Base::_check_template_params();
36 Base::template _init1<Scalar>(s);
42 Matrix(std::initializer_list<Scalar> lst) {
43 EIGEN_STATIC_ASSERT_FIXED_SIZE(
Matrix);
44 assert((lst.size() == RowsAtCompileTime || lst.size() == ColsAtCompileTime) &&
45 "Initializer list of inappropriate size.");
47 for (
const Scalar& s : lst) {
48 this->operator()(i++) = s;
54 return {this->data(), this->size()};
56 Map<Matrix<Scalar, Dynamic, 1>>
asLinear()
const {
57 return {this->data(), this->size()};
61 return {this->data(), this->size()};
63 Map<Matrix<Scalar, Dynamic, 1>>
asRowLinear()
const {
64 return {this->data(), this->size()};
67 #endif // MEDUSA_BITS_TYPES_MATRIXADDONS_HPP_