Blaze  3.6
Classes | Public Types | Public Member Functions | Static Public Attributes | Private Types | Static Private Attributes | List of all members
blaze::StaticMatrix< Type, M, N, SO > Class Template Reference

Efficient implementation of a fixed-sized matrix.The StaticMatrix class template is the representation of a fixed-size matrix with statically allocated elements of arbitrary type. The type of the elements, the number of rows and columns and the storage order of the matrix can be specified via the four template parameters: More...

#include <StaticMatrix.h>

Inherits blaze::DenseMatrix< StaticMatrix< Type, M, N, SO >, SO >.

Classes

struct  Rebind
 Rebind mechanism to obtain a StaticMatrix with different data/element type. More...
 
struct  Resize
 Resize mechanism to obtain a StaticMatrix with different fixed dimensions. More...
 

Public Types

using This = StaticMatrix< Type, M, N, SO >
 Type of this StaticMatrix instance.
 
using BaseType = DenseMatrix< This, SO >
 Base type of this StaticMatrix instance.
 
using ResultType = This
 Result type for expression template evaluations.
 
using OppositeType = StaticMatrix< Type, M, N,!SO >
 Result type with opposite storage order for expression template evaluations.
 
using TransposeType = StaticMatrix< Type, N, M,!SO >
 Transpose type for expression template evaluations.
 
using ElementType = Type
 Type of the matrix elements.
 
using SIMDType = SIMDTrait_t< ElementType >
 SIMD type of the matrix elements.
 
using ReturnType = const Type &
 Return type for expression template evaluations.
 
using CompositeType = const This &
 Data type for composite expression templates.
 
using Reference = Type &
 Reference to a non-constant matrix value.
 
using ConstReference = const Type &
 Reference to a constant matrix value.
 
using Pointer = Type *
 Pointer to a non-constant matrix value.
 
using ConstPointer = const Type *
 Pointer to a constant matrix value.
 
using Iterator = DenseIterator< Type, align >
 Iterator over non-constant elements.
 
using ConstIterator = DenseIterator< const Type, align >
 Iterator over constant elements.
 
using MatrixType = MT
 Type of the matrix.
 

Public Member Functions

template<typename Other , size_t Rows, size_t Cols>
StaticMatrix< Type, M, N, SO > & operator= (const Other(&array)[Rows][Cols])
 Array assignment to all matrix elements. More...
 
template<typename Other , bool SO2>
StaticMatrix< Type, M, N, SO > & operator= (const StaticMatrix< Other, M, N, SO2 > &rhs)
 Assignment operator for different StaticMatrix instances. More...
 
template<typename MT , bool SO2>
StaticMatrix< Type, M, N, SO > & operator= (const Matrix< MT, SO2 > &rhs)
 Assignment operator for different matrices. More...
 
template<typename MT , bool SO2>
StaticMatrix< Type, M, N, SO > & operator+= (const Matrix< MT, SO2 > &rhs)
 Addition assignment operator for the addition of a matrix ( $ A+=B $). More...
 
template<typename MT , bool SO2>
StaticMatrix< Type, M, N, SO > & operator-= (const Matrix< MT, SO2 > &rhs)
 Subtraction assignment operator for the subtraction of a matrix ( $ A-=B $). More...
 
template<typename MT , bool SO2>
StaticMatrix< Type, M, N, SO > & operator%= (const Matrix< MT, SO2 > &rhs)
 Schur product assignment operator for the multiplication of a matrix ( $ A\circ=B $). More...
 
template<typename Other >
StaticMatrix< Type, M, N, SO > & scale (const Other &scalar)
 Scaling of the matrix by the scalar value scalar ( $ A*=s $). More...
 
BLAZE_ALWAYS_INLINE constexpr MatrixTypeoperator~ () noexcept
 Conversion operator for non-constant matrices. More...
 
BLAZE_ALWAYS_INLINE constexpr const MatrixTypeoperator~ () const noexcept
 Conversion operator for constant matrices. More...
 
Constructors
 StaticMatrix ()
 The default constructor for StaticMatrix. More...
 
 StaticMatrix (const Type &init)
 Constructor for a homogenous initialization of all elements. More...
 
constexpr StaticMatrix (initializer_list< initializer_list< Type > > list)
 List initialization of all matrix elements. More...
 
template<typename Other >
 StaticMatrix (size_t m, size_t n, const Other *array)
 Array initialization of all matrix elements. More...
 
template<typename Other , size_t Rows, size_t Cols>
 StaticMatrix (const Other(&array)[Rows][Cols])
 Array initialization of all matrix elements. More...
 
constexpr StaticMatrix (const StaticMatrix &m)
 The copy constructor for StaticMatrix. More...
 
template<typename Other , bool SO2>
 StaticMatrix (const StaticMatrix< Other, M, N, SO2 > &m)
 Conversion constructor from different StaticMatrix instances. More...
 
template<typename MT , bool SO2>
 StaticMatrix (const Matrix< MT, SO2 > &m)
 Conversion constructor from different matrices. More...
 
Destructor
 ~StaticMatrix ()=default
 
Data access functions
constexpr Reference operator() (size_t i, size_t j) noexcept
 2D-access to the matrix elements. More...
 
constexpr ConstReference operator() (size_t i, size_t j) const noexcept
 2D-access to the matrix elements. More...
 
Reference at (size_t i, size_t j)
 Checked access to the matrix elements. More...
 
ConstReference at (size_t i, size_t j) const
 Checked access to the matrix elements. More...
 
constexpr Pointer data () noexcept
 Low-level data access to the matrix elements. More...
 
constexpr ConstPointer data () const noexcept
 Low-level data access to the matrix elements. More...
 
constexpr Pointer data (size_t i) noexcept
 Low-level data access to the matrix elements of row/column i. More...
 
constexpr ConstPointer data (size_t i) const noexcept
 Low-level data access to the matrix elements of row/column i. More...
 
constexpr Iterator begin (size_t i) noexcept
 Returns an iterator to the first element of row/column i. More...
 
constexpr ConstIterator begin (size_t i) const noexcept
 Returns an iterator to the first element of row/column i. More...
 
constexpr ConstIterator cbegin (size_t i) const noexcept
 Returns an iterator to the first element of row/column i. More...
 
constexpr Iterator end (size_t i) noexcept
 Returns an iterator just past the last element of row/column i. More...
 
constexpr ConstIterator end (size_t i) const noexcept
 Returns an iterator just past the last element of row/column i. More...
 
constexpr ConstIterator cend (size_t i) const noexcept
 Returns an iterator just past the last element of row/column i. More...
 
Assignment operators
constexpr StaticMatrixoperator= (const Type &set)
 Homogenous assignment to all matrix elements. More...
 
constexpr StaticMatrixoperator= (initializer_list< initializer_list< Type > > list)
 List assignment to all matrix elements. More...
 
template<typename Other , size_t Rows, size_t Cols>
StaticMatrixoperator= (const Other(&array)[Rows][Cols])
 
constexpr StaticMatrixoperator= (const StaticMatrix &rhs)
 Copy assignment operator for StaticMatrix. More...
 
template<typename Other , bool SO2>
StaticMatrixoperator= (const StaticMatrix< Other, M, N, SO2 > &rhs)
 
template<typename MT , bool SO2>
StaticMatrixoperator= (const Matrix< MT, SO2 > &rhs)
 
template<typename MT , bool SO2>
StaticMatrixoperator+= (const Matrix< MT, SO2 > &rhs)
 
template<typename MT , bool SO2>
StaticMatrixoperator-= (const Matrix< MT, SO2 > &rhs)
 
template<typename MT , bool SO2>
StaticMatrixoperator%= (const Matrix< MT, SO2 > &rhs)
 
Numeric functions
StaticMatrixtranspose ()
 In-place transpose of the matrix. More...
 
StaticMatrixctranspose ()
 In-place conjugate transpose of the matrix. More...
 
template<typename Other >
StaticMatrixscale (const Other &scalar)
 
Debugging functions
constexpr bool isIntact () const noexcept
 Returns whether the invariants of the static matrix are intact. More...
 

Static Public Member Functions

Memory functions
static void * operator new (std::size_t size)
 Class specific implementation of operator new. More...
 
static void * operator new[] (std::size_t size)
 Class specific implementation of operator new[]. More...
 
static void * operator new (std::size_t size, const std::nothrow_t &)
 Class specific implementation of the no-throw operator new. More...
 
static void * operator new[] (std::size_t size, const std::nothrow_t &)
 Class specific implementation of the no-throw operator new[]. More...
 
static void operator delete (void *ptr)
 Class specific implementation of operator delete. More...
 
static void operator delete[] (void *ptr)
 Class specific implementation of operator delete[]. More...
 
static void operator delete (void *ptr, const std::nothrow_t &)
 Class specific implementation of no-throw operator delete. More...
 
static void operator delete[] (void *ptr, const std::nothrow_t &)
 Class specific implementation of no-throw operator delete[]. More...
 

Static Public Attributes

static constexpr bool simdEnabled = IsVectorizable_v<Type>
 Compilation flag for SIMD optimization. More...
 
static constexpr bool smpAssignable = false
 Compilation flag for SMP assignments. More...
 
static constexpr bool storageOrder = SO
 Storage order of the matrix.
 

Private Types

using AlignedStorage = AlignedArray< Type, M *NN, Alignment >
 Type of the aligned storage.
 

Private Attributes

Member variables
AlignedStorage v_
 The statically allocated matrix elements. More...
 

Static Private Attributes

static constexpr size_t SIMDSIZE = SIMDTrait<Type>::size
 The number of elements packed within a single SIMD vector.
 
static constexpr size_t NN = ( usePadding ? nextMultiple( N, SIMDSIZE ) : N )
 Alignment adjustment.
 
static constexpr bool align = ( usePadding || NN % SIMDSIZE == 0UL )
 Compilation switch for the choice of alignment.
 
static constexpr size_t Alignment
 Alignment of the data elements. More...
 

Utility functions

size_t capacity (size_t i) const noexcept
 Returns the current capacity of the specified row/column. More...
 
size_t nonZeros () const
 Returns the total number of non-zero elements in the matrix. More...
 
size_t nonZeros (size_t i) const
 Returns the number of non-zero elements in the specified row/column. More...
 
constexpr void reset ()
 Reset to the default initial values. More...
 
void reset (size_t i)
 Reset the specified row/column to the default initial values. More...
 
void swap (StaticMatrix &m) noexcept
 Swapping the contents of two static matrices. More...
 
static constexpr size_t rows () noexcept
 Returns the current number of rows of the matrix. More...
 
static constexpr size_t columns () noexcept
 Returns the current number of columns of the matrix. More...
 
static constexpr size_t spacing () noexcept
 Returns the spacing between the beginning of two rows. More...
 
static constexpr size_t capacity () noexcept
 Returns the maximum capacity of the matrix. More...
 

Expression template evaluation functions

template<typename Other >
bool canAlias (const Other *alias) const noexcept
 Returns whether the matrix can alias with the given address alias. More...
 
template<typename Other >
bool isAliased (const Other *alias) const noexcept
 Returns whether the matrix is aliased with the given address alias. More...
 
BLAZE_ALWAYS_INLINE SIMDType load (size_t i, size_t j) const noexcept
 Load of a SIMD element of the matrix. More...
 
BLAZE_ALWAYS_INLINE SIMDType loada (size_t i, size_t j) const noexcept
 Aligned load of a SIMD element of the matrix. More...
 
BLAZE_ALWAYS_INLINE SIMDType loadu (size_t i, size_t j) const noexcept
 Unaligned load of a SIMD element of the matrix. More...
 
BLAZE_ALWAYS_INLINE void store (size_t i, size_t j, const SIMDType &value) noexcept
 Store of a SIMD element of the matrix. More...
 
BLAZE_ALWAYS_INLINE void storea (size_t i, size_t j, const SIMDType &value) noexcept
 Aligned store of a SIMD element of the matrix. More...
 
BLAZE_ALWAYS_INLINE void storeu (size_t i, size_t j, const SIMDType &value) noexcept
 Unaligned store of a SIMD element of the matrix. More...
 
BLAZE_ALWAYS_INLINE void stream (size_t i, size_t j, const SIMDType &value) noexcept
 Aligned, non-temporal store of a SIMD element of the matrix. More...
 
template<typename MT , bool SO2>
auto assign (const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedAssign_v< MT > >
 Default implementation of the assignment of a dense matrix. More...
 
template<typename MT , bool SO2>
auto assign (const DenseMatrix< MT, SO2 > &rhs) -> EnableIf_t< VectorizedAssign_v< MT > >
 
template<typename MT >
void assign (const SparseMatrix< MT, SO > &rhs)
 Default implementation of the assignment of a row-major sparse matrix. More...
 
template<typename MT >
void assign (const SparseMatrix< MT,!SO > &rhs)
 Default implementation of the assignment of a column-major sparse matrix. More...
 
template<typename MT , bool SO2>
auto addAssign (const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedAddAssign_v< MT > >
 Default implementation of the addition assignment of a row-major dense matrix. More...
 
template<typename MT , bool SO2>
auto addAssign (const DenseMatrix< MT, SO2 > &rhs) -> EnableIf_t< VectorizedAddAssign_v< MT > >
 
template<typename MT >
void addAssign (const SparseMatrix< MT, SO > &rhs)
 Default implementation of the addition assignment of a row-major sparse matrix. More...
 
template<typename MT >
void addAssign (const SparseMatrix< MT,!SO > &rhs)
 Default implementation of the addition assignment of a column-major sparse matrix. More...
 
template<typename MT , bool SO2>
auto subAssign (const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedSubAssign_v< MT > >
 Default implementation of the subtraction assignment of a dense matrix. More...
 
template<typename MT , bool SO2>
auto subAssign (const DenseMatrix< MT, SO2 > &rhs) -> EnableIf_t< VectorizedSubAssign_v< MT > >
 
template<typename MT >
void subAssign (const SparseMatrix< MT, SO > &rhs)
 Default implementation of the subtraction assignment of a row-major sparse matrix. More...
 
template<typename MT >
void subAssign (const SparseMatrix< MT,!SO > &rhs)
 Default implementation of the subtraction assignment of a column-major sparse matrix. More...
 
template<typename MT , bool SO2>
auto schurAssign (const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedSchurAssign_v< MT > >
 Default implementation of the Schur product assignment of a dense matrix. More...
 
template<typename MT , bool SO2>
auto schurAssign (const DenseMatrix< MT, SO2 > &rhs) -> EnableIf_t< VectorizedSchurAssign_v< MT > >
 
template<typename MT >
void schurAssign (const SparseMatrix< MT, SO > &rhs)
 Default implementation of the Schur product assignment of a row-major sparse matrix. More...
 
template<typename MT >
void schurAssign (const SparseMatrix< MT,!SO > &rhs)
 Default implementation of the Schur product assignment of a column-major sparse matrix. More...
 
static constexpr bool isAligned () noexcept
 Returns whether the matrix is properly aligned in memory. More...
 

Detailed Description

template<typename Type, size_t M, size_t N, bool SO = defaultStorageOrder>
class blaze::StaticMatrix< Type, M, N, SO >

Efficient implementation of a fixed-sized matrix.

The StaticMatrix class template is the representation of a fixed-size matrix with statically allocated elements of arbitrary type. The type of the elements, the number of rows and columns and the storage order of the matrix can be specified via the four template parameters:

template< typename Type, size_t M, size_t N, bool SO >

Depending on the storage order, the matrix elements are either stored in a row-wise fashion or in a column-wise fashion. Given the 2x3 matrix

\[\left(\begin{array}{*{3}{c}} 1 & 2 & 3 \\ 4 & 5 & 6 \\ \end{array}\right)\]


in case of row-major order the elements are stored in the order

\[\left(\begin{array}{*{6}{c}} 1 & 2 & 3 & 4 & 5 & 6. \\ \end{array}\right)\]

In case of column-major order the elements are stored in the order

\[\left(\begin{array}{*{6}{c}} 1 & 4 & 2 & 5 & 3 & 6. \\ \end{array}\right)\]

The use of StaticMatrix is very natural and intuitive. All operations (addition, subtraction, multiplication, scaling, ...) can be performed on all possible combinations of row-major and column-major dense and sparse matrices with fitting element types. The following example gives an impression of the use of StaticMatrix:

StaticMatrix<double,2UL,3UL,rowMajor> A; // Default constructed, non-initialized, row-major 2x3 matrix
A(0,0) = 1.0; A(0,1) = 2.0; A(0,2) = 3.0; // Initialization of the first row
A(1,0) = 4.0; A(1,1) = 5.0; A(1,2) = 6.0; // Initialization of the second row
DynamicMatrix<float,2UL,3UL,columnMajor> B; // Default constructed column-major single precision 2x3 matrix
B(0,0) = 1.0; B(0,1) = 3.0; B(0,2) = 5.0; // Initialization of the first row
B(1,0) = 2.0; B(1,1) = 4.0; B(1,2) = 6.0; // Initialization of the second row
CompressedMatrix<float> C( 2, 3 ); // Empty row-major sparse single precision matrix
StaticMatrix<float,3UL,2UL> D( 4.0F ); // Directly, homogeneously initialized single precision 3x2 matrix
StaticMatrix<double,2UL,3UL,rowMajor> E( A ); // Creation of a new row-major matrix as a copy of A
StaticMatrix<double,2UL,2UL,columnMajor> F; // Creation of a default column-major matrix
E = A + B; // Matrix addition and assignment to a row-major matrix
F = A - C; // Matrix subtraction and assignment to a column-major matrix
F = A * D; // Matrix multiplication between two matrices of different element types
A *= 2.0; // In-place scaling of matrix A
E = 2.0 * B; // Scaling of matrix B
E = B * 2.0; // Scaling of matrix B
E += A - B; // Addition assignment
E -= A + C; // Subtraction assignment
F *= A * D; // Multiplication assignment

Constructor & Destructor Documentation

◆ StaticMatrix() [1/8]

template<typename Type , size_t M, size_t N, bool SO>
blaze::StaticMatrix< Type, M, N, SO >::StaticMatrix ( )
inlineexplicit

The default constructor for StaticMatrix.

All matrix elements are initialized to the default value (i.e. 0 for integral data types).

Note that it is possible to skip the default initialization by means of the BLAZE_USE_DEFAULT_INITIALIZATION configuration switch. In case the switch is set to 1 all elements are initialized to their respective default. In case the switch is set to 0 the default initialization is skipped and the elements are not initialized. Please note that this switch is only effective in case the elements are of fundamental type (i.e. integral or floating point). In case the elements are of class type, this switch has no effect. See the <blaze/config/Optimizations.h> configuration file for more details.

◆ StaticMatrix() [2/8]

template<typename Type , size_t M, size_t N, bool SO>
blaze::StaticMatrix< Type, M, N, SO >::StaticMatrix ( const Type &  init)
inlineexplicit

Constructor for a homogenous initialization of all elements.

Parameters
initInitial value for all matrix elements.

◆ StaticMatrix() [3/8]

template<typename Type , size_t M, size_t N, bool SO>
constexpr blaze::StaticMatrix< Type, M, N, SO >::StaticMatrix ( initializer_list< initializer_list< Type > >  list)
inline

List initialization of all matrix elements.

Parameters
listThe initializer list.
Exceptions
std::invalid_argumentInvalid setup of static matrix.

This constructor provides the option to explicitly initialize the elements of the matrix by means of an initializer list:

{ 4, 5 },
{ 7, 8, 9 } };

The matrix elements are (copy) assigned the values of the given initializer list. Missing values are initialized as default (as e.g. the value 6 in the example). Note that in case the size of the top-level initializer list does not match the number of rows of the matrix or the size of any nested list exceeds the number of columns, a std::invalid_argument exception is thrown.

◆ StaticMatrix() [4/8]

template<typename Type , size_t M, size_t N, bool SO>
template<typename Other >
blaze::StaticMatrix< Type, M, N, SO >::StaticMatrix ( size_t  m,
size_t  n,
const Other *  array 
)
inlineexplicit

Array initialization of all matrix elements.

Parameters
mThe number of rows of the matrix.
nThe number of columns of the matrix.
arrayDynamic array for the initialization.

This constructor offers the option to directly initialize the elements of the matrix with a dynamic array:

int* array = new int[6];
// ... Initialization of the dynamic array
delete[] array;

The matrix is initialized with the values from the given array. Missing values are initialized with default values. In case the specified number of rows and/or columns exceeds the maximum number of rows/column of the static matrix (i.e. m is larger than M or n is larger than N), a std::invalid_argument exception is thrown.
Note that it is expected that the given array has at least m by n elements. Providing an array with less elements results in undefined behavior!

◆ StaticMatrix() [5/8]

template<typename Type , size_t M, size_t N, bool SO>
template<typename Other , size_t Rows, size_t Cols>
blaze::StaticMatrix< Type, M, N, SO >::StaticMatrix ( const Other(&)  array[Rows][Cols])
inlineexplicit

Array initialization of all matrix elements.

Parameters
array$ M \times N $ dimensional array for the initialization.

This constructor offers the option to directly initialize the elements of the matrix with a static array:

const int init[3][3] = { { 1, 2, 3 },
{ 4, 5 },
{ 7, 8, 9 } };

The matrix is initialized with the values from the given array. Missing values are initialized with default values (as e.g. the value 6 in the example).

◆ StaticMatrix() [6/8]

template<typename Type , size_t M, size_t N, bool SO>
constexpr blaze::StaticMatrix< Type, M, N, SO >::StaticMatrix ( const StaticMatrix< Type, M, N, SO > &  m)
inline

The copy constructor for StaticMatrix.

Parameters
mMatrix to be copied.

The copy constructor is explicitly defined in order to enable/facilitate NRV optimization.

◆ StaticMatrix() [7/8]

template<typename Type , size_t M, size_t N, bool SO>
template<typename Other , bool SO2>
blaze::StaticMatrix< Type, M, N, SO >::StaticMatrix ( const StaticMatrix< Other, M, N, SO2 > &  m)
inline

Conversion constructor from different StaticMatrix instances.

Parameters
mMatrix to be copied.

◆ StaticMatrix() [8/8]

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT , bool SO2>
blaze::StaticMatrix< Type, M, N, SO >::StaticMatrix ( const Matrix< MT, SO2 > &  m)
inline

Conversion constructor from different matrices.

Parameters
mMatrix to be copied.
Exceptions
std::invalid_argumentInvalid setup of static matrix.

This constructor initializes the static matrix from the given matrix. In case the size of the given matrix does not match the size of the static matrix (i.e. the number of rows is not M or the number of columns is not N), a std::invalid_argument exception is thrown.

Member Function Documentation

◆ addAssign() [1/3]

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT , bool SO2>
auto blaze::StaticMatrix< Type, M, N, SO >::addAssign ( const DenseMatrix< MT, SO2 > &  rhs) -> DisableIf_t< VectorizedAddAssign_v<MT> >
inline

Default implementation of the addition assignment of a row-major dense matrix.

SIMD optimized implementation of the addition assignment of a dense matrix.

Parameters
rhsThe right-hand side dense matrix to be added.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

◆ addAssign() [2/3]

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT >
void blaze::StaticMatrix< Type, M, N, SO >::addAssign ( const SparseMatrix< MT, SO > &  rhs)
inline

Default implementation of the addition assignment of a row-major sparse matrix.

Parameters
rhsThe right-hand side sparse matrix to be added.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

◆ addAssign() [3/3]

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT >
void blaze::StaticMatrix< Type, M, N, SO >::addAssign ( const SparseMatrix< MT,!SO > &  rhs)
inline

Default implementation of the addition assignment of a column-major sparse matrix.

Parameters
rhsThe right-hand side sparse matrix to be added.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

◆ assign() [1/3]

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT , bool SO2>
auto blaze::StaticMatrix< Type, M, N, SO >::assign ( const DenseMatrix< MT, SO2 > &  rhs) -> DisableIf_t< VectorizedAssign_v<MT> >
inline

Default implementation of the assignment of a dense matrix.

SIMD optimized implementation of the assignment of a dense matrix.

Parameters
rhsThe right-hand side dense matrix to be assigned.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

◆ assign() [2/3]

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT >
void blaze::StaticMatrix< Type, M, N, SO >::assign ( const SparseMatrix< MT, SO > &  rhs)
inline

Default implementation of the assignment of a row-major sparse matrix.

Parameters
rhsThe right-hand side sparse matrix to be assigned.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

◆ assign() [3/3]

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT >
void blaze::StaticMatrix< Type, M, N, SO >::assign ( const SparseMatrix< MT,!SO > &  rhs)
inline

Default implementation of the assignment of a column-major sparse matrix.

Parameters
rhsThe right-hand side sparse matrix to be assigned.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

◆ at() [1/2]

template<typename Type , size_t M, size_t N, bool SO>
StaticMatrix< Type, M, N, SO >::Reference blaze::StaticMatrix< Type, M, N, SO >::at ( size_t  i,
size_t  j 
)
inline

Checked access to the matrix elements.

Parameters
iAccess index for the row. The index has to be in the range $[0..M-1]$.
jAccess index for the column. The index has to be in the range $[0..N-1]$.
Returns
Reference to the accessed value.
Exceptions
std::out_of_rangeInvalid matrix access index.

In contrast to the subscript operator this function always performs a check of the given access indices.

◆ at() [2/2]

template<typename Type , size_t M, size_t N, bool SO>
StaticMatrix< Type, M, N, SO >::ConstReference blaze::StaticMatrix< Type, M, N, SO >::at ( size_t  i,
size_t  j 
) const
inline

Checked access to the matrix elements.

Parameters
iAccess index for the row. The index has to be in the range $[0..M-1]$.
jAccess index for the column. The index has to be in the range $[0..N-1]$.
Returns
Reference to the accessed value.
Exceptions
std::out_of_rangeInvalid matrix access index.

In contrast to the subscript operator this function always performs a check of the given access indices.

◆ begin() [1/2]

template<typename Type , size_t M, size_t N, bool SO>
constexpr StaticMatrix< Type, M, N, SO >::Iterator blaze::StaticMatrix< Type, M, N, SO >::begin ( size_t  i)
inlinenoexcept

Returns an iterator to the first element of row/column i.

Parameters
iThe row/column index.
Returns
Iterator to the first element of row/column i.

This function returns a row/column iterator to the first element of row/column i. In case the storage order is set to rowMajor the function returns an iterator to the first element of row i, in case the storage flag is set to columnMajor the function returns an iterator to the first element of column i.

◆ begin() [2/2]

template<typename Type , size_t M, size_t N, bool SO>
constexpr StaticMatrix< Type, M, N, SO >::ConstIterator blaze::StaticMatrix< Type, M, N, SO >::begin ( size_t  i) const
inlinenoexcept

Returns an iterator to the first element of row/column i.

Parameters
iThe row/column index.
Returns
Iterator to the first element of row/column i.

This function returns a row/column iterator to the first element of row/column i. In case the storage order is set to rowMajor the function returns an iterator to the first element of row i, in case the storage flag is set to columnMajor the function returns an iterator to the first element of column i.

◆ canAlias()

template<typename Type , size_t M, size_t N, bool SO>
template<typename Other >
bool blaze::StaticMatrix< Type, M, N, SO >::canAlias ( const Other *  alias) const
inlinenoexcept

Returns whether the matrix can alias with the given address alias.

Parameters
aliasThe alias to be checked.
Returns
true in case the alias corresponds to this matrix, false if not.

This function returns whether the given address can alias with the matrix. In contrast to the isAliased() function this function is allowed to use compile time expressions to optimize the evaluation.

◆ capacity() [1/2]

template<typename Type , size_t M, size_t N, bool SO>
constexpr size_t blaze::StaticMatrix< Type, M, N, SO >::capacity ( )
inlinestaticnoexcept

Returns the maximum capacity of the matrix.

Returns
The capacity of the matrix.

◆ capacity() [2/2]

template<typename Type , size_t M, size_t N, bool SO>
size_t blaze::StaticMatrix< Type, M, N, SO >::capacity ( size_t  i) const
inlinenoexcept

Returns the current capacity of the specified row/column.

Parameters
iThe index of the row/column.
Returns
The current capacity of row/column i.

This function returns the current capacity of the specified row/column. In case the storage order is set to rowMajor the function returns the capacity of row i, in case the storage flag is set to columnMajor the function returns the capacity of column i.

◆ cbegin()

template<typename Type , size_t M, size_t N, bool SO>
constexpr StaticMatrix< Type, M, N, SO >::ConstIterator blaze::StaticMatrix< Type, M, N, SO >::cbegin ( size_t  i) const
inlinenoexcept

Returns an iterator to the first element of row/column i.

Parameters
iThe row/column index.
Returns
Iterator to the first element of row/column i.

This function returns a row/column iterator to the first element of row/column i. In case the storage order is set to rowMajor the function returns an iterator to the first element of row i, in case the storage flag is set to columnMajor the function returns an iterator to the first element of column i.

◆ cend()

template<typename Type , size_t M, size_t N, bool SO>
constexpr StaticMatrix< Type, M, N, SO >::ConstIterator blaze::StaticMatrix< Type, M, N, SO >::cend ( size_t  i) const
inlinenoexcept

Returns an iterator just past the last element of row/column i.

Parameters
iThe row/column index.
Returns
Iterator just past the last element of row/column i.

This function returns an row/column iterator just past the last element of row/column i. In case the storage order is set to rowMajor the function returns an iterator just past the last element of row i, in case the storage flag is set to columnMajor the function returns an iterator just past the last element of column i.

◆ columns()

template<typename Type , size_t M, size_t N, bool SO>
constexpr size_t blaze::StaticMatrix< Type, M, N, SO >::columns ( )
inlinestaticnoexcept

Returns the current number of columns of the matrix.

Returns
The number of columns of the matrix.

◆ ctranspose()

template<typename Type , size_t M, size_t N, bool SO>
StaticMatrix< Type, M, N, SO > & blaze::StaticMatrix< Type, M, N, SO >::ctranspose ( )
inline

In-place conjugate transpose of the matrix.

Returns
Reference to the transposed matrix.

This function transposes the static matrix in-place. Note that this function can only be used for square static matrices, i.e. if M is equal to N.

◆ data() [1/4]

template<typename Type , size_t M, size_t N, bool SO>
constexpr StaticMatrix< Type, M, N, SO >::Pointer blaze::StaticMatrix< Type, M, N, SO >::data ( )
inlinenoexcept

Low-level data access to the matrix elements.

Returns
Pointer to the internal element storage.

This function returns a pointer to the internal storage of the static matrix. Note that you can NOT assume that all matrix elements lie adjacent to each other! The static matrix may use techniques such as padding to improve the alignment of the data. Whereas the number of elements within a row/column are given by the rows() and columns() member functions, respectively, the total number of elements including padding is given by the spacing() member function.

◆ data() [2/4]

template<typename Type , size_t M, size_t N, bool SO>
constexpr StaticMatrix< Type, M, N, SO >::ConstPointer blaze::StaticMatrix< Type, M, N, SO >::data ( ) const
inlinenoexcept

Low-level data access to the matrix elements.

Returns
Pointer to the internal element storage.

This function returns a pointer to the internal storage of the static matrix. Note that you can NOT assume that all matrix elements lie adjacent to each other! The static matrix may use techniques such as padding to improve the alignment of the data. Whereas the number of elements within a row/column are given by the rows() and columns() member functions, respectively, the total number of elements including padding is given by the spacing() member function.

◆ data() [3/4]

template<typename Type , size_t M, size_t N, bool SO>
constexpr StaticMatrix< Type, M, N, SO >::Pointer blaze::StaticMatrix< Type, M, N, SO >::data ( size_t  i)
inlinenoexcept

Low-level data access to the matrix elements of row/column i.

Parameters
iThe row/column index.
Returns
Pointer to the internal element storage.

This function returns a pointer to the internal storage for the elements in row/column i.

◆ data() [4/4]

template<typename Type , size_t M, size_t N, bool SO>
constexpr StaticMatrix< Type, M, N, SO >::ConstPointer blaze::StaticMatrix< Type, M, N, SO >::data ( size_t  i) const
inlinenoexcept

Low-level data access to the matrix elements of row/column i.

Parameters
iThe row/column index.
Returns
Pointer to the internal element storage.

This function returns a pointer to the internal storage for the elements in row/column i.

◆ end() [1/2]

template<typename Type , size_t M, size_t N, bool SO>
constexpr StaticMatrix< Type, M, N, SO >::Iterator blaze::StaticMatrix< Type, M, N, SO >::end ( size_t  i)
inlinenoexcept

Returns an iterator just past the last element of row/column i.

Parameters
iThe row/column index.
Returns
Iterator just past the last element of row/column i.

This function returns an row/column iterator just past the last element of row/column i. In case the storage order is set to rowMajor the function returns an iterator just past the last element of row i, in case the storage flag is set to columnMajor the function returns an iterator just past the last element of column i.

◆ end() [2/2]

template<typename Type , size_t M, size_t N, bool SO>
constexpr StaticMatrix< Type, M, N, SO >::ConstIterator blaze::StaticMatrix< Type, M, N, SO >::end ( size_t  i) const
inlinenoexcept

Returns an iterator just past the last element of row/column i.

Parameters
iThe row/column index.
Returns
Iterator just past the last element of row/column i.

This function returns an row/column iterator just past the last element of row/column i. In case the storage order is set to rowMajor the function returns an iterator just past the last element of row i, in case the storage flag is set to columnMajor the function returns an iterator just past the last element of column i.

◆ isAliased()

template<typename Type , size_t M, size_t N, bool SO>
template<typename Other >
bool blaze::StaticMatrix< Type, M, N, SO >::isAliased ( const Other *  alias) const
inlinenoexcept

Returns whether the matrix is aliased with the given address alias.

Parameters
aliasThe alias to be checked.
Returns
true in case the alias corresponds to this matrix, false if not.

This function returns whether the given address is aliased with the matrix. In contrast to the canAlias() function this function is not allowed to use compile time expressions to optimize the evaluation.

◆ isAligned()

template<typename Type , size_t M, size_t N, bool SO>
constexpr bool blaze::StaticMatrix< Type, M, N, SO >::isAligned ( )
inlinestaticnoexcept

Returns whether the matrix is properly aligned in memory.

Returns
true in case the matrix is aligned, false if not.

This function returns whether the matrix is guaranteed to be properly aligned in memory, i.e. whether the beginning and the end of each row/column of the matrix are guaranteed to conform to the alignment restrictions of the element type Type.

◆ isIntact()

template<typename Type , size_t M, size_t N, bool SO>
constexpr bool blaze::StaticMatrix< Type, M, N, SO >::isIntact ( ) const
inlinenoexcept

Returns whether the invariants of the static matrix are intact.

Returns
true in case the static matrix's invariants are intact, false otherwise.

This function checks whether the invariants of the static matrix are intact, i.e. if its state is valid. In case the invariants are intact, the function returns true, else it will return false.

◆ load()

template<typename Type , size_t M, size_t N, bool SO>
BLAZE_ALWAYS_INLINE StaticMatrix< Type, M, N, SO >::SIMDType blaze::StaticMatrix< Type, M, N, SO >::load ( size_t  i,
size_t  j 
) const
noexcept

Load of a SIMD element of the matrix.

Parameters
iAccess index for the row. The index has to be in the range [0..M-1].
jAccess index for the column. The index has to be in the range [0..N-1].
Returns
The loaded SIMD element.

This function performs a load of a specific SIMD element of the dense matrix. The row index must be smaller than the number of rows and the column index must be smaller then the number of columns. Additionally, the column index (in case of a row-major matrix) or the row index (in case of a column-major matrix) must be a multiple of the number of values inside the SIMD element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ loada()

template<typename Type , size_t M, size_t N, bool SO>
BLAZE_ALWAYS_INLINE StaticMatrix< Type, M, N, SO >::SIMDType blaze::StaticMatrix< Type, M, N, SO >::loada ( size_t  i,
size_t  j 
) const
noexcept

Aligned load of a SIMD element of the matrix.

Parameters
iAccess index for the row. The index has to be in the range [0..M-1].
jAccess index for the column. The index has to be in the range [0..N-1].
Returns
The loaded SIMD element.

This function performs an aligned load of a specific SIMD element of the dense matrix. The row index must be smaller than the number of rows and the column index must be smaller than the number of columns. Additionally, the column index (in case of a row-major matrix) or the row index (in case of a column-major matrix) must be a multiple of the number of values inside the SIMD element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ loadu()

template<typename Type , size_t M, size_t N, bool SO>
BLAZE_ALWAYS_INLINE StaticMatrix< Type, M, N, SO >::SIMDType blaze::StaticMatrix< Type, M, N, SO >::loadu ( size_t  i,
size_t  j 
) const
noexcept

Unaligned load of a SIMD element of the matrix.

Parameters
iAccess index for the row. The index has to be in the range [0..M-1].
jAccess index for the column. The index has to be in the range [0..N-1].
Returns
The loaded SIMD element.

This function performs an unaligned load of a specific SIMD element of the dense matrix. The row index must be smaller than the number of rows and the column index must be smaller than the number of columns. Additionally, the column index (in case of a row-major matrix) or the row index (in case of a column-major matrix) must be a multiple of the number of values inside the SIMD element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ nonZeros() [1/2]

template<typename Type , size_t M, size_t N, bool SO>
size_t blaze::StaticMatrix< Type, M, N, SO >::nonZeros ( ) const
inline

Returns the total number of non-zero elements in the matrix.

Returns
The number of non-zero elements in the matrix.

◆ nonZeros() [2/2]

template<typename Type , size_t M, size_t N, bool SO>
size_t blaze::StaticMatrix< Type, M, N, SO >::nonZeros ( size_t  i) const
inline

Returns the number of non-zero elements in the specified row/column.

Parameters
iThe index of the row/column.
Returns
The number of non-zero elements of row/column i.

This function returns the current number of non-zero elements in the specified row/column. In case the storage order is set to rowMajor the function returns the number of non-zero elements in row i, in case the storage flag is set to columnMajor the function returns the number of non-zero elements in column i.

◆ operator delete() [1/2]

template<typename Type , size_t M, size_t N, bool SO>
void blaze::StaticMatrix< Type, M, N, SO >::operator delete ( void *  ptr)
inlinestatic

Class specific implementation of operator delete.

Parameters
ptrThe memory to be deallocated.
Returns
void

◆ operator delete() [2/2]

template<typename Type , size_t M, size_t N, bool SO>
void blaze::StaticMatrix< Type, M, N, SO >::operator delete ( void *  ptr,
const std::nothrow_t &   
)
inlinestatic

Class specific implementation of no-throw operator delete.

Parameters
ptrThe memory to be deallocated.
Returns
void

◆ operator delete[]() [1/2]

template<typename Type , size_t M, size_t N, bool SO>
void blaze::StaticMatrix< Type, M, N, SO >::operator delete[] ( void *  ptr)
inlinestatic

Class specific implementation of operator delete[].

Parameters
ptrThe memory to be deallocated.
Returns
void

◆ operator delete[]() [2/2]

template<typename Type , size_t M, size_t N, bool SO>
void blaze::StaticMatrix< Type, M, N, SO >::operator delete[] ( void *  ptr,
const std::nothrow_t &   
)
inlinestatic

Class specific implementation of no-throw operator delete[].

Parameters
ptrThe memory to be deallocated.
Returns
void

◆ operator new() [1/2]

template<typename Type , size_t M, size_t N, bool SO>
void * blaze::StaticMatrix< Type, M, N, SO >::operator new ( std::size_t  size)
inlinestatic

Class specific implementation of operator new.

Parameters
sizeThe total number of bytes to be allocated.
Returns
Pointer to the newly allocated memory.
Exceptions
std::bad_allocAllocation failed.

This class-specific implementation of operator new provides the functionality to allocate dynamic memory based on the alignment restrictions of the StaticMatrix class template.

◆ operator new() [2/2]

template<typename Type , size_t M, size_t N, bool SO>
void * blaze::StaticMatrix< Type, M, N, SO >::operator new ( std::size_t  size,
const std::nothrow_t &   
)
inlinestatic

Class specific implementation of the no-throw operator new.

Parameters
sizeThe total number of bytes to be allocated.
Returns
Pointer to the newly allocated memory.
Exceptions
std::bad_allocAllocation failed.

This class-specific implementation of operator new provides the functionality to allocate dynamic memory based on the alignment restrictions of the StaticMatrix class template.

◆ operator new[]() [1/2]

template<typename Type , size_t M, size_t N, bool SO>
void * blaze::StaticMatrix< Type, M, N, SO >::operator new[] ( std::size_t  size)
inlinestatic

Class specific implementation of operator new[].

Parameters
sizeThe total number of bytes to be allocated.
Returns
Pointer to the newly allocated memory.
Exceptions
std::bad_allocAllocation failed.

This class-specific implementation of operator new provides the functionality to allocate dynamic memory based on the alignment restrictions of the StaticMatrix class template.

◆ operator new[]() [2/2]

template<typename Type , size_t M, size_t N, bool SO>
void * blaze::StaticMatrix< Type, M, N, SO >::operator new[] ( std::size_t  size,
const std::nothrow_t &   
)
inlinestatic

Class specific implementation of the no-throw operator new[].

Parameters
sizeThe total number of bytes to be allocated.
Returns
Pointer to the newly allocated memory.
Exceptions
std::bad_allocAllocation failed.

This class-specific implementation of operator new provides the functionality to allocate dynamic memory based on the alignment restrictions of the StaticMatrix class template.

◆ operator%=()

template<typename Type, size_t M, size_t N, bool SO = defaultStorageOrder>
template<typename MT , bool SO2>
StaticMatrix<Type,M,N,SO>& blaze::StaticMatrix< Type, M, N, SO >::operator%= ( const Matrix< MT, SO2 > &  rhs)
inline

Schur product assignment operator for the multiplication of a matrix ( $ A\circ=B $).

Parameters
rhsThe right-hand side matrix for the Schur product.
Returns
Reference to the matrix.
Exceptions
std::invalid_argumentMatrix sizes do not match.

In case the current sizes of the two matrices don't match, a std::invalid_argument exception is thrown.

◆ operator()() [1/2]

template<typename Type , size_t M, size_t N, bool SO>
constexpr StaticMatrix< Type, M, N, SO >::Reference blaze::StaticMatrix< Type, M, N, SO >::operator() ( size_t  i,
size_t  j 
)
inlinenoexcept

2D-access to the matrix elements.

Parameters
iAccess index for the row. The index has to be in the range [0..M-1].
jAccess index for the column. The index has to be in the range [0..N-1].
Returns
Reference to the accessed value.

This function only performs an index check in case BLAZE_USER_ASSERT() is active. In contrast, the at() function is guaranteed to perform a check of the given access indices.

◆ operator()() [2/2]

template<typename Type , size_t M, size_t N, bool SO>
constexpr StaticMatrix< Type, M, N, SO >::ConstReference blaze::StaticMatrix< Type, M, N, SO >::operator() ( size_t  i,
size_t  j 
) const
inlinenoexcept

2D-access to the matrix elements.

Parameters
iAccess index for the row. The index has to be in the range [0..M-1].
jAccess index for the column. The index has to be in the range [0..N-1].
Returns
Reference-to-const to the accessed value.

This function only performs an index check in case BLAZE_USER_ASSERT() is active. In contrast, the at() function is guaranteed to perform a check of the given access indices.

◆ operator+=()

template<typename Type, size_t M, size_t N, bool SO = defaultStorageOrder>
template<typename MT , bool SO2>
StaticMatrix<Type,M,N,SO>& blaze::StaticMatrix< Type, M, N, SO >::operator+= ( const Matrix< MT, SO2 > &  rhs)
inline

Addition assignment operator for the addition of a matrix ( $ A+=B $).

Parameters
rhsThe right-hand side matrix to be added to the matrix.
Returns
Reference to the matrix.
Exceptions
std::invalid_argumentMatrix sizes do not match.

In case the current sizes of the two matrices don't match, a std::invalid_argument exception is thrown.

◆ operator-=()

template<typename Type, size_t M, size_t N, bool SO = defaultStorageOrder>
template<typename MT , bool SO2>
StaticMatrix<Type,M,N,SO>& blaze::StaticMatrix< Type, M, N, SO >::operator-= ( const Matrix< MT, SO2 > &  rhs)
inline

Subtraction assignment operator for the subtraction of a matrix ( $ A-=B $).

Parameters
rhsThe right-hand side matrix to be subtracted from the matrix.
Returns
Reference to the matrix.
Exceptions
std::invalid_argumentMatrix sizes do not match.

In case the current sizes of the two matrices don't match, a std::invalid_argument exception is thrown.

◆ operator=() [1/6]

template<typename Type , size_t M, size_t N, bool SO>
constexpr StaticMatrix< Type, M, N, SO > & blaze::StaticMatrix< Type, M, N, SO >::operator= ( const Type &  set)
inline

Homogenous assignment to all matrix elements.

Parameters
setScalar value to be assigned to all matrix elements.
Returns
Reference to the assigned matrix.

◆ operator=() [2/6]

template<typename Type , size_t M, size_t N, bool SO>
constexpr StaticMatrix< Type, M, N, SO > & blaze::StaticMatrix< Type, M, N, SO >::operator= ( initializer_list< initializer_list< Type > >  list)
inline

List assignment to all matrix elements.

Parameters
listThe initializer list.
Exceptions
std::invalid_argumentInvalid assignment to static matrix.

This assignment operator offers the option to directly assign to all elements of the matrix by means of an initializer list:

A = { { 1, 2, 3 },
{ 4, 5 },
{ 7, 8, 9 } };

The matrix elements are (copy) assigned the values from the given initializer list. Missing values are initialized as default (as e.g. the value 6 in the example). Note that in case the size of the top-level initializer list does not match the number of rows of the matrix or the size of any nested list exceeds the number of columns, a std::invalid_argument exception is thrown.

◆ operator=() [3/6]

template<typename Type , size_t M, size_t N, bool SO>
constexpr StaticMatrix< Type, M, N, SO > & blaze::StaticMatrix< Type, M, N, SO >::operator= ( const StaticMatrix< Type, M, N, SO > &  rhs)
inline

Copy assignment operator for StaticMatrix.

Parameters
rhsMatrix to be copied.
Returns
Reference to the assigned matrix.

Explicit definition of a copy assignment operator for performance reasons.

◆ operator=() [4/6]

template<typename Type, size_t M, size_t N, bool SO = defaultStorageOrder>
template<typename Other , size_t Rows, size_t Cols>
StaticMatrix<Type,M,N,SO>& blaze::StaticMatrix< Type, M, N, SO >::operator= ( const Other(&)  array[Rows][Cols])
inline

Array assignment to all matrix elements.

Parameters
array$ M \times N $ dimensional array for the assignment.
Returns
Reference to the assigned matrix.

This assignment operator offers the option to directly set all elements of the matrix:

const int init[3][3] = { { 1, 2, 3 },
{ 4, 5 },
{ 7, 8, 9 } };
A = init;

The matrix is assigned the values from the given array. Missing values are initialized with default values (as e.g. the value 6 in the example).

◆ operator=() [5/6]

template<typename Type, size_t M, size_t N, bool SO = defaultStorageOrder>
template<typename Other , bool SO2>
StaticMatrix<Type,M,N,SO>& blaze::StaticMatrix< Type, M, N, SO >::operator= ( const StaticMatrix< Other, M, N, SO2 > &  rhs)
inline

Assignment operator for different StaticMatrix instances.

Parameters
rhsMatrix to be copied.
Returns
Reference to the assigned matrix.

◆ operator=() [6/6]

template<typename Type, size_t M, size_t N, bool SO = defaultStorageOrder>
template<typename MT , bool SO2>
StaticMatrix<Type,M,N,SO>& blaze::StaticMatrix< Type, M, N, SO >::operator= ( const Matrix< MT, SO2 > &  rhs)
inline

Assignment operator for different matrices.

Parameters
rhsMatrix to be copied.
Returns
Reference to the assigned matrix.
Exceptions
std::invalid_argumentInvalid assignment to static matrix.

This constructor initializes the matrix as a copy of the given matrix. In case the number of rows of the given matrix is not M or the number of columns is not N, a std::invalid_argument exception is thrown.

◆ operator~() [1/2]

template<typename MT, bool SO>
BLAZE_ALWAYS_INLINE constexpr MatrixType& blaze::Matrix< MT, SO >::operator~ ( )
inlinenoexceptinherited

Conversion operator for non-constant matrices.

Returns
Reference of the actual type of the matrix.

◆ operator~() [2/2]

template<typename MT, bool SO>
BLAZE_ALWAYS_INLINE constexpr const MatrixType& blaze::Matrix< MT, SO >::operator~ ( ) const
inlinenoexceptinherited

Conversion operator for constant matrices.

Returns
Constant reference of the actual type of the matrix.

◆ reset() [1/2]

template<typename Type , size_t M, size_t N, bool SO>
constexpr void blaze::StaticMatrix< Type, M, N, SO >::reset ( )
inline

Reset to the default initial values.

Returns
void

◆ reset() [2/2]

template<typename Type , size_t M, size_t N, bool SO>
void blaze::StaticMatrix< Type, M, N, SO >::reset ( size_t  i)
inline

Reset the specified row/column to the default initial values.

Parameters
iThe index of the row/column.
Returns
void

This function resets the values in the specified row/column to their default value. In case the storage order is set to rowMajor the function resets the values in row i, in case the storage order is set to columnMajor the function resets the values in column i. Note that the capacity of the row/column remains unchanged.

◆ rows()

template<typename Type , size_t M, size_t N, bool SO>
constexpr size_t blaze::StaticMatrix< Type, M, N, SO >::rows ( )
inlinestaticnoexcept

Returns the current number of rows of the matrix.

Returns
The number of rows of the matrix.

◆ scale()

template<typename Type, size_t M, size_t N, bool SO = defaultStorageOrder>
template<typename Other >
StaticMatrix<Type,M,N,SO>& blaze::StaticMatrix< Type, M, N, SO >::scale ( const Other &  scalar)
inline

Scaling of the matrix by the scalar value scalar ( $ A*=s $).

Parameters
scalarThe scalar value for the matrix scaling.
Returns
Reference to the matrix.

This function scales the matrix by applying the given scalar value scalar to each element of the matrix. For built-in and complex data types it has the same effect as using the multiplication assignment operator:

// ... Initialization
A *= 4; // Scaling of the matrix
A.scale( 4 ); // Same effect as above

◆ schurAssign() [1/3]

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT , bool SO2>
auto blaze::StaticMatrix< Type, M, N, SO >::schurAssign ( const DenseMatrix< MT, SO2 > &  rhs) -> DisableIf_t< VectorizedSchurAssign_v<MT> >
inline

Default implementation of the Schur product assignment of a dense matrix.

SIMD optimized implementation of the Schur product assignment of a dense matrix.

Parameters
rhsThe right-hand side dense matrix for the Schur product.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

◆ schurAssign() [2/3]

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT >
void blaze::StaticMatrix< Type, M, N, SO >::schurAssign ( const SparseMatrix< MT, SO > &  rhs)
inline

Default implementation of the Schur product assignment of a row-major sparse matrix.

Parameters
rhsThe right-hand side sparse matrix for the Schur product.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

◆ schurAssign() [3/3]

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT >
void blaze::StaticMatrix< Type, M, N, SO >::schurAssign ( const SparseMatrix< MT,!SO > &  rhs)
inline

Default implementation of the Schur product assignment of a column-major sparse matrix.

Parameters
rhsThe right-hand side sparse matrix for the Schur product.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

◆ spacing()

template<typename Type , size_t M, size_t N, bool SO>
constexpr size_t blaze::StaticMatrix< Type, M, N, SO >::spacing ( )
inlinestaticnoexcept

Returns the spacing between the beginning of two rows.

Returns
The spacing between the beginning of two rows.

This function returns the spacing between the beginning of two rows, i.e. the total number of elements of a row.

◆ store()

template<typename Type , size_t M, size_t N, bool SO>
BLAZE_ALWAYS_INLINE void blaze::StaticMatrix< Type, M, N, SO >::store ( size_t  i,
size_t  j,
const SIMDType value 
)
noexcept

Store of a SIMD element of the matrix.

Parameters
iAccess index for the row. The index has to be in the range [0..M-1].
jAccess index for the column. The index has to be in the range [0..N-1].
valueThe SIMD element to be stored.
Returns
void

This function performs a store of a specific SIMD element of the dense matrix. The row index must be smaller than the number of rows and the column index must be smaller than the number of columns. Additionally, the column index (in case of a row-major matrix) or the row index (in case of a column-major matrix) must be a multiple of the number of values inside the SIMD element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ storea()

template<typename Type , size_t M, size_t N, bool SO>
BLAZE_ALWAYS_INLINE void blaze::StaticMatrix< Type, M, N, SO >::storea ( size_t  i,
size_t  j,
const SIMDType value 
)
noexcept

Aligned store of a SIMD element of the matrix.

Parameters
iAccess index for the row. The index has to be in the range [0..M-1].
jAccess index for the column. The index has to be in the range [0..N-1].
valueThe SIMD element to be stored.
Returns
void

This function performs an aligned store of a specific SIMD element of the dense matrix. The row index must be smaller than the number of rows and the column index must be smaller than the number of columns. Additionally, the column index (in case of a row-major matrix) or the row index (in case of a column-major matrix) must be a multiple of the number of values inside the SIMD element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ storeu()

template<typename Type , size_t M, size_t N, bool SO>
BLAZE_ALWAYS_INLINE void blaze::StaticMatrix< Type, M, N, SO >::storeu ( size_t  i,
size_t  j,
const SIMDType value 
)
noexcept

Unaligned store of a SIMD element of the matrix.

Parameters
iAccess index for the row. The index has to be in the range [0..M-1].
jAccess index for the column. The index has to be in the range [0..N-1].
valueThe SIMD element to be stored.
Returns
void

This function performs an unaligned store of a specific SIMD element of the dense matrix. The row index must be smaller than the number of rows and the column index must be smaller than the number of columns. Additionally, the column index (in case of a row-major matrix) or the row index (in case of a column-major matrix) must be a multiple of the number of values inside the SIMD element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ stream()

template<typename Type , size_t M, size_t N, bool SO>
BLAZE_ALWAYS_INLINE void blaze::StaticMatrix< Type, M, N, SO >::stream ( size_t  i,
size_t  j,
const SIMDType value 
)
noexcept

Aligned, non-temporal store of a SIMD element of the matrix.

Parameters
iAccess index for the row. The index has to be in the range [0..M-1].
jAccess index for the column. The index has to be in the range [0..N-1].
valueThe SIMD element to be stored.
Returns
void

This function performs an aligned, non-temporal store of a specific SIMD element of the dense matrix. The row index must be smaller than the number of rows and the column index must be smaller than the number of columns. Additionally, the column index (in case of a row-major matrix) or the row index (in case of a column-major matrix) must be a multiple of the number of values inside the SIMD element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ subAssign() [1/3]

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT , bool SO2>
auto blaze::StaticMatrix< Type, M, N, SO >::subAssign ( const DenseMatrix< MT, SO2 > &  rhs) -> DisableIf_t< VectorizedSubAssign_v<MT> >
inline

Default implementation of the subtraction assignment of a dense matrix.

SIMD optimized implementation of the subtraction assignment of a dense matrix.

Parameters
rhsThe right-hand side dense matrix to be subtracted.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

◆ subAssign() [2/3]

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT >
void blaze::StaticMatrix< Type, M, N, SO >::subAssign ( const SparseMatrix< MT, SO > &  rhs)
inline

Default implementation of the subtraction assignment of a row-major sparse matrix.

Parameters
rhsThe right-hand side sparse matrix to be subtracted.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

◆ subAssign() [3/3]

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT >
void blaze::StaticMatrix< Type, M, N, SO >::subAssign ( const SparseMatrix< MT,!SO > &  rhs)
inline

Default implementation of the subtraction assignment of a column-major sparse matrix.

Parameters
rhsThe right-hand side sparse matrix to be subtracted.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

◆ swap()

template<typename Type , size_t M, size_t N, bool SO>
void blaze::StaticMatrix< Type, M, N, SO >::swap ( StaticMatrix< Type, M, N, SO > &  m)
inlinenoexcept

Swapping the contents of two static matrices.

Parameters
mThe matrix to be swapped.
Returns
void

◆ transpose()

template<typename Type , size_t M, size_t N, bool SO>
StaticMatrix< Type, M, N, SO > & blaze::StaticMatrix< Type, M, N, SO >::transpose ( )
inline

In-place transpose of the matrix.

Returns
Reference to the transposed matrix.

This function transposes the static matrix in-place. Note that this function can only be used for square static matrices, i.e. if M is equal to N.

Member Data Documentation

◆ Alignment

template<typename Type, size_t M, size_t N, bool SO = defaultStorageOrder>
constexpr size_t blaze::StaticMatrix< Type, M, N, SO >::Alignment
staticprivate
Initial value:
=
( align ? AlignmentOf_v<Type> : std::alignment_of<Type>::value )

Alignment of the data elements.

◆ simdEnabled

template<typename Type, size_t M, size_t N, bool SO = defaultStorageOrder>
constexpr bool blaze::StaticMatrix< Type, M, N, SO >::simdEnabled = IsVectorizable_v<Type>
static

Compilation flag for SIMD optimization.

The simdEnabled compilation flag indicates whether expressions the matrix is involved in can be optimized via SIMD operations. In case the element type of the matrix is a vectorizable data type, the simdEnabled compilation flag is set to true, otherwise it is set to false.

◆ smpAssignable

template<typename Type, size_t M, size_t N, bool SO = defaultStorageOrder>
constexpr bool blaze::StaticMatrix< Type, M, N, SO >::smpAssignable = false
static

Compilation flag for SMP assignments.

The smpAssignable compilation flag indicates whether the matrix can be used in SMP (shared memory parallel) assignments (both on the left-hand and right-hand side of the assignment).

◆ v_

template<typename Type, size_t M, size_t N, bool SO = defaultStorageOrder>
AlignedStorage blaze::StaticMatrix< Type, M, N, SO >::v_
private

The statically allocated matrix elements.

Access to the matrix elements is gained via the function call operator. In case of row-major order the memory layout of the elements is

\[\left(\begin{array}{*{5}{c}} 0 & 1 & 2 & \cdots & N-1 \\ N & N+1 & N+2 & \cdots & 2 \cdot N-1 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ M \cdot N-N & M \cdot N-N+1 & M \cdot N-N+2 & \cdots & M \cdot N-1 \\ \end{array}\right)\]

.


The documentation for this class was generated from the following files: