codac 2.0.0
Loading...
Searching...
No Matches
codac2_MatrixBase_addons_VectorBase.h
Go to the documentation of this file.
1
15
25template<int R=RowsAtCompileTime,int C=ColsAtCompileTime>
26 requires IsVectorOrRow<R,C>
27inline auto diag_matrix() const
28{
29 return this->asDiagonal().toDenseMatrix();
30}
31
43template<int R=RowsAtCompileTime,int C=ColsAtCompileTime>
44 requires IsVectorOrRow<R,C>
45inline auto subvector(Index start_id, Index end_id) const
46{
47 assert_release(end_id >= 0 && start_id >= 0);
48 assert_release(end_id < this->size() && start_id <= end_id);
49 return this->segment(start_id,end_id-start_id+1);
50}
auto subvector(Index start_id, Index end_id) const
Extracts a subvector from the current vector.
Definition codac2_MatrixBase_addons_VectorBase.h:45
auto diag_matrix() const
Converts a vector into a diagonal matrix.
Definition codac2_MatrixBase_addons_VectorBase.h:27