Public Types | Static Public Member Functions | Static Public Attributes | List of all members
lar::util::details::FastMatrixOperations< T, 2 > Struct Template Reference

Routines for 2x2 matrices. More...

#include <FastMatrixMathHelper.h>

Inheritance diagram for lar::util::details::FastMatrixOperations< T, 2 >:
lar::util::details::FastMatrixOperationsBase< T, 2 >

Public Types

using Base_t = FastMatrixOperationsBase< T, 2 >
 
using Data_t = typename Base_t::Data_t
 
using Matrix_t = typename Base_t::Matrix_t
 
- Public Types inherited from lar::util::details::FastMatrixOperationsBase< T, 2 >
using Data_t = T
 
using Matrix_t = std::array< Data_t, Dim *Dim >
 
using Vector_t = std::array< Data_t, Dim >
 

Static Public Member Functions

static Data_t Determinant (Matrix_t const &mat)
 Computes the determinant of a matrix. More...
 
static Matrix_t InvertMatrix (Matrix_t const &mat, Data_t det)
 Computes the determinant of a matrix, using the provided determinant. More...
 
static Matrix_t InvertSymmetricMatrix (Matrix_t const &mat, Data_t det)
 
static Matrix_t InvertMatrix (Matrix_t const &mat)
 Computes the determinant of a matrix. More...
 
static Matrix_t InvertSymmetricMatrix (Matrix_t const &mat)
 Computes the determinant of a matrix. More...
 
- Static Public Member Functions inherited from lar::util::details::FastMatrixOperationsBase< T, 2 >
static Vector_t MatrixVectorProduct (Matrix_t const &mat, Vector_t const &vec)
 Returns the product of a square matrix times a column vector. More...
 
static constexpr Data_t sqr (Data_t v)
 

Static Public Attributes

static constexpr unsigned int Dim = Base_t::Dim
 
- Static Public Attributes inherited from lar::util::details::FastMatrixOperationsBase< T, 2 >
static constexpr unsigned int Dim
 matrix dimensions More...
 

Detailed Description

template<typename T>
struct lar::util::details::FastMatrixOperations< T, 2 >

Routines for 2x2 matrices.

Definition at line 254 of file FastMatrixMathHelper.h.

Member Typedef Documentation

template<typename T >
using lar::util::details::FastMatrixOperations< T, 2 >::Base_t = FastMatrixOperationsBase<T, 2>

Definition at line 257 of file FastMatrixMathHelper.h.

template<typename T >
using lar::util::details::FastMatrixOperations< T, 2 >::Data_t = typename Base_t::Data_t

Definition at line 259 of file FastMatrixMathHelper.h.

template<typename T >
using lar::util::details::FastMatrixOperations< T, 2 >::Matrix_t = typename Base_t::Matrix_t

Definition at line 260 of file FastMatrixMathHelper.h.

Member Function Documentation

template<typename T >
static Data_t lar::util::details::FastMatrixOperations< T, 2 >::Determinant ( Matrix_t const &  mat)
inlinestatic

Computes the determinant of a matrix.

Definition at line 263 of file FastMatrixMathHelper.h.

264  { return DeterminantHelper<T, Dim, 0, 1, 0, 1>::compute(mat.data()); }
static T compute(T const *data)
template<typename T >
auto lar::util::details::FastMatrixOperations< T, 2 >::InvertMatrix ( Matrix_t const &  mat,
Data_t  det 
)
static

Computes the determinant of a matrix, using the provided determinant.

Definition at line 379 of file FastMatrixMathHelper.h.

380 {
381  Matrix_t Inverse;
382  Inverse[0 * Dim + 0] = mat[1 * Dim + 1] / det;
383  Inverse[0 * Dim + 1] = - mat[0 * Dim + 1] / det;
384  Inverse[1 * Dim + 0] = - mat[1 * Dim + 0] / det;
385  Inverse[1 * Dim + 1] = mat[0 * Dim + 0] / det;
386  return Inverse;
387 } // FastMatrixOperations<T, 2>::InvertMatrix()
template<typename T >
static Matrix_t lar::util::details::FastMatrixOperations< T, 2 >::InvertMatrix ( Matrix_t const &  mat)
inlinestatic

Computes the determinant of a matrix.

Definition at line 274 of file FastMatrixMathHelper.h.

275  { return InvertMatrix(mat, Determinant(mat)); }
static Matrix_t InvertMatrix(Matrix_t const &mat, Data_t det)
Computes the determinant of a matrix, using the provided determinant.
static Data_t Determinant(Matrix_t const &mat)
Computes the determinant of a matrix.
template<typename T >
auto lar::util::details::FastMatrixOperations< T, 2 >::InvertSymmetricMatrix ( Matrix_t const &  mat,
Data_t  det 
)
static

Computes the determinant of a symmatric matrix, using the provided determinant

Definition at line 392 of file FastMatrixMathHelper.h.

393 {
394  Matrix_t Inverse;
395  Inverse[0 * Dim + 0] = mat[1 * Dim + 1] / det;
396  Inverse[0 * Dim + 1] =
397  Inverse[1 * Dim + 0] = - mat[1 * Dim + 0] / det;
398  Inverse[1 * Dim + 1] = mat[0 * Dim + 0] / det;
399  return Inverse;
400 } // FastMatrixOperations<T, 2>::InvertMatrix()
template<typename T >
static Matrix_t lar::util::details::FastMatrixOperations< T, 2 >::InvertSymmetricMatrix ( Matrix_t const &  mat)
inlinestatic

Computes the determinant of a matrix.

Definition at line 278 of file FastMatrixMathHelper.h.

279  { return InvertSymmetricMatrix(mat, Determinant(mat)); }
static Matrix_t InvertSymmetricMatrix(Matrix_t const &mat, Data_t det)
static Data_t Determinant(Matrix_t const &mat)
Computes the determinant of a matrix.

Member Data Documentation

template<typename T >
constexpr unsigned int lar::util::details::FastMatrixOperations< T, 2 >::Dim = Base_t::Dim
static

Definition at line 258 of file FastMatrixMathHelper.h.


The documentation for this struct was generated from the following file: