Converts a matrix type to an array.
Converts an std::vector<std::vector> to an Eigen Array.
Converts a std::vector type to an array.
- Template Parameters
-
T | Type of Eigen Matrix or expression |
- Parameters
-
v | Specified Eigen Matrix or expression. |
- Returns
- Matrix converted to an array.
- Note
- The math library's reverse mode assumes that
Eigen::Map
types are allocated and owned elsewhere so we cannot just return back a map here else the reverse mode library may try to access into a dangling pointer. Instead we wrap the Eigen::Map
in a Holder
to trick the reverse mode library into not thinking this is a map. The .array().matrix()
inside the holder is so that the holder thinks it is returning an expression.
- Template Parameters
-
- Parameters
-
- Returns
- Matrix converted to an array.
- Template Parameters
-
T | A standard vector with inner container of a standard vector with an inner stan scalar. |
- Parameters
-
v | specified vector of vectorized |
- Returns
- An Eigen Array with dynamic rows and columns.
Definition at line 56 of file as_array_or_scalar.hpp.