|
template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires IsVectorOrRow<R,C> |
| Matrix (int n) |
| Constructs a vector or row matrix with size n .
|
|
template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires IsVectorOrRow<R,C> |
| Matrix (const std::vector< double > &v) |
| Constructs a vector or row matrix from a vector of doubles.
|
|
template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires IsVectorOrRow<R,C> |
Scalar & | operator() (Index i) |
| Access element at index i (mutable).
|
|
template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires IsVectorOrRow<R,C> |
const Scalar & | operator() (Index i) const |
| Access element at index i (const).
|
|
template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires IsVectorOrRow<R,C> |
Scalar & | operator[] (Index i) |
| Access element at index i (mutable) via operator[].
|
|
template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires IsVectorOrRow<R,C> |
const Scalar & | operator[] (Index i) const |
| Access element at index i (const) via operator[].
|
|
template<typename OtherDerived, int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires IsVectorOrRow<R,C> && IsVectorOrRow<MatrixBase<OtherDerived>::RowsAtCompileTime,MatrixBase<OtherDerived>::ColsAtCompileTime> |
void | put (Index start_id, const MatrixBase< OtherDerived > &x) |
| Inserts values from matrix x starting at index start_id .
|
|
template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires IsVectorOrRow<R,C> |
void | resize_save_values (Index n) |
| Resizes the vector or row matrix to size n , preserving existing values.
|
|
This file is included in the declaration of Eigen::MatrixBase, thanks to the preprocessor token EIGEN_MATRIX_PLUGIN. See: https://eigen.tuxfamily.org/dox/TopicCustomizing_Plugins.html and the file codac2_matrices.h
- Date
- 2024
- Author
- Simon Rohou
- Copyright
- Copyright 2024 Codac Team
- License: GNU Lesser General Public License (LGPL)
template<typename OtherDerived, int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires IsVectorOrRow<R,C> && IsVectorOrRow<MatrixBase<OtherDerived>::RowsAtCompileTime,MatrixBase<OtherDerived>::ColsAtCompileTime>
void put |
( |
Index | start_id, |
|
|
const MatrixBase< OtherDerived > & | x ) |
|
inline |
Inserts values from matrix x
starting at index start_id
.
- Precondition
- The matrix and
x
are both vectors or row vectors.
- Parameters
-
start_id | Start index for insertion. |
x | The matrix whose values will be inserted. |
191{
192 assert_release(start_id >= 0 && start_id < this->size());
193 assert_release(start_id+x.size() <= this->size());
194
195 this->segment(start_id,x.size()) << x;
196}
template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires IsVectorOrRow<R,C>
void resize_save_values |
( |
Index | n | ) |
|
|
inline |
Resizes the vector or row matrix to size n
, preserving existing values.
- Precondition
- The matrix is a vector or row vector.
- Parameters
-
Eigen's resize()
discards existing data, so this function copies existing values before resizing and restores them afterward.
212{
213
214 auto copy = *this;
215 this->resize(n);
216 for(Index i = 0 ; i < std::min((Index)copy.size(),n) ; i++)
217 (*this)[i] = copy[i];
218}