All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Private Types | List of all members
blaze::HybridMatrix< typename, size_t, size_t, bool > Class Template Reference

Efficient implementation of a dynamically sized matrix with static memory.The HybridMatrix class template combines the flexibility of a dynamically sized matrix with the efficiency and performance of a fixed-size matrix. It is implemented as a crossing between the blaze::StaticMatrix and the blaze::DynamicMatrix class templates: Similar to the static matrix it uses static stack memory instead of dynamically allocated memory and similar to the dynamic matrix it can be resized (within the extend of the static memory). The type of the elements, the maximum number of rows and columns and the storage order of the matrix can be specified via the four template parameters: More...

#include <HybridMatrix.h>

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

Classes

struct  Rebind
 Rebind mechanism to obtain a HybridMatrix with different data/element type. More...
 

Public Types

enum  { vectorizable = IsVectorizable<Type>::value }
 Compilation flag for intrinsic optimization. More...
 
enum  { smpAssignable = 0 }
 Compilation flag for SMP assignments. More...
 
typedef HybridMatrix< Type, M,
N, SO > 
This
 Type of this HybridMatrix instance.
 
typedef This ResultType
 Result type for expression template evaluations.
 
typedef HybridMatrix< Type, M,
N,!SO > 
OppositeType
 Result type with opposite storage order for expression template evaluations.
 
typedef HybridMatrix< Type, N,
M,!SO > 
TransposeType
 Transpose type for expression template evaluations.
 
typedef Type ElementType
 Type of the matrix elements.
 
typedef IT::Type IntrinsicType
 Intrinsic type of the matrix elements.
 
typedef const Type & ReturnType
 Return type for expression template evaluations.
 
typedef const ThisCompositeType
 Data type for composite expression templates.
 
typedef Type & Reference
 Reference to a non-constant matrix value.
 
typedef const Type & ConstReference
 Reference to a constant matrix value.
 
typedef Type * Pointer
 Pointer to a non-constant matrix value.
 
typedef const Type * ConstPointer
 Pointer to a constant matrix value.
 
typedef DenseIterator< Type > Iterator
 Iterator over non-constant elements.
 
typedef DenseIterator< const Type > ConstIterator
 Iterator over constant elements.
 
typedef MT MatrixType
 Type of the matrix.
 

Public Member Functions

template<typename Other , size_t M2, size_t N2>
HybridMatrix< Type, M, N, SO > & operator= (const Other(&array)[M2][N2])
 Array assignment to all matrix elements. More...
 
template<typename MT , bool SO2>
HybridMatrix< Type, M, N, SO > & operator= (const Matrix< MT, SO2 > &rhs)
 Assignment operator for different matrices. More...
 
template<typename MT , bool SO2>
HybridMatrix< 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>
HybridMatrix< 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>
HybridMatrix< Type, M, N, SO > & operator*= (const Matrix< MT, SO2 > &rhs)
 Multiplication assignment operator for the multiplication of a matrix ( $ A*=B $). More...
 
template<typename Other >
EnableIf< IsNumeric< Other >
, HybridMatrix< Type, M, N, SO >
>::Type & 
operator*= (Other rhs)
 Multiplication assignment operator for the multiplication between a matrix and a scalar value ( $ A*=s $). More...
 
template<typename Other >
EnableIf< IsNumeric< Other >
, HybridMatrix< Type, M, N, SO >
>::Type & 
operator/= (Other rhs)
 Division assignment operator for the division of a matrix by a scalar value ( $ A/=s $). More...
 
template<typename Other >
HybridMatrix< Type, M, N, SO > & scale (const Other &scalar)
 Scaling of the matrix by the scalar value scalar ( $ A*=s $). More...
 
template<typename MT , bool SO2>
DisableIf< typename
HybridMatrix< Type, M, N, SO >
::BLAZE_TEMPLATE
VectorizedAssign< MT > >::Type 
assign (const DenseMatrix< MT, SO2 > &rhs)
 Default implementation of the assignment of a dense matrix. More...
 
template<typename MT , bool SO2>
EnableIf< typename
HybridMatrix< Type, M, N, SO >
::BLAZE_TEMPLATE
VectorizedAssign< MT > >::Type 
assign (const DenseMatrix< MT, SO2 > &rhs)
 Intrinsic optimized implementation of the assignment of a dense matrix. More...
 
template<typename MT , bool SO2>
DisableIf< typename
HybridMatrix< Type, M, N, SO >
::BLAZE_TEMPLATE
VectorizedAddAssign< MT >
>::Type 
addAssign (const DenseMatrix< MT, SO2 > &rhs)
 Default implementation of the addition assignment of a row-major dense matrix. More...
 
template<typename MT , bool SO2>
EnableIf< typename
HybridMatrix< Type, M, N, SO >
::BLAZE_TEMPLATE
VectorizedAddAssign< MT >
>::Type 
addAssign (const DenseMatrix< MT, SO2 > &rhs)
 Intrinsic optimized implementation of the addition assignment of a dense matrix. More...
 
template<typename MT , bool SO2>
DisableIf< typename
HybridMatrix< Type, M, N, SO >
::BLAZE_TEMPLATE
VectorizedSubAssign< MT >
>::Type 
subAssign (const DenseMatrix< MT, SO2 > &rhs)
 Default implementation of the subtraction assignment of a dense matrix. More...
 
template<typename MT , bool SO2>
EnableIf< typename
HybridMatrix< Type, M, N, SO >
::BLAZE_TEMPLATE
VectorizedSubAssign< MT >
>::Type 
subAssign (const DenseMatrix< MT, SO2 > &rhs)
 Intrinsic optimized implementation of the subtraction assignment of a dense matrix. More...
 
BLAZE_ALWAYS_INLINE MatrixTypeoperator~ ()
 Conversion operator for non-constant matrices. More...
 
BLAZE_ALWAYS_INLINE const
MatrixType
operator~ () const
 Conversion operator for constant matrices. More...
 
Constructors
 HybridMatrix ()
 The default constructor for HybridMatrix. More...
 
 HybridMatrix (size_t m, size_t n)
 Constructor for a matrix of size $ m \times n $. No element initialization is performed! More...
 
 HybridMatrix (size_t m, size_t n, const Type &init)
 Constructor for a homogenous initialization of all $ m \times n $ matrix elements. More...
 
template<typename Other >
 HybridMatrix (size_t m, size_t n, const Other *array)
 Array initialization of all matrix elements. More...
 
template<typename Other , size_t M2, size_t N2>
 HybridMatrix (const Other(&array)[M2][N2])
 Array initialization of all matrix elements. More...
 
 HybridMatrix (const HybridMatrix &m)
 The copy constructor for HybridMatrix. More...
 
template<typename MT , bool SO2>
 HybridMatrix (const Matrix< MT, SO2 > &m)
 Conversion constructor from different matrices. More...
 
Data access functions
Reference operator() (size_t i, size_t j)
 2D-access to the matrix elements. More...
 
ConstReference operator() (size_t i, size_t j) const
 2D-access to the matrix elements. More...
 
Pointer data ()
 Low-level data access to the matrix elements. More...
 
ConstPointer data () const
 Low-level data access to the matrix elements. More...
 
Pointer data (size_t i)
 Low-level data access to the matrix elements of row/column i. More...
 
ConstPointer data (size_t i) const
 Low-level data access to the matrix elements of row/column i. More...
 
Iterator begin (size_t i)
 Returns an iterator to the first element of row/column i. More...
 
ConstIterator begin (size_t i) const
 Returns an iterator to the first element of row/column i. More...
 
ConstIterator cbegin (size_t i) const
 Returns an iterator to the first element of row/column i. More...
 
Iterator end (size_t i)
 Returns an iterator just past the last element of row/column i. More...
 
ConstIterator end (size_t i) const
 Returns an iterator just past the last element of row/column i. More...
 
ConstIterator cend (size_t i) const
 Returns an iterator just past the last element of row/column i. More...
 
Assignment operators
template<typename Other , size_t M2, size_t N2>
HybridMatrixoperator= (const Other(&array)[M2][N2])
 
HybridMatrixoperator= (const Type &set)
 Homogenous assignment to all matrix elements. More...
 
HybridMatrixoperator= (const HybridMatrix &rhs)
 Copy assignment operator for HybridMatrix. More...
 
template<typename MT , bool SO2>
HybridMatrixoperator= (const Matrix< MT, SO2 > &rhs)
 
template<typename MT , bool SO2>
HybridMatrixoperator+= (const Matrix< MT, SO2 > &rhs)
 
template<typename MT , bool SO2>
HybridMatrixoperator-= (const Matrix< MT, SO2 > &rhs)
 
template<typename MT , bool SO2>
HybridMatrixoperator*= (const Matrix< MT, SO2 > &rhs)
 
template<typename Other >
EnableIf< IsNumeric< Other >
, HybridMatrix >::Type & 
operator*= (Other rhs)
 
template<typename Other >
EnableIf< IsNumeric< Other >
, HybridMatrix >::Type & 
operator/= (Other rhs)
 
Utility functions
size_t rows () const
 Returns the current number of rows of the matrix. More...
 
size_t columns () const
 Returns the current number of columns of the matrix. More...
 
size_t spacing () const
 Returns the spacing between the beginning of two rows. More...
 
size_t capacity () const
 Returns the maximum capacity of the matrix. More...
 
size_t capacity (size_t i) const
 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...
 
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 clear ()
 Clearing the hybrid matrix. More...
 
void resize (size_t m, size_t n, bool preserve=true)
 Changing the size of the matrix. More...
 
void extend (size_t m, size_t n, bool preserve=true)
 Extending the size of the matrix. More...
 
HybridMatrixtranspose ()
 Transposing the matrix. More...
 
template<typename Other >
HybridMatrixscale (const Other &scalar)
 
void swap (HybridMatrix &m)
 Swapping the contents of two hybrid matrices. More...
 
Expression template evaluation functions
template<typename Other >
bool canAlias (const Other *alias) const
 Returns whether the matrix can alias with the given address alias. More...
 
template<typename Other >
bool isAliased (const Other *alias) const
 Returns whether the matrix is aliased with the given address alias. More...
 
bool isAligned () const
 Returns whether the matrix is properly aligned in memory. More...
 
IntrinsicType load (size_t i, size_t j) const
 Aligned load of an intrinsic element of the matrix. More...
 
IntrinsicType loadu (size_t i, size_t j) const
 Unaligned load of an intrinsic element of the matrix. More...
 
void store (size_t i, size_t j, const IntrinsicType &value)
 Aligned store of an intrinsic element of the matrix. More...
 
void storeu (size_t i, size_t j, const IntrinsicType &value)
 Unaligned store of an intrinsic element of the matrix. More...
 
void stream (size_t i, size_t j, const IntrinsicType &value)
 Aligned, non-temporal store of an intrinsic element of the matrix. More...
 
template<typename MT , bool SO2>
DisableIf< VectorizedAssign
< MT > >::Type 
assign (const DenseMatrix< MT, SO2 > &rhs)
 
template<typename MT , bool SO2>
EnableIf< VectorizedAssign< MT >
>::Type 
assign (const DenseMatrix< MT, SO2 > &rhs)
 
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>
DisableIf< VectorizedAddAssign
< MT > >::Type 
addAssign (const DenseMatrix< MT, SO2 > &rhs)
 
template<typename MT , bool SO2>
EnableIf< VectorizedAddAssign
< MT > >::Type 
addAssign (const DenseMatrix< MT, SO2 > &rhs)
 
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>
DisableIf< VectorizedSubAssign
< MT > >::Type 
subAssign (const DenseMatrix< MT, SO2 > &rhs)
 
template<typename MT , bool SO2>
EnableIf< VectorizedSubAssign
< MT > >::Type 
subAssign (const DenseMatrix< MT, SO2 > &rhs)
 
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...
 

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...
 

Private Types

enum  { NN = N + ( IT::size - ( N % IT::size ) ) % IT::size }
 Alignment adjustment.
 
typedef IntrinsicTrait< Type > IT
 Intrinsic trait for the matrix element type.
 

Private Attributes

Member variables
AlignedArray< Type, M *NN > v_
 The statically allocated matrix elements. More...
 
size_t m_
 The current number of rows of the matrix.
 
size_t n_
 The current number of columns of the matrix.
 

Detailed Description

template<typename, size_t, size_t, bool>
class blaze::HybridMatrix< typename, size_t, size_t, bool >

Efficient implementation of a dynamically sized matrix with static memory.

The HybridMatrix class template combines the flexibility of a dynamically sized matrix with the efficiency and performance of a fixed-size matrix. It is implemented as a crossing between the blaze::StaticMatrix and the blaze::DynamicMatrix class templates: Similar to the static matrix it uses static stack memory instead of dynamically allocated memory and similar to the dynamic matrix it can be resized (within the extend of the static memory). The type of the elements, the maximum 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 HybridMatrix is very natural and intuitive. All operations (addition, subtraction, multiplication, scaling, ...) can be performed on all possible combination of row-major and column-major dense and sparse matrices with fitting element types. The following example gives an impression of the use of HybridMatrix:

HybridMatrix<double,rowMajor> A( 2, 3 ); // 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
HybridMatrix<float,columnMajor> B( 2, 3 ); // 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
HybridMatrix<float> D( 3, 2, 4.0F ); // Directly, homogeneously initialized single precision 3x2 matrix
HybridMatrix<double,rowMajor> E( A ); // Creation of a new row-major matrix as a copy of A
HybridMatrix<double,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
F = D * 2.0; // Scaling of matrix D
E += A - B; // Addition assignment
F -= A + C; // Subtraction assignment
F *= A * D; // Multiplication assignment

Member Enumeration Documentation

template<typename , size_t , size_t , bool >
anonymous enum

Compilation flag for intrinsic optimization.

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

template<typename , size_t , size_t , bool >
anonymous enum

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).

Constructor & Destructor Documentation

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

The default constructor for HybridMatrix.

The size of a default constructed HybridMatrix is initially set to 0.

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

Constructor for a matrix of size $ m \times n $. No element initialization is performed!

Parameters
mThe number of rows of the matrix.
nThe number of columns of the matrix.
Exceptions
std::invalid_argumentInvalid number of rows for hybrid matrix.
std::invalid_argumentInvalid number of columns for hybrid matrix.

This constructor creates a hybrid matrix of size $ m \times n $, but leaves the elements uninitialized. In case m is larger than the maximum allowed number of rows (i.e. m > M) or n is larger than the maximum allowed number of columns a std::invalid_argument exception is thrown.

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

Constructor for a homogenous initialization of all $ m \times n $ matrix elements.

Parameters
mThe number of rows of the matrix.
nThe number of columns of the matrix.
initThe initial value of the matrix elements.
Exceptions
std::invalid_argumentInvalid number of rows for hybrid matrix.
std::invalid_argumentInvalid number of columns for hybrid matrix.

This constructor creates a hybrid matrix of size $ m \times n $ and initializes all matrix elements with the specified value. In case m is larger than the maximum allowed number of rows (i.e. m > M) or n is larger than the maximum allowed number of columns a std::invalid_argument exception is thrown.

template<typename Type , size_t M, size_t N, bool SO>
template<typename Other >
blaze::HybridMatrix< Type, M, N, SO >::HybridMatrix ( 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.
Exceptions
std::invalid_argumentInvalid number of rows for hybrid matrix.
std::invalid_argumentInvalid number of columns for hybrid matrix.

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

int* array = new int[20];
// ... Initialization of the dynamic array
blaze::HybridMatrix<int,rowMajor> v( 4UL, 5UL, array );
delete[] array;

The matrix is sized accoring to the given size of the array and initialized with the values from the given array. In case m is larger than the maximum allowed number of rows (i.e. m > M) or n is larger than the maximum allowed number of columns 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!

template<typename Type , size_t M, size_t N, bool SO>
template<typename Other , size_t M2, size_t N2>
blaze::HybridMatrix< Type, M, N, SO >::HybridMatrix ( const Other(&)  array[M2][N2])
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 sized accoring to the size of the array and initialized with the values from the given array. Missing values are initialized with default values (as e.g. the value 6 in the example).

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

The copy constructor for HybridMatrix.

Parameters
mMatrix to be copied.

The copy constructor is explicitly defined due to the required dynamic memory management and in order to enable/facilitate NRV optimization.

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

Conversion constructor from different matrices.

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

Member Function Documentation

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT >
void blaze::HybridMatrix< 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.

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT >
void blaze::HybridMatrix< 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.

template<typename , size_t , size_t , bool >
template<typename MT , bool SO2>
DisableIf< typename HybridMatrix<Type,M,N,SO>::BLAZE_TEMPLATE VectorizedAddAssign<MT> >::Type blaze::HybridMatrix< typename, size_t, size_t, bool >::addAssign ( const DenseMatrix< MT, SO2 > &  rhs)
inline

Default implementation of the addition assignment of a row-major 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.

template<typename , size_t , size_t , bool >
template<typename MT , bool SO2>
EnableIf< typename HybridMatrix<Type,M,N,SO>::BLAZE_TEMPLATE VectorizedAddAssign<MT> >::Type blaze::HybridMatrix< typename, size_t, size_t, bool >::addAssign ( const DenseMatrix< MT, SO2 > &  rhs)
inline

Intrinsic 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.

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT >
void blaze::HybridMatrix< 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.

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT >
void blaze::HybridMatrix< 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.

template<typename , size_t , size_t , bool >
template<typename MT , bool SO2>
DisableIf< typename HybridMatrix<Type,M,N,SO>::BLAZE_TEMPLATE VectorizedAssign<MT> >::Type blaze::HybridMatrix< typename, size_t, size_t, bool >::assign ( const DenseMatrix< MT, SO2 > &  rhs)
inline

Default 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.

template<typename , size_t , size_t , bool >
template<typename MT , bool SO2>
EnableIf< typename HybridMatrix<Type,M,N,SO>::BLAZE_TEMPLATE VectorizedAssign<MT> >::Type blaze::HybridMatrix< typename, size_t, size_t, bool >::assign ( const DenseMatrix< MT, SO2 > &  rhs)
inline

Intrinsic 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.

template<typename Type , size_t M, size_t N, bool SO>
HybridMatrix< Type, M, N, SO >::Iterator blaze::HybridMatrix< Type, M, N, SO >::begin ( size_t  i)
inline

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.

template<typename Type , size_t M, size_t N, bool SO>
HybridMatrix< Type, M, N, SO >::ConstIterator blaze::HybridMatrix< Type, M, N, SO >::begin ( size_t  i) const
inline

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.

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

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.

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

Returns the maximum capacity of the matrix.

Returns
The capacity of the matrix.
template<typename Type , size_t M, size_t N, bool SO>
size_t blaze::HybridMatrix< Type, M, N, SO >::capacity ( size_t  i) const
inline

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.

template<typename Type , size_t M, size_t N, bool SO>
HybridMatrix< Type, M, N, SO >::ConstIterator blaze::HybridMatrix< Type, M, N, SO >::cbegin ( size_t  i) const
inline

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.

template<typename Type , size_t M, size_t N, bool SO>
HybridMatrix< Type, M, N, SO >::ConstIterator blaze::HybridMatrix< Type, M, N, SO >::cend ( size_t  i) const
inline

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.

template<typename Type , size_t M, size_t N, bool SO>
void blaze::HybridMatrix< Type, M, N, SO >::clear ( )
inline

Clearing the hybrid matrix.

Returns
void

After the clear() function, the size of the matrix is 0.

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

Returns the current number of columns of the matrix.

Returns
The number of columns of the matrix.
template<typename Type , size_t M, size_t N, bool SO>
HybridMatrix< Type, M, N, SO >::Pointer blaze::HybridMatrix< Type, M, N, SO >::data ( )
inline

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 hybrid matrix. Note that you can NOT assume that all matrix elements lie adjacent to each other! The hybrid 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.

template<typename Type , size_t M, size_t N, bool SO>
HybridMatrix< Type, M, N, SO >::ConstPointer blaze::HybridMatrix< Type, M, N, SO >::data ( ) const
inline

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 hybrid matrix. Note that you can NOT assume that all matrix elements lie adjacent to each other! The hybrid 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.

template<typename Type , size_t M, size_t N, bool SO>
HybridMatrix< Type, M, N, SO >::Pointer blaze::HybridMatrix< Type, M, N, SO >::data ( size_t  i)
inline

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.

template<typename Type , size_t M, size_t N, bool SO>
HybridMatrix< Type, M, N, SO >::ConstPointer blaze::HybridMatrix< Type, M, N, SO >::data ( size_t  i) const
inline

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.

template<typename Type , size_t M, size_t N, bool SO>
HybridMatrix< Type, M, N, SO >::Iterator blaze::HybridMatrix< Type, M, N, SO >::end ( size_t  i)
inline

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.

template<typename Type , size_t M, size_t N, bool SO>
HybridMatrix< Type, M, N, SO >::ConstIterator blaze::HybridMatrix< Type, M, N, SO >::end ( size_t  i) const
inline

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.

template<typename Type , size_t M, size_t N, bool SO>
void blaze::HybridMatrix< Type, M, N, SO >::extend ( size_t  m,
size_t  n,
bool  preserve = true 
)
inline

Extending the size of the matrix.

Parameters
mNumber of additional rows.
nNumber of additional columns.
preservetrue if the old values of the matrix should be preserved, false if not.
Returns
void

This function increases the matrix size by m rows and n columns. In case the resulting number of rows or columns is larger than the maximum number of rows or columns (i.e. if m > M or n > N) a std::invalid_argument exception is thrown. During this operation, all matrix elements are potentially changed. In order to preserve the old matrix values, the preserve flag can be set to true.
Note that new matrix elements are not initialized!

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

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.

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

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.

template<typename Type , size_t M, size_t N, bool SO>
HybridMatrix< Type, M, N, SO >::IntrinsicType blaze::HybridMatrix< Type, M, N, SO >::load ( size_t  i,
size_t  j 
) const
inline

Aligned load of an intrinsic 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 intrinsic element.

This function performs an aligned load of a specific intrinsic 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 intrinsic 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.

template<typename Type , size_t M, size_t N, bool SO>
HybridMatrix< Type, M, N, SO >::IntrinsicType blaze::HybridMatrix< Type, M, N, SO >::loadu ( size_t  i,
size_t  j 
) const
inline

Unaligned load of an intrinsic 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 intrinsic element.

This function performs an unaligned load of a specific intrinsic 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 intrinsic 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.

template<typename Type , size_t M, size_t N, bool SO>
size_t blaze::HybridMatrix< 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.
template<typename Type , size_t M, size_t N, bool SO>
size_t blaze::HybridMatrix< 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.

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

Class specific implementation of operator delete.

Parameters
ptrThe memory to be deallocated.
Returns
void
template<typename Type , size_t M, size_t N, bool SO>
void blaze::HybridMatrix< 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
template<typename Type , size_t M, size_t N, bool SO>
void blaze::HybridMatrix< Type, M, N, SO >::operator delete[] ( void *  ptr)
inlinestatic

Class specific implementation of operator delete[].

Parameters
ptrThe memory to be deallocated.
Returns
void
template<typename Type , size_t M, size_t N, bool SO>
void blaze::HybridMatrix< 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
template<typename Type , size_t M, size_t N, bool SO>
void * blaze::HybridMatrix< 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 HybridMatrix class template.

template<typename Type , size_t M, size_t N, bool SO>
void * blaze::HybridMatrix< 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 HybridMatrix class template.

template<typename Type , size_t M, size_t N, bool SO>
void * blaze::HybridMatrix< 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 HybridMatrix class template.

template<typename Type , size_t M, size_t N, bool SO>
void * blaze::HybridMatrix< 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 HybridMatrix class template.

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

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.
template<typename Type , size_t M, size_t N, bool SO>
HybridMatrix< Type, M, N, SO >::ConstReference blaze::HybridMatrix< Type, M, N, SO >::operator() ( size_t  i,
size_t  j 
) const
inline

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.
template<typename , size_t , size_t , bool >
template<typename MT , bool SO2>
HybridMatrix<Type,M,N,SO>& blaze::HybridMatrix< typename, size_t, size_t, bool >::operator*= ( const Matrix< MT, SO2 > &  rhs)
inline

Multiplication assignment operator for the multiplication of a matrix ( $ A*=B $).

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

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

template<typename , size_t , size_t , bool >
template<typename Other >
EnableIf< IsNumeric<Other>, HybridMatrix<Type,M,N,SO> >::Type& blaze::HybridMatrix< typename, size_t, size_t, bool >::operator*= ( Other  rhs)
inline

Multiplication assignment operator for the multiplication between a matrix and a scalar value ( $ A*=s $).

Parameters
rhsThe right-hand side scalar value for the multiplication.
Returns
Reference to the matrix.
template<typename , size_t , size_t , bool >
template<typename MT , bool SO2>
HybridMatrix<Type,M,N,SO>& blaze::HybridMatrix< typename, size_t, size_t, bool >::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.

template<typename , size_t , size_t , bool >
template<typename MT , bool SO2>
HybridMatrix<Type,M,N,SO>& blaze::HybridMatrix< typename, size_t, size_t, bool >::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.

template<typename , size_t , size_t , bool >
template<typename Other >
EnableIf< IsNumeric<Other>, HybridMatrix<Type,M,N,SO> >::Type& blaze::HybridMatrix< typename, size_t, size_t, bool >::operator/= ( Other  rhs)
inline

Division assignment operator for the division of a matrix by a scalar value ( $ A/=s $).

Parameters
rhsThe right-hand side scalar value for the division.
Returns
Reference to the matrix.

Note: A division by zero is only checked by an user assert.

template<typename Type , size_t M, size_t N, bool SO>
HybridMatrix< Type, M, N, SO > & blaze::HybridMatrix< 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.
template<typename Type , size_t M, size_t N, bool SO>
HybridMatrix< Type, M, N, SO > & blaze::HybridMatrix< Type, M, N, SO >::operator= ( const HybridMatrix< typename, size_t, size_t, bool > &  rhs)
inline

Copy assignment operator for HybridMatrix.

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

Explicit definition of a copy assignment operator for performance reasons.

template<typename , size_t , size_t , bool >
template<typename Other , size_t M2, size_t N2>
HybridMatrix<Type,M,N,SO>& blaze::HybridMatrix< typename, size_t, size_t, bool >::operator= ( const Other(&)  array[M2][N2])
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 real 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).

template<typename , size_t , size_t , bool >
template<typename MT , bool SO2>
HybridMatrix<Type,M,N,SO>& blaze::HybridMatrix< typename, size_t, size_t, bool >::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 hybrid 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.

template<typename , bool >
BLAZE_ALWAYS_INLINE MatrixType& blaze::Matrix< typename, bool >::operator~ ( )
inlineinherited

Conversion operator for non-constant matrices.

Returns
Reference of the actual type of the matrix.
template<typename , bool >
BLAZE_ALWAYS_INLINE const MatrixType& blaze::Matrix< typename, bool >::operator~ ( ) const
inlineinherited

Conversion operator for constant matrices.

Returns
Constant reference of the actual type of the matrix.
template<typename Type , size_t M, size_t N, bool SO>
void blaze::HybridMatrix< Type, M, N, SO >::reset ( )
inline

Reset to the default initial values.

Returns
void
template<typename Type , size_t M, size_t N, bool SO>
void blaze::HybridMatrix< 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.

template<typename Type , size_t M, size_t N, bool SO>
void blaze::HybridMatrix< Type, M, N, SO >::resize ( size_t  m,
size_t  n,
bool  preserve = true 
)

Changing the size of the matrix.

Parameters
mThe new number of rows of the matrix.
nThe new number of columns of the matrix.
preservetrue if the old values of the matrix should be preserved, false if not.
Returns
void

This function resizes the matrix using the given size to $ m \times n $. In case the given number of rows m is larger than the maximum number of rows (i.e. if m > M) or in case the given number of columns n is larger than the maximum number of column (i.e. if n > N) a std::invalid_argument exception is thrown. Note that this function may invalidate all existing views (submatrices, rows, columns, ...) on the matrix if it is used to shrink the matrix. Additionally, during this operation all matrix elements are potentially changed. In order to preserve the old matrix values, the preserve flag can be set to true.

Note that in case the number of rows or columns is increased new matrix elements are not initialized! The following example illustrates the resize operation of a $ 2 \times 4 $ matrix to a $ 4 \times 2 $ matrix. The new, uninitialized elements are marked with x:

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

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

Returns the current number of rows of the matrix.

Returns
The number of rows of the matrix.
template<typename , size_t , size_t , bool >
template<typename Other >
HybridMatrix<Type,M,N,SO>& blaze::HybridMatrix< typename, size_t, size_t, bool >::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.
template<typename Type , size_t M, size_t N, bool SO>
size_t blaze::HybridMatrix< Type, M, N, SO >::spacing ( ) const
inline

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.

template<typename Type , size_t M, size_t N, bool SO>
void blaze::HybridMatrix< Type, M, N, SO >::store ( size_t  i,
size_t  j,
const IntrinsicType value 
)
inline

Aligned store of an intrinsic 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 intrinsic element to be stored.
Returns
void

This function performs an aligned store of a specific intrinsic 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 intrinsic 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.

template<typename Type , size_t M, size_t N, bool SO>
void blaze::HybridMatrix< Type, M, N, SO >::storeu ( size_t  i,
size_t  j,
const IntrinsicType value 
)
inline

Unaligned store of an intrinsic 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 intrinsic element to be stored.
Returns
void

This function performs an unaligned store of a specific intrinsic 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 intrinsic 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.

template<typename Type , size_t M, size_t N, bool SO>
void blaze::HybridMatrix< Type, M, N, SO >::stream ( size_t  i,
size_t  j,
const IntrinsicType value 
)
inline

Aligned, non-temporal store of an intrinsic 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 intrinsic element to be stored.
Returns
void

This function performs an aligned, non-temporal store of a specific intrinsic 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 intrinsic 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.

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT >
void blaze::HybridMatrix< 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.

template<typename Type , size_t M, size_t N, bool SO>
template<typename MT >
void blaze::HybridMatrix< 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.

template<typename , size_t , size_t , bool >
template<typename MT , bool SO2>
DisableIf< typename HybridMatrix<Type,M,N,SO>::BLAZE_TEMPLATE VectorizedSubAssign<MT> >::Type blaze::HybridMatrix< typename, size_t, size_t, bool >::subAssign ( const DenseMatrix< MT, SO2 > &  rhs)
inline

Default 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.

template<typename , size_t , size_t , bool >
template<typename MT , bool SO2>
EnableIf< typename HybridMatrix<Type,M,N,SO>::BLAZE_TEMPLATE VectorizedSubAssign<MT> >::Type blaze::HybridMatrix< typename, size_t, size_t, bool >::subAssign ( const DenseMatrix< MT, SO2 > &  rhs)
inline

Intrinsic 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.

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

Swapping the contents of two hybrid matrices.

Parameters
mThe matrix to be swapped.
Returns
void
Exceptions
no-throwguarantee.
template<typename Type , size_t M, size_t N, bool SO>
HybridMatrix< Type, M, N, SO > & blaze::HybridMatrix< Type, M, N, SO >::transpose ( )
inline

Transposing the matrix.

Returns
Reference to the transposed matrix.
Exceptions
std::logic_errorImpossible transpose operation.

This function transposes the hybrid matrix in-place. Note that this function can only be used on hybrid matrices whose current dimensions allow an in-place transpose operation. In case the current number of rows is larger than the maximum number of columns or if the current number of columns is larger than the maximum number of rows, an std::logic_error is thrown.

Member Data Documentation

template<typename , size_t , size_t , bool >
AlignedArray<Type,M*NN> blaze::HybridMatrix< typename, size_t, size_t, bool >::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: