All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Modules | Classes | Functions
Sparse Matrices

Modules

 Expressions
 
 CompressedMatrix
 

Classes

struct  blaze::SparseMatrix< MT, SO >
 Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes. It provides an abstraction from the actual type of the sparse matrix, but enables a conversion back to this type via the Matrix base class. More...
 

Functions

template<typename T1 , typename T2 >
const DVecTSVecMultExpr< T1, T2 > blaze::operator* (const DenseVector< T1, false > &lhs, const SparseVector< T2, true > &rhs)
 Multiplication operator for the dense vector-sparse vector outer product ( $ A=\vec{b}*\vec{c}^T $).
 
template<typename MT , bool SO>
const SMatAbsExpr< MT, SO > blaze::abs (const SparseMatrix< MT, SO > &sm)
 Returns a matrix containing the absolute values of each single element of sm.
 
template<typename MT , bool SO>
const SMatEvalExpr< MT, SO > blaze::eval (const SparseMatrix< MT, SO > &sm)
 Forces the evaluation of the given sparse matrix expression sm.
 
template<typename T1 , bool SO, typename T2 >
const EnableIf< IsNumeric< T2 >
, typename
SMatScalarDivExprHelper< T1,
T2, SO >::Type >::Type 
blaze::operator/ (const SparseMatrix< T1, SO > &mat, T2 scalar)
 Division operator for the division of a sparse matrix by a scalar value ( $ A=B/s $).
 
template<typename MT , bool SO>
const SMatScalarMultExpr< MT,
typename BaseElementType< MT >
::Type, SO > 
blaze::operator- (const SparseMatrix< MT, SO > &sm)
 Unary minus operator for the negation of a sparse matrix ( $ A = -B $).
 
template<typename T1 , bool SO, typename T2 >
const EnableIf< IsNumeric< T2 >
, typename MultExprTrait< T1,
T2 >::Type >::Type 
blaze::operator* (const SparseMatrix< T1, SO > &mat, T2 scalar)
 Multiplication operator for the multiplication of a sparse matrix and a scalar value ( $ A=B*s $).
 
template<typename T1 , typename T2 , bool SO>
const EnableIf< IsNumeric< T1 >
, typename MultExprTrait< T1,
T2 >::Type >::Type 
blaze::operator* (T1 scalar, const SparseMatrix< T2, SO > &mat)
 Multiplication operator for the multiplication of a scalar value and a sparse matrix ( $ A=s*B $).
 
template<typename T1 , typename T2 >
const SMatSMatAddExpr< T1, T2 > blaze::operator+ (const SparseMatrix< T1, false > &lhs, const SparseMatrix< T2, false > &rhs)
 Addition operator for the addition of two row-major sparse matrices ( $ A=B+C $).
 
template<typename T1 , typename T2 >
const SMatSMatMultExpr< T1, T2 > blaze::operator* (const SparseMatrix< T1, false > &lhs, const SparseMatrix< T2, false > &rhs)
 Multiplication operator for the multiplication of two row-major sparse matrices ( $ A=B*C $).
 
template<typename T1 , typename T2 >
const SMatSMatSubExpr< T1, T2 > blaze::operator- (const SparseMatrix< T1, false > &lhs, const SparseMatrix< T2, false > &rhs)
 Subtraction operator for the subtraction of two row-major sparse matrices ( $ A=B-C $).
 
template<typename MT , bool SO>
const SMatTransExpr< MT,!SO > blaze::trans (const SparseMatrix< MT, SO > &sm)
 Calculation of the transpose of the given sparse matrix.
 
template<typename T1 , typename T2 >
const SMatTSMatAddExpr< T1, T2 > blaze::operator+ (const SparseMatrix< T1, false > &lhs, const SparseMatrix< T2, true > &rhs)
 Addition operator for the addition of a row-major and a column-major sparse matrix ( $ A=B+C $).
 
template<typename T1 , typename T2 >
const SMatTSMatAddExpr< T2, T1 > blaze::operator+ (const SparseMatrix< T1, true > &lhs, const SparseMatrix< T2, false > &rhs)
 Addition operator for the addition of a column-major and a row-major sparse matrix ( $ A=B+C $).
 
template<typename T1 , typename T2 >
const SMatTSMatMultExpr< T1, T2 > blaze::operator* (const SparseMatrix< T1, false > &lhs, const SparseMatrix< T2, true > &rhs)
 Multiplication operator for the multiplication of a row-major sparse matrix and a column-major sparse matrix ( $ A=B*C $).
 
template<typename T1 , typename T2 >
const SMatTSMatSubExpr< T1, T2 > blaze::operator- (const SparseMatrix< T1, false > &lhs, const SparseMatrix< T2, true > &rhs)
 Subtraction operator for the subtraction of a row-major and a column-major sparse matrix ( $ A=B-C $).
 
template<typename T1 , typename T2 >
const SVecTDVecMultExpr< T1, T2 > blaze::operator* (const SparseVector< T1, false > &lhs, const DenseVector< T2, true > &rhs)
 Multiplication operator for the sparse vector-dense vector outer product ( $ A=\vec{b}*\vec{c}^T $).
 
template<typename T1 , typename T2 >
const SVecTSVecMultExpr< T1, T2 > blaze::operator* (const SparseVector< T1, false > &lhs, const SparseVector< T2, true > &rhs)
 Multiplication operator for the sparse vector-sparse vector outer product ( $ A=\vec{b}*\vec{c}^T $).
 
template<typename T1 , typename T2 >
const DisableIf
< IsMatMatMultExpr< T2 >
, TDVecSMatMultExpr< T1, T2 >
>::Type 
blaze::operator* (const DenseVector< T1, true > &vec, const SparseMatrix< T2, false > &mat)
 Multiplication operator for the multiplication of a transpose dense vector and a row-major sparse matrix ( $ \vec{y}^T=\vec{x}^T*A $).
 
template<typename T1 , typename T2 >
const DisableIf
< IsMatMatMultExpr< T2 >
, TDVecTSMatMultExpr< T1, T2 >
>::Type 
blaze::operator* (const DenseVector< T1, true > &vec, const SparseMatrix< T2, true > &mat)
 Multiplication operator for the multiplication of a transpose dense vector and a column-major sparse matrix ( $ \vec{y}^T=\vec{x}^T*A $).
 
template<typename T1 , typename T2 >
const TSMatSMatMultExpr< T1, T2 > blaze::operator* (const SparseMatrix< T1, true > &lhs, const SparseMatrix< T2, false > &rhs)
 Multiplication operator for the multiplication of a column-major sparse matrix and a row-major sparse matrix ( $ A=B*C $).
 
template<typename T1 , typename T2 >
const TSMatSMatSubExpr< T1, T2 > blaze::operator- (const SparseMatrix< T1, true > &lhs, const SparseMatrix< T2, false > &rhs)
 Subtraction operator for the subtraction of a column-major and a row-major sparse matrix ( $ A=B-C $).
 
template<typename T1 , typename T2 >
const TSMatTSMatAddExpr< T1, T2 > blaze::operator+ (const SparseMatrix< T1, true > &lhs, const SparseMatrix< T2, true > &rhs)
 Addition operator for the addition of two column-major sparse matrices ( $ A=B+C $).
 
template<typename T1 , typename T2 >
const TSMatTSMatMultExpr< T1, T2 > blaze::operator* (const SparseMatrix< T1, true > &lhs, const SparseMatrix< T2, true > &rhs)
 Multiplication operator for the multiplication of two column-major sparse matrices ( $ A=B*C $).
 
template<typename T1 , typename T2 >
const TSMatTSMatSubExpr< T1, T2 > blaze::operator- (const SparseMatrix< T1, true > &lhs, const SparseMatrix< T2, true > &rhs)
 Subtraction operator for the subtraction of two column-major sparse matrices ( $ A=B-C $).
 
template<typename T1 , typename T2 >
bool blaze::operator== (const SparseMatrix< T1, false > &lhs, const SparseMatrix< T2, false > &rhs)
 Equality operator for the comparison of two row-major sparse matrices.
 
template<typename T1 , typename T2 >
bool blaze::operator== (const SparseMatrix< T1, true > &lhs, const SparseMatrix< T2, true > &rhs)
 Equality operator for the comparison of two column-major sparse matrices.
 

SparseMatrix operators

template<typename T1 , typename T2 , bool SO>
bool blaze::operator== (const SparseMatrix< T1, SO > &lhs, const SparseMatrix< T2,!SO > &rhs)
 Equality operator for the comparison of two sparse matrices with different storage order.
 
template<typename T1 , bool SO1, typename T2 , bool SO2>
bool blaze::operator!= (const SparseMatrix< T1, SO1 > &lhs, const SparseMatrix< T2, SO2 > &rhs)
 Inequality operator for the comparison of two sparse matrices.
 
template<typename T1 , typename T2 , bool SO>
bool blaze::operator== (const SparseMatrix< T1, true > &lhs, const SparseMatrix< T2, true > &rhs)
 Equality operator for the comparison of two column-major sparse matrices.
 

Detailed Description

Function Documentation

template<typename MT , bool SO>
const SMatAbsExpr<MT,SO> blaze::abs ( const SparseMatrix< MT, SO > &  sm)
inline

Returns a matrix containing the absolute values of each single element of sm.

Parameters
smThe input matrix.
Returns
The absolute value of each single element of sm.

The abs function calculates the absolute value of each element of the input matrix sm. The operator returns an expression representing this operation.
The following example demonstrates the use of the abs function:

// ... Resizing and initialization
B = abs( A );
template<typename MT , bool SO>
const SMatEvalExpr<MT,SO> blaze::eval ( const SparseMatrix< MT, SO > &  sm)
inline

Forces the evaluation of the given sparse matrix expression sm.

Parameters
smThe input matrix.
Returns
The evaluated sparse matrix.

The eval function forces the evaluation of the given sparse matrix expression sm. The operator returns an expression representing the operation.
The following example demonstrates the use of the eval function

// ... Resizing and initialization
B = eval( A );
template<typename T1 , bool SO1, typename T2 , bool SO2>
bool blaze::operator!= ( const SparseMatrix< T1, SO1 > &  lhs,
const SparseMatrix< T2, SO2 > &  rhs 
)
inline

Inequality operator for the comparison of two sparse matrices.

Parameters
lhsThe left-hand side sparse matrix for the comparison.
rhsThe right-hand side sparse matrix for the comparison.
Returns
true if the two sparse matrices are not equal, false if they are equal.
template<typename T1 , typename T2 >
const DisableIf< IsMatMatMultExpr<T2>, TDVecSMatMultExpr<T1,T2> >::Type blaze::operator* ( const DenseVector< T1, true > &  vec,
const SparseMatrix< T2, false > &  mat 
)
inline

Multiplication operator for the multiplication of a transpose dense vector and a row-major sparse matrix ( $ \vec{y}^T=\vec{x}^T*A $).

Parameters
vecThe left-hand side transpose dense vector for the multiplication.
matThe right-hand side row-major sparse matrix for the multiplication.
Returns
The resulting transpose vector.
Exceptions
std::invalid_argumentVector and matrix sizes do not match.

This operator represents the multiplication between a transpose dense vector and a row-major sparse matrix:

// ... Resizing and initialization
y = x * A;

The operator returns an expression representing a transpose dense vector of the higher-order element type of the two involved element types T1::ElementType and T2::ElementType. Both the dense matrix type T1 and the dense vector type T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the MultTrait class template.
In case the current size of the vector vec doesn't match the current number of rows of the matrix mat, a std::invalid_argument is thrown.

template<typename T1 , typename T2 >
const DisableIf< IsMatMatMultExpr<T2>, TDVecTSMatMultExpr<T1,T2> >::Type blaze::operator* ( const DenseVector< T1, true > &  vec,
const SparseMatrix< T2, true > &  mat 
)
inline

Multiplication operator for the multiplication of a transpose dense vector and a column-major sparse matrix ( $ \vec{y}^T=\vec{x}^T*A $).

Parameters
vecThe left-hand side transpose dense vector for the multiplication.
matThe right-hand side column-major sparse matrix for the multiplication.
Returns
The resulting transpose vector.
Exceptions
std::invalid_argumentVector and matrix sizes do not match.

This operator represents the multiplication between a transpose dense vector and a column-major sparse matrix:

The operator returns an expression representing a transpose dense vector of the higher-order element type of the two involved element types T1::ElementType and T2::ElementType. Both the dense matrix type T1 and the dense vector type T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the MultTrait class template.
In case the current size of the vector vec doesn't match the current number of rows of the matrix mat, a std::invalid_argument is thrown.

template<typename T1 , typename T2 >
const TSMatSMatMultExpr<T1,T2> blaze::operator* ( const SparseMatrix< T1, true > &  lhs,
const SparseMatrix< T2, false > &  rhs 
)
inline

Multiplication operator for the multiplication of a column-major sparse matrix and a row-major sparse matrix ( $ A=B*C $).

Parameters
lhsThe left-hand side sparse matrix for the matrix multiplication.
rhsThe right-hand side sparse matrix for the matrix multiplication.
Returns
The product of the two matrices.
Exceptions
std::invalid_argumentMatrix sizes do not match

This operator represents the multiplication of a column-major sparse matrix and a row-major sparse matrix:

// ... Resizing and initialization
C = A * B;

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types T1::ElementType and T2::ElementType. Both matrix types T1 and T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the MultTrait class template.
In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

template<typename T1 , bool SO, typename T2 >
const EnableIf< IsNumeric<T2>, typename MultExprTrait<T1,T2>::Type >::Type blaze::operator* ( const SparseMatrix< T1, SO > &  mat,
T2  scalar 
)
inline

Multiplication operator for the multiplication of a sparse matrix and a scalar value ( $ A=B*s $).

Parameters
matThe left-hand side sparse matrix for the multiplication.
scalarThe right-hand side scalar value for the multiplication.
Returns
The scaled result matrix.

This operator represents the multiplication between a sparse matrix and a scalar value:

// ... Resizing and initialization
B = A * 1.25;

The operator returns an expression representing a sparse matrix of the higher-order element type of the involved data types T1::ElementType and T2. Note that this operator only works for scalar values of built-in data type.

template<typename T1 , typename T2 >
const SMatTSMatMultExpr<T1,T2> blaze::operator* ( const SparseMatrix< T1, false > &  lhs,
const SparseMatrix< T2, true > &  rhs 
)
inline

Multiplication operator for the multiplication of a row-major sparse matrix and a column-major sparse matrix ( $ A=B*C $).

Parameters
lhsThe left-hand side sparse matrix for the matrix multiplication.
rhsThe right-hand side sparse matrix for the matrix multiplication.
Returns
The product of the two matrices.
Exceptions
std::invalid_argumentMatrix sizes do not match

This operator represents the multiplication of a row-major sparse matrix and a column-major sparse matrix:

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types T1::ElementType and T2::ElementType. Both matrix types T1 and T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the MultTrait class template.
In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

template<typename T1 , typename T2 >
const SVecTSVecMultExpr<T1,T2> blaze::operator* ( const SparseVector< T1, false > &  lhs,
const SparseVector< T2, true > &  rhs 
)
inline

Multiplication operator for the sparse vector-sparse vector outer product ( $ A=\vec{b}*\vec{c}^T $).

Parameters
lhsThe left-hand side sparse vector for the outer product.
rhsThe right-hand side transpose sparse vector for the outer product.
Returns
The resulting sparse matrix.

This operator represents the outer product between a sparse vector and a transpose sparse vector:

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved element types T1::ElementType and T2::ElementType. Both vector types T1 and T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the MultTrait class template.

template<typename T1 , typename T2 >
const SMatSMatMultExpr<T1,T2> blaze::operator* ( const SparseMatrix< T1, false > &  lhs,
const SparseMatrix< T2, false > &  rhs 
)
inline

Multiplication operator for the multiplication of two row-major sparse matrices ( $ A=B*C $).

Parameters
lhsThe left-hand side sparse matrix for the matrix multiplication.
rhsThe right-hand side sparse matrix for the matrix multiplication.
Returns
The product of the two matrices.
Exceptions
std::invalid_argumentMatrix sizes do not match

This operator represents the multiplication of two row-major sparse matrices:

// ... Resizing and initialization
C = A * B;

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types T1::ElementType and T2::ElementType. Both matrix types T1 and T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the MultTrait class template.
In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

template<typename T1 , typename T2 , bool SO>
const EnableIf< IsNumeric<T1>, typename MultExprTrait<T1,T2>::Type >::Type blaze::operator* ( T1  scalar,
const SparseMatrix< T2, SO > &  mat 
)
inline

Multiplication operator for the multiplication of a scalar value and a sparse matrix ( $ A=s*B $).

Parameters
scalarThe left-hand side scalar value for the multiplication.
matThe right-hand side sparse matrix for the multiplication.
Returns
The scaled result matrix.

This operator represents the multiplication between a scalar value and a sparse matrix:

// ... Resizing and initialization
B = 1.25 * A;

The operator returns an expression representing a sparse matrix of the higher-order element type of the involved data types T1::ElementType and T2. Note that this operator only works for scalar values of built-in data type.

template<typename T1 , typename T2 >
const TSMatTSMatMultExpr<T1,T2> blaze::operator* ( const SparseMatrix< T1, true > &  lhs,
const SparseMatrix< T2, true > &  rhs 
)
inline

Multiplication operator for the multiplication of two column-major sparse matrices ( $ A=B*C $).

Parameters
lhsThe left-hand side sparse matrix for the matrix multiplication.
rhsThe right-hand side sparse matrix for the matrix multiplication.
Returns
The product of the two matrices.
Exceptions
std::invalid_argumentMatrix sizes do not match

This operator represents the multiplication of two column-major sparse matrices:

// ... Resizing and initialization
C = A * B;

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types T1::ElementType and T2::ElementType. Both matrix types T1 and T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the MultTrait class template.
In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

template<typename T1 , typename T2 >
const DVecTSVecMultExpr<T1,T2> blaze::operator* ( const DenseVector< T1, false > &  lhs,
const SparseVector< T2, true > &  rhs 
)
inline

Multiplication operator for the dense vector-sparse vector outer product ( $ A=\vec{b}*\vec{c}^T $).

Parameters
lhsThe left-hand side dense vector for the outer product.
rhsThe right-hand side transpose sparse vector for the outer product.
Returns
The resulting sparse matrix.

This operator represents the outer product between a dense vector and a transpose sparse vector:

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved element types T1::ElementType and T2::ElementType. Both vector types T1 and T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the MultTrait class template.

template<typename T1 , typename T2 >
const SVecTDVecMultExpr<T1,T2> blaze::operator* ( const SparseVector< T1, false > &  lhs,
const DenseVector< T2, true > &  rhs 
)
inline

Multiplication operator for the sparse vector-dense vector outer product ( $ A=\vec{b}*\vec{c}^T $).

Parameters
lhsThe left-hand side sparse vector for the outer product.
rhsThe right-hand side transpose dense vector for the outer product.
Returns
The resulting sparse matrix.

This operator represents the outer product between a sparse vector and a transpose dense vector:

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved element types T1::ElementType and T2::ElementType. Both vector types T1 and T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the MultTrait class template.

template<typename T1 , typename T2 >
const SMatTSMatAddExpr<T1,T2> blaze::operator+ ( const SparseMatrix< T1, false > &  lhs,
const SparseMatrix< T2, true > &  rhs 
)
inline

Addition operator for the addition of a row-major and a column-major sparse matrix ( $ A=B+C $).

Parameters
lhsThe left-hand side sparse matrix for the matrix addition.
rhsThe right-hand side sparse matrix to be added to the left-hand side matrix.
Returns
The sum of the two matrices.
Exceptions
std::invalid_argumentMatrix sizes do not match

This operator represents the addition of a row-major and a column-major sparse matrix:

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types T1::ElementType and T2::ElementType. Both matrix types T1 and T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the AddTrait class template.
In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

template<typename T1 , typename T2 >
const SMatSMatAddExpr<T1,T2> blaze::operator+ ( const SparseMatrix< T1, false > &  lhs,
const SparseMatrix< T2, false > &  rhs 
)
inline

Addition operator for the addition of two row-major sparse matrices ( $ A=B+C $).

Parameters
lhsThe left-hand side sparse matrix for the matrix addition.
rhsThe right-hand side sparse matrix to be added to the left-hand side matrix.
Returns
The sum of the two matrices.
Exceptions
std::invalid_argumentMatrix sizes do not match

This operator represents the addition of two row-major sparse matrices:

// ... Resizing and initialization
C = A + B;

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types T1::ElementType and T2::ElementType. Both matrix types T1 and T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the AddTrait class template.
In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

template<typename T1 , typename T2 >
const TSMatTSMatAddExpr<T1,T2> blaze::operator+ ( const SparseMatrix< T1, true > &  lhs,
const SparseMatrix< T2, true > &  rhs 
)
inline

Addition operator for the addition of two column-major sparse matrices ( $ A=B+C $).

Parameters
lhsThe left-hand side sparse matrix for the matrix addition.
rhsThe right-hand side sparse matrix to be added to the left-hand side matrix.
Returns
The sum of the two matrices.
Exceptions
std::invalid_argumentMatrix sizes do not match

This operator represents the addition of two column-major sparse matrices:

// ... Resizing and initialization
C = A + B;

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types T1::ElementType and T2::ElementType. Both matrix types T1 and T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the AddTrait class template.
In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

template<typename T1 , typename T2 >
const SMatTSMatAddExpr<T2,T1> blaze::operator+ ( const SparseMatrix< T1, true > &  lhs,
const SparseMatrix< T2, false > &  rhs 
)
inline

Addition operator for the addition of a column-major and a row-major sparse matrix ( $ A=B+C $).

Parameters
lhsThe left-hand side sparse matrix for the matrix addition.
rhsThe right-hand side sparse matrix to be added to the left-hand side matrix.
Returns
The sum of the two matrices.
Exceptions
std::invalid_argumentMatrix sizes do not match

This operator represents the addition of a column-major and a row-major sparse matrix:

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types T1::ElementType and T2::ElementType. Both matrix types T1 and T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the AddTrait class template.
In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

template<typename T1 , typename T2 >
const SMatTSMatSubExpr<T1,T2> blaze::operator- ( const SparseMatrix< T1, false > &  lhs,
const SparseMatrix< T2, true > &  rhs 
)
inline

Subtraction operator for the subtraction of a row-major and a column-major sparse matrix ( $ A=B-C $).

Parameters
lhsThe left-hand side sparse matrix for the matrix subtraction.
rhsThe right-hand side sparse matrix to be subtracted from the left-hand side matrix.
Returns
The sum of the two matrices.
Exceptions
std::invalid_argumentMatrix sizes do not match

This operator represents the subtraction of a row-major and a column-major sparse matrix:

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types T1::ElementType and T2::ElementType. Both matrix types T1 and T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the SubTrait class template.
In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

template<typename T1 , typename T2 >
const TSMatSMatSubExpr<T1,T2> blaze::operator- ( const SparseMatrix< T1, true > &  lhs,
const SparseMatrix< T2, false > &  rhs 
)
inline

Subtraction operator for the subtraction of a column-major and a row-major sparse matrix ( $ A=B-C $).

Parameters
lhsThe left-hand side sparse matrix for the matrix subtraction.
rhsThe right-hand side sparse matrix to be added to the left-hand side matrix.
Returns
The sum of the two matrices.
Exceptions
std::invalid_argumentMatrix sizes do not match

This operator represents the subtraction of a column-major and a row-major sparse matrix:

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types T1::ElementType and T2::ElementType. Both matrix types T1 and T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the SubTrait class template.
In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

template<typename MT , bool SO>
const SMatScalarMultExpr<MT,typename BaseElementType<MT>::Type,SO> blaze::operator- ( const SparseMatrix< MT, SO > &  sm)
inline

Unary minus operator for the negation of a sparse matrix ( $ A = -B $).

Parameters
smThe sparse matrix to be negated.
Returns
The negation of the matrix.

This operator represents the negation of a sparse matrix:

// ... Resizing and initialization
B = -A;

The operator returns an expression representing the negation of the given sparse matrix.

template<typename T1 , typename T2 >
const SMatSMatSubExpr<T1,T2> blaze::operator- ( const SparseMatrix< T1, false > &  lhs,
const SparseMatrix< T2, false > &  rhs 
)
inline

Subtraction operator for the subtraction of two row-major sparse matrices ( $ A=B-C $).

Parameters
lhsThe left-hand side sparse matrix for the matrix subtraction.
rhsThe right-hand side sparse matrix to be subtracted from the left-hand side matrix.
Returns
The difference of the two matrices.
Exceptions
std::invalid_argumentMatrix sizes do not match

This operator represents the subtraction of two row-major sparse matrices:

// ... Resizing and initialization
C = A - B;

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types T1::ElementType and T2::ElementType. Both matrix types T1 and T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the SubTrait class template.
In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

template<typename T1 , typename T2 >
const TSMatTSMatSubExpr<T1,T2> blaze::operator- ( const SparseMatrix< T1, true > &  lhs,
const SparseMatrix< T2, true > &  rhs 
)
inline

Subtraction operator for the subtraction of two column-major sparse matrices ( $ A=B-C $).

Parameters
lhsThe left-hand side sparse matrix for the matrix subtraction.
rhsThe right-hand side sparse matrix to be subtracted from the left-hand side matrix.
Returns
The sum of the two matrices.
Exceptions
std::invalid_argumentMatrix sizes do not match

This operator represents the subtraction of two column-major sparse matrices:

// ... Resizing and initialization
C = A - B;

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types T1::ElementType and T2::ElementType. Both matrix types T1 and T2 as well as the two element types T1::ElementType and T2::ElementType have to be supported by the SubTrait class template.
In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

template<typename T1 , bool SO, typename T2 >
const EnableIf< IsNumeric<T2>, typename SMatScalarDivExprHelper<T1,T2,SO>::Type >::Type blaze::operator/ ( const SparseMatrix< T1, SO > &  mat,
T2  scalar 
)
inline

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

Parameters
matThe left-hand side sparse matrix for the division.
scalarThe right-hand side scalar value for the division.
Returns
The scaled result matrix.

This operator represents the division of a sparse matrix by a scalar value:

// ... Resizing and initialization
B = A / 0.24;

The operator returns an expression representing a sparse matrix of the higher-order element type of the involved data types T1::ElementType and T2. Note that this operator only works for scalar values of built-in data type.

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

template<typename T1 , typename T2 , bool SO>
bool blaze::operator== ( const SparseMatrix< T1, true > &  lhs,
const SparseMatrix< T2, true > &  rhs 
)
inline

Equality operator for the comparison of two column-major sparse matrices.

Parameters
lhsThe left-hand side sparse matrix for the comparison.
rhsThe right-hand side sparse matrix for the comparison.
Returns
true if the two sparse matrices are equal, false if not.
template<typename T1 , typename T2 , bool SO>
bool blaze::operator== ( const SparseMatrix< T1, SO > &  lhs,
const SparseMatrix< T2,!SO > &  rhs 
)
inline

Equality operator for the comparison of two sparse matrices with different storage order.

Parameters
lhsThe left-hand side sparse matrix for the comparison.
rhsThe right-hand side sparse matrix for the comparison.
Returns
true if the two sparse matrices are equal, false if not.
template<typename T1 , typename T2 >
bool blaze::operator== ( const SparseMatrix< T1, false > &  lhs,
const SparseMatrix< T2, false > &  rhs 
)
inline

Equality operator for the comparison of two row-major sparse matrices.

Parameters
lhsThe left-hand side sparse matrix for the comparison.
rhsThe right-hand side sparse matrix for the comparison.
Returns
true if the two sparse matrices are equal, false if not.
template<typename T1 , typename T2 >
bool blaze::operator== ( const SparseMatrix< T1, true > &  lhs,
const SparseMatrix< T2, true > &  rhs 
)
inline

Equality operator for the comparison of two column-major sparse matrices.

Parameters
lhsThe left-hand side sparse matrix for the comparison.
rhsThe right-hand side sparse matrix for the comparison.
Returns
true if the two sparse matrices are equal, false if not.
template<typename MT , bool SO>
const SMatTransExpr<MT,!SO> blaze::trans ( const SparseMatrix< MT, SO > &  sm)
inline

Calculation of the transpose of the given sparse matrix.

Parameters
smThe sparse matrix to be transposed.
Returns
The transpose of the matrix.

This function returns an expression representing the transpose of the given sparse matrix:

// ... Resizing and initialization
B = trans( A );