batmat 0.0.15
Batched linear algebra routines
Loading...
Searching...
No Matches
batmat::matrix::Matrix< T, I, S, D, O, A > Struct Template Reference

#include <batmat/matrix/matrix.hpp>

Detailed Description

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
struct batmat::matrix::Matrix< T, I, S, D, O, A >

Class for a batch of matrices that owns its storage.

Template Parameters
TElement value type.
IIndex type.
SInner stride (batch size).
DDepth type.
OStorage order (column or row major).
ABatch alignment type.
Examples
example.cpp.

Definition at line 52 of file matrix.hpp.

Constructors, assignment and resizing

 Matrix ()=default
 Matrix (layout_type layout)
 Matrix (layout_type layout, uninitialized_t init)
 Matrix (plain_layout_type p)
 Matrix (plain_layout_type p, uninitialized_t init)
 Matrix (const Matrix &o)
 Copy the values from another matrix.
 Matrix (Matrix &&o) noexcept
Matrixoperator= (Matrix &&o) noexcept
 Cheap move assignment. No data is copied.
 ~Matrix ()
void resize (layout_type new_layout)
 Resize the matrix to a new layout, reallocating if the padded size changes.

Element access

value_typeoperator() (index_type l, index_type r, index_type c)
 Access a single element at layer l, row r and column c.
const value_typeoperator() (index_type l, index_type r, index_type c) const
 Access a single element at layer l, row r and column c.

Batch-wise slicing

auto batch (index_type b)
 Access a batch of batch_size() layers, starting at batch index b (i.e.
auto batch (index_type b) const
 Access a batch of batch_size() layers, starting at batch index b (i.e.
auto batch_dyn (index_type b)
 Same as batch(), but returns a view with a dynamic batch size.
auto batch_dyn (index_type b) const
 Same as batch(), but returns a view with a dynamic batch size.
auto middle_batches (index_type b, index_type n, index_type stride=1)
 Get a view of n batches starting at batch b, with a stride of stride layers.
auto middle_batches (index_type b, index_type n, index_type stride=1) const
 Get a view of n batches starting at batch b, with a stride of stride layers.

Layer-wise slicing

guanaqo::MatrixView< T, I, standard_stride_type, O > operator() (index_type l)
 Access a single layer l as a non-batched view.
guanaqo::MatrixView< const T, I, standard_stride_type, O > operator() (index_type l) const
 Access a single layer l as a non-batched view.
template<class N>
auto first_layers (N n)
 Get a view of the first n layers. Note that n can be a compile-time constant.
template<class N>
auto first_layers (N n) const
 Get a view of the first n layers. Note that n can be a compile-time constant.
template<class N>
auto middle_layers (index_type l, N n)
 Get a view of n layers starting at layer l.
template<class N>
auto middle_layers (index_type l, N n) const
 Get a view of n layers starting at layer l.

Iterators and buffer access

value_typedata ()
 Get a pointer to the first element of the first layer.
const value_typedata () const
 Get a pointer to the first element of the first layer.
auto begin ()
 Iterate linearly (in storage order) over all elements of the view.
auto begin () const
 Iterate linearly (in storage order) over all elements of the view.
auto end ()
 Sentinel for begin().
auto end () const
 Sentinel for begin().

Dimensions

layout_type layout () const
index_type size () const
 Total number of elements in the view (excluding padding).
index_type padded_size () const
 Total number of elements in the view (including all padding).
depth_type depth () const
 Number of layers in the view (i.e. depth).
index_type ceil_depth () const
 The depth rounded up to a multiple of the batch size.
index_type num_batches () const
 Number of batches in the view, i.e. ceil_depth() / batch_size().
index_type rows () const
 Number of rows of the matrices.
index_type cols () const
 Number of columns of the matrices.
index_type outer_size () const
 The size of the outer dimension, i.e.
index_type inner_size () const
 The size of the inner dimension, i.e.

Strides

index_type outer_stride () const
 Outer stride of the matrices (leading dimension in BLAS parlance).
constexpr auto inner_stride () const
 The inner stride of the matrices.
constexpr auto row_stride () const
 The row stride of the matrices, i.e.
constexpr auto col_stride () const
 The column stride of the matrices, i.e.
index_type layer_stride () const
 The layer stride, i.e.
bool has_full_layer_stride () const
 Whether the layer_stride() == outer_stride() * outer_size().
bool has_full_outer_stride () const
 Whether the outer_stride() == inner_stride() * inner_size().
bool has_full_inner_stride () const
 Whether the inner_stride() == 1. Always true.
batch_size_type batch_size () const
 The batch size, i.e. the number of layers in each batch. Equals the inner stride.

Reshaping and slicing

auto reshaped (index_type rows, index_type cols)
 Reshape the view to the given dimensions. The total size should not change.
auto reshaped (index_type rows, index_type cols) const
 Reshape the view to the given dimensions. The total size should not change.
auto top_rows (index_type n)
 Get a view of the first n rows.
auto top_rows (index_type n) const
 Get a view of the first n rows.
auto left_cols (index_type n)
 Get a view of the first n columns.
auto left_cols (index_type n) const
 Get a view of the first n columns.
auto bottom_rows (index_type n)
 Get a view of the last n rows.
auto bottom_rows (index_type n) const
 Get a view of the last n rows.
auto right_cols (index_type n)
 Get a view of the last n columns.
auto right_cols (index_type n) const
 Get a view of the last n columns.
auto middle_rows (index_type r, index_type n)
 Get a view of n rows starting at row r.
auto middle_rows (index_type r, index_type n) const
 Get a view of n rows starting at row r.
auto middle_rows (index_type r, index_type n, index_type stride)
 Get a view of n rows starting at row r.
auto middle_rows (index_type r, index_type n, index_type stride) const
 Get a view of n rows starting at row r.
auto middle_cols (index_type c, index_type n)
 Get a view of n columns starting at column c.
auto middle_cols (index_type c, index_type n) const
 Get a view of n columns starting at column c.
auto middle_cols (index_type c, index_type n, index_type stride)
 Get a view of n columns starting at column c.
auto middle_cols (index_type c, index_type n, index_type stride) const
 Get a view of n columns starting at column c.
auto top_left (index_type nr, index_type nc)
 Get a view of the top-left nr by nc block of the matrices.
auto top_left (index_type nr, index_type nc) const
 Get a view of the top-left nr by nc block of the matrices.
auto top_right (index_type nr, index_type nc)
 Get a view of the top-right nr by nc block of the matrices.
auto top_right (index_type nr, index_type nc) const
 Get a view of the top-right nr by nc block of the matrices.
auto bottom_left (index_type nr, index_type nc)
 Get a view of the bottom-left nr by nc block of the matrices.
auto bottom_left (index_type nr, index_type nc) const
 Get a view of the bottom-left nr by nc block of the matrices.
auto bottom_right (index_type nr, index_type nc)
 Get a view of the bottom-right nr by nc block of the matrices.
auto bottom_right (index_type nr, index_type nc) const
 Get a view of the bottom-right nr by nc block of the matrices.
auto block (index_type r, index_type c, index_type nr, index_type nc)
 Get a view of the nr by nc block of the matrices starting at row r and column c.
auto block (index_type r, index_type c, index_type nr, index_type nc) const
 Get a view of the nr by nc block of the matrices starting at row r and column c.
auto transposed ()
 Get a transposed view of the matrices.
auto transposed () const
 Get a transposed view of the matrices.

Value manipulation

Matrixoperator= (const Matrix &o)
 Copy the values of another matrix, resizing if necessary.
template<class U, class J, class R, class E, class M>
Matrixoperator= (View< U, J, R, E, M, O > other)
 Copy the values from a compatible view, resizing if necessary.
void set_constant (value_type t)
void add_to_diagonal (const value_type &t)
void negate ()
template<class Other>
void copy_values (const Other &other)
template<class U, class J, class R, class E, class M>
Matrixoperator+= (View< U, J, R, E, M, O > other)

View conversions

view_type view ()
 Returns the same view. For consistency with Matrix.
const_view_type view () const
 Returns the same view. For consistency with Matrix.
auto as_const () const
 Explicit conversion to a const view.
 operator view_type ()
 operator const_view_type () const
 operator View< T, I, S, D, I, O > ()
 operator View< const T, I, S, D, I, O > () const
 operator View< T, I, S, integral_value_type_t< D >, DefaultStride, O > ()
 operator View< const T, I, S, integral_value_type_t< D >, DefaultStride, O > () const
 operator guanaqo::MatrixView< T, I, standard_stride_type, O > ()
 operator guanaqo::MatrixView< const T, I, standard_stride_type, O > () const

Public Types

using view_type = View<T, I, S, D, DefaultStride, O>
using const_view_type = typename view_type::const_view_type
using layout_type = typename view_type::layout_type
using plain_layout_type = typename layout_type::PlainLayout
using value_type = T
using index_type = typename layout_type::index_type
using batch_size_type = typename layout_type::batch_size_type
using depth_type = typename layout_type::depth_type
using standard_stride_type = typename layout_type::standard_stride_type
using alignment_type = A

Static Public Attributes

static constexpr StorageOrder storage_order = view_type::storage_order
static constexpr bool is_column_major = view_type::is_column_major
static constexpr bool is_row_major = view_type::is_row_major
static constexpr bool has_single_batch_at_compile_time
static constexpr bool has_single_layer_at_compile_time

Private Member Functions

void clear ()
template<class U, class J, class R, class E, class M>
void assign_from_view (View< U, J, R, E, M, O > other)

Static Private Member Functions

static constexpr auto default_alignment (layout_type layout)
static auto allocate (layout_type layout)
static auto allocate (layout_type layout, uninitialized_t init)

Private Attributes

view_type view_

Member Typedef Documentation

◆ view_type

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
using batmat::matrix::Matrix< T, I, S, D, O, A >::view_type = View<T, I, S, D, DefaultStride, O>

Definition at line 54 of file matrix.hpp.

◆ const_view_type

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
using batmat::matrix::Matrix< T, I, S, D, O, A >::const_view_type = typename view_type::const_view_type

Definition at line 55 of file matrix.hpp.

◆ layout_type

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
using batmat::matrix::Matrix< T, I, S, D, O, A >::layout_type = typename view_type::layout_type

Definition at line 56 of file matrix.hpp.

◆ plain_layout_type

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
using batmat::matrix::Matrix< T, I, S, D, O, A >::plain_layout_type = typename layout_type::PlainLayout

Definition at line 57 of file matrix.hpp.

◆ value_type

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
using batmat::matrix::Matrix< T, I, S, D, O, A >::value_type = T

Definition at line 58 of file matrix.hpp.

◆ index_type

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
using batmat::matrix::Matrix< T, I, S, D, O, A >::index_type = typename layout_type::index_type

Definition at line 59 of file matrix.hpp.

◆ batch_size_type

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
using batmat::matrix::Matrix< T, I, S, D, O, A >::batch_size_type = typename layout_type::batch_size_type

Definition at line 60 of file matrix.hpp.

◆ depth_type

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
using batmat::matrix::Matrix< T, I, S, D, O, A >::depth_type = typename layout_type::depth_type

Definition at line 61 of file matrix.hpp.

◆ standard_stride_type

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
using batmat::matrix::Matrix< T, I, S, D, O, A >::standard_stride_type = typename layout_type::standard_stride_type

Definition at line 62 of file matrix.hpp.

◆ alignment_type

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
using batmat::matrix::Matrix< T, I, S, D, O, A >::alignment_type = A

Definition at line 63 of file matrix.hpp.

Constructor & Destructor Documentation

◆ Matrix() [1/7]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batmat::matrix::Matrix< T, I, S, D, O, A >::Matrix ( )
default

◆ Matrix() [2/7]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batmat::matrix::Matrix< T, I, S, D, O, A >::Matrix ( layout_type layout)
inline

Definition at line 117 of file matrix.hpp.

◆ Matrix() [3/7]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batmat::matrix::Matrix< T, I, S, D, O, A >::Matrix ( layout_type layout,
uninitialized_t init )
inline

Definition at line 118 of file matrix.hpp.

◆ Matrix() [4/7]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batmat::matrix::Matrix< T, I, S, D, O, A >::Matrix ( plain_layout_type p)
inline

Definition at line 120 of file matrix.hpp.

◆ Matrix() [5/7]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batmat::matrix::Matrix< T, I, S, D, O, A >::Matrix ( plain_layout_type p,
uninitialized_t init )
inline

Definition at line 121 of file matrix.hpp.

◆ Matrix() [6/7]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batmat::matrix::Matrix< T, I, S, D, O, A >::Matrix ( const Matrix< T, I, S, D, O, A > & o)
inline

Copy the values from another matrix.

Definition at line 123 of file matrix.hpp.

◆ Matrix() [7/7]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batmat::matrix::Matrix< T, I, S, D, O, A >::Matrix ( Matrix< T, I, S, D, O, A > && o)
inlinenoexcept

Definition at line 126 of file matrix.hpp.

◆ ~Matrix()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batmat::matrix::Matrix< T, I, S, D, O, A >::~Matrix ( )
inline

Definition at line 136 of file matrix.hpp.

Member Function Documentation

◆ default_alignment()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
constexpr auto batmat::matrix::Matrix< T, I, S, D, O, A >::default_alignment ( layout_type layout)
inlinestaticconstexprprivate

Definition at line 75 of file matrix.hpp.

◆ allocate() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::allocate ( layout_type layout)
inlinestaticnodiscardprivate

Definition at line 83 of file matrix.hpp.

◆ allocate() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::allocate ( layout_type layout,
uninitialized_t init )
inlinestaticnodiscardprivate

Definition at line 87 of file matrix.hpp.

◆ clear()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
void batmat::matrix::Matrix< T, I, S, D, O, A >::clear ( )
inlineprivate

Definition at line 91 of file matrix.hpp.

◆ assign_from_view()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
template<class U, class J, class R, class E, class M>
void batmat::matrix::Matrix< T, I, S, D, O, A >::assign_from_view ( View< U, J, R, E, M, O > other)
inlineprivate

Definition at line 100 of file matrix.hpp.

◆ operator=() [1/3]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
Matrix & batmat::matrix::Matrix< T, I, S, D, O, A >::operator= ( Matrix< T, I, S, D, O, A > && o)
inlinenoexcept

Cheap move assignment. No data is copied.

Definition at line 128 of file matrix.hpp.

◆ resize()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
void batmat::matrix::Matrix< T, I, S, D, O, A >::resize ( layout_type new_layout)
inline

Resize the matrix to a new layout, reallocating if the padded size changes.

Definition at line 139 of file matrix.hpp.

◆ operator()() [1/4]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
value_type & batmat::matrix::Matrix< T, I, S, D, O, A >::operator() ( index_type l,
index_type r,
index_type c )
inlinenodiscard

Access a single element at layer l, row r and column c.

Definition at line 153 of file matrix.hpp.

◆ operator()() [2/4]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
const value_type & batmat::matrix::Matrix< T, I, S, D, O, A >::operator() ( index_type l,
index_type r,
index_type c ) const
inlinenodiscard

Access a single element at layer l, row r and column c.

Definition at line 157 of file matrix.hpp.

◆ batch() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::batch ( index_type b)
inlinenodiscard

Access a batch of batch_size() layers, starting at batch index b (i.e.

starting at layer b * batch_size()).

Definition at line 167 of file matrix.hpp.

◆ batch() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::batch ( index_type b) const
inlinenodiscard

Access a batch of batch_size() layers, starting at batch index b (i.e.

starting at layer b * batch_size()).

Definition at line 169 of file matrix.hpp.

◆ batch_dyn() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::batch_dyn ( index_type b)
inlinenodiscard

Same as batch(), but returns a view with a dynamic batch size.

If the total depth is not a multiple of the batch size, the last batch will have a smaller size.

Definition at line 171 of file matrix.hpp.

◆ batch_dyn() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::batch_dyn ( index_type b) const
inlinenodiscard

Same as batch(), but returns a view with a dynamic batch size.

If the total depth is not a multiple of the batch size, the last batch will have a smaller size.

Definition at line 173 of file matrix.hpp.

◆ middle_batches() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::middle_batches ( index_type b,
index_type n,
index_type stride = 1 )
inlinenodiscard

Get a view of n batches starting at batch b, with a stride of stride layers.

Definition at line 175 of file matrix.hpp.

◆ middle_batches() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::middle_batches ( index_type b,
index_type n,
index_type stride = 1 ) const
inlinenodiscard

Get a view of n batches starting at batch b, with a stride of stride layers.

Definition at line 179 of file matrix.hpp.

◆ operator()() [3/4]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
guanaqo::MatrixView< T, I, standard_stride_type, O > batmat::matrix::Matrix< T, I, S, D, O, A >::operator() ( index_type l)
inlinenodiscard

Access a single layer l as a non-batched view.

Definition at line 189 of file matrix.hpp.

◆ operator()() [4/4]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
guanaqo::MatrixView< const T, I, standard_stride_type, O > batmat::matrix::Matrix< T, I, S, D, O, A >::operator() ( index_type l) const
inlinenodiscard

Access a single layer l as a non-batched view.

Definition at line 194 of file matrix.hpp.

◆ first_layers() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
template<class N>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::first_layers ( N n)
inlinenodiscard

Get a view of the first n layers. Note that n can be a compile-time constant.

Definition at line 199 of file matrix.hpp.

◆ first_layers() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
template<class N>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::first_layers ( N n) const
inlinenodiscard

Get a view of the first n layers. Note that n can be a compile-time constant.

Definition at line 204 of file matrix.hpp.

◆ middle_layers() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
template<class N>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::middle_layers ( index_type l,
N n )
inlinenodiscard

Get a view of n layers starting at layer l.

Note that n can be a compile-time constant.

Precondition
l % batch_size() == 0 (i.e. the starting layer must be at the start of a batch).

Definition at line 209 of file matrix.hpp.

◆ middle_layers() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
template<class N>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::middle_layers ( index_type l,
N n ) const
inlinenodiscard

Get a view of n layers starting at layer l.

Note that n can be a compile-time constant.

Precondition
l % batch_size() == 0 (i.e. the starting layer must be at the start of a batch).

Definition at line 214 of file matrix.hpp.

◆ data() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
value_type * batmat::matrix::Matrix< T, I, S, D, O, A >::data ( )
inlinenodiscard

Get a pointer to the first element of the first layer.

Definition at line 224 of file matrix.hpp.

◆ data() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
const value_type * batmat::matrix::Matrix< T, I, S, D, O, A >::data ( ) const
inlinenodiscard

Get a pointer to the first element of the first layer.

Definition at line 226 of file matrix.hpp.

◆ begin() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::begin ( )
inlinenodiscard

Iterate linearly (in storage order) over all elements of the view.

Precondition
has_full_outer_stride() (i.e. no padding within layers).
has_full_layer_stride() (i.e. no padding between batches).

Definition at line 228 of file matrix.hpp.

◆ begin() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::begin ( ) const
inlinenodiscard

Iterate linearly (in storage order) over all elements of the view.

Precondition
has_full_outer_stride() (i.e. no padding within layers).
has_full_layer_stride() (i.e. no padding between batches).

Definition at line 230 of file matrix.hpp.

◆ end() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::end ( )
inlinenodiscard

Sentinel for begin().

Definition at line 232 of file matrix.hpp.

◆ end() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::end ( ) const
inlinenodiscard

Sentinel for begin().

Definition at line 234 of file matrix.hpp.

◆ layout()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
layout_type batmat::matrix::Matrix< T, I, S, D, O, A >::layout ( ) const
inlinenodiscard

Definition at line 241 of file matrix.hpp.

◆ size()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
index_type batmat::matrix::Matrix< T, I, S, D, O, A >::size ( ) const
inlinenodiscard

Total number of elements in the view (excluding padding).

Definition at line 243 of file matrix.hpp.

◆ padded_size()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
index_type batmat::matrix::Matrix< T, I, S, D, O, A >::padded_size ( ) const
inlinenodiscard

Total number of elements in the view (including all padding).

Definition at line 245 of file matrix.hpp.

◆ depth()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
depth_type batmat::matrix::Matrix< T, I, S, D, O, A >::depth ( ) const
inlinenodiscard

Number of layers in the view (i.e. depth).

Definition at line 247 of file matrix.hpp.

◆ ceil_depth()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
index_type batmat::matrix::Matrix< T, I, S, D, O, A >::ceil_depth ( ) const
inlinenodiscard

The depth rounded up to a multiple of the batch size.

Definition at line 249 of file matrix.hpp.

◆ num_batches()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
index_type batmat::matrix::Matrix< T, I, S, D, O, A >::num_batches ( ) const
inlinenodiscard

Number of batches in the view, i.e. ceil_depth() / batch_size().

Definition at line 251 of file matrix.hpp.

◆ rows()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
index_type batmat::matrix::Matrix< T, I, S, D, O, A >::rows ( ) const
inlinenodiscard

Number of rows of the matrices.

Definition at line 253 of file matrix.hpp.

◆ cols()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
index_type batmat::matrix::Matrix< T, I, S, D, O, A >::cols ( ) const
inlinenodiscard

Number of columns of the matrices.

Definition at line 255 of file matrix.hpp.

◆ outer_size()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
index_type batmat::matrix::Matrix< T, I, S, D, O, A >::outer_size ( ) const
inlinenodiscard

The size of the outer dimension, i.e.

the number of columns for column-major storage, or the number of rows for row-major storage.

Definition at line 257 of file matrix.hpp.

◆ inner_size()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
index_type batmat::matrix::Matrix< T, I, S, D, O, A >::inner_size ( ) const
inlinenodiscard

The size of the inner dimension, i.e.

the number of rows for column-major storage, or the number of columns for row-major storage.

Definition at line 259 of file matrix.hpp.

◆ outer_stride()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
index_type batmat::matrix::Matrix< T, I, S, D, O, A >::outer_stride ( ) const
inlinenodiscard

Outer stride of the matrices (leading dimension in BLAS parlance).

Should be multiplied by the batch size to get the actual number of elements.

Definition at line 267 of file matrix.hpp.

◆ inner_stride()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::inner_stride ( ) const
inlinenodiscardconstexpr

The inner stride of the matrices.

Should be multiplied by the batch size to get the actual number of elements.

Definition at line 269 of file matrix.hpp.

◆ row_stride()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::row_stride ( ) const
inlinenodiscardconstexpr

The row stride of the matrices, i.e.

the distance between elements in consecutive rows in a given column. Should be multiplied by the batch size to get the actual number of elements.

Definition at line 271 of file matrix.hpp.

◆ col_stride()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::col_stride ( ) const
inlinenodiscardconstexpr

The column stride of the matrices, i.e.

the distance between elements in consecutive columns in a given row. Should be multiplied by the batch size to get the actual number of elements.

Definition at line 273 of file matrix.hpp.

◆ layer_stride()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
index_type batmat::matrix::Matrix< T, I, S, D, O, A >::layer_stride ( ) const
inlinenodiscard

The layer stride, i.e.

the distance between the first layer of one batch and the first layer of the next batch. Should be multiplied by the batch size to get the actual number of elements.

Definition at line 275 of file matrix.hpp.

◆ has_full_layer_stride()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
bool batmat::matrix::Matrix< T, I, S, D, O, A >::has_full_layer_stride ( ) const
inlinenodiscard

Whether the layer_stride() == outer_stride() * outer_size().

Definition at line 277 of file matrix.hpp.

◆ has_full_outer_stride()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
bool batmat::matrix::Matrix< T, I, S, D, O, A >::has_full_outer_stride ( ) const
inlinenodiscard

Whether the outer_stride() == inner_stride() * inner_size().

Definition at line 279 of file matrix.hpp.

◆ has_full_inner_stride()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
bool batmat::matrix::Matrix< T, I, S, D, O, A >::has_full_inner_stride ( ) const
inlinenodiscard

Whether the inner_stride() == 1. Always true.

Definition at line 281 of file matrix.hpp.

◆ batch_size()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batch_size_type batmat::matrix::Matrix< T, I, S, D, O, A >::batch_size ( ) const
inlinenodiscard

The batch size, i.e. the number of layers in each batch. Equals the inner stride.

Definition at line 283 of file matrix.hpp.

◆ reshaped() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::reshaped ( index_type rows,
index_type cols )
inlinenodiscard

Reshape the view to the given dimensions. The total size should not change.

Definition at line 291 of file matrix.hpp.

◆ reshaped() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::reshaped ( index_type rows,
index_type cols ) const
inlinenodiscard

Reshape the view to the given dimensions. The total size should not change.

Definition at line 295 of file matrix.hpp.

◆ top_rows() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::top_rows ( index_type n)
inlinenodiscard

Get a view of the first n rows.

Definition at line 299 of file matrix.hpp.

◆ top_rows() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::top_rows ( index_type n) const
inlinenodiscard

Get a view of the first n rows.

Definition at line 301 of file matrix.hpp.

◆ left_cols() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::left_cols ( index_type n)
inlinenodiscard

Get a view of the first n columns.

Definition at line 303 of file matrix.hpp.

◆ left_cols() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::left_cols ( index_type n) const
inlinenodiscard

Get a view of the first n columns.

Definition at line 305 of file matrix.hpp.

◆ bottom_rows() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::bottom_rows ( index_type n)
inlinenodiscard

Get a view of the last n rows.

Definition at line 307 of file matrix.hpp.

◆ bottom_rows() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::bottom_rows ( index_type n) const
inlinenodiscard

Get a view of the last n rows.

Definition at line 309 of file matrix.hpp.

◆ right_cols() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::right_cols ( index_type n)
inlinenodiscard

Get a view of the last n columns.

Definition at line 311 of file matrix.hpp.

◆ right_cols() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::right_cols ( index_type n) const
inlinenodiscard

Get a view of the last n columns.

Definition at line 313 of file matrix.hpp.

◆ middle_rows() [1/4]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::middle_rows ( index_type r,
index_type n )
inlinenodiscard

Get a view of n rows starting at row r.

Definition at line 315 of file matrix.hpp.

◆ middle_rows() [2/4]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::middle_rows ( index_type r,
index_type n ) const
inlinenodiscard

Get a view of n rows starting at row r.

Definition at line 317 of file matrix.hpp.

◆ middle_rows() [3/4]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::middle_rows ( index_type r,
index_type n,
index_type stride )
inlinenodiscard

Get a view of n rows starting at row r.

Definition at line 321 of file matrix.hpp.

◆ middle_rows() [4/4]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::middle_rows ( index_type r,
index_type n,
index_type stride ) const
inlinenodiscard

Get a view of n rows starting at row r.

Definition at line 327 of file matrix.hpp.

◆ middle_cols() [1/4]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::middle_cols ( index_type c,
index_type n )
inlinenodiscard

Get a view of n columns starting at column c.

Definition at line 333 of file matrix.hpp.

◆ middle_cols() [2/4]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::middle_cols ( index_type c,
index_type n ) const
inlinenodiscard

Get a view of n columns starting at column c.

Definition at line 335 of file matrix.hpp.

◆ middle_cols() [3/4]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::middle_cols ( index_type c,
index_type n,
index_type stride )
inlinenodiscard

Get a view of n columns starting at column c.

Definition at line 339 of file matrix.hpp.

◆ middle_cols() [4/4]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::middle_cols ( index_type c,
index_type n,
index_type stride ) const
inlinenodiscard

Get a view of n columns starting at column c.

Definition at line 345 of file matrix.hpp.

◆ top_left() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::top_left ( index_type nr,
index_type nc )
inlinenodiscard

Get a view of the top-left nr by nc block of the matrices.

Definition at line 351 of file matrix.hpp.

◆ top_left() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::top_left ( index_type nr,
index_type nc ) const
inlinenodiscard

Get a view of the top-left nr by nc block of the matrices.

Definition at line 353 of file matrix.hpp.

◆ top_right() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::top_right ( index_type nr,
index_type nc )
inlinenodiscard

Get a view of the top-right nr by nc block of the matrices.

Definition at line 357 of file matrix.hpp.

◆ top_right() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::top_right ( index_type nr,
index_type nc ) const
inlinenodiscard

Get a view of the top-right nr by nc block of the matrices.

Definition at line 359 of file matrix.hpp.

◆ bottom_left() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::bottom_left ( index_type nr,
index_type nc )
inlinenodiscard

Get a view of the bottom-left nr by nc block of the matrices.

Definition at line 363 of file matrix.hpp.

◆ bottom_left() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::bottom_left ( index_type nr,
index_type nc ) const
inlinenodiscard

Get a view of the bottom-left nr by nc block of the matrices.

Definition at line 367 of file matrix.hpp.

◆ bottom_right() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::bottom_right ( index_type nr,
index_type nc )
inlinenodiscard

Get a view of the bottom-right nr by nc block of the matrices.

Definition at line 371 of file matrix.hpp.

◆ bottom_right() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::bottom_right ( index_type nr,
index_type nc ) const
inlinenodiscard

Get a view of the bottom-right nr by nc block of the matrices.

Definition at line 375 of file matrix.hpp.

◆ block() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::block ( index_type r,
index_type c,
index_type nr,
index_type nc )
inlinenodiscard

Get a view of the nr by nc block of the matrices starting at row r and column c.

Definition at line 379 of file matrix.hpp.

◆ block() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::block ( index_type r,
index_type c,
index_type nr,
index_type nc ) const
inlinenodiscard

Get a view of the nr by nc block of the matrices starting at row r and column c.

Definition at line 383 of file matrix.hpp.

◆ transposed() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::transposed ( )
inlinenodiscard

Get a transposed view of the matrices.

Note that the data itself is not modified, the returned view simply accesses the same data with rows and column indices swapped.

Definition at line 387 of file matrix.hpp.

◆ transposed() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::transposed ( ) const
inlinenodiscard

Get a transposed view of the matrices.

Note that the data itself is not modified, the returned view simply accesses the same data with rows and column indices swapped.

Definition at line 389 of file matrix.hpp.

◆ operator=() [2/3]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
Matrix & batmat::matrix::Matrix< T, I, S, D, O, A >::operator= ( const Matrix< T, I, S, D, O, A > & o)
inline

Copy the values of another matrix, resizing if necessary.

Definition at line 397 of file matrix.hpp.

◆ operator=() [3/3]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
template<class U, class J, class R, class E, class M>
Matrix & batmat::matrix::Matrix< T, I, S, D, O, A >::operator= ( View< U, J, R, E, M, O > other)
inline

Copy the values from a compatible view, resizing if necessary.

Definition at line 411 of file matrix.hpp.

◆ set_constant()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
void batmat::matrix::Matrix< T, I, S, D, O, A >::set_constant ( value_type t)
inline

Definition at line 417 of file matrix.hpp.

◆ add_to_diagonal()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
void batmat::matrix::Matrix< T, I, S, D, O, A >::add_to_diagonal ( const value_type & t)
inline

Definition at line 419 of file matrix.hpp.

◆ negate()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
void batmat::matrix::Matrix< T, I, S, D, O, A >::negate ( )
inline

Definition at line 421 of file matrix.hpp.

◆ copy_values()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
template<class Other>
void batmat::matrix::Matrix< T, I, S, D, O, A >::copy_values ( const Other & other)
inline

Definition at line 424 of file matrix.hpp.

◆ operator+=()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
template<class U, class J, class R, class E, class M>
Matrix & batmat::matrix::Matrix< T, I, S, D, O, A >::operator+= ( View< U, J, R, E, M, O > other)
inline

Definition at line 430 of file matrix.hpp.

◆ view() [1/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
view_type batmat::matrix::Matrix< T, I, S, D, O, A >::view ( )
inlinenodiscard

Returns the same view. For consistency with Matrix.

Definition at line 441 of file matrix.hpp.

◆ view() [2/2]

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
const_view_type batmat::matrix::Matrix< T, I, S, D, O, A >::view ( ) const
inlinenodiscard

Returns the same view. For consistency with Matrix.

Definition at line 443 of file matrix.hpp.

◆ as_const()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
auto batmat::matrix::Matrix< T, I, S, D, O, A >::as_const ( ) const
inlinenodiscard

Explicit conversion to a const view.

Definition at line 445 of file matrix.hpp.

◆ operator view_type()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batmat::matrix::Matrix< T, I, S, D, O, A >::operator view_type ( )
inline

Definition at line 447 of file matrix.hpp.

◆ operator const_view_type()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batmat::matrix::Matrix< T, I, S, D, O, A >::operator const_view_type ( ) const
inline

Definition at line 448 of file matrix.hpp.

◆ operator View< T, I, S, D, I, O >()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batmat::matrix::Matrix< T, I, S, D, O, A >::operator View< T, I, S, D, I, O > ( )
inline

Definition at line 449 of file matrix.hpp.

◆ operator View< const T, I, S, D, I, O >()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batmat::matrix::Matrix< T, I, S, D, O, A >::operator View< const T, I, S, D, I, O > ( ) const
inline

Definition at line 450 of file matrix.hpp.

◆ operator View< T, I, S, integral_value_type_t< D >, DefaultStride, O >()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batmat::matrix::Matrix< T, I, S, D, O, A >::operator View< T, I, S, integral_value_type_t< D >, DefaultStride, O > ( )
inline

Definition at line 451 of file matrix.hpp.

◆ operator View< const T, I, S, integral_value_type_t< D >, DefaultStride, O >()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batmat::matrix::Matrix< T, I, S, D, O, A >::operator View< const T, I, S, integral_value_type_t< D >, DefaultStride, O > ( ) const
inline

Definition at line 456 of file matrix.hpp.

◆ operator guanaqo::MatrixView< T, I, standard_stride_type, O >()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batmat::matrix::Matrix< T, I, S, D, O, A >::operator guanaqo::MatrixView< T, I, standard_stride_type, O > ( )
inline

Definition at line 461 of file matrix.hpp.

◆ operator guanaqo::MatrixView< const T, I, standard_stride_type, O >()

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
batmat::matrix::Matrix< T, I, S, D, O, A >::operator guanaqo::MatrixView< const T, I, standard_stride_type, O > ( ) const
inline

Definition at line 466 of file matrix.hpp.

Member Data Documentation

◆ storage_order

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
StorageOrder batmat::matrix::Matrix< T, I, S, D, O, A >::storage_order = view_type::storage_order
staticconstexpr

Definition at line 64 of file matrix.hpp.

◆ is_column_major

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
bool batmat::matrix::Matrix< T, I, S, D, O, A >::is_column_major = view_type::is_column_major
staticconstexpr

Definition at line 65 of file matrix.hpp.

◆ is_row_major

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
bool batmat::matrix::Matrix< T, I, S, D, O, A >::is_row_major = view_type::is_row_major
staticconstexpr

Definition at line 66 of file matrix.hpp.

◆ has_single_batch_at_compile_time

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
bool batmat::matrix::Matrix< T, I, S, D, O, A >::has_single_batch_at_compile_time
staticconstexpr
Initial value:

Definition at line 67 of file matrix.hpp.

◆ has_single_layer_at_compile_time

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
bool batmat::matrix::Matrix< T, I, S, D, O, A >::has_single_layer_at_compile_time
staticconstexpr
Initial value:

Definition at line 69 of file matrix.hpp.

◆ view_

template<class T, class I = index_t, class S = std::integral_constant<I, 1>, class D = I, StorageOrder O = StorageOrder::ColMajor, class A = detail::default_alignment_t<T, I, S>>
view_type batmat::matrix::Matrix< T, I, S, D, O, A >::view_
private

Definition at line 73 of file matrix.hpp.


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