LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
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.

References lar::util::details::FastMatrixOperationsBase< T, DIM >::Dim, and lar::util::details::FastMatrixOperations< T, DIM >::InvertMatrix().

Referenced by lar::util::details::FastMatrixOperations< T, 4 >::InvertSymmetricMatrix().

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
Float_t mat
Definition: plot.C:40
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


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