ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::algebra::storage::matrix< array_t, scalar_t, ROW, COL > Struct Template Reference

Generic matrix type that can take vectors as columns. More...

#include <detray/algebra/common/matrix.hpp>

Inheritance diagram for detray::algebra::storage::matrix< array_t, scalar_t, ROW, COL >:
[legend]

Public Types

using scalar_type = scalar_t
 Value type: Can be simd types.
using vector_type = algebra::storage::vector<ROW, scalar_t, array_t>
 The matrix consists of column vectors.

Public Member Functions

constexpr matrix ()=default
 Default constructor.
template<concepts::vector... vector_t>
requires (sizeof...(vector_t) == COL)
 matrix (vector_t &&...v)
 Construct from given column vectors v.
constexpr const vector_type & operator[] (const std::size_t i) const
 Subscript operator.
constexpr vector_type & operator[] (const std::size_t i)

Static Public Member Functions

static consteval std::size_t columns ()
static consteval std::size_t rows ()
static consteval std::size_t storage_rows ()

Detailed Description

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t, std::size_t ROW, std::size_t COL>
struct detray::algebra::storage::matrix< array_t, scalar_t, ROW, COL >

Generic matrix type that can take vectors as columns.

Constructor & Destructor Documentation

◆ matrix()

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t, std::size_t ROW, std::size_t COL>
template<concepts::vector... vector_t>
requires (sizeof...(vector_t) == COL)
detray::algebra::storage::matrix< array_t, scalar_t, ROW, COL >::matrix ( vector_t &&... v)
explicit

Construct from given column vectors v.

Parameters
vColumn vectors, one for each matrix column.

Member Function Documentation

◆ columns()

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t, std::size_t ROW, std::size_t COL>
consteval std::size_t detray::algebra::storage::matrix< array_t, scalar_t, ROW, COL >::columns ( )
staticconsteval
Returns
the number of columns

◆ operator[]() [1/2]

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t, std::size_t ROW, std::size_t COL>
vector_type & detray::algebra::storage::matrix< array_t, scalar_t, ROW, COL >::operator[] ( const std::size_t i)
constexpr
Parameters
iZero-based column index.
Returns
A mutable reference to the column vector.

◆ operator[]() [2/2]

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t, std::size_t ROW, std::size_t COL>
const vector_type & detray::algebra::storage::matrix< array_t, scalar_t, ROW, COL >::operator[] ( const std::size_t i) const
constexpr

Subscript operator.

Parameters
iZero-based column index.
Returns
A const reference to the column vector.

◆ rows()

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t, std::size_t ROW, std::size_t COL>
consteval std::size_t detray::algebra::storage::matrix< array_t, scalar_t, ROW, COL >::rows ( )
staticconsteval
Returns
the number of rows

◆ storage_rows()

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t, std::size_t ROW, std::size_t COL>
consteval std::size_t detray::algebra::storage::matrix< array_t, scalar_t, ROW, COL >::storage_rows ( )
staticconsteval
Returns
the number of rows of the underlying vector storage
Note
can be different from the matrix rows due to padding