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

Reference to a specific row of a dense matrix.The DenseRow template represents a reference to a specific row of a dense matrix primitive. The type of the dense matrix is specified via the first template parameter: More...

#include <DenseRow.h>

Inherits blaze::DenseVector< DenseRow< MT, SO >, true >, and blaze::Row.

Public Types

enum  { vectorizable = MT::vectorizable }
 Compilation switch for the expression template evaluation strategy.
 
enum  { smpAssignable = MT::smpAssignable }
 Compilation switch for the expression template assignment strategy.
 
typedef DenseRow< MT, SO > This
 Type of this DenseRow instance.
 
typedef RowTrait< MT >::Type ResultType
 Result type for expression template evaluations.
 
typedef ResultType::TransposeType TransposeType
 Transpose type for expression template evaluations.
 
typedef MT::ElementType ElementType
 Type of the row elements.
 
typedef IT::Type IntrinsicType
 Intrinsic type of the row elements.
 
typedef MT::ReturnType ReturnType
 Return type for expression template evaluations.
 
typedef const DenseRowCompositeType
 Data type for composite expression templates.
 
typedef MT::ConstReference ConstReference
 Reference to a constant row value.
 
typedef SelectType< useConst,
ConstReference, typename
MT::Reference >::Type 
Reference
 Reference to a non-constant row value.
 
typedef const ElementTypeConstPointer
 Pointer to a constant row value.
 
typedef SelectType< useConst,
ConstPointer, ElementType * >
::Type 
Pointer
 Pointer to a constant row value.
 
typedef MT::ConstIterator ConstIterator
 Iterator over constant elements.
 
typedef SelectType< useConst,
ConstIterator, typename
MT::Iterator >::Type 
Iterator
 Iterator over non-constant elements.
 
typedef VT VectorType
 Type of the vector.
 

Public Member Functions

template<typename VT >
DenseRow< MT, SO > & operator= (const Vector< VT, true > &rhs)
 Assignment operator for different vectors. More...
 
template<typename VT >
DenseRow< MT, SO > & operator+= (const Vector< VT, true > &rhs)
 Addition assignment operator for the addition of a vector ( $ \vec{a}+=\vec{b} $). More...
 
template<typename VT >
DenseRow< MT, SO > & operator-= (const Vector< VT, true > &rhs)
 Subtraction assignment operator for the subtraction of a vector ( $ \vec{a}-=\vec{b} $). More...
 
template<typename VT >
DenseRow< MT, SO > & operator*= (const Vector< VT, true > &rhs)
 Multiplication assignment operator for the multiplication of a vector ( $ \vec{a}*=\vec{b} $). More...
 
template<typename Other >
EnableIf< IsNumeric< Other >
, DenseRow< MT, SO > >::Type & 
operator*= (Other rhs)
 Multiplication assignment operator for the multiplication between a vector and a scalar value ( $ \vec{a}*=s $). More...
 
template<typename Other >
EnableIf< IsNumeric< Other >
, DenseRow< MT, SO > >::Type & 
operator/= (Other rhs)
 Division assignment operator for the division of a vector by a scalar value ( $ \vec{a}/=s $). More...
 
template<typename Other >
DenseRow< MT, SO > & scale (const Other &scalar)
 Scaling of the row by the scalar value scalar ( $ \vec{a}=\vec{b}*s $). More...
 
template<typename VT >
DisableIf< typename DenseRow
< MT, SO >::BLAZE_TEMPLATE
VectorizedAssign< VT > >::Type 
assign (const DenseVector< VT, true > &rhs)
 Default implementation of the assignment of a dense vector. More...
 
template<typename VT >
EnableIf< typename DenseRow
< MT, SO >::BLAZE_TEMPLATE
VectorizedAssign< VT > >::Type 
assign (const DenseVector< VT, true > &rhs)
 Intrinsic optimized implementation of the assignment of a dense vector. More...
 
template<typename VT >
DisableIf< typename DenseRow
< MT, SO >::BLAZE_TEMPLATE
VectorizedAddAssign< VT >
>::Type 
addAssign (const DenseVector< VT, true > &rhs)
 Default implementation of the addition assignment of a dense vector. More...
 
template<typename VT >
EnableIf< typename DenseRow
< MT, SO >::BLAZE_TEMPLATE
VectorizedAddAssign< VT >
>::Type 
addAssign (const DenseVector< VT, true > &rhs)
 Intrinsic optimized implementation of the addition assignment of a dense vector. More...
 
template<typename VT >
DisableIf< typename DenseRow
< MT, SO >::BLAZE_TEMPLATE
VectorizedSubAssign< VT >
>::Type 
subAssign (const DenseVector< VT, true > &rhs)
 Default implementation of the subtraction assignment of a dense vector. More...
 
template<typename VT >
EnableIf< typename DenseRow
< MT, SO >::BLAZE_TEMPLATE
VectorizedSubAssign< VT >
>::Type 
subAssign (const DenseVector< VT, true > &rhs)
 Intrinsic optimized implementation of the subtraction assignment of a dense vector. More...
 
template<typename VT >
DisableIf< typename DenseRow
< MT, SO >::BLAZE_TEMPLATE
VectorizedMultAssign< VT >
>::Type 
multAssign (const DenseVector< VT, true > &rhs)
 Default implementation of the multiplication assignment of a dense vector. More...
 
template<typename VT >
EnableIf< typename DenseRow
< MT, SO >::BLAZE_TEMPLATE
VectorizedMultAssign< VT >
>::Type 
multAssign (const DenseVector< VT, true > &rhs)
 Intrinsic optimized implementation of the multiplication assignment of a dense vector. More...
 
VectorTypeoperator~ ()
 Conversion operator for non-constant vectors. More...
 
const VectorTypeoperator~ () const
 Conversion operator for constant vectors. More...
 
Constructors
 DenseRow (MT &matrix, size_t index)
 The constructor for DenseRow. More...
 
Data access functions
Reference operator[] (size_t index)
 Subscript operator for the direct access to the row elements. More...
 
ConstReference operator[] (size_t index) const
 Subscript operator for the direct access to the row elements. More...
 
Pointer data ()
 Low-level data access to the row elements. More...
 
ConstPointer data () const
 Low-level data access to the row elements. More...
 
Iterator begin ()
 Returns an iterator to the first element of the row. More...
 
ConstIterator begin () const
 Returns an iterator to the first element of the row. More...
 
ConstIterator cbegin () const
 Returns an iterator to the first element of the row. More...
 
Iterator end ()
 Returns an iterator just past the last element of the row. More...
 
ConstIterator end () const
 Returns an iterator just past the last element of the row. More...
 
ConstIterator cend () const
 Returns an iterator just past the last element of the row. More...
 
Assignment operators
DenseRowoperator= (const ElementType &rhs)
 Homogenous assignment to all row elements. More...
 
DenseRowoperator= (const DenseRow &rhs)
 Copy assignment operator for DenseRow. More...
 
template<typename VT >
DenseRowoperator= (const Vector< VT, true > &rhs)
 
template<typename VT >
DenseRowoperator+= (const Vector< VT, true > &rhs)
 
template<typename VT >
DenseRowoperator-= (const Vector< VT, true > &rhs)
 
template<typename VT >
DenseRowoperator*= (const Vector< VT, true > &rhs)
 
template<typename Other >
EnableIf< IsNumeric< Other >
, DenseRow >::Type & 
operator*= (Other rhs)
 
template<typename Other >
EnableIf< IsNumeric< Other >
, DenseRow >::Type & 
operator/= (Other rhs)
 
Utility functions
size_t size () const
 Returns the current size/dimension of the row. More...
 
size_t capacity () const
 Returns the maximum capacity of the dense row. More...
 
size_t nonZeros () const
 Returns the number of non-zero elements in the row. More...
 
void reset ()
 Reset to the default initial values. More...
 
template<typename Other >
DenseRowscale (const Other &scalar)
 
Expression template evaluation functions
template<typename Other >
bool canAlias (const Other *alias) const
 Returns whether the dense row can alias with the given address alias. More...
 
template<typename Other >
bool isAliased (const Other *alias) const
 Returns whether the dense row is aliased with the given address alias. More...
 
bool isAligned () const
 Returns whether the dense row is properly aligned in memory. More...
 
bool canSMPAssign () const
 Returns whether the dense row can be used in SMP assignments. More...
 
IntrinsicType load (size_t index) const
 Aligned load of an intrinsic element of the dense row. More...
 
IntrinsicType loadu (size_t index) const
 Unaligned load of an intrinsic element of the dense row. More...
 
void store (size_t index, const IntrinsicType &value)
 Aligned store of an intrinsic element of the dense row. More...
 
void storeu (size_t index, const IntrinsicType &value)
 Unligned store of an intrinsic element of the dense row. More...
 
void stream (size_t index, const IntrinsicType &value)
 Aligned, non-temporal store of an intrinsic element of the dense row. More...
 
template<typename VT >
DisableIf< VectorizedAssign
< VT > >::Type 
assign (const DenseVector< VT, true > &rhs)
 
template<typename VT >
EnableIf< VectorizedAssign< VT >
>::Type 
assign (const DenseVector< VT, true > &rhs)
 
template<typename VT >
void assign (const SparseVector< VT, true > &rhs)
 Default implementation of the assignment of a sparse vector. More...
 
template<typename VT >
DisableIf< VectorizedAddAssign
< VT > >::Type 
addAssign (const DenseVector< VT, true > &rhs)
 
template<typename VT >
EnableIf< VectorizedAddAssign
< VT > >::Type 
addAssign (const DenseVector< VT, true > &rhs)
 
template<typename VT >
void addAssign (const SparseVector< VT, true > &rhs)
 Default implementation of the addition assignment of a sparse vector. More...
 
template<typename VT >
DisableIf< VectorizedSubAssign
< VT > >::Type 
subAssign (const DenseVector< VT, true > &rhs)
 
template<typename VT >
EnableIf< VectorizedSubAssign
< VT > >::Type 
subAssign (const DenseVector< VT, true > &rhs)
 
template<typename VT >
void subAssign (const SparseVector< VT, true > &rhs)
 Default implementation of the subtraction assignment of a sparse vector. More...
 
template<typename VT >
DisableIf
< VectorizedMultAssign< VT >
>::Type 
multAssign (const DenseVector< VT, true > &rhs)
 
template<typename VT >
EnableIf< VectorizedMultAssign
< VT > >::Type 
multAssign (const DenseVector< VT, true > &rhs)
 
template<typename VT >
void multAssign (const SparseVector< VT, true > &rhs)
 Default implementation of the multiplication assignment of a sparse vector. More...
 

Private Types

enum  { useConst = IsConst<MT>::value }
 Compilation switch for the non-const reference and iterator types. More...
 
typedef SelectType
< IsExpression< MT >::value,
MT, MT & >::Type 
Operand
 Composite data type of the dense matrix expression.
 
typedef IntrinsicTrait
< typename MT::ElementType > 
IT
 Intrinsic trait for the row element type.
 

Private Attributes

Member variables
Operand matrix_
 The dense matrix containing the row.
 
const size_t row_
 The index of the row in the matrix.
 

Detailed Description

template<typename MT, bool SO = IsRowMajorMatrix<MT>::value>
class blaze::DenseRow< MT, SO >

Reference to a specific row of a dense matrix.

The DenseRow template represents a reference to a specific row of a dense matrix primitive. The type of the dense matrix is specified via the first template parameter:

template< typename MT, bool SO >
class DenseRow;


Setup of Dense Rows

A reference to a dense row can be created very conveniently via the row() function. This reference can be treated as any other row vector, i.e. it can be assigned to, it can be copied from, and it can be used in arithmetic operations. The reference can also be used on both sides of an assignment: The row can either be used as an alias to grant write access to a specific row of a matrix primitive on the left-hand side of an assignment or to grant read-access to a specific row of a matrix primitive or expression on the right-hand side of an assignment. The following example demonstrates this in detail:

DenseVectorType x;
SparseVectorType y;
DenseMatrixType A, B;
// ... Resizing and initialization
// Setting the 2nd row of matrix A to x
row2 = x;
// Setting the 3rd row of matrix B to y
row( B, 3UL ) = y;
// Setting x to the 1st row of matrix B
x = row( B, 1UL );
// Setting y to the 4th row of the result of the matrix multiplication
y = row( A * B, 4UL );


Element access

A dense row can be used like any other row vector. For instance, the elements of the dense row can be directly accessed with the subscript operator.

MatrixType A;
// ... Resizing and initialization
// Creating a view on the 4th row of matrix A
// Setting the 1st element of the dense row, which corresponds
// to the 1st element in the 4th row of matrix A
row4[1] = 2.0;

The numbering of the row elements is

\[\left(\begin{array}{*{5}{c}} 0 & 1 & 2 & \cdots & N-1 \\ \end{array}\right),\]

where N is the number of columns of the referenced matrix. Alternatively, the elements of a row can be traversed via iterators. Just as with vectors, in case of non-const rows, begin() and end() return an Iterator, which allows a manipulation of the non-zero values, in case of constant rows a ConstIterator is returned:

MatrixType A( 128UL, 256UL );
// ... Resizing and initialization
// Creating a reference to the 31st row of matrix A
RowType row31 = row( A, 31UL );
for( RowType::Iterator it=row31.begin(); it!=row31.end(); ++it ) {
*it = ...; // OK; Write access to the dense row value
... = *it; // OK: Read access to the dense row value.
}
for( RowType::ConstIterator it=row31.begin(); it!=row31.end(); ++it ) {
*it = ...; // Compilation error: Assignment to the value via a ConstIterator is invalid.
... = *it; // OK: Read access to the dense row value.
}


Common Operations

The current number of row elements can be obtained via the size() function, the current capacity via the capacity() function, and the number of non-zero elements via the nonZeros() function. However, since rows are references to specific rows of a matrix, several operations are not possible on views, such as resizing and swapping:

MatrixType A( 42UL, 42UL );
// ... Resizing and initialization
// Creating a reference to the 2nd row of matrix A
RowType row2 = row( A, 2UL );
row2.size(); // Returns the number of elements in the row
row2.capacity(); // Returns the capacity of the row
row2.nonZeros(); // Returns the number of non-zero elements contained in the row
row2.resize( 84UL ); // Compilation error: Cannot resize a single row of a matrix
RowType row3 = row( A, 3UL );
swap( row2, row3 ); // Compilation error: Swap operation not allowed


Arithmetic Operations

The following example gives an impression of the use of DenseRow within arithmetic operations. All operations (addition, subtraction, multiplication, scaling, ...) can be performed on all possible combinations of dense and sparse vectors with fitting element types:

c[1] = 3.0;
DenseMatrix A( 4UL, 2UL ); // Non-initialized 4x2 matrix
RowType row0( row( A, 0UL ) ); // Reference to the 0th row of A
row0[0] = 0.0; // Manual initialization of the 0th row of A
row0[1] = 0.0;
row( A, 1UL ) = 1.0; // Homogeneous initialization of the 1st row of A
row( A, 2UL ) = a; // Dense vector initialization of the 2nd row of A
row( A, 3UL ) = c; // Sparse vector initialization of the 3rd row of A
b = row0 + a; // Dense vector/dense vector addition
b = c + row( A, 1UL ); // Sparse vector/dense vector addition
b = row0 * row( A, 2UL ); // Component-wise vector multiplication
row( A, 1UL ) *= 2.0; // In-place scaling of the 1st row
b = row( A, 1UL ) * 2.0; // Scaling of the 1st row
b = 2.0 * row( A, 1UL ); // Scaling of the 1st row
row( A, 2UL ) += a; // Addition assignment
row( A, 2UL ) -= c; // Subtraction assignment
row( A, 2UL ) *= row( A, 0UL ); // Multiplication assignment
double scalar = row( A, 1UL ) * trans( c ); // Scalar/dot/inner product between two vectors
A = trans( c ) * row( A, 1UL ); // Outer product between two vectors


Dense Row on a Column-Major Matrix

It is especially noteworthy that row views can be created for both row-major and column-major matrices. Whereas the interface of a row-major matrix only allows to traverse a row directly and the interface of a column-major matrix only allows to traverse a column, via views it is also possible to traverse a row of a column-major matrix. For instance:

MatrixType A( 64UL, 32UL );
// ... Resizing and initialization
// Creating a reference to the 1st row of a column-major matrix A
RowType row1 = row( A, 1UL );
for( RowType::Iterator it=row1.begin(); it!=row1.end(); ++it ) {
// ...
}

However, please note that creating a row view on a matrix stored in a column-major fashion can result in a considerable performance decrease in comparison to a row view on a matrix with row-major storage format. This is due to the non-contiguous storage of the matrix elements. Therefore care has to be taken in the choice of the most suitable storage order:

// Setup of two column-major matrices
// ... Resizing and initialization
// The computation of the 15th row of the multiplication between A and B ...
// ... is essentially the same as the following computation, which multiplies
// the 15th row of the column-major matrix A with B.

Although Blaze performs the resulting vector/matrix multiplication as efficiently as possible using a row-major storage order for matrix A would result in a more efficient evaluation.

Member Enumeration Documentation

template<typename MT, bool SO = IsRowMajorMatrix<MT>::value>
anonymous enum
private

Compilation switch for the non-const reference and iterator types.

The useConst compile time constant expression represents a compilation switch for the non-const reference and iterator types. In case the given dense matrix of type MT is const qualified, useConst will be set to 1 and the dense row will return references and iterators to const. Otherwise useConst will be set to 0 and the dense row will offer write access to the dense matrix elements both via the subscript operator and iterators.

Constructor & Destructor Documentation

template<typename MT , bool SO>
blaze::DenseRow< MT, SO >::DenseRow ( MT &  matrix,
size_t  index 
)
inlineexplicit

The constructor for DenseRow.

Parameters
matrixThe matrix containing the row.
indexThe index of the row.
Exceptions
std::invalid_argumentInvalid row access index.

Member Function Documentation

template<typename MT , bool SO>
template<typename VT >
void blaze::DenseRow< MT, SO >::addAssign ( const SparseVector< VT, true > &  rhs)
inline

Default implementation of the addition assignment of a sparse vector.

Parameters
rhsThe right-hand side sparse vector 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 MT, bool SO = IsRowMajorMatrix<MT>::value>
template<typename VT >
DisableIf< typename DenseRow<MT,SO>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type blaze::DenseRow< MT, SO >::addAssign ( const DenseVector< VT, true > &  rhs)
inline

Default implementation of the addition assignment of a dense vector.

Parameters
rhsThe right-hand side dense vector 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 MT, bool SO = IsRowMajorMatrix<MT>::value>
template<typename VT >
EnableIf< typename DenseRow<MT,SO>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type blaze::DenseRow< MT, SO >::addAssign ( const DenseVector< VT, true > &  rhs)
inline

Intrinsic optimized implementation of the addition assignment of a dense vector.

Parameters
rhsThe right-hand side dense vector 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 MT , bool SO>
template<typename VT >
void blaze::DenseRow< MT, SO >::assign ( const SparseVector< VT, true > &  rhs)
inline

Default implementation of the assignment of a sparse vector.

Parameters
rhsThe right-hand side sparse vector 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 MT, bool SO = IsRowMajorMatrix<MT>::value>
template<typename VT >
DisableIf< typename DenseRow<MT,SO>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type blaze::DenseRow< MT, SO >::assign ( const DenseVector< VT, true > &  rhs)
inline

Default implementation of the assignment of a dense vector.

Parameters
rhsThe right-hand side dense vector 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 MT, bool SO = IsRowMajorMatrix<MT>::value>
template<typename VT >
EnableIf< typename DenseRow<MT,SO>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type blaze::DenseRow< MT, SO >::assign ( const DenseVector< VT, true > &  rhs)
inline

Intrinsic optimized implementation of the assignment of a dense vector.

Parameters
rhsThe right-hand side dense vector 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 MT , bool SO>
DenseRow< MT, SO >::Iterator blaze::DenseRow< MT, SO >::begin ( )
inline

Returns an iterator to the first element of the row.

Returns
Iterator to the first element of the row.

This function returns an iterator to the first element of the row.

template<typename MT , bool SO>
DenseRow< MT, SO >::ConstIterator blaze::DenseRow< MT, SO >::begin ( ) const
inline

Returns an iterator to the first element of the row.

Returns
Iterator to the first element of the row.

This function returns an iterator to the first element of the row.

template<typename MT , bool SO>
template<typename Other >
bool blaze::DenseRow< MT, SO >::canAlias ( const Other *  alias) const
inline

Returns whether the dense row can alias with the given address alias.

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

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

template<typename MT , bool SO>
bool blaze::DenseRow< MT, SO >::canSMPAssign ( ) const
inline

Returns whether the dense row can be used in SMP assignments.

Returns
true in case the dense row can be used in SMP assignments, false if not.

This function returns whether the dense row can be used in SMP assignments. In contrast to the smpAssignable member enumeration, which is based solely on compile time information, this function additionally provides runtime information (as for instance the current size of the dense row).

template<typename MT , bool SO>
size_t blaze::DenseRow< MT, SO >::capacity ( ) const
inline

Returns the maximum capacity of the dense row.

Returns
The capacity of the dense row.
template<typename MT , bool SO>
DenseRow< MT, SO >::ConstIterator blaze::DenseRow< MT, SO >::cbegin ( ) const
inline

Returns an iterator to the first element of the row.

Returns
Iterator to the first element of the row.

This function returns an iterator to the first element of the row.

template<typename MT , bool SO>
DenseRow< MT, SO >::ConstIterator blaze::DenseRow< MT, SO >::cend ( ) const
inline

Returns an iterator just past the last element of the row.

Returns
Iterator just past the last element of the row.

This function returns an iterator just past the last element of the row.

template<typename MT , bool SO>
DenseRow< MT, SO >::Pointer blaze::DenseRow< MT, SO >::data ( )
inline

Low-level data access to the row elements.

Returns
Pointer to the internal element storage.

This function returns a pointer to the internal storage of the dense row.

template<typename MT , bool SO>
DenseRow< MT, SO >::ConstPointer blaze::DenseRow< MT, SO >::data ( ) const
inline

Low-level data access to the row elements.

Returns
Pointer to the internal element storage.

This function returns a pointer to the internal storage of the dense row.

template<typename MT , bool SO>
DenseRow< MT, SO >::Iterator blaze::DenseRow< MT, SO >::end ( )
inline

Returns an iterator just past the last element of the row.

Returns
Iterator just past the last element of the row.

This function returns an iterator just past the last element of the row.

template<typename MT , bool SO>
DenseRow< MT, SO >::ConstIterator blaze::DenseRow< MT, SO >::end ( ) const
inline

Returns an iterator just past the last element of the row.

Returns
Iterator just past the last element of the row.

This function returns an iterator just past the last element of the row.

template<typename MT , bool SO>
template<typename Other >
bool blaze::DenseRow< MT, SO >::isAliased ( const Other *  alias) const
inline

Returns whether the dense row is aliased with the given address alias.

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

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

template<typename MT , bool SO>
bool blaze::DenseRow< MT, SO >::isAligned ( ) const
inline

Returns whether the dense row is properly aligned in memory.

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

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

template<typename MT , bool SO>
DenseRow< MT, SO >::IntrinsicType blaze::DenseRow< MT, SO >::load ( size_t  index) const
inline

Aligned load of an intrinsic element of the dense row.

Parameters
indexAccess index. The index must be smaller than the number of matrix columns.
Returns
The loaded intrinsic element.

This function performs an aligned load of a specific intrinsic element of the dense row. The index must be smaller than the number of matrix columns. 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 MT , bool SO>
DenseRow< MT, SO >::IntrinsicType blaze::DenseRow< MT, SO >::loadu ( size_t  index) const
inline

Unaligned load of an intrinsic element of the dense row.

Parameters
indexAccess index. The index must be smaller than the number of matrix columns.
Returns
The loaded intrinsic element.

This function performs an unaligned load of a specific intrinsic element of the dense row. The index must be smaller than the number of matrix columns. 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 MT , bool SO>
template<typename VT >
void blaze::DenseRow< MT, SO >::multAssign ( const SparseVector< VT, true > &  rhs)
inline

Default implementation of the multiplication assignment of a sparse vector.

Parameters
rhsThe right-hand side sparse vector to be multiplied.
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 MT, bool SO = IsRowMajorMatrix<MT>::value>
template<typename VT >
DisableIf< typename DenseRow<MT,SO>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type blaze::DenseRow< MT, SO >::multAssign ( const DenseVector< VT, true > &  rhs)
inline

Default implementation of the multiplication assignment of a dense vector.

Parameters
rhsThe right-hand side dense vector to be multiplied.
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 MT, bool SO = IsRowMajorMatrix<MT>::value>
template<typename VT >
EnableIf< typename DenseRow<MT,SO>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type blaze::DenseRow< MT, SO >::multAssign ( const DenseVector< VT, true > &  rhs)
inline

Intrinsic optimized implementation of the multiplication assignment of a dense vector.

Parameters
rhsThe right-hand side dense vector to be multiplied.
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 MT , bool SO>
size_t blaze::DenseRow< MT, SO >::nonZeros ( ) const
inline

Returns the number of non-zero elements in the row.

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

Note that the number of non-zero elements is always less than or equal to the current number of columns of the matrix containing the row.

template<typename MT, bool SO = IsRowMajorMatrix<MT>::value>
template<typename VT >
DenseRow<MT,SO>& blaze::DenseRow< MT, SO >::operator*= ( const Vector< VT, true > &  rhs)
inline

Multiplication assignment operator for the multiplication of a vector ( $ \vec{a}*=\vec{b} $).

Parameters
rhsThe right-hand side vector to be multiplied with the dense row.
Returns
Reference to the assigned row.
Exceptions
std::invalid_argumentVector sizes do not match.

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

template<typename MT, bool SO = IsRowMajorMatrix<MT>::value>
template<typename Other >
EnableIf< IsNumeric<Other>, DenseRow<MT,SO> >::Type& blaze::DenseRow< MT, SO >::operator*= ( Other  rhs)
inline

Multiplication assignment operator for the multiplication between a vector and a scalar value ( $ \vec{a}*=s $).

Parameters
rhsThe right-hand side scalar value for the multiplication.
Returns
Reference to the vector.
template<typename MT, bool SO = IsRowMajorMatrix<MT>::value>
template<typename VT >
DenseRow<MT,SO>& blaze::DenseRow< MT, SO >::operator+= ( const Vector< VT, true > &  rhs)
inline

Addition assignment operator for the addition of a vector ( $ \vec{a}+=\vec{b} $).

Parameters
rhsThe right-hand side vector to be added to the dense row.
Returns
Reference to the assigned row.
Exceptions
std::invalid_argumentVector sizes do not match.

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

template<typename MT, bool SO = IsRowMajorMatrix<MT>::value>
template<typename VT >
DenseRow<MT,SO>& blaze::DenseRow< MT, SO >::operator-= ( const Vector< VT, true > &  rhs)
inline

Subtraction assignment operator for the subtraction of a vector ( $ \vec{a}-=\vec{b} $).

Parameters
rhsThe right-hand side vector to be subtracted from the dense row.
Returns
Reference to the assigned row.
Exceptions
std::invalid_argumentVector sizes do not match.

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

template<typename MT, bool SO = IsRowMajorMatrix<MT>::value>
template<typename Other >
EnableIf< IsNumeric<Other>, DenseRow<MT,SO> >::Type& blaze::DenseRow< MT, SO >::operator/= ( Other  rhs)
inline

Division assignment operator for the division of a vector by a scalar value ( $ \vec{a}/=s $).

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

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

template<typename MT , bool SO>
DenseRow< MT, SO > & blaze::DenseRow< MT, SO >::operator= ( const ElementType rhs)
inline

Homogenous assignment to all row elements.

Parameters
rhsScalar value to be assigned to all row elements.
Returns
Reference to the assigned row.
template<typename MT , bool SO>
DenseRow< MT, SO > & blaze::DenseRow< MT, SO >::operator= ( const DenseRow< MT, SO > &  rhs)
inline

Copy assignment operator for DenseRow.

Parameters
rhsDense row to be copied.
Returns
Reference to the assigned row.
Exceptions
std::invalid_argumentRow sizes do not match.

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

template<typename MT, bool SO = IsRowMajorMatrix<MT>::value>
template<typename VT >
DenseRow<MT,SO>& blaze::DenseRow< MT, SO >::operator= ( const Vector< VT, true > &  rhs)
inline

Assignment operator for different vectors.

Parameters
rhsVector to be assigned.
Returns
Reference to the assigned row.
Exceptions
std::invalid_argumentVector sizes do not match.

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

template<typename MT , bool SO>
DenseRow< MT, SO >::Reference blaze::DenseRow< MT, SO >::operator[] ( size_t  index)
inline

Subscript operator for the direct access to the row elements.

Parameters
indexAccess index. The index must be smaller than the number of matrix columns.
Returns
Reference to the accessed value.
template<typename MT , bool SO>
DenseRow< MT, SO >::ConstReference blaze::DenseRow< MT, SO >::operator[] ( size_t  index) const
inline

Subscript operator for the direct access to the row elements.

Parameters
indexAccess index. The index must be smaller than the number of matrix columns.
Returns
Reference to the accessed value.
template<typename , bool >
VectorType& blaze::Vector< typename, bool >::operator~ ( )
inlineinherited

Conversion operator for non-constant vectors.

Returns
Reference of the actual type of the vector.
template<typename , bool >
const VectorType& blaze::Vector< typename, bool >::operator~ ( ) const
inlineinherited

Conversion operator for constant vectors.

Returns
Const reference of the actual type of the vector.
template<typename MT , bool SO>
void blaze::DenseRow< MT, SO >::reset ( )
inline

Reset to the default initial values.

Returns
void
template<typename MT, bool SO = IsRowMajorMatrix<MT>::value>
template<typename Other >
DenseRow<MT,SO>& blaze::DenseRow< MT, SO >::scale ( const Other &  scalar)
inline

Scaling of the row by the scalar value scalar ( $ \vec{a}=\vec{b}*s $).

Parameters
scalarThe scalar value for the row scaling.
Returns
Reference to the dense row.
template<typename MT , bool SO>
size_t blaze::DenseRow< MT, SO >::size ( ) const
inline

Returns the current size/dimension of the row.

Returns
The size of the row.
template<typename MT , bool SO>
void blaze::DenseRow< MT, SO >::store ( size_t  index,
const IntrinsicType value 
)
inline

Aligned store of an intrinsic element of the dense row.

Parameters
indexAccess index. The index must be smaller than the number of matrix columns.
valueThe intrinsic element to be stored.
Returns
void

This function performs an aligned store a specific intrinsic element of the dense row. The index must be smaller than the number of matrix columns. 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 MT , bool SO>
void blaze::DenseRow< MT, SO >::storeu ( size_t  index,
const IntrinsicType value 
)
inline

Unligned store of an intrinsic element of the dense row.

Parameters
indexAccess index. The index must be smaller than the number of matrix columns.
valueThe intrinsic element to be stored.
Returns
void

This function performs an unaligned store a specific intrinsic element of the dense row. The index must be smaller than the number of matrix columns. 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 MT , bool SO>
void blaze::DenseRow< MT, SO >::stream ( size_t  index,
const IntrinsicType value 
)
inline

Aligned, non-temporal store of an intrinsic element of the dense row.

Parameters
indexAccess index. The index must be smaller than the number of matrix columns.
valueThe intrinsic element to be stored.
Returns
void

This function performs an aligned, non-temporal store a specific intrinsic element of the dense row. The index must be smaller than the number of matrix columns. 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 MT , bool SO>
template<typename VT >
void blaze::DenseRow< MT, SO >::subAssign ( const SparseVector< VT, true > &  rhs)
inline

Default implementation of the subtraction assignment of a sparse vector.

Parameters
rhsThe right-hand side sparse vector 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 MT, bool SO = IsRowMajorMatrix<MT>::value>
template<typename VT >
DisableIf< typename DenseRow<MT,SO>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type blaze::DenseRow< MT, SO >::subAssign ( const DenseVector< VT, true > &  rhs)
inline

Default implementation of the subtraction assignment of a dense vector.

Parameters
rhsThe right-hand side dense vector 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 MT, bool SO = IsRowMajorMatrix<MT>::value>
template<typename VT >
EnableIf< typename DenseRow<MT,SO>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type blaze::DenseRow< MT, SO >::subAssign ( const DenseVector< VT, true > &  rhs)
inline

Intrinsic optimized implementation of the subtraction assignment of a dense vector.

Parameters
rhsThe right-hand side dense vector 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.


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