Belle II Software development
|
A matrix implementation to be used as an interface typ through out the track finder. More...
#include <PlainMatrix.h>
Public Member Functions | |
PlainMatrix ()=default | |
Default initializing of the matrix. | |
PlainMatrix (std::initializer_list< T > values) | |
Construct from initialiser list - also for value initialisation. | |
PlainMatrix (std::array< T, S > values) | |
Construct from the given values. | |
T * | data () |
Access to the flat value array. | |
const T * | data () const |
Constant access to the flat value array. | |
T & | operator[] (int s) |
Flat element access at the given row i and column j. | |
T | operator[] (int s) const |
Constant flat element access at the given row i and column j. | |
T & | operator() (int i, int j=0) |
Element access at the given row i and column j. | |
T | operator() (int i, int j=0) const |
Constant element access at the given row i and column j. | |
PlainMatrix< T, M, N > | operator+ (const PlainMatrix< T, M, N > &rhs) const |
Elementwise addition of two matrices. | |
PlainMatrix< T, M, N > | operator- (const PlainMatrix< T, M, N > &rhs) const |
Elementwise subtraction of two matrices. | |
template<int O> | |
PlainMatrix< T, M, O > | operator* (const PlainMatrix< T, N, O > &rhs) const |
Naive matrix multiplication. | |
PlainMatrix< T, M, N > | operator/ (T rhs) const |
Elementwise division of the elements of the matrix by a number. | |
template<int K, int L> | |
PlainMatrix< T, K, L > | block (int i=0, int j=0) const |
Get the K x L block from the matrix starting at the element at position (i, j) | |
template<int K> | |
PlainMatrix< T, K, N > | head () const |
Get the K top rows of the matrix. | |
template<int K> | |
PlainMatrix< T, K, N > | tail () const |
Get the K bottom rows of the matrix. | |
Static Public Member Functions | |
static PlainMatrix< T, M, N > | Zero () |
Construct a matrix initialized with zeros. | |
static PlainMatrix< T, M, N > | Identity () |
Construct an identity matrix. | |
static PlainMatrix< T, M, N > | Constant (T t) |
Construct a matrix with all elements set to a constant. | |
static constexpr size_t | size () |
Total number of values in the matrix. | |
static constexpr int | rows () |
Total number of rows in the matrix. | |
static constexpr int | cols () |
Total number of columns in the matrix. | |
Private Member Functions | |
T * | begin () |
The begin iterator of the flattened values. | |
T * | end () |
The end iterator of the flattened values. | |
const T * | begin () const |
The begin const_iterator of the flattened values. | |
const T * | end () const |
The end const_iterator of the flattened values. | |
Private Attributes | |
std::array< T, M *N > | m_values |
Memory of the flat value content. | |
Static Private Attributes | |
static const int | S = M * N |
Total number of elements. | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const PlainMatrix< T, M, N > &rhs) |
Output operator for debugging purposes. | |
PlainMatrix< T, M, N > | operator/ (T lhs, PlainMatrix< T, M, N > &rhs) |
Elementwise division of a number by the elements of the matrix. | |
A matrix implementation to be used as an interface typ through out the track finder.
This represents a fixed sized matrix with dimensions known at compile time to replace the Eigen::Matrix as vocabulary type at object interfaces. Because of its limited feature set it significantly reduces the compilation time of the whole cdc track finding as the Eigen headers do not have to be included in each translation unit.
It exposes only a limited number of methods for basic interactions. For all the linear algebra algorithms use the mapToEigen function in EigenView.h But it is advised to use the linear algebra only in .cc such that transitive includes do not suffer from Eigens heavily templated implementation.
The arrangement of element in this matrix is in column-major order (same as the default for Eigen).
Definition at line 40 of file PlainMatrix.h.
|
inlineexplicit |
Construct from initialiser list - also for value initialisation.
Definition at line 53 of file PlainMatrix.h.
|
inlineexplicit |
Construct from the given values.
Definition at line 61 of file PlainMatrix.h.
|
inlineprivate |
The begin iterator of the flattened values.
Definition at line 240 of file PlainMatrix.h.
|
inlineprivate |
The begin const_iterator of the flattened values.
Definition at line 252 of file PlainMatrix.h.
|
inline |
Get the K x L block from the matrix starting at the element at position (i, j)
Definition at line 191 of file PlainMatrix.h.
|
inlinestaticconstexpr |
Total number of columns in the matrix.
Definition at line 233 of file PlainMatrix.h.
|
inlinestatic |
Construct a matrix with all elements set to a constant.
Definition at line 83 of file PlainMatrix.h.
|
inline |
Access to the flat value array.
Definition at line 92 of file PlainMatrix.h.
|
inline |
Constant access to the flat value array.
Definition at line 98 of file PlainMatrix.h.
|
inlineprivate |
The end iterator of the flattened values.
Definition at line 246 of file PlainMatrix.h.
|
inlineprivate |
The end const_iterator of the flattened values.
Definition at line 258 of file PlainMatrix.h.
|
inline |
Get the K top rows of the matrix.
Definition at line 208 of file PlainMatrix.h.
|
inlinestatic |
Construct an identity matrix.
Definition at line 74 of file PlainMatrix.h.
|
inline |
Element access at the given row i and column j.
Definition at line 116 of file PlainMatrix.h.
|
inline |
Constant element access at the given row i and column j.
Definition at line 122 of file PlainMatrix.h.
|
inline |
Naive matrix multiplication.
Definition at line 158 of file PlainMatrix.h.
|
inline |
Elementwise addition of two matrices.
Definition at line 141 of file PlainMatrix.h.
|
inline |
Elementwise subtraction of two matrices.
Definition at line 149 of file PlainMatrix.h.
|
inline |
Elementwise division of the elements of the matrix by a number.
Definition at line 172 of file PlainMatrix.h.
|
inline |
Flat element access at the given row i and column j.
Definition at line 104 of file PlainMatrix.h.
|
inline |
Constant flat element access at the given row i and column j.
Definition at line 110 of file PlainMatrix.h.
|
inlinestaticconstexpr |
Total number of rows in the matrix.
Definition at line 227 of file PlainMatrix.h.
|
inlinestaticconstexpr |
Total number of values in the matrix.
Definition at line 221 of file PlainMatrix.h.
|
inline |
Get the K bottom rows of the matrix.
Definition at line 215 of file PlainMatrix.h.
|
inlinestatic |
Construct a matrix initialized with zeros.
Definition at line 67 of file PlainMatrix.h.
|
friend |
Elementwise division of a number by the elements of the matrix.
Definition at line 180 of file PlainMatrix.h.
|
friend |
Output operator for debugging purposes.
Definition at line 128 of file PlainMatrix.h.
|
private |
Memory of the flat value content.
Definition at line 265 of file PlainMatrix.h.
|
staticprivate |
Total number of elements.
Definition at line 46 of file PlainMatrix.h.