Go to the source code of this file.
|
| template<int R = RowsAtCompileTime, int C = ColsAtCompileTime> |
| | Matrix (std::initializer_list< double > l) |
| | Constructs a vector or row matrix from a list of double values.
|
| template<int R = RowsAtCompileTime, int C = ColsAtCompileTime> |
| | Matrix (int n, double values[]) |
| | Constructs a vector or row matrix of size n from an array of double 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 2023 Codac Team
- License: GNU Lesser General Public License (LGPL)
◆ Matrix() [1/2]
template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
| Matrix |
( |
std::initializer_list< double > | l | ) |
|
Constructs a vector or row matrix from a list of double values.
- Precondition
- The matrix is a vector or row vector (
IsVectorOrRow<R,C>).
- Parameters
-
| l | Initializer list of double values to populate the matrix. |
If the compile-time size is fixed to 1 (vector or row), the size is 1; otherwise, the size matches the initializer list size.
31{
32 assert_release(!std::empty(l));
33 Index i = 0;
34 for(const auto& li : l)
35 (*this)[i++] = li;
36}
Matrix()=delete
Deleted default constructor to prevent default instantiation when either the number of rows or column...
◆ Matrix() [2/2]
template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
| Matrix |
( |
int | n, |
|
|
double | values[] ) |
|
explicit |
Constructs a vector or row matrix of size n from an array of double values.
- Precondition
- The matrix is a vector or row vector (
IsVectorOrRow<R,C>).
- Parameters
-
| n | Number of elements (must be greater than 0). |
| values | Pointer to an array of double values to initialize the matrix. |
50{
51 assert_release(n > 0);
52}