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

Base class with common definitions for "fast" matrix operations. More...

#include <FastMatrixMathHelper.h>

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

Public Types

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 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 = DIM
 matrix dimensions More...
 

Detailed Description

template<typename T, unsigned int DIM>
struct lar::util::details::FastMatrixOperationsBase< T, DIM >

Base class with common definitions for "fast" matrix operations.

Definition at line 34 of file FastMatrixMathHelper.h.

Member Typedef Documentation

template<typename T, unsigned int DIM>
using lar::util::details::FastMatrixOperationsBase< T, DIM >::Data_t = T

Definition at line 35 of file FastMatrixMathHelper.h.

template<typename T, unsigned int DIM>
using lar::util::details::FastMatrixOperationsBase< T, DIM >::Matrix_t = std::array<Data_t, Dim*Dim>

Definition at line 39 of file FastMatrixMathHelper.h.

template<typename T, unsigned int DIM>
using lar::util::details::FastMatrixOperationsBase< T, DIM >::Vector_t = std::array<Data_t, Dim>

Definition at line 40 of file FastMatrixMathHelper.h.

Member Function Documentation

template<typename T , unsigned int DIM>
auto lar::util::details::FastMatrixOperationsBase< T, DIM >::MatrixVectorProduct ( Matrix_t const &  mat,
Vector_t const &  vec 
)
static

Returns the product of a square matrix times a column vector.

Definition at line 362 of file FastMatrixMathHelper.h.

363 {
364  // not really fast, but there is probably not much to fasten...
365  Vector_t res;
366  Data_t const* mat_row = mat.data();
367  for (size_t r = 0; r < Dim; ++r) {
368  Data_t elem = Data_t(0);
369  for (size_t c = 0; c < Dim; ++c)
370  elem += *(mat_row++) * vec[c];
371  res[r] = elem;
372  } // for
373  return res;
374 } // FastMatrixOperationsBase<>::MatrixVectorProduct()
static constexpr unsigned int Dim
matrix dimensions
recob::tracking::Vector_t Vector_t
template<typename T, unsigned int DIM>
static constexpr Data_t lar::util::details::FastMatrixOperationsBase< T, DIM >::sqr ( Data_t  v)
inlinestatic

Definition at line 47 of file FastMatrixMathHelper.h.

47 { return v*v; }

Member Data Documentation

template<typename T, unsigned int DIM>
constexpr unsigned int lar::util::details::FastMatrixOperationsBase< T, DIM >::Dim = DIM
static

matrix dimensions

Definition at line 37 of file FastMatrixMathHelper.h.


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