codac 2.0.0
Loading...
Searching...
No Matches
codac2_Matrix_addons_Vector.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires (!IsIntervalDomain<Scalar>) && (IsVectorOrRow<R,C>)
 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>
requires (!IsIntervalDomain<Scalar>) && (IsVectorOrRow<R,C>)
 Matrix (int n, double values[])
 Constructs a vector or row matrix of size n from an array of double values.
 

Detailed Description

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
License: GNU Lesser General Public License (LGPL)

Function Documentation

◆ Matrix() [1/2]

template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires (!IsIntervalDomain<Scalar>) && (IsVectorOrRow<R,C>)
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
lInitializer 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.

30 : Matrix<double,R,C>(R == 1 ? 1 : l.size(), C == 1 ? 1 : l.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>
requires (!IsIntervalDomain<Scalar>) && (IsVectorOrRow<R,C>)
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
nNumber of elements (must be greater than 0).
valuesPointer to an array of double values to initialize the matrix.
49 : Matrix<double,R,C>(R == 1 ? 1 : n, C == 1 ? 1 : n, values)
50{
51 assert_release(n > 0);
52}