ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::algebra::array::storage::block_getter Struct Reference

"Block getter", assuming a simple 2D array access More...

#include <algebra/impl/array_getter.hpp>

Public Member Functions

template<std::size_t ROWS, std::size_t COLS, std::size_t oROWS, std::size_t oCOLS, concepts::scalar scalar_t, template< typename, std::size_t > class array_t>
constexpr auto operator() (const array_t< array_t< scalar_t, oROWS >, oCOLS > &m, std::size_t row, std::size_t col) const
 Operator producing a sub-matrix from a const matrix.
template<std::size_t ROWS, std::size_t COLS, class input_matrix_type, concepts::scalar scalar_t, template< typename, std::size_t > class array_t>
constexpr void set (input_matrix_type &m, const array_t< array_t< scalar_t, ROWS >, COLS > &b, std::size_t row, std::size_t col) const
 Sets a matrix of dimension ROWS and COLS as submatrix of m beginning at row row and column col.
template<std::size_t ROWS, concepts::scalar scalar_t, template< typename, std::size_t > class vector_t, class input_matrix_type>
constexpr void set (input_matrix_type &m, const vector_t< scalar_t, ROWS > &b, std::size_t row, std::size_t col) const
 Sets a vector of length ROWS as submatrix of m beginning at row row and column col.
template<std::size_t SIZE, std::size_t ROWS, std::size_t COLS, concepts::scalar scalar_t, template< typename, std::size_t > class array_t>
constexpr array_t< scalar_t, SIZE > vector (const array_t< array_t< scalar_t, ROWS >, COLS > &m, std::size_t row, std::size_t col) const
 Operator producing a vector out of a const matrix.

Detailed Description

"Block getter", assuming a simple 2D array access

Member Function Documentation

◆ operator()()

template<std::size_t ROWS, std::size_t COLS, std::size_t oROWS, std::size_t oCOLS, concepts::scalar scalar_t, template< typename, std::size_t > class array_t>
auto detray::algebra::array::storage::block_getter::operator() ( const array_t< array_t< scalar_t, oROWS >, oCOLS > & m,
std::size_t row,
std::size_t col ) const
constexpr

Operator producing a sub-matrix from a const matrix.

Parameters
mSource matrix.
rowFirst source row of the block.
colFirst source column of the block.
Returns
A copy of the requested block.

◆ set() [1/2]

template<std::size_t ROWS, std::size_t COLS, class input_matrix_type, concepts::scalar scalar_t, template< typename, std::size_t > class array_t>
void detray::algebra::array::storage::block_getter::set ( input_matrix_type & m,
const array_t< array_t< scalar_t, ROWS >, COLS > & b,
std::size_t row,
std::size_t col ) const
constexpr

Sets a matrix of dimension ROWS and COLS as submatrix of m beginning at row row and column col.

Parameters
mMatrix to update.
bBlock values to write.
rowFirst destination row.
colFirst destination column.

◆ set() [2/2]

template<std::size_t ROWS, concepts::scalar scalar_t, template< typename, std::size_t > class vector_t, class input_matrix_type>
void detray::algebra::array::storage::block_getter::set ( input_matrix_type & m,
const vector_t< scalar_t, ROWS > & b,
std::size_t row,
std::size_t col ) const
constexpr

Sets a vector of length ROWS as submatrix of m beginning at row row and column col.

Parameters
mMatrix to update.
bVector values to write.
rowFirst destination row.
colDestination column.

◆ vector()

template<std::size_t SIZE, std::size_t ROWS, std::size_t COLS, concepts::scalar scalar_t, template< typename, std::size_t > class array_t>
array_t< scalar_t, SIZE > detray::algebra::array::storage::block_getter::vector ( const array_t< array_t< scalar_t, ROWS >, COLS > & m,
std::size_t row,
std::size_t col ) const
constexpr

Operator producing a vector out of a const matrix.

Parameters
mSource matrix.
rowFirst row of the selected segment.
colColumn containing the segment.
Returns
A copy of the selected column segment.