Modules | Classes | Functions
Sparse Matrices

Modules

 Expressions
 
 CompressedMatrix
 
 IdentityMatrix
 

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...
 
class  blaze::MatrixAccessProxy< MT >
 Access proxy for sparse, $ M \times N $ matrices.The MatrixAccessProxy provides safe access to the elements of a non-const sparse matrices.
The proxied access to the elements of a sparse matrix is necessary since it may be possible that several insertion operations happen in the same statement. The following code illustrates this with two examples by means of the CompressedMatrix class: More...
 

Functions

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% (const DenseMatrix< MT1, false > &lhs, const SparseMatrix< MT2, false > &rhs)
 Operator for the Schur product of a row-major dense matrix and a row-major sparse matrix ( $ A=B \circ C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% (const DenseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, false > &rhs)
 Operator for the Schur product of a column-major dense matrix and a row-major sparse matrix ( $ A=B \circ C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% (const DenseMatrix< MT1, false > &lhs, const SparseMatrix< MT2, true > &rhs)
 Operator for the Schur product of a row-major dense matrix and a column-major sparse matrix ( $ A=B \circ C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% (const DenseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, true > &rhs)
 Operator for the Schur product of a column-major dense matrix and a column-major sparse matrix ( $ A=B \circ C $). More...
 
template<typename VT1 , typename VT2 >
decltype(auto) blaze::operator* (const DenseVector< VT1, false > &lhs, const SparseVector< VT2, true > &rhs)
 Multiplication operator for the dense vector-sparse vector outer product ( $ A=\vec{b}*\vec{c}^T $). More...
 
template<typename MT , bool SO>
decltype(auto) blaze::decldiag (const SparseMatrix< MT, SO > &sm)
 Declares the given sparse matrix expression sm as diagonal. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::declherm (const SparseMatrix< MT, SO > &sm)
 Declares the given sparse matrix expression sm as Hermitian. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::decllow (const SparseMatrix< MT, SO > &sm)
 Declares the given sparse matrix expression sm as lower. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::declsym (const SparseMatrix< MT, SO > &sm)
 Declares the given sparse matrix expression sm as symmetric. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::declupp (const SparseMatrix< MT, SO > &sm)
 Declares the given sparse matrix expression sm as upper. More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% (const SparseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
 Operator for the Schur product of a row-major sparse matrix and a row-major dense matrix ( $ A=B \circ C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% (const SparseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, true > &rhs)
 Operator for the Schur product of a row-major sparse matrix and a column-major dense matrix ( $ A=B \circ C $). More...
 
template<typename MT , bool SO>
decltype(auto) blaze::eval (const SparseMatrix< MT, SO > &sm)
 Forces the evaluation of the given sparse matrix expression sm. More...
 
template<typename MT , bool SO, typename OP >
decltype(auto) blaze::map (const SparseMatrix< MT, SO > &sm, OP op)
 Evaluates the given custom operation on each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO, typename OP >
decltype(auto) blaze::forEach (const SparseMatrix< MT, SO > &sm, OP op)
 Evaluates the given custom operation on each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::abs (const SparseMatrix< MT, SO > &sm)
 Applies the abs() function to each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::floor (const SparseMatrix< MT, SO > &sm)
 Applies the floor() function to each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::ceil (const SparseMatrix< MT, SO > &sm)
 Applies the ceil() function to each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::trunc (const SparseMatrix< MT, SO > &sm)
 Applies the trunc() function to each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::round (const SparseMatrix< MT, SO > &sm)
 Applies the round() function to each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::conj (const SparseMatrix< MT, SO > &sm)
 Returns a matrix containing the complex conjugate of each single element of sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::ctrans (const SparseMatrix< MT, SO > &sm)
 Returns the conjugate transpose matrix of sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::real (const SparseMatrix< MT, SO > &sm)
 Returns a matrix containing the real parts of each single element of sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::imag (const SparseMatrix< MT, SO > &sm)
 Returns a matrix containing the imaginary parts of each single element of sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::sqrt (const SparseMatrix< MT, SO > &sm)
 Computes the square root of each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::invsqrt (const SparseMatrix< MT, SO > &sm)
 Computes the inverse square root of each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::cbrt (const SparseMatrix< MT, SO > &sm)
 Computes the cubic root of each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::invcbrt (const SparseMatrix< MT, SO > &sm)
 Computes the inverse cubic root of each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO, typename DT >
decltype(auto) blaze::clamp (const SparseMatrix< MT, SO > &sm, const DT &min, const DT &max)
 Restricts each single element of the sparse matrix sm to the range $[min..max]$. More...
 
template<typename MT , bool SO, typename ST , typename = EnableIf_< IsNumeric<ST> >>
decltype(auto) blaze::pow (const SparseMatrix< MT, SO > &sm, ST exp)
 Computes the exponential value for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::exp (const SparseMatrix< MT, SO > &sm)
 Computes $ e^x $ for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::exp2 (const SparseMatrix< MT, SO > &sm)
 Computes $ 2^x $ for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::exp10 (const SparseMatrix< MT, SO > &sm)
 Computes $ 10^x $ for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::log (const SparseMatrix< MT, SO > &sm)
 Computes the natural logarithm for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::log10 (const SparseMatrix< MT, SO > &sm)
 Computes the binary logarithm for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::log2 (const SparseMatrix< MT, SO > &sm)
 Computes the common logarithm for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::sin (const SparseMatrix< MT, SO > &sm)
 Computes the sine for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::asin (const SparseMatrix< MT, SO > &sm)
 Computes the inverse sine for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::sinh (const SparseMatrix< MT, SO > &sm)
 Computes the hyperbolic sine for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::asinh (const SparseMatrix< MT, SO > &sm)
 Computes the inverse hyperbolic sine for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::cos (const SparseMatrix< MT, SO > &sm)
 Computes the cosine for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::acos (const SparseMatrix< MT, SO > &sm)
 Computes the inverse cosine for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::cosh (const SparseMatrix< MT, SO > &sm)
 Computes the hyperbolic cosine for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::acosh (const SparseMatrix< MT, SO > &sm)
 Computes the inverse hyperbolic cosine for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::tan (const SparseMatrix< MT, SO > &sm)
 Computes the tangent for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::atan (const SparseMatrix< MT, SO > &sm)
 Computes the inverse tangent for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::tanh (const SparseMatrix< MT, SO > &sm)
 Computes the hyperbolic tangent for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::atanh (const SparseMatrix< MT, SO > &sm)
 Computes the inverse hyperbolic tangent for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::erf (const SparseMatrix< MT, SO > &sm)
 Computes the error function for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::erfc (const SparseMatrix< MT, SO > &sm)
 Computes the complementary error function for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::norm (const SparseMatrix< MT, SO > &sm)
 Computes the L2 norm for the given sparse matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::sqrNorm (const SparseMatrix< MT, SO > &sm)
 Computes the squared L2 norm for the given sparse matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::l1Norm (const SparseMatrix< MT, SO > &sm)
 Computes the L1 norm for the given sparse matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::l2Norm (const SparseMatrix< MT, SO > &sm)
 Computes the L2 norm for the given sparse matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::l3Norm (const SparseMatrix< MT, SO > &sm)
 Computes the L3 norm for the given sparse matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::l4Norm (const SparseMatrix< MT, SO > &sm)
 Computes the L4 norm for the given sparse matrix. More...
 
template<typename MT , bool SO, typename ST >
decltype(auto) blaze::lpNorm (const SparseMatrix< MT, SO > &sm, ST p)
 Computes the Lp norm for the given sparse matrix. More...
 
template<size_t P, typename MT , bool SO>
decltype(auto) blaze::lpNorm (const SparseMatrix< MT, SO > &sm)
 Computes the Lp norm for the given sparse matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::maxNorm (const SparseMatrix< MT, SO > &sm)
 Computes the maximum norm for the given sparse matrix. More...
 
template<typename MT , bool SO, typename ST , typename = EnableIf_< IsNumeric<ST> >>
decltype(auto) blaze::operator/ (const SparseMatrix< MT, SO > &mat, ST scalar)
 Division operator for the division of a sparse matrix by a scalar value ( $ A=B/s $). More...
 
template<typename MT , bool SO>
decltype(auto) blaze::operator- (const SparseMatrix< MT, SO > &sm)
 Unary minus operator for the negation of a sparse matrix ( $ A = -B $). More...
 
template<typename MT , bool SO, typename ST , typename = EnableIf_< IsNumeric<ST> >>
decltype(auto) blaze::operator* (const SparseMatrix< MT, SO > &mat, ST scalar)
 Multiplication operator for the multiplication of a sparse matrix and a scalar value ( $ A=B*s $). More...
 
template<typename ST , typename MT , bool SO, typename = EnableIf_< IsNumeric<ST> >>
decltype(auto) blaze::operator* (ST scalar, const SparseMatrix< MT, SO > &mat)
 Multiplication operator for the multiplication of a scalar value and a sparse matrix ( $ A=s*B $). More...
 
template<typename MT , bool SO>
decltype(auto) blaze::serial (const SparseMatrix< MT, SO > &sm)
 Forces the serial evaluation of the given sparse matrix expression sm. More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator+ (const SparseMatrix< MT1, false > &lhs, const SparseMatrix< MT2, false > &rhs)
 Addition operator for the addition of two row-major sparse matrices ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* (const SparseMatrix< MT1, false > &lhs, const SparseMatrix< MT2, false > &rhs)
 Multiplication operator for the multiplication of two row-major sparse matrices ( $ A=B*C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% (const SparseMatrix< MT1, false > &lhs, const SparseMatrix< MT2, false > &rhs)
 Operator for the Schur product of two row-major sparse matrices ( $ A=B \circ C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator- (const SparseMatrix< MT1, false > &lhs, const SparseMatrix< MT2, false > &rhs)
 Subtraction operator for the subtraction of two row-major sparse matrices ( $ A=B-C $). More...
 
template<typename MT , bool SO>
decltype(auto) blaze::trans (const SparseMatrix< MT, SO > &sm)
 Calculation of the transpose of the given sparse matrix. More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator+ (const SparseMatrix< MT1, false > &lhs, const SparseMatrix< MT2, true > &rhs)
 Addition operator for the addition of a row-major and a column-major sparse matrix ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator+ (const SparseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, false > &rhs)
 Addition operator for the addition of a column-major and a row-major sparse matrix ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* (const SparseMatrix< MT1, false > &lhs, const SparseMatrix< MT2, true > &rhs)
 Multiplication operator for the multiplication of a row-major sparse matrix and a column-major sparse matrix ( $ A=B*C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% (const SparseMatrix< MT1, false > &lhs, const SparseMatrix< MT2, true > &rhs)
 Operator for the Schur product of a row-major and a column-major sparse matrix ( $ A=B \circ C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator- (const SparseMatrix< MT1, false > &lhs, const SparseMatrix< MT2, true > &rhs)
 Subtraction operator for the subtraction of a row-major and a column-major sparse matrix ( $ A=B-C $). More...
 
template<typename VT1 , typename VT2 >
decltype(auto) blaze::operator* (const SparseVector< VT1, false > &lhs, const DenseVector< VT2, true > &rhs)
 Multiplication operator for the sparse vector-dense vector outer product ( $ A=\vec{b}*\vec{c}^T $). More...
 
template<typename VT1 , typename VT2 >
decltype(auto) blaze::operator* (const SparseVector< VT1, false > &lhs, const SparseVector< VT2, true > &rhs)
 Multiplication operator for the sparse vector-sparse vector outer product ( $ A=\vec{b}*\vec{c}^T $). More...
 
template<typename VT , typename MT >
decltype(auto) blaze::operator* (const DenseVector< VT, true > &vec, const SparseMatrix< MT, 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 $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% (const SparseMatrix< MT1, true > &lhs, const DenseMatrix< MT2, false > &rhs)
 Operator for the Schur product of a column-major sparse matrix and a row-major dense matrix ( $ A=B \circ C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% (const SparseMatrix< MT1, true > &lhs, const DenseMatrix< MT2, true > &rhs)
 Operator for the Schur product of a column-major sparse matrix and a column-major dense matrix ( $ A=B \circ C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* (const SparseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, false > &rhs)
 Multiplication operator for the multiplication of a column-major sparse matrix and a row-major sparse matrix ( $ A=B*C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% (const SparseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, false > &rhs)
 Operator for the Schur product of a column-major and a row-major sparse matrix ( $ A=B \circ C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator- (const SparseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, false > &rhs)
 Subtraction operator for the subtraction of a column-major and a row-major sparse matrix ( $ A=B-C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator+ (const SparseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, true > &rhs)
 Addition operator for the addition of two column-major sparse matrices ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* (const SparseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, true > &rhs)
 Multiplication operator for the multiplication of two column-major sparse matrices ( $ A=B*C $). More...
 
template<typename MT1 , typename MT2 , typename = DisableIf_< Or< And< IsUniLower<MT1>, IsUniUpper<MT2> > , And< IsUniUpper<MT1>, IsUniLower<MT2> > > >>
const TSMatTSMatSchurExpr< MT1, MT2 > blaze::tsmattsmatschur (const SparseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, true > &rhs)
 Backend implementation of the Schur product between two column-major sparse matrices ( $ A=B \circ C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% (const SparseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, true > &rhs)
 Operator for the Schur product of two column-major sparse matrices ( $ A=B \circ C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator- (const SparseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, true > &rhs)
 Subtraction operator for the subtraction of two column-major sparse matrices ( $ A=B-C $). More...
 
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. More...
 
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. More...
 

MatrixAccessProxy global functions

template<typename MT >
void blaze::reset (const MatrixAccessProxy< MT > &proxy)
 Resetting the represented element to the default initial values. More...
 
template<typename MT >
void blaze::clear (const MatrixAccessProxy< MT > &proxy)
 Clearing the represented element. More...
 
template<bool RF, typename MT >
bool blaze::isDefault (const MatrixAccessProxy< MT > &proxy)
 Returns whether the represented element is in default state. More...
 
template<bool RF, typename MT >
bool blaze::isReal (const MatrixAccessProxy< MT > &proxy)
 Returns whether the matrix element represents a real number. More...
 
template<bool RF, typename MT >
bool blaze::isZero (const MatrixAccessProxy< MT > &proxy)
 Returns whether the represented element is 0. More...
 
template<bool RF, typename MT >
bool blaze::isOne (const MatrixAccessProxy< MT > &proxy)
 Returns whether the represented element is 1. More...
 
template<typename MT >
bool blaze::isnan (const MatrixAccessProxy< MT > &proxy)
 Returns whether the represented element is not a number. More...
 
template<typename MT >
void blaze::swap (const MatrixAccessProxy< MT > &a, const MatrixAccessProxy< MT > &b) noexcept
 Swapping the contents of two access proxies. More...
 
template<typename MT , typename T >
void blaze::swap (const MatrixAccessProxy< MT > &a, T &b) noexcept
 Swapping the contents of an access proxy with another element. More...
 
template<typename T , typename MT >
void blaze::swap (T &a, const MatrixAccessProxy< MT > &b) noexcept
 Swapping the contents of an access proxy with another element. More...
 

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. More...
 
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. More...
 
template<typename MT , bool SO, typename ST >
EnableIf_< IsNumeric< ST >, MT &> blaze::operator*= (SparseMatrix< MT, SO > &mat, ST scalar)
 Multiplication assignment operator for the multiplication of a sparse matrix and a scalar value ( $ A*=s $). More...
 
template<typename MT , bool SO, typename ST >
EnableIf_< IsNumeric< ST >, MT &> blaze::operator*= (SparseMatrix< MT, SO > &&mat, ST scalar)
 Multiplication assignment operator for the multiplication of a temporary sparse matrix and a scalar value ( $ A*=s $). More...
 
template<typename MT , bool SO, typename ST >
EnableIf_< IsNumeric< ST >, MT &> blaze::operator/= (SparseMatrix< MT, SO > &mat, ST scalar)
 Division assignment operator for the division of a sparse matrix by a scalar value ( $ A/=s $). More...
 
template<typename MT , bool SO, typename ST >
EnableIf_< IsNumeric< ST >, MT &> blaze::operator/= (SparseMatrix< MT, SO > &&mat, ST scalar)
 Division assignment operator for the division of a temporary sparse matrix by a scalar value ( $ A/=s $). More...
 
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. More...
 

SparseMatrix functions

template<typename MT , bool SO>
bool blaze::isnan (const SparseMatrix< MT, SO > &sm)
 Checks the given sparse matrix for not-a-number elements. More...
 
template<bool RF, typename MT , bool SO>
bool blaze::isSymmetric (const SparseMatrix< MT, SO > &sm)
 Checks if the given sparse matrix is symmetric. More...
 
template<bool RF, typename MT , bool SO>
bool blaze::isHermitian (const SparseMatrix< MT, SO > &sm)
 Checks if the given sparse matrix is Hermitian. More...
 
template<bool RF, typename MT , bool SO>
bool blaze::isUniform (const SparseMatrix< MT, SO > &sm)
 Checks if the given sparse matrix is a uniform matrix. More...
 
template<bool RF, typename MT , bool SO>
bool blaze::isLower (const SparseMatrix< MT, SO > &sm)
 Checks if the given sparse matrix is a lower triangular matrix. More...
 
template<bool RF, typename MT , bool SO>
bool blaze::isUniLower (const SparseMatrix< MT, SO > &sm)
 Checks if the given sparse matrix is a lower unitriangular matrix. More...
 
template<bool RF, typename MT , bool SO>
bool blaze::isStrictlyLower (const SparseMatrix< MT, SO > &sm)
 Checks if the given sparse matrix is a strictly lower triangular matrix. More...
 
template<bool RF, typename MT , bool SO>
bool blaze::isUpper (const SparseMatrix< MT, SO > &sm)
 Checks if the given sparse matrix is an upper triangular matrix. More...
 
template<bool RF, typename MT , bool SO>
bool blaze::isUniUpper (const SparseMatrix< MT, SO > &sm)
 Checks if the given sparse matrix is an upper unitriangular matrix. More...
 
template<bool RF, typename MT , bool SO>
bool blaze::isStrictlyUpper (const SparseMatrix< MT, SO > &sm)
 Checks if the given sparse matrix is a strictly upper triangular matrix. More...
 
template<bool RF, typename MT , bool SO>
bool blaze::isDiagonal (const SparseMatrix< MT, SO > &sm)
 Checks if the give sparse matrix is diagonal. More...
 
template<bool RF, typename MT , bool SO>
bool blaze::isIdentity (const SparseMatrix< MT, SO > &sm)
 Checks if the give sparse matrix is an identity matrix. More...
 
template<typename MT , bool SO>
const ElementType_< MT > blaze::min (const SparseMatrix< MT, SO > &sm)
 Returns the smallest element of the sparse matrix. More...
 
template<typename MT , bool SO>
const ElementType_< MT > blaze::max (const SparseMatrix< MT, SO > &sm)
 Returns the largest element of the sparse matrix. More...
 

Detailed Description

Function Documentation

◆ abs()

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

Applies the abs() function to each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The resulting sparse matrix.

This function applies the abs() function to each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the abs() function:

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

◆ acos()

template<typename MT , bool SO>
decltype(auto) blaze::acos ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the inverse cosine for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix; all non-zero elements must be in the range $[-1..1]$.
Returns
The inverse cosine of each non-zero element of sm.

The acos() function computes the inverse cosine for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the acos() function:

// ... Resizing and initialization
B = acos( A );
Note
All non-zero elements are expected to be in the range $[-1..1]$. No runtime checks are performed to assert this precondition!

◆ acosh()

template<typename MT , bool SO>
decltype(auto) blaze::acosh ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the inverse hyperbolic cosine for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix; all non-zero elements must be in the range $[1..\infty)$.
Returns
The inverse hyperbolic cosine of each non-zero element of sm.

The acosh() function computes the inverse hyperbolic cosine for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the acosh() function:

// ... Resizing and initialization
B = acosh( A );
Note
All non-zero elements are expected to be in the range $[1..\infty)$. No runtime checks are performed to assert this precondition!

◆ asin()

template<typename MT , bool SO>
decltype(auto) blaze::asin ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the inverse sine for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix; all non-zero elements must be in the range $[-1..1]$.
Returns
The inverse sine of each non-zero element of sm.

The asin() function computes the inverse sine for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the asin() function:

// ... Resizing and initialization
B = asin( A );
Note
All non-zero elements are expected to be in the range $[-1..1]$. No runtime checks are performed to assert this precondition!

◆ asinh()

template<typename MT , bool SO>
decltype(auto) blaze::asinh ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the inverse hyperbolic sine for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The inverse hyperbolic sine of each non-zero element of sm.

The asinh() function computes the inverse hyperbolic sine for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the asinh() function:

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

◆ atan()

template<typename MT , bool SO>
decltype(auto) blaze::atan ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the inverse tangent for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The inverse tangent of each non-zero element of sm.

The atan() function computes the inverse tangent for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the atan() function:

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

◆ atanh()

template<typename MT , bool SO>
decltype(auto) blaze::atanh ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the inverse hyperbolic tangent for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix; all non-zero elements must be in the range $[-1..1]$.
Returns
The inverse hyperbolic tangent of each non-zero element of sm.

The atanh() function computes the inverse hyperbolic tangent for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the atanh() function:

// ... Resizing and initialization
B = atanh( A );
Note
All non-zero elements are expected to be in the range $[-1..1]$. No runtime checks are performed to assert this precondition!

◆ cbrt()

template<typename MT , bool SO>
decltype(auto) blaze::cbrt ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the cubic root of each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix; all non-zero elements must be in the range $[0..\infty)$.
Returns
The cubic root of each single element of sm.

The cbrt() function computes the cubic root of each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the cbrt() function:

// ... Resizing and initialization
B = cbrt( A );
Note
All non-zero elements are expected to be in the range $[0..\infty)$. No runtime checks are performed to assert this precondition!

◆ ceil()

template<typename MT , bool SO>
decltype(auto) blaze::ceil ( const SparseMatrix< MT, SO > &  sm)
inline

Applies the ceil() function to each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The resulting sparse matrix.

This function applies the ceil() function to each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the ceil() function:

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

◆ clamp()

template<typename MT , bool SO, typename DT >
decltype(auto) blaze::clamp ( const SparseMatrix< MT, SO > &  sm,
const DT &  min,
const DT &  max 
)
inline

Restricts each single element of the sparse matrix sm to the range $[min..max]$.

Parameters
smThe input matrix.
minThe lower delimiter.
maxThe upper delimiter.
Returns
The matrix with restricted elements.

The clamp() function restricts each element of the input matrix sm to the range $[min..max]$. The function returns an expression representing this operation.
The following example demonstrates the use of the clamp() function:

// ... Resizing and initialization
B = clamp( A, -1.0, 1.0 );

◆ clear()

template<typename MT >
void blaze::clear ( const MatrixAccessProxy< MT > &  proxy)
inline

Clearing the represented element.

Parameters
proxyThe given access proxy.
Returns
void

This function clears the element represented by the access proxy to its default initial state. In case the access proxy represents a vector- or matrix-like data structure that provides a clear() function, this function clears the vector/matrix to its default initial state.

◆ conj()

template<typename MT , bool SO>
decltype(auto) blaze::conj ( const SparseMatrix< MT, SO > &  sm)
inline

Returns a matrix containing the complex conjugate of each single element of sm.

Parameters
smThe input matrix.
Returns
The complex conjugate of each single element of sm.

The conj function calculates the complex conjugate of each element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the conj function:

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

◆ cos()

template<typename MT , bool SO>
decltype(auto) blaze::cos ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the cosine for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The cosine of each non-zero element of sm.

The cos() function computes the cosine for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the cos() function:

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

◆ cosh()

template<typename MT , bool SO>
decltype(auto) blaze::cosh ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the hyperbolic cosine for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The hyperbolic cosine of each non-zero element of sm.

The cosh() function computes the hyperbolic cosine for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the cosh() function:

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

◆ ctrans()

template<typename MT , bool SO>
decltype(auto) blaze::ctrans ( const SparseMatrix< MT, SO > &  sm)
inline

Returns the conjugate transpose matrix of sm.

Parameters
smThe input matrix.
Returns
The conjugate transpose of sm.

The ctrans function returns an expression representing the conjugate transpose (also called adjoint matrix, Hermitian conjugate matrix or transjugate matrix) of the given input matrix sm.
The following example demonstrates the use of the ctrans function:

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

Note that the ctrans function has the same effect as manually applying the conj and trans function in any order:

B = trans( conj( A ) ); // Computing the conjugate transpose matrix
B = conj( trans( A ) ); // Computing the conjugate transpose matrix

◆ decldiag()

template<typename MT , bool SO>
decltype(auto) blaze::decldiag ( const SparseMatrix< MT, SO > &  sm)
inline

Declares the given sparse matrix expression sm as diagonal.

Parameters
smThe input matrix.
Returns
The redeclared sparse matrix.
Exceptions
std::invalid_argumentInvalid diagonal matrix specification.

The decldiag function declares the given sparse matrix expression sm as diagonal. In case the given matrix is not a square matrix, a std::invalid_argument exception is thrown.
The following example demonstrates the use of the decldiag function:

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

◆ declherm()

template<typename MT , bool SO>
decltype(auto) blaze::declherm ( const SparseMatrix< MT, SO > &  sm)
inline

Declares the given sparse matrix expression sm as Hermitian.

Parameters
smThe input matrix.
Returns
The redeclared sparse matrix.
Exceptions
std::invalid_argumentInvalid Hermitian matrix specification.

The declherm function declares the given sparse matrix expression sm as Hermitian. In case the given matrix is not a square matrix, a std::invalid_argument exception is thrown.
The following example demonstrates the use of the declherm function:

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

◆ decllow()

template<typename MT , bool SO>
decltype(auto) blaze::decllow ( const SparseMatrix< MT, SO > &  sm)
inline

Declares the given sparse matrix expression sm as lower.

Parameters
smThe input matrix.
Returns
The redeclared sparse matrix.
Exceptions
std::invalid_argumentInvalid lower matrix specification.

The decllow function declares the given sparse matrix expression sm as lower. In case the given matrix is not a square matrix, a std::invalid_argument exception is thrown.
The following example demonstrates the use of the decllow function:

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

◆ declsym()

template<typename MT , bool SO>
decltype(auto) blaze::declsym ( const SparseMatrix< MT, SO > &  sm)
inline

Declares the given sparse matrix expression sm as symmetric.

Parameters
smThe input matrix.
Returns
The redeclared sparse matrix.
Exceptions
std::invalid_argumentInvalid symmetric matrix specification.

The declsym function declares the given sparse matrix expression sm as symmetric. In case the given matrix is not a square matrix, a std::invalid_argument exception is thrown.
The following example demonstrates the use of the declsym function:

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

◆ declupp()

template<typename MT , bool SO>
decltype(auto) blaze::declupp ( const SparseMatrix< MT, SO > &  sm)
inline

Declares the given sparse matrix expression sm as upper.

Parameters
smThe input matrix.
Returns
The redeclared sparse matrix.
Exceptions
std::invalid_argumentInvalid upper matrix specification.

The declupp function declares the given sparse matrix expression sm as upper. In case the given matrix is not a square matrix, a std::invalid_argument exception is thrown.
The following example demonstrates the use of the declupp function:

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

◆ erf()

template<typename MT , bool SO>
decltype(auto) blaze::erf ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the error function for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The error function of each non-zero element of sm.

The erf() function computes the error function for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the erf() function:

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

◆ erfc()

template<typename MT , bool SO>
decltype(auto) blaze::erfc ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the complementary error function for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The complementary error function of each non-zero element of sm.

The erfc() function computes the complementary error function for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the erfc() function:

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

◆ eval()

template<typename MT , bool SO>
decltype(auto) blaze::eval ( const SparseMatrix< MT, SO > &  sm)

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 function returns an expression representing the operation.
The following example demonstrates the use of the eval function:

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

◆ exp()

template<typename MT , bool SO>
decltype(auto) blaze::exp ( const SparseMatrix< MT, SO > &  sm)
inline

Computes $ e^x $ for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The resulting sparse matrix.

The exp() function computes $ e^x $ for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the exp() function:

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

◆ exp10()

template<typename MT , bool SO>
decltype(auto) blaze::exp10 ( const SparseMatrix< MT, SO > &  sm)
inline

Computes $ 10^x $ for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The resulting sparse matrix.

The exp10() function computes $ 10^x $ for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the exp10() function:

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

◆ exp2()

template<typename MT , bool SO>
decltype(auto) blaze::exp2 ( const SparseMatrix< MT, SO > &  sm)
inline

Computes $ 2^x $ for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The resulting sparse matrix.

The exp2() function computes $ 2^x $ for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the exp2() function:

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

◆ floor()

template<typename MT , bool SO>
decltype(auto) blaze::floor ( const SparseMatrix< MT, SO > &  sm)
inline

Applies the floor() function to each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The resulting sparse matrix.

This function applies the floor() function to each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the floor() function:

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

◆ forEach()

template<typename MT , bool SO, typename OP >
decltype(auto) blaze::forEach ( const SparseMatrix< MT, SO > &  sm,
OP  op 
)
inline

Evaluates the given custom operation on each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
opThe custom operation.
Returns
The custom operation applied to each single element of sm.

The forEach() function evaluates the given custom operation on each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the forEach() function:

// ... Resizing and initialization
B = forEach( A, []( double a ){ return std::sqrt( a ); } );

◆ imag()

template<typename MT , bool SO>
decltype(auto) blaze::imag ( const SparseMatrix< MT, SO > &  sm)
inline

Returns a matrix containing the imaginary parts of each single element of sm.

Parameters
smThe input matrix.
Returns
The imaginary part of each single element of sm.

The imag function calculates the imaginary part of each element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the imag function:

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

◆ invcbrt()

template<typename MT , bool SO>
decltype(auto) blaze::invcbrt ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the inverse cubic root of each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix; all non-zero elements must be in the range $(0..\infty)$.
Returns
The inverse cubic root of each single element of sm.

The invcbrt() function computes the inverse cubic root of each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the invcbrt() function:

// ... Resizing and initialization
B = invcbrt( A );
Note
All non-zero elements are expected to be in the range $(0..\infty)$. No runtime checks are performed to assert this precondition!

◆ invsqrt()

template<typename MT , bool SO>
decltype(auto) blaze::invsqrt ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the inverse square root of each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix; all non-zero elements must be in the range $(0..\infty)$.
Returns
The inverse square root of each single element of sm.

The invsqrt() function computes the inverse square root of each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the invsqrt() function:

// ... Resizing and initialization
B = invsqrt( A );
Note
All non-zero elements are expected to be in the range $(0..\infty)$. No runtime checks are performed to assert this precondition!

◆ isDefault()

template<bool RF, typename MT >
bool blaze::isDefault ( const MatrixAccessProxy< MT > &  proxy)
inline

Returns whether the represented element is in default state.

Parameters
proxyThe given access proxy.
Returns
true in case the represented element is in default state, false otherwise.

This function checks whether the element represented by the access proxy is in default state. In case it is in default state, the function returns true, otherwise it returns false.

◆ isDiagonal()

template<bool RF, typename MT , bool SO>
bool blaze::isDiagonal ( const SparseMatrix< MT, SO > &  sm)

Checks if the give sparse matrix is diagonal.

Parameters
smThe sparse matrix to be checked.
Returns
true if the matrix is diagonal, false if not.

This function tests whether the matrix is diagonal, i.e. if the non-diagonal elements are default elements. In case of integral or floating point data types, a diagonal matrix has the form

\[\left(\begin{array}{*{5}{c}} aa & 0 & 0 & \cdots & 0 \\ 0 & bb & 0 & \cdots & 0 \\ 0 & 0 & cc & \cdots & 0 \\ \vdots & \vdots & \vdots & \ddots & 0 \\ 0 & 0 & 0 & 0 & xx \\ \end{array}\right)\]

The following example demonstrates the use of the function:

// ... Initialization
if( isDiagonal( A ) ) { ... }

Optionally, it is possible to switch between strict semantics (blaze::strict) and relaxed semantics (blaze::relaxed):

if( isDiagonal<relaxed>( A ) ) { ... }

It is also possible to check if a matrix expression results in a diagonal matrix:

if( isDiagonal( A * B ) ) { ... }

However, note that this might require the complete evaluation of the expression, including the generation of a temporary matrix.

◆ isHermitian()

template<bool RF, typename MT , bool SO>
bool blaze::isHermitian ( const SparseMatrix< MT, SO > &  sm)

Checks if the given sparse matrix is Hermitian.

Parameters
smThe sparse matrix to be checked.
Returns
true if the matrix is Hermitian, false if not.

This function checks if the given sparse matrix is an Hermitian matrix. The matrix is considered to be an Hermitian matrix if it is a square matrix whose conjugate transpose is equal to itself ( $ A = \overline{A^T} $), i.e. each matrix element $ a_{ij} $ is equal to the complex conjugate of the element $ a_{ji} $. The following code example demonstrates the use of the function:

// ... Initialization
if( isHermitian( A ) ) { ... }

Optionally, it is possible to switch between strict semantics (blaze::strict) and relaxed semantics (blaze::relaxed):

if( isHermitian<relaxed>( A ) ) { ... }

It is also possible to check if a matrix expression results in an Hermitian matrix:

if( isHermitian( A * B ) ) { ... }

However, note that this might require the complete evaluation of the expression, including the generation of a temporary matrix.

◆ isIdentity()

template<bool RF, typename MT , bool SO>
bool blaze::isIdentity ( const SparseMatrix< MT, SO > &  sm)

Checks if the give sparse matrix is an identity matrix.

Parameters
smThe sparse matrix to be checked.
Returns
true if the matrix is an identity matrix, false if not.

This function tests whether the matrix is an identity matrix, i.e. if the diagonal elements are 1 and the non-diagonal elements are 0. In case of integral or floating point data types, an identity matrix has the form

\[\left(\begin{array}{*{5}{c}} 1 & 0 & 0 & \cdots & 0 \\ 0 & 1 & 0 & \cdots & 0 \\ 0 & 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \vdots & \ddots & 0 \\ 0 & 0 & 0 & 0 & 1 \\ \end{array}\right)\]

The following example demonstrates the use of the function:

// ... Initialization
if( isIdentity( A ) ) { ... }

Optionally, it is possible to switch between strict semantics (blaze::strict) and relaxed semantics (blaze::relaxed):

if( isIdentity<relaxed>( A ) ) { ... }

It is also possible to check if a matrix expression results in an identity matrix:

if( isIdentity( A * B ) ) { ... }

However, note that this might require the complete evaluation of the expression, including the generation of a temporary matrix.

◆ isLower()

template<bool RF, typename MT , bool SO>
bool blaze::isLower ( const SparseMatrix< MT, SO > &  sm)

Checks if the given sparse matrix is a lower triangular matrix.

Parameters
smThe sparse matrix to be checked.
Returns
true if the matrix is a lower triangular matrix, false if not.

This function checks if the given sparse matrix is a lower triangular matrix. The matrix is considered to be lower triangular if it is a square matrix of the form

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

$ 0 \times 0 $ or $ 1 \times 1 $ matrices are considered as trivially lower triangular. The following code example demonstrates the use of the function:

// ... Initialization
if( isLower( A ) ) { ... }

Optionally, it is possible to switch between strict semantics (blaze::strict) and relaxed semantics (blaze::relaxed):

if( isLower<relaxed>( A ) ) { ... }

It is also possible to check if a matrix expression results in a lower triangular matrix:

if( isLower( A * B ) ) { ... }

However, note that this might require the complete evaluation of the expression, including the generation of a temporary matrix.

◆ isnan() [1/2]

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

Checks the given sparse matrix for not-a-number elements.

Parameters
smThe sparse matrix to be checked for not-a-number elements.
Returns
true if at least one element of the sparse matrix is not-a-number, false otherwise.

This function checks the sparse matrix for not-a-number (NaN) elements. If at least one element of the matrix is not-a-number, the function returns true, otherwise it returns false.

// ... Initialization
if( isnan( A ) ) { ... }

Note that this function only works for matrices with floating point elements. The attempt to use it for a matrix with a non-floating point element type results in a compile time error.

◆ isnan() [2/2]

template<typename MT >
bool blaze::isnan ( const MatrixAccessProxy< MT > &  proxy)
inline

Returns whether the represented element is not a number.

Parameters
proxyThe given access proxy.
Returns
true in case the represented element is in not a number, false otherwise.

This function checks whether the element represented by the access proxy is not a number (NaN). In case it is not a number, the function returns true, otherwise it returns false.

◆ isOne()

template<bool RF, typename MT >
bool blaze::isOne ( const MatrixAccessProxy< MT > &  proxy)
inline

Returns whether the represented element is 1.

Parameters
proxyThe given access proxy.
Returns
true in case the represented element is 1, false otherwise.

This function checks whether the element represented by the access proxy represents the numeric value 1. In case it is 1, the function returns true, otherwise it returns false.

◆ isReal()

template<bool RF, typename MT >
bool blaze::isReal ( const MatrixAccessProxy< MT > &  proxy)
inline

Returns whether the matrix element represents a real number.

Parameters
proxyThe given access proxy.
Returns
true in case the matrix element represents a real number, false otherwise.

This function checks whether the element represented by the access proxy represents the a real number. In case the element is of built-in type, the function returns true. In case the element is of complex type, the function returns true if the imaginary part is equal to 0. Otherwise it returns false.

◆ isStrictlyLower()

template<bool RF, typename MT , bool SO>
bool blaze::isStrictlyLower ( const SparseMatrix< MT, SO > &  sm)

Checks if the given sparse matrix is a strictly lower triangular matrix.

Parameters
smThe sparse matrix to be checked.
Returns
true if the matrix is a strictly lower triangular matrix, false if not.

This function checks if the given sparse matrix is a strictly lower triangular matrix. The matrix is considered to be strictly lower triangular if it is a square matrix of the form

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

The following code example demonstrates the use of the function:

// ... Initialization
if( isStrictlyLower( A ) ) { ... }

Optionally, it is possible to switch between strict semantics (blaze::strict) and relaxed semantics (blaze::relaxed):

if( isStrictlyLower<relaxed>( A ) ) { ... }

It is also possible to check if a matrix expression results in a strictly lower triangular matrix:

if( isStrictlyLower( A * B ) ) { ... }

However, note that this might require the complete evaluation of the expression, including the generation of a temporary matrix.

◆ isStrictlyUpper()

template<bool RF, typename MT , bool SO>
bool blaze::isStrictlyUpper ( const SparseMatrix< MT, SO > &  sm)

Checks if the given sparse matrix is a strictly upper triangular matrix.

Parameters
smThe sparse matrix to be checked.
Returns
true if the matrix is a strictly upper triangular matrix, false if not.

This function checks if the given sparse matrix is a strictly upper triangular matrix. The matrix is considered to be strictly upper triangular if it is a square matrix of the form

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

The following code example demonstrates the use of the function:

// ... Initialization
if( isStrictlyUpper( A ) ) { ... }

Optionally, it is possible to switch between strict semantics (blaze::strict) and relaxed semantics (blaze::relaxed):

if( isStrictlyUpper<relaxed>( A ) ) { ... }

It is also possible to check if a matrix expression results in a strictly upper triangular matrix:

if( isStrictlyUpper( A * B ) ) { ... }

However, note that this might require the complete evaluation of the expression, including the generation of a temporary matrix.

◆ isSymmetric()

template<bool RF, typename MT , bool SO>
bool blaze::isSymmetric ( const SparseMatrix< MT, SO > &  sm)

Checks if the given sparse matrix is symmetric.

Parameters
smThe sparse matrix to be checked.
Returns
true if the matrix is symmetric, false if not.

This function checks if the given sparse matrix is symmetric. The matrix is considered to be symmetric if it is a square matrix whose transpose is equal to itself ( $ A = A^T $). The following code example demonstrates the use of the function:

// ... Initialization
if( isSymmetric( A ) ) { ... }

Optionally, it is possible to switch between strict semantics (blaze::strict) and relaxed semantics (blaze::relaxed):

if( isSymmetric<relaxed>( A ) ) { ... }

It is also possible to check if a matrix expression results in a symmetric matrix:

if( isSymmetric( A * B ) ) { ... }

However, note that this might require the complete evaluation of the expression, including the generation of a temporary matrix.

◆ isUniform()

template<bool RF, typename MT , bool SO>
bool blaze::isUniform ( const SparseMatrix< MT, SO > &  sm)

Checks if the given sparse matrix is a uniform matrix.

Parameters
smThe sparse matrix to be checked.
Returns
true if the matrix is a uniform matrix, false if not.

This function checks if the given sparse matrix is a uniform matrix. The matrix is considered to be uniform if all its elements are identical. The following code example demonstrates the use of the function:

// ... Initialization
if( isUniform( A ) ) { ... }

Optionally, it is possible to switch between strict semantics (blaze::strict) and relaxed semantics (blaze::relaxed):

if( isUniform<relaxed>( A ) ) { ... }

It is also possible to check if a matrix expression results in a uniform matrix:

if( isUniform( A * B ) ) { ... }

However, note that this might require the complete evaluation of the expression, including the generation of a temporary matrix.

◆ isUniLower()

template<bool RF, typename MT , bool SO>
bool blaze::isUniLower ( const SparseMatrix< MT, SO > &  sm)

Checks if the given sparse matrix is a lower unitriangular matrix.

Parameters
smThe sparse matrix to be checked.
Returns
true if the matrix is a lower unitriangular matrix, false if not.

This function checks if the given sparse matrix is a lower unitriangular matrix. The matrix is considered to be lower unitriangular if it is a square matrix of the form

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

The following code example demonstrates the use of the function:

// ... Initialization
if( isUniLower( A ) ) { ... }

Optionally, it is possible to switch between strict semantics (blaze::strict) and relaxed semantics (blaze::relaxed):

if( isUniLower<relaxed>( A ) ) { ... }

It is also possible to check if a matrix expression results in a lower unitriangular matrix:

if( isUniLower( A * B ) ) { ... }

However, note that this might require the complete evaluation of the expression, including the generation of a temporary matrix.

◆ isUniUpper()

template<bool RF, typename MT , bool SO>
bool blaze::isUniUpper ( const SparseMatrix< MT, SO > &  sm)

Checks if the given sparse matrix is an upper unitriangular matrix.

Parameters
smThe sparse matrix to be checked.
Returns
true if the matrix is an upper unitriangular matrix, false if not.

This function checks if the given sparse matrix is an upper unitriangular matrix. The matrix is considered to be upper unitriangular if it is a square matrix of the form

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

The following code example demonstrates the use of the function:

// ... Initialization
if( isUniUpper( A ) ) { ... }

Optionally, it is possible to switch between strict semantics (blaze::strict) and relaxed semantics (blaze::relaxed):

if( isUniUpper<relaxed>( A ) ) { ... }

It is also possible to check if a matrix expression results in an upper unitriangular matrix:

if( isUniUpper( A * B ) ) { ... }

However, note that this might require the complete evaluation of the expression, including the generation of a temporary matrix.

◆ isUpper()

template<bool RF, typename MT , bool SO>
bool blaze::isUpper ( const SparseMatrix< MT, SO > &  sm)

Checks if the given sparse matrix is an upper triangular matrix.

Parameters
smThe sparse matrix to be checked.
Returns
true if the matrix is an upper triangular matrix, false if not.

This function checks if the given sparse matrix is an upper triangular matrix. The matrix is considered to be upper triangular if it is a square matrix of the form

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

$ 0 \times 0 $ or $ 1 \times 1 $ matrices are considered as trivially upper triangular. The following code example demonstrates the use of the function:

// ... Initialization
if( isUpper( A ) ) { ... }

Optionally, it is possible to switch between strict semantics (blaze::strict) and relaxed semantics (blaze::relaxed):

if( isUpper<relaxed>( A ) ) { ... }

It is also possible to check if a matrix expression results in an upper triangular matrix:

if( isUpper( A * B ) ) { ... }

However, note that this might require the complete evaluation of the expression, including the generation of a temporary matrix.

◆ isZero()

template<bool RF, typename MT >
bool blaze::isZero ( const MatrixAccessProxy< MT > &  proxy)
inline

Returns whether the represented element is 0.

Parameters
proxyThe given access proxy.
Returns
true in case the represented element is 0, false otherwise.

This function checks whether the element represented by the access proxy represents the numeric value 0. In case it is 0, the function returns true, otherwise it returns false.

◆ l1Norm()

template<typename MT , bool SO>
decltype(auto) blaze::l1Norm ( const SparseMatrix< MT, SO > &  sm)

Computes the L1 norm for the given sparse matrix.

Parameters
smThe given sparse matrix for the norm computation.
Returns
The L1 norm of the given sparse matrix.

This function computes the L1 norm of the given sparse matrix:

// ... Resizing and initialization
const double l1 = l1Norm( A );

◆ l2Norm()

template<typename MT , bool SO>
decltype(auto) blaze::l2Norm ( const SparseMatrix< MT, SO > &  sm)

Computes the L2 norm for the given sparse matrix.

Parameters
smThe given sparse matrix for the norm computation.
Returns
The L2 norm of the given sparse matrix.

This function computes the L2 norm of the given sparse matrix:

// ... Resizing and initialization
const double l2 = l2Norm( A );

◆ l3Norm()

template<typename MT , bool SO>
decltype(auto) blaze::l3Norm ( const SparseMatrix< MT, SO > &  sm)

Computes the L3 norm for the given sparse matrix.

Parameters
smThe given sparse matrix for the norm computation.
Returns
The L3 norm of the given sparse matrix.

This function computes the L3 norm of the given sparse matrix:

// ... Resizing and initialization
const double l3 = l3Norm( A );

◆ l4Norm()

template<typename MT , bool SO>
decltype(auto) blaze::l4Norm ( const SparseMatrix< MT, SO > &  sm)

Computes the L4 norm for the given sparse matrix.

Parameters
smThe given sparse matrix for the norm computation.
Returns
The L4 norm of the given sparse matrix.

This function computes the L4 norm of the given sparse matrix:

// ... Resizing and initialization
const double l4 = l4Norm( A );

◆ log()

template<typename MT , bool SO>
decltype(auto) blaze::log ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the natural logarithm for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix; all non-zero elements must be in the range $[0..\infty)$.
Returns
The natural logarithm of each non-zero element of sm.

The log() function computes the natural logarithm for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the log() function:

// ... Resizing and initialization
B = log( A );
Note
All non-zero elements are expected to be in the range $[0..\infty)$. No runtime checks are performed to assert this precondition!

◆ log10()

template<typename MT , bool SO>
decltype(auto) blaze::log10 ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the binary logarithm for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix; all non-zero elements must be in the range $[0..\infty)$.
Returns
The binary logarithm of each non-zero element of sm.

The log10() function computes the binary logarithm for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the log10() function:

// ... Resizing and initialization
B = log10( A );
Note
All non-zero elements are expected to be in the range $[0..\infty)$. No runtime checks are performed to assert this precondition!

◆ log2()

template<typename MT , bool SO>
decltype(auto) blaze::log2 ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the common logarithm for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix; all non-zero elements must be in the range $[0..\infty)$.
Returns
The common logarithm of each non-zero element of sm.

The log2() function computes the common logarithm for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the log2() function:

// ... Resizing and initialization
B = log2( A );
Note
All non-zero elements are expected to be in the range $[0..\infty)$. No runtime checks are performed to assert this precondition!

◆ lpNorm() [1/2]

template<typename MT , bool SO, typename ST >
decltype(auto) blaze::lpNorm ( const SparseMatrix< MT, SO > &  sm,
ST  p 
)

Computes the Lp norm for the given sparse matrix.

Parameters
smThe given sparse matrix for the norm computation.
pThe norm parameter (p > 0).
Returns
The Lp norm of the given sparse matrix.

This function computes the Lp norm of the given sparse matrix, where the norm is specified by the runtime argument p:

// ... Resizing and initialization
const double lp = lpNorm( A, 2.3 );
Note
The norm parameter p is expected to be larger than 0. This precondition is only checked by a user assertion.

◆ lpNorm() [2/2]

template<size_t P, typename MT , bool SO>
decltype(auto) blaze::lpNorm ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the Lp norm for the given sparse matrix.

Parameters
smThe given sparse matrix for the norm computation.
Returns
The Lp norm of the given sparse matrix.

This function computes the Lp norm of the given sparse matrix, where the norm is specified by the runtime argument P:

// ... Resizing and initialization
const double lp = lpNorm<2>( A );
Note
The norm parameter P is expected to be larger than 0. A value of 0 results in a compile time error!.

◆ map()

template<typename MT , bool SO, typename OP >
decltype(auto) blaze::map ( const SparseMatrix< MT, SO > &  sm,
OP  op 
)

Evaluates the given custom operation on each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
opThe custom operation.
Returns
The custom operation applied to each single element of sm.

The map() function evaluates the given custom operation on each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the map() function:

// ... Resizing and initialization
B = map( A, []( double a ){ return std::sqrt( a ); } );

◆ max()

template<typename MT , bool SO>
const ElementType_< MT > blaze::max ( const SparseMatrix< MT, SO > &  sm)

Returns the largest element of the sparse matrix.

Parameters
smThe given sparse matrix.
Returns
The largest sparse matrix element.

This function returns the largest element of the given sparse matrix. This function can only be used for element types that support the smaller-than relationship. In case the matrix currently has either 0 rows or 0 columns, the returned value is the default value (e.g. 0 in case of fundamental data types).

◆ maxNorm()

template<typename MT , bool SO>
decltype(auto) blaze::maxNorm ( const SparseMatrix< MT, SO > &  sm)

Computes the maximum norm for the given sparse matrix.

Parameters
smThe given sparse matrix for the norm computation.
Returns
The maximum norm of the given sparse matrix.

This function computes the maximum norm of the given sparse matrix:

// ... Resizing and initialization
const double max = maxNorm( A );

◆ min()

template<typename MT , bool SO>
const ElementType_< MT > blaze::min ( const SparseMatrix< MT, SO > &  sm)

Returns the smallest element of the sparse matrix.

Parameters
smThe given sparse matrix.
Returns
The smallest sparse matrix element.

This function returns the smallest element of the given sparse matrix. This function can only be used for element types that support the smaller-than relationship. In case the matrix currently has either 0 rows or 0 columns, the returned value is the default value (e.g. 0 in case of fundamental data types).

◆ norm()

template<typename MT , bool SO>
decltype(auto) blaze::norm ( const SparseMatrix< MT, SO > &  sm)

Computes the L2 norm for the given sparse matrix.

Parameters
smThe given sparse matrix for the norm computation.
Returns
The L2 norm of the given sparse matrix.

This function computes the L2 norm of the given sparse matrix:

// ... Resizing and initialization
const double l2 = norm( A );

◆ operator!=()

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.

◆ operator%() [1/12]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% ( const SparseMatrix< MT1, false > &  lhs,
const DenseMatrix< MT2, false > &  rhs 
)

Operator for the Schur product of a row-major sparse matrix and a row-major dense matrix ( $ A=B \circ C $).

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

This operator represents the Schur product of a row-major sparse matrix and a row-major dense matrix:

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

◆ operator%() [2/12]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% ( const SparseMatrix< MT1, false > &  lhs,
const DenseMatrix< MT2, true > &  rhs 
)

Operator for the Schur product of a row-major sparse matrix and a column-major dense matrix ( $ A=B \circ C $).

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

This operator represents the Schur product of a row-major sparse matrix and a column-major dense matrix:

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

◆ operator%() [3/12]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% ( const SparseMatrix< MT1, true > &  lhs,
const DenseMatrix< MT2, false > &  rhs 
)

Operator for the Schur product of a column-major sparse matrix and a row-major dense matrix ( $ A=B \circ C $).

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

This operator represents the Schur product of a column-major sparse matrix and a row-major dense matrix:

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

◆ operator%() [4/12]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% ( const SparseMatrix< MT1, true > &  lhs,
const DenseMatrix< MT2, true > &  rhs 
)

Operator for the Schur product of a column-major sparse matrix and a column-major dense matrix ( $ A=B \circ C $).

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

This operator represents the Schur product of a column-major sparse matrix and a column-major dense matrix:

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

◆ operator%() [5/12]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% ( const SparseMatrix< MT1, false > &  lhs,
const SparseMatrix< MT2, false > &  rhs 
)

Operator for the Schur product of two row-major sparse matrices ( $ A=B \circ C $).

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

This operator represents the Schur product 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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::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.

◆ operator%() [6/12]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% ( const SparseMatrix< MT1, false > &  lhs,
const SparseMatrix< MT2, true > &  rhs 
)

Operator for the Schur product of a row-major and a column-major sparse matrix ( $ A=B \circ C $).

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

This operator represents the Schur product 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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::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.

◆ operator%() [7/12]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% ( const SparseMatrix< MT1, true > &  lhs,
const SparseMatrix< MT2, false > &  rhs 
)

Operator for the Schur product of a column-major and a row-major sparse matrix ( $ A=B \circ C $).

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

This operator represents the Schur product 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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::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.

◆ operator%() [8/12]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% ( const SparseMatrix< MT1, true > &  lhs,
const SparseMatrix< MT2, true > &  rhs 
)

Operator for the Schur product of two column-major sparse matrices ( $ A=B \circ C $).

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

This operator represents the Schur product 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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::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.

◆ operator%() [9/12]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% ( const DenseMatrix< MT1, false > &  lhs,
const SparseMatrix< MT2, false > &  rhs 
)
inline

Operator for the Schur product of a row-major dense matrix and a row-major sparse matrix ( $ A=B \circ C $).

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

This operator represents the Schur product of a row-major dense matrix 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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::ElementType have to be supported by the MultTrait class template.
In case the current sizes of the two given matrices don't match, a std::invalid_argument is thrown.

◆ operator%() [10/12]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% ( const DenseMatrix< MT1, false > &  lhs,
const SparseMatrix< MT2, true > &  rhs 
)
inline

Operator for the Schur product of a row-major dense matrix and a column-major sparse matrix ( $ A=B \circ C $).

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

This operator represents the Schur product of a row-major dense 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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::ElementType have to be supported by the MultTrait class template.
In case the current sizes of the two given matrices don't match, a std::invalid_argument is thrown.

◆ operator%() [11/12]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% ( const DenseMatrix< MT1, true > &  lhs,
const SparseMatrix< MT2, false > &  rhs 
)
inline

Operator for the Schur product of a column-major dense matrix and a row-major sparse matrix ( $ A=B \circ C $).

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

This operator represents the Schur product of a column-major dense matrix 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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::ElementType have to be supported by the MultTrait class template.
In case the current sizes of the two given matrices don't match, a std::invalid_argument is thrown.

◆ operator%() [12/12]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% ( const DenseMatrix< MT1, true > &  lhs,
const SparseMatrix< MT2, true > &  rhs 
)
inline

Operator for the Schur product of a column-major dense matrix and a column-major sparse matrix ( $ A=B \circ C $).

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

This operator represents the Schur product of a column-major dense 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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::ElementType have to be supported by the MultTrait class template.
In case the current sizes of the two given matrices don't match, a std::invalid_argument is thrown.

◆ operator*() [1/10]

template<typename VT1 , typename VT2 >
decltype(auto) blaze::operator* ( const SparseVector< VT1, false > &  lhs,
const DenseVector< VT2, true > &  rhs 
)

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 VT1::ElementType and VT2::ElementType. Both vector types VT1 and VT2 as well as the two element types VT1::ElementType and VT2::ElementType have to be supported by the MultTrait class template.

◆ operator*() [2/10]

template<typename VT1 , typename VT2 >
decltype(auto) blaze::operator* ( const SparseVector< VT1, false > &  lhs,
const SparseVector< VT2, true > &  rhs 
)

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 VT1::ElementType and VT2::ElementType. Both vector types VT1 and VT2 as well as the two element types VT1::ElementType and VT2::ElementType have to be supported by the MultTrait class template.

◆ operator*() [3/10]

template<typename VT , typename MT >
decltype(auto) blaze::operator* ( const DenseVector< VT, true > &  vec,
const SparseMatrix< MT, 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 $).

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 VT::ElementType and MT::ElementType. Both the dense matrix type VT and the dense vector type MT as well as the two element types VT::ElementType and MT::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.

◆ operator*() [4/10]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* ( const SparseMatrix< MT1, false > &  lhs,
const SparseMatrix< MT2, false > &  rhs 
)

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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::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.

◆ operator*() [5/10]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* ( const SparseMatrix< MT1, false > &  lhs,
const SparseMatrix< MT2, true > &  rhs 
)

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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::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.

◆ operator*() [6/10]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* ( const SparseMatrix< MT1, true > &  lhs,
const SparseMatrix< MT2, false > &  rhs 
)

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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::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.

◆ operator*() [7/10]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* ( const SparseMatrix< MT1, true > &  lhs,
const SparseMatrix< MT2, true > &  rhs 
)

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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::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.

◆ operator*() [8/10]

template<typename MT , bool SO, typename ST , typename = EnableIf_< IsNumeric<ST> >>
decltype(auto) blaze::operator* ( const SparseMatrix< MT, SO > &  mat,
ST  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 MT::ElementType and T2. Note that this operator only works for scalar values of built-in data type.

◆ operator*() [9/10]

template<typename ST , typename MT , bool SO, typename = EnableIf_< IsNumeric<ST> >>
decltype(auto) blaze::operator* ( ST  scalar,
const SparseMatrix< MT, 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 ST and MT::ElementType. Note that this operator only works for scalar values of built-in data type.

◆ operator*() [10/10]

template<typename VT1 , typename VT2 >
decltype(auto) blaze::operator* ( const DenseVector< VT1, false > &  lhs,
const SparseVector< VT2, 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 VT1::ElementType and VT2::ElementType. Both vector types VT1 and VT2 as well as the two element types VT1::ElementType and VT2::ElementType have to be supported by the MultTrait class template.

◆ operator*=() [1/2]

template<typename MT , bool SO, typename ST >
EnableIf_< IsNumeric< ST >, MT &> blaze::operator*= ( SparseMatrix< MT, SO > &  mat,
ST  scalar 
)
inline

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

Parameters
matThe left-hand side sparse matrix for the multiplication.
scalarThe right-hand side scalar value for the multiplication.
Returns
Reference to the left-hand side sparse matrix.
Exceptions
std::invalid_argumentInvalid scaling of restricted matrix.

In case the matrix MT is restricted and the assignment would violate an invariant of the matrix, a std::invalid_argument exception is thrown.

◆ operator*=() [2/2]

template<typename MT , bool SO, typename ST >
EnableIf_< IsNumeric< ST >, MT &> blaze::operator*= ( SparseMatrix< MT, SO > &&  mat,
ST  scalar 
)
inline

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

Parameters
matThe left-hand side temporary sparse matrix for the multiplication.
scalarThe right-hand side scalar value for the multiplication.
Returns
Reference to the left-hand side sparse matrix.
Exceptions
std::invalid_argumentInvalid scaling of restricted matrix.

In case the matrix MT is restricted and the assignment would violate an invariant of the matrix, a std::invalid_argument exception is thrown.

◆ operator+() [1/4]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator+ ( const SparseMatrix< MT1, false > &  lhs,
const SparseMatrix< MT2, false > &  rhs 
)

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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::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.

◆ operator+() [2/4]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator+ ( const SparseMatrix< MT1, false > &  lhs,
const SparseMatrix< MT2, true > &  rhs 
)

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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::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.

◆ operator+() [3/4]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator+ ( const SparseMatrix< MT1, true > &  lhs,
const SparseMatrix< MT2, false > &  rhs 
)

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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::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.

◆ operator+() [4/4]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator+ ( const SparseMatrix< MT1, true > &  lhs,
const SparseMatrix< MT2, true > &  rhs 
)

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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::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.

◆ operator-() [1/5]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator- ( const SparseMatrix< MT1, false > &  lhs,
const SparseMatrix< MT2, false > &  rhs 
)

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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::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.

◆ operator-() [2/5]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator- ( const SparseMatrix< MT1, false > &  lhs,
const SparseMatrix< MT2, true > &  rhs 
)

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 difference 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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::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.

◆ operator-() [3/5]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator- ( const SparseMatrix< MT1, true > &  lhs,
const SparseMatrix< MT2, false > &  rhs 
)

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 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 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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::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.

◆ operator-() [4/5]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator- ( const SparseMatrix< MT1, true > &  lhs,
const SparseMatrix< MT2, true > &  rhs 
)

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 difference 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 MT1::ElementType and MT2::ElementType. Both matrix types MT1 and MT2 as well as the two element types MT1::ElementType and MT2::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.

◆ operator-() [5/5]

template<typename MT , bool SO>
decltype(auto) 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.

◆ operator/()

template<typename MT , bool SO, typename ST , typename = EnableIf_< IsNumeric<ST> >>
decltype(auto) blaze::operator/ ( const SparseMatrix< MT, SO > &  mat,
ST  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 MT::ElementType and ST. 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.

◆ operator/=() [1/2]

template<typename MT , bool SO, typename ST >
EnableIf_< IsNumeric< ST >, MT &> blaze::operator/= ( SparseMatrix< MT, SO > &  mat,
ST  scalar 
)
inline

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

Parameters
matThe left-hand side sparse matrix for the division.
scalarThe right-hand side scalar value for the division.
Returns
Reference to the left-hand side sparse matrix.
Exceptions
std::invalid_argumentInvalid scaling of restricted matrix.

In case the matrix MT is restricted and the assignment would violate an invariant of the matrix, a std::invalid_argument exception is thrown.

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

◆ operator/=() [2/2]

template<typename MT , bool SO, typename ST >
EnableIf_< IsNumeric< ST >, MT &> blaze::operator/= ( SparseMatrix< MT, SO > &&  mat,
ST  scalar 
)
inline

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

Parameters
matThe left-hand side temporary sparse matrix for the division.
scalarThe right-hand side scalar value for the division.
Returns
Reference to the left-hand side sparse matrix.
Exceptions
std::invalid_argumentInvalid scaling of restricted matrix.

In case the matrix MT is restricted and the assignment would violate an invariant of the matrix, a std::invalid_argument exception is thrown.

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

◆ operator==() [1/4]

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.

◆ operator==() [2/4]

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.

◆ operator==() [3/4]

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.

◆ operator==() [4/4]

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.

◆ pow()

template<typename MT , bool SO, typename ST , typename = EnableIf_< IsNumeric<ST> >>
decltype(auto) blaze::pow ( const SparseMatrix< MT, SO > &  sm,
ST  exp 
)
inline

Computes the exponential value for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
expThe scalar exponent.
Returns
The exponential value of each non-zero element of sm.

The pow() function computes the exponential value for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the pow() function:

// ... Resizing and initialization
B = pow( A, 4.2 );

◆ real()

template<typename MT , bool SO>
decltype(auto) blaze::real ( const SparseMatrix< MT, SO > &  sm)
inline

Returns a matrix containing the real parts of each single element of sm.

Parameters
smThe input matrix.
Returns
The real part of each single element of sm.

The real function calculates the real part of each element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the real function:

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

◆ reset()

template<typename MT >
void blaze::reset ( const MatrixAccessProxy< MT > &  proxy)
inline

Resetting the represented element to the default initial values.

Parameters
proxyThe given access proxy.
Returns
void

This function resets the element represented by the access proxy to its default initial value. In case the access proxy represents a vector- or matrix-like data structure that provides a reset() function, this function resets all elements of the vector/matrix to the default initial values.

◆ round()

template<typename MT , bool SO>
decltype(auto) blaze::round ( const SparseMatrix< MT, SO > &  sm)
inline

Applies the round() function to each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The resulting sparse matrix.

This function applies the round() function to each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the round() function:

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

◆ serial()

template<typename MT , bool SO>
decltype(auto) blaze::serial ( const SparseMatrix< MT, SO > &  sm)

Forces the serial evaluation of the given sparse matrix expression sm.

Parameters
smThe input matrix.
Returns
The evaluated sparse matrix.

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

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

◆ sin()

template<typename MT , bool SO>
decltype(auto) blaze::sin ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the sine for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The sine of each non-zero element of sm.

The sin() function computes the sine for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the sin() function:

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

◆ sinh()

template<typename MT , bool SO>
decltype(auto) blaze::sinh ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the hyperbolic sine for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The hyperbolic sine of each non-zero element of sm.

The sinh() function computes the hyperbolic sine for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the sinh() function:

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

◆ sqrNorm()

template<typename MT , bool SO>
decltype(auto) blaze::sqrNorm ( const SparseMatrix< MT, SO > &  sm)

Computes the squared L2 norm for the given sparse matrix.

Parameters
smThe given sparse matrix for the norm computation.
Returns
The squared L2 norm of the given sparse matrix.

This function computes the squared L2 norm of the given sparse matrix:

// ... Resizing and initialization
const double l2 = sqrNorm( A );

◆ sqrt()

template<typename MT , bool SO>
decltype(auto) blaze::sqrt ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the square root of each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix; all non-zero elements must be in the range $[0..\infty)$.
Returns
The square root of each single element of sm.

The sqrt() function computes the square root of each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the sqrt() function:

// ... Resizing and initialization
B = sqrt( A );
Note
All non-zero elements are expected to be in the range $[0..\infty)$. No runtime checks are performed to assert this precondition!

◆ swap() [1/3]

template<typename MT >
void blaze::swap ( const MatrixAccessProxy< MT > &  a,
const MatrixAccessProxy< MT > &  b 
)
inlinenoexcept

Swapping the contents of two access proxies.

Parameters
aThe first access proxy to be swapped.
bThe second access proxy to be swapped.
Returns
void

◆ swap() [2/3]

template<typename MT , typename T >
void blaze::swap ( const MatrixAccessProxy< MT > &  a,
T &  b 
)
inlinenoexcept

Swapping the contents of an access proxy with another element.

Parameters
aThe access proxy to be swapped.
bThe other element to be swapped.
Returns
void

◆ swap() [3/3]

template<typename T , typename MT >
void blaze::swap ( T &  a,
const MatrixAccessProxy< MT > &  b 
)
inlinenoexcept

Swapping the contents of an access proxy with another element.

Parameters
aThe other element to be swapped.
bThe access proxy to be swapped.
Returns
void

◆ tan()

template<typename MT , bool SO>
decltype(auto) blaze::tan ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the tangent for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The tangent of each non-zero element of sm.

The tan() function computes the tangent for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the tan() function:

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

◆ tanh()

template<typename MT , bool SO>
decltype(auto) blaze::tanh ( const SparseMatrix< MT, SO > &  sm)
inline

Computes the hyperbolic tangent for each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix; all non-zero elements must be in the range $[-1..1]$.
Returns
The hyperbolic tangent of each non-zero element of sm.

The tanh() function computes the hyperbolic tangent for each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the tanh() function:

// ... Resizing and initialization
B = tanh( A );
Note
All non-zero elements are expected to be in the range $[-1..1]$. No runtime checks are performed to assert this precondition!

◆ trans()

template<typename MT , bool SO>
decltype(auto) blaze::trans ( const SparseMatrix< MT, SO > &  sm)

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:

◆ trunc()

template<typename MT , bool SO>
decltype(auto) blaze::trunc ( const SparseMatrix< MT, SO > &  sm)
inline

Applies the trunc() function to each non-zero element of the sparse matrix sm.

Parameters
smThe input matrix.
Returns
The resulting sparse matrix.

This function applies the trunc() function to each non-zero element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the trunc() function:

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

◆ tsmattsmatschur()

template<typename MT1 , typename MT2 , typename = DisableIf_< Or< And< IsUniLower<MT1>, IsUniUpper<MT2> > , And< IsUniUpper<MT1>, IsUniLower<MT2> > > >>
const TSMatTSMatSchurExpr<MT1,MT2> blaze::tsmattsmatschur ( const SparseMatrix< MT1, true > &  lhs,
const SparseMatrix< MT2, true > &  rhs 
)
inline

Backend implementation of the Schur product between two column-major sparse matrices ( $ A=B \circ C $).

Parameters
lhsThe left-hand side sparse matrix for the Schur product.
rhsThe right-hand side sparse matrix for the Schur product.
Returns
The Schur product of the two matrices.

This function implements a performance optimized treatment of the Schur product between two column-major sparse matrices.