WPILibC++ 2023.4.3-108-ge5452e3
|
Eigen defines several typedef shortcuts for most common 1D and 2D array types.
Eigen defines several typedef shortcuts for most common 1D and 2D array types.
The general patterns are the following:
ArrayRowsColsType
where Rows
and Cols
can be 2
,3
,4
for fixed size square matrices or X
for dynamic size, and where Type
can be i
for integer, f
for float, d
for double, cf
for complex float, cd
for complex double.
For example, Array33d
is a fixed-size 3x3 array type of doubles, and ArrayXXf
is a dynamic-size matrix of floats.
There are also ArraySizeType
which are self-explanatory. For example, Array4cf
is a fixed-size 1D array of 4 complex floats.
With \cpp11, template alias are also defined for common sizes. They follow the same pattern as above except that the scalar type suffix is replaced by a template parameter, i.e.:
ArrayRowsCols<Type>
where Rows
and Cols
can be 2
,3
,4
, or X
for fixed or dynamic size.ArraySize<Type>
where Size
can be 2
,3
,4
or X
for fixed or dynamic size 1D arrays.