Function navtk::eye(Size, Size, int)
Defined in File factory.hpp
Function Documentation
-
Matrix navtk::eye(Size rows, Size cols, int diagonal_index = 0)
Returns the NxM Matrix with given row and column size.
The placement of diagonal ones is specified with
diagonal_index. By default, the diagonal ones are placed starting atdiagonal_index=0, or matrix index (0,0).diagonal_indexcan range from-(rows-1)to(cols-1).- Parameters
rows – Number of rows for desired matrix.
cols – Number of columns for desired matrix.
diagonal_index – Placement index of the diagonal.
- Throws
Throws – an
invalid_argumentexception whendiagonal_indexis less than-(cols-1)or greater than(rows-1)and the error mode is ErrorMode::DIE for either case.- Returns
NxM Matrix where N is the number of rows and M is the number of columns.