as_column_vector_or_scalar of a kernel generator expression.
Converts input argument to a var_value<>
with column vector or a scalar.
Converts std::vector
to a column vector.
- Template Parameters
-
- Parameters
-
a | input argument (must be a row or a column vector) |
- Returns
- as_column_vector_or_scalar of given expression
- 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
- input converted to a column vector.
For column vector inputs this is an identity function.
- Template Parameters
-
- Parameters
-
- Returns
- Same vector.
Definition at line 325 of file as_column_vector_or_scalar.hpp.