Blaze 3.9
Modules | Classes | Functions
Sparse Matrices

Modules

 Expressions
 
 CompressedMatrix
 
 IdentityMatrix
 
 ZeroMatrix
 

Classes

class  blaze::SparseMatrix< MT, SO >
 Base class for sparse matrices. More...
 
class  blaze::MatrixAccessProxy< MT >
 Access proxy for sparse, $ M \times N $ matrices. More...
 

Functions

template<typename MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::kron (const DenseMatrix< MT1, SO1 > &lhs, const SparseMatrix< MT2, SO2 > &rhs)
 Computes the Kronecker product of a dense matrix and a sparse matrix ( $ A=B \otimes 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::declstrlow (const SparseMatrix< MT, SO > &sm)
 Declares the given sparse matrix expression sm as strictly lower. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::declstrupp (const SparseMatrix< MT, SO > &sm)
 Declares the given sparse matrix expression sm as strictly upper. 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::declunilow (const SparseMatrix< MT, SO > &sm)
 Declares the given sparse matrix expression sm as unilower. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::decluniupp (const SparseMatrix< MT, SO > &sm)
 Declares the given sparse matrix expression sm as uniupper. 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 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::kron (const SparseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Computes the Kronecker product of a sparse matrix and a dense matrix ( $ A=B \otimes C $). 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>
decltype(auto) blaze::fix (SparseMatrix< MT, SO > &sm) noexcept
 Fixing the size of the given sparse matrix. 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::sign (const SparseMatrix< MT, SO > &sm)
 Applies the sign() 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::arg (const SparseMatrix< MT, SO > &sm)
 Returns a matrix containing the phase angle 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 , EnableIf_t< IsScalar_v< ST > > * = nullptr>
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::log2 (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::log10 (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::log1p (const SparseMatrix< MT, SO > &sm)
 Computes the natural logarithm of x+1 for each non-zero element of the sparse matrix sm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::lgamma (const SparseMatrix< MT, SO > &sm)
 Computes the natural logarithm of the absolute value of the gamma function 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::mean (const SparseMatrix< MT, SO > &sm)
 Computes the (arithmetic) mean for the given sparse matrix. More...
 
template<ReductionFlag , typename MT , bool SO>
decltype(auto) blaze::mean (const SparseMatrix< MT, SO > &sm)
 Computes the row-/columnwise mean function for the given sparse matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::noalias (const SparseMatrix< MT, SO > &sm)
 Forces the non-aliased evaluation of the given sparse matrix expression 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::linfNorm (const SparseMatrix< MT, SO > &sm)
 Computes the infinity 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>
decltype(auto) blaze::minNorm (const SparseMatrix< MT, SO > &sm)
 Computes the minimum norm for the given sparse matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::nosimd (const SparseMatrix< MT, SO > &sm)
 Disables the SIMD evaluation of the given sparse matrix expression sm. More...
 
template<typename MT , bool SO, typename OP >
decltype(auto) blaze::reduce (const SparseMatrix< MT, SO > &sm, OP op)
 Performs a custom reduction operation on the given sparse matrix. More...
 
template<ReductionFlag , typename MT , bool SO, typename OP >
decltype(auto) blaze::reduce (const SparseMatrix< MT, SO > &sm, OP op)
 Performs a custom reduction operation on the given sparse matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::sum (const SparseMatrix< MT, SO > &sm)
 Reduces the given sparse matrix by means of addition. More...
 
template<ReductionFlag RF, typename MT , bool SO>
decltype(auto) blaze::sum (const SparseMatrix< MT, SO > &sm)
 Reduces the given sparse matrix by means of addition. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::prod (const SparseMatrix< MT, SO > &sm)
 Reduces the given sparse matrix by means of multiplication. More...
 
template<ReductionFlag RF, typename MT , bool SO>
decltype(auto) blaze::prod (const SparseMatrix< MT, SO > &sm)
 Reduces the given sparse matrix by means of multiplication. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::min (const SparseMatrix< MT, SO > &sm)
 Returns the smallest element of the sparse matrix. More...
 
template<ReductionFlag RF, typename MT , bool SO>
decltype(auto) blaze::min (const SparseMatrix< MT, SO > &sm)
 Returns the smallest element of each row/columns of the sparse matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::max (const SparseMatrix< MT, SO > &sm)
 Returns the largest element of the sparse matrix. More...
 
template<ReductionFlag RF, typename MT , bool SO>
decltype(auto) blaze::max (const SparseMatrix< MT, SO > &sm)
 Returns the largest element of each row/columns of the sparse matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::repeat (const SparseMatrix< MT, SO > &sm, size_t m, size_t n)
 Repeats the given sparse matrix. More...
 
template<size_t R0, size_t R1, typename MT , bool SO>
decltype(auto) blaze::repeat (const SparseMatrix< MT, SO > &sm)
 Repeats the given sparse matrix. More...
 
template<typename MT , bool SO, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
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 , EnableIf_t< IsScalar_v< ST > > * = nullptr>
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, EnableIf_t< IsScalar_v< ST > > * = nullptr>
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 , bool SO1, typename MT2 , bool SO2>
bool blaze::operator== (const SparseMatrix< MT1, SO1 > &lhs, const SparseMatrix< MT2, SO2 > &rhs)
 Equality operator for the comparison of two sparse matrices. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
bool blaze::operator!= (const SparseMatrix< MT1, SO1 > &lhs, const SparseMatrix< MT2, SO2 > &rhs)
 Inequality operator for the comparison of two sparse matrices. More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::kron (const SparseMatrix< MT1, false > &lhs, const SparseMatrix< MT2, false > &rhs)
 Computes the Kronecker product of two row-major sparse matrices ( $ A=B \otimes 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::stddev (const SparseMatrix< MT, SO > &sm)
 Computes the standard deviation for the given sparse matrix. More...
 
template<ReductionFlag , typename MT , bool SO>
decltype(auto) blaze::stddev (const SparseMatrix< MT, SO > &sm)
 Computes the row-/columnwise standard deviation function for the given sparse matrix. 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<bool B, typename MT , bool SO>
decltype(auto) blaze::transIf (const SparseMatrix< MT, SO > &sm)
 Conditional 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::kron (const SparseMatrix< MT1, false > &lhs, const SparseMatrix< MT2, true > &rhs)
 Operator for the Kronecker product of a row-major and a column-major sparse matrix ( $ A=B \otimes 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 MT , bool SO>
decltype(auto) blaze::var (const SparseMatrix< MT, SO > &sm)
 Computes the variance for the given sparse matrix. More...
 
template<ReductionFlag , typename MT , bool SO>
decltype(auto) blaze::var (const SparseMatrix< MT, SO > &sm)
 Computes the row-/column-wise variance function for the given sparse matrix. 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 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::kron (const SparseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, false > &rhs)
 Operator for the Kronecker product of a column-major and a row-major sparse matrix ( $ A=B \otimes 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::kron (const SparseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, true > &rhs)
 Computes the Kronecker product of two column-major sparse matrices ( $ A=B \otimes 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 , DisableIf_t<(IsUniLower_v< MT1 > &&IsUniUpper_v< MT2 >)||(IsUniUpper_v< MT1 > &&IsUniLower_v< MT2 >)||(IsStrictlyLower_v< MT1 > &&IsUpper_v< MT2 >)||(IsStrictlyUpper_v< MT1 > &&IsLower_v< MT2 >)||(IsLower_v< MT1 > &&IsStrictlyUpper_v< MT2 >)||(IsUpper_v< MT1 > &&IsStrictlyLower_v< MT2 >)||(IsZero_v< MT1 >||IsZero_v< MT2 >) > * = nullptr>
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...
 

SparseMatrix global functions

template<typename MT , bool SO>
MT::Iterator blaze::find (SparseMatrix< MT, SO > &sm, size_t i, size_t j)
 Searches for a specific matrix element. More...
 
template<typename MT , bool SO>
MT::ConstIterator blaze::find (const SparseMatrix< MT, SO > &sm, size_t i, size_t j)
 Searches for a specific matrix element. More...
 
template<typename MT , bool SO>
MT::Iterator blaze::lowerBound (SparseMatrix< MT, SO > &sm, size_t i, size_t j)
 Returns an iterator to the first index not less than the given index. More...
 
template<typename MT , bool SO>
MT::ConstIterator blaze::lowerBound (const SparseMatrix< MT, SO > &sm, size_t i, size_t j)
 Returns an iterator to the first index not less than the given index. More...
 
template<typename MT , bool SO>
MT::Iterator blaze::upperBound (SparseMatrix< MT, SO > &sm, size_t i, size_t j)
 Returns an iterator to the first index greater than the given index. More...
 
template<typename MT , bool SO>
MT::ConstIterator blaze::upperBound (const SparseMatrix< MT, SO > &sm, size_t i, size_t j)
 Returns an iterator to the first index greater than the given index. More...
 

MatrixAccessProxy global functions

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 MT , bool SO, typename ST >
auto blaze::operator*= (SparseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Multiplication assignment operator for the multiplication of a sparse matrix and a scalar value ( $ A*=s $). More...
 
template<typename MT , bool SO, typename ST >
auto blaze::operator*= (SparseMatrix< MT, SO > &&mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 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 >
auto blaze::operator/= (SparseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Division assignment operator for the division of a sparse matrix by a scalar value ( $ A/=s $). More...
 
template<typename MT , bool SO, typename ST >
auto blaze::operator/= (SparseMatrix< MT, SO > &&mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Division assignment operator for the division of a temporary sparse matrix by a scalar value ( $ A/=s $). 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<typename MT , bool SO>
bool blaze::isinf (const SparseMatrix< MT, SO > &sm)
 Checks the given sparse matrix for infinite elements. More...
 
template<typename MT , bool SO>
bool blaze::isfinite (const SparseMatrix< MT, SO > &sm)
 Checks the given sparse matrix for finite elements. More...
 
template<RelaxationFlag RF, typename MT , bool SO>
bool blaze::isSymmetric (const SparseMatrix< MT, SO > &sm)
 Checks if the given sparse matrix is symmetric. More...
 
template<RelaxationFlag RF, typename MT , bool SO>
bool blaze::isHermitian (const SparseMatrix< MT, SO > &sm)
 Checks if the given sparse matrix is Hermitian. More...
 
template<RelaxationFlag 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<RelaxationFlag RF, typename MT , bool SO>
bool blaze::isZero (const SparseMatrix< MT, SO > &sm)
 Checks if the given sparse matrix is a zero matrix. More...
 
template<RelaxationFlag 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<RelaxationFlag 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<RelaxationFlag 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<RelaxationFlag 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<RelaxationFlag 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<RelaxationFlag 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<RelaxationFlag RF, typename MT , bool SO>
bool blaze::isDiagonal (const SparseMatrix< MT, SO > &sm)
 Checks if the give sparse matrix is diagonal. More...
 
template<RelaxationFlag RF, typename MT , bool SO>
bool blaze::isIdentity (const SparseMatrix< MT, SO > &sm)
 Checks if the give sparse matrix is an identity 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 );
Efficient implementation of a dynamic matrix.
Definition: DynamicMatrix.h:242
decltype(auto) abs(const DenseMatrix< MT, SO > &dm)
Applies the abs() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1296

◆ 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 );
Efficient implementation of a compressed matrix.
Definition: CompressedMatrix.h:239
decltype(auto) acos(const DenseMatrix< MT, SO > &dm)
Computes the inverse cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2190
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 );
decltype(auto) acosh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2249
Note
All non-zero elements are expected to be in the range $[1..\infty)$. No runtime checks are performed to assert this precondition!

◆ arg()

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

Returns a matrix containing the phase angle of each single element of sm.

Parameters
smThe input matrix.
Returns
The phase angle of each single element of sm.

The arg() function calculates the phase angle of each element of the input matrix sm. The function returns an expression representing this operation.
The following example demonstrates the use of the arg() function:

// ... Resizing and initialization
B = arg( A );
decltype(auto) arg(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the phase angle of each single element of dm.
Definition: DMatMapExpr.h:1585

◆ 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 );
decltype(auto) asin(const DenseMatrix< MT, SO > &dm)
Computes the inverse sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2075
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 );
decltype(auto) asinh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2131

◆ 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 );
decltype(auto) atan(const DenseMatrix< MT, SO > &dm)
Computes the inverse tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2305

◆ 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 );
decltype(auto) atanh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2367
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 );
decltype(auto) cbrt(const DenseMatrix< MT, SO > &dm)
Computes the cubic root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1678
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 );
decltype(auto) ceil(const DenseMatrix< MT, SO > &dm)
Applies the ceil() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1380

◆ 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 );
decltype(auto) clamp(const DenseMatrix< MT, SO > &dm, const DT &min, const DT &max)
Restricts each single element of the dense matrix dm to the range .
Definition: DMatMapExpr.h:1740

◆ 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 );
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1464

◆ 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 );
decltype(auto) cos(const DenseMatrix< MT, SO > &dm)
Computes the cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2159

◆ 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 );
decltype(auto) cosh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2218

◆ 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 );
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1501

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
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766

◆ 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 );
decltype(auto) decldiag(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as diagonal.
Definition: DMatDeclDiagExpr.h:978

◆ 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 );
decltype(auto) declherm(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as Hermitian.
Definition: DMatDeclHermExpr.h:1005

◆ 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 );
decltype(auto) decllow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as lower.
Definition: DMatDeclLowExpr.h:1004

◆ declstrlow()

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

Declares the given sparse matrix expression sm as strictly lower.

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

The declstrlow function declares the given sparse matrix expression sm as strictly 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 declstrlow function:

// ... Resizing and initialization
B = declstrlow( A );
decltype(auto) declstrlow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as strictly lower.
Definition: DMatDeclStrLowExpr.h:1003

◆ declstrupp()

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

Declares the given sparse matrix expression sm as strictly upper.

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

The declstrupp function declares the given sparse matrix expression sm as strictly 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 declstrupp function:

// ... Resizing and initialization
B = declstrupp( A );
decltype(auto) declstrupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as strictly upper.
Definition: DMatDeclStrUppExpr.h:1003

◆ 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 );
decltype(auto) declsym(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as symmetric.
Definition: DMatDeclSymExpr.h:1005

◆ declunilow()

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

Declares the given sparse matrix expression sm as unilower.

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

The declunilow function declares the given sparse matrix expression sm as unilower. 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 declunilow function:

// ... Resizing and initialization
B = declunilow( A );
decltype(auto) declunilow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as unilower.
Definition: DMatDeclUniLowExpr.h:1004

◆ decluniupp()

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

Declares the given sparse matrix expression sm as uniupper.

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

The decluniupp function declares the given sparse matrix expression sm as uniupper. 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 decluniupp function:

// ... Resizing and initialization
B = decluniupp( A );
decltype(auto) decluniupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as uniupper.
Definition: DMatDeclUniUppExpr.h:1005

◆ 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 );
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1004

◆ 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 );
decltype(auto) erf(const DenseMatrix< MT, SO > &dm)
Computes the error function for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2395

◆ 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 );
decltype(auto) erfc(const DenseMatrix< MT, SO > &dm)
Computes the complementary error function for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2423

◆ eval()

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

Forces the evaluation of the given sparse matrix expression sm.

Parameters
smThe input matrix.
Returns
The evaluated sparse matrix.

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

// ... Resizing and initialization
B = eval( A );
decltype(auto) eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:790

◆ 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 );
decltype(auto) exp(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1801

◆ 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 );
decltype(auto) exp10(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1857

◆ 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 );
decltype(auto) exp2(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1829

◆ find() [1/2]

template<typename MT , bool SO>
MT::ConstIterator blaze::find ( const SparseMatrix< MT, SO > &  sm,
size_t  i,
size_t  j 
)

Searches for a specific matrix element.

Parameters
smThe given sparse matrix.
iThe row index of the search element. The index has to be in the range $[0..M-1]$.
jThe column index of the search element. The index has to be in the range $[0..N-1]$.
Returns
Iterator to the element in case the index is found, end() iterator otherwise.

This function can be used to check whether a specific element is contained in the sparse matrix. It specifically searches for the element with row index i and column index j. In case the element is found, the function returns an row/column iterator to the element. Otherwise an iterator just past the last non-zero element of row i or column j (the end() iterator) is returned. Note that the returned sparse matrix iterator is subject to invalidation due to inserting operations via the function call operator, the set() function or the insert() function!

◆ find() [2/2]

template<typename MT , bool SO>
MT::Iterator blaze::find ( SparseMatrix< MT, SO > &  sm,
size_t  i,
size_t  j 
)

Searches for a specific matrix element.

Parameters
smThe given sparse matrix.
iThe row index of the search element. The index has to be in the range $[0..M-1]$.
jThe column index of the search element. The index has to be in the range $[0..N-1]$.
Returns
Iterator to the element in case the index is found, end() iterator otherwise.

This function can be used to check whether a specific element is contained in the sparse matrix. It specifically searches for the element with row index i and column index j. In case the element is found, the function returns an row/column iterator to the element. Otherwise an iterator just past the last non-zero element of row i or column j (the end() iterator) is returned. Note that the returned sparse matrix iterator is subject to invalidation due to inserting operations via the function call operator, the set() function or the insert() function!

◆ fix()

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

Fixing the size of the given sparse matrix.

Parameters
smThe sparse matrix to be size-fixed.
Returns
The size-fixed sparse matrix.

This function returns an expression representing the size-fixed given sparse matrix:

// ... Resizing and initialization
fix( B ) = A;
decltype(auto) fix(DenseMatrix< MT, SO > &dm) noexcept
Fixing the size of the given dense matrix.
Definition: DMatFixExpr.h:227

◆ 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 );
decltype(auto) floor(const DenseMatrix< MT, SO > &dm)
Applies the floor() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1352

◆ 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 ); } );
decltype(auto) forEach(const DenseMatrix< MT, SO > &dm, OP op)
Evaluates the given custom operation on each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1132
decltype(auto) sqrt(const DenseMatrix< MT, SO > &dm)
Computes the square root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1616

◆ 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 );
decltype(auto) imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatMapExpr.h:1557

◆ 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 );
decltype(auto) invcbrt(const DenseMatrix< MT, SO > &dm)
Computes the inverse cubic root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1709
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 );
decltype(auto) invsqrt(const DenseMatrix< MT, SO > &dm)
Computes the inverse square root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1647
Note
All non-zero elements are expected to be in the range $(0..\infty)$. No runtime checks are performed to assert this precondition!

◆ isDiagonal()

template<RelaxationFlag 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

                    \f[\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)\f]

The following example demonstrates the use of the function:

// ... Initialization
if( isDiagonal( A ) ) { ... }
bool isDiagonal(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is diagonal.
Definition: DenseMatrix.h:2456

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.

◆ isfinite()

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

Checks the given sparse matrix for finite elements.

Parameters
smThe sparsre matrix to be checked for finite elements.
Returns
true if all elements of the matrix are finite, false otherwise.

This function checks if all elements of the sparse matrix are finite elements (i.e. normal, subnormal or zero elements, but not infinite or NaN). If all elements of the matrix are finite, the function returns true, otherwise it returns false.

// ... Initialization
if( isfinite( A ) ) { ... }
bool isfinite(const DenseMatrix< MT, SO > &dm)
Checks the given dense matrix for finite elements.
Definition: DenseMatrix.h:1389

◆ isHermitian()

template<RelaxationFlag 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 ) ) { ... }
bool isHermitian(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is Hermitian.
Definition: DenseMatrix.h:1534

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

                    \f[\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)\f]

The following example demonstrates the use of the function:

// ... Initialization
if( isIdentity( A ) ) { ... }
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an identity matrix.
Definition: DenseMatrix.h:2561

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.

◆ isinf()

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

Checks the given sparse matrix for infinite elements.

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

This function checks the sparse matrix for infinite (inf) elements. If at least one element of the matrix is infinite, the function returns true, otherwise it returns false.

// ... Initialization
if( isinf( A ) ) { ... }
bool isinf(const DenseMatrix< MT, SO > &dm)
Checks the given dense matrix for infinite elements.
Definition: DenseMatrix.h:1339

◆ isLower()

template<RelaxationFlag 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

                    \f[\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).\f]

$ 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 ) ) { ... }
bool isLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a lower triangular matrix.
Definition: DenseMatrix.h:1921

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

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 ) ) { ... }
bool isnan(const DenseMatrix< MT, SO > &dm)
Checks the given dense matrix for not-a-number elements.
Definition: DenseMatrix.h:1290

◆ isStrictlyLower()

template<RelaxationFlag 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

                    \f[\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).\f]

The following code example demonstrates the use of the function:

// ... Initialization
if( isStrictlyLower( A ) ) { ... }
bool isStrictlyLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly lower triangular matrix.
Definition: DenseMatrix.h:2096

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

                    \f[\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).\f]

The following code example demonstrates the use of the function:

// ... Initialization
if( isStrictlyUpper( A ) ) { ... }
bool isStrictlyUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly upper triangular matrix.
Definition: DenseMatrix.h:2363

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<RelaxationFlag 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 ) ) { ... }
bool isSymmetric(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is symmetric.
Definition: DenseMatrix.h:1456

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<RelaxationFlag 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 ) ) { ... }
bool isUniform(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a uniform matrix.
Definition: DenseMatrix.h:1766

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

                    \f[\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).\f]

The following code example demonstrates the use of the function:

// ... Initialization
if( isUniLower( A ) ) { ... }
bool isUniLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a lower unitriangular matrix.
Definition: DenseMatrix.h:2009

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

                    \f[\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).\f]

The following code example demonstrates the use of the function:

// ... Initialization
if( isUniUpper( A ) ) { ... }
bool isUniUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper unitriangular matrix.
Definition: DenseMatrix.h:2276

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

                    \f[\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).\f]

$ 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 ) ) { ... }
bool isUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper triangular matrix.
Definition: DenseMatrix.h:2188

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<RelaxationFlag RF, typename MT , bool SO>
bool blaze::isZero ( const SparseMatrix< MT, SO > &  sm)

Checks if the given sparse matrix is a zero matrix.

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

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

// ... Initialization
if( isZero( A ) ) { ... }
bool isZero(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a zero matrix.
Definition: DenseMatrix.h:1819

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

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

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

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

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

◆ kron() [1/6]

template<typename MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::kron ( const DenseMatrix< MT1, SO1 > &  lhs,
const SparseMatrix< MT2, SO2 > &  rhs 
)
inline

Computes the Kronecker product of a dense matrix and a sparse matrix ( $ A=B \otimes C $).

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

This kron() function computes the Kronecker product of the given dense matrix and sparse matrix:

// ... Resizing and initialization
C = kron( A, B );
decltype(auto) kron(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the Kronecker product of two dense matrices ( ).
Definition: DMatDMatKronExpr.h:957

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

◆ kron() [2/6]

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

Computes the Kronecker product of two row-major sparse matrices ( $ A=B \otimes C $).

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

The kron() function computes the Kronecker product of the two given row-major sparse matrices:

// ... Resizing and initialization
C = kron( A, B );
constexpr bool rowMajor
Storage order flag for row-major matrices.
Definition: StorageOrder.h:71

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

◆ kron() [3/6]

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

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

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

The kron() function computes the Kronecker product for a row-major sparse matrix and a column-major sparse matrix:

// ... Resizing and initialization
C = kron( A, B );
constexpr bool columnMajor
Storage order flag for column-major matrices.
Definition: StorageOrder.h:99

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

◆ kron() [4/6]

template<typename MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::kron ( const SparseMatrix< MT1, SO1 > &  lhs,
const DenseMatrix< MT2, SO2 > &  rhs 
)
inline

Computes the Kronecker product of a sparse matrix and a dense matrix ( $ A=B \otimes C $).

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

This kron() function computes the Kronecker product of the given sparse matrix and dense matrix:

// ... Resizing and initialization
C = kron( A, B );

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

◆ kron() [5/6]

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

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

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

The kron() function computes the Kronecker product for a column-major sparse matrix and a row-major sparse matrix:

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

◆ kron() [6/6]

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

Computes the Kronecker product of two column-major sparse matrices ( $ A=B \otimes C $).

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

The kron() function computes the Kronecker product of the two given column-major sparse matrices:

// ... Resizing and initialization
C = kron( A, B );

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

◆ 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 );
decltype(auto) l1Norm(const DenseMatrix< MT, SO > &dm)
Computes the L1 norm for the given dense matrix.
Definition: DMatNormExpr.h:625

◆ 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 );
decltype(auto) l2Norm(const DenseMatrix< MT, SO > &dm)
Computes the L2 norm for the given dense matrix.
Definition: DMatNormExpr.h:651

◆ 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 );
decltype(auto) l3Norm(const DenseMatrix< MT, SO > &dm)
Computes the L3 norm for the given dense matrix.
Definition: DMatNormExpr.h:677

◆ 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 );
decltype(auto) l4Norm(const DenseMatrix< MT, SO > &dm)
Computes the L4 norm for the given dense matrix.
Definition: DMatNormExpr.h:703

◆ lgamma()

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

Computes the natural logarithm of the absolute value of the gamma function for each non-zero element of the sparse matrix sm.

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

The lgamma() function computes the natural logarithm of the absolute value of the gamma 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 lgamma() function:

// ... Resizing and initialization
B = lgamma( A );
decltype(auto) lgamma(const DenseMatrix< MT, SO > &dm)
Computes the natural logarithm of the absolute value of the gamma function for each single element of...
Definition: DMatMapExpr.h:2016
Note
All elements are expected to be in the range $[0..\infty)$. No runtime checks are performed to assert this precondition!

◆ linfNorm()

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

Computes the infinity norm for the given sparse matrix.

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

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

// ... Resizing and initialization
const double linf = linfNorm( A );
decltype(auto) linfNorm(const DenseMatrix< MT, SO > &dm)
Computes the infinity norm for the given dense matrix.
Definition: DMatNormExpr.h:799

◆ 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 );
decltype(auto) log(const DenseMatrix< MT, SO > &dm)
Computes the natural logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1888
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 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 log10() 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 log10() function:

// ... Resizing and initialization
B = log10( A );
decltype(auto) log10(const DenseMatrix< MT, SO > &dm)
Computes the common logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1950
Note
All non-zero elements are expected to be in the range $[0..\infty)$. No runtime checks are performed to assert this precondition!

◆ log1p()

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

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

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

The log1p() function computes the natural logarithm of x+1 for each non-zero element of the input matrix sm. This may be preferred over the natural logarithm for higher precision computing the natural logarithm of a quantity very close to 1. The function returns an expression representing this operation.
The following example demonstrates the use of the log1p() function:

// ... Resizing and initialization
B = log1p( A );
decltype(auto) log1p(const DenseMatrix< MT, SO > &dm)
Computes the natural logarithm of x+1 for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1983
Note
All 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 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 log2() 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 log2() function:

// ... Resizing and initialization
B = log2( A );
decltype(auto) log2(const DenseMatrix< MT, SO > &dm)
Computes the binary logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1919
Note
All non-zero elements are expected to be in the range $[0..\infty)$. No runtime checks are performed to assert this precondition!

◆ lowerBound() [1/2]

template<typename MT , bool SO>
MT::ConstIterator blaze::lowerBound ( const SparseMatrix< MT, SO > &  sm,
size_t  i,
size_t  j 
)

Returns an iterator to the first index not less than the given index.

Parameters
smThe given sparse matrix.
iThe row index of the search element. The index has to be in the range $[0..M-1]$.
jThe column index of the search element. The index has to be in the range $[0..N-1]$.
Returns
Iterator to the first index not less than the given index, end() iterator otherwise.

In case of a row-major matrix, this function returns a row iterator to the first element with an index not less than the given column index. In case of a column-major matrix, the function returns a column iterator to the first element with an index not less than the given row index. In combination with the upperBound() function this function can be used to create a pair of iterators specifying a range of indices. Note that the returned sparse matrix iterator is subject to invalidation due to inserting operations via the function call operator, the set() function or the insert() function!

◆ lowerBound() [2/2]

template<typename MT , bool SO>
MT::Iterator blaze::lowerBound ( SparseMatrix< MT, SO > &  sm,
size_t  i,
size_t  j 
)

Returns an iterator to the first index not less than the given index.

Parameters
smThe given sparse matrix.
iThe row index of the search element. The index has to be in the range $[0..M-1]$.
jThe column index of the search element. The index has to be in the range $[0..N-1]$.
Returns
Iterator to the first index not less than the given index, end() iterator otherwise.

In case of a row-major matrix, this function returns a row iterator to the first element with an index not less than the given column index. In case of a column-major matrix, the function returns a column iterator to the first element with an index not less than the given row index. In combination with the upperBound() function this function can be used to create a pair of iterators specifying a range of indices. Note that the returned sparse matrix iterator is subject to invalidation due to inserting operations via the function call operator, the set() function or the insert() function!

◆ lpNorm() [1/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!.

◆ lpNorm() [2/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 );
decltype(auto) lpNorm(const DenseMatrix< MT, SO > &dm, ST p)
Computes the Lp norm for the given dense matrix.
Definition: DMatNormExpr.h:735
Note
The norm parameter p is expected to be larger than 0. This precondition is only checked by a user assertion.

◆ map()

template<typename MT , bool SO, typename OP >
decltype(auto) blaze::map ( 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 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 ); } );
decltype(auto) map(const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs, OP op)
Elementwise evaluation of the given binary operation on each single element of the dense matrices lhs...
Definition: DMatDMatMapExpr.h:1144

◆ max() [1/2]

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

Returns the largest element of the sparse matrix.

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

This function returns the largest non-zero element of the given sparse matrix. This function can only be used for element types that support the smaller-than relationship. In case the given 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).

Note
In case the sparse matrix is not completely filled, the implicit zero elements are NOT taken into account. Example: the following compressed matrix has only 2 non-zero elements. However, the maximum of this matrix is -1:
blaze::CompressedMatrix<int> A{ { -1, 0 }, { -3, 0 } };
const int totalmax = max( A ); // Results in -1
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1375

◆ max() [2/2]

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

Returns the largest element of each row/columns of the sparse matrix.

Parameters
smThe given sparse matrix.
Returns
The largest elements in each row/column.

This function returns the largest element of each row/column of the given sparse matrix sm. In case the reduction flag RF is set to blaze::columnwise, a row vector containing the largest element of each column is returned. In case RF is set to blaze::rowwise, a column vector containing the largest element of each row is returned.

Note
In case the sparse matrix is not completely filled, the implicit zero elements are NOT taken into account:
blaze::CompressedMatrix<int> A{ { -1, 0, -2 }, { -1, -3, -4 } };
colmax = max<columnwise>( A ); // Results in ( -1, -3, -2 )
constexpr ReductionFlag columnwise
Reduction flag for column-wise reduction operations.
Definition: ReductionFlag.h:97
Efficient implementation of an arbitrary sized vector.
Definition: DynamicVector.h:223
blaze::CompressedMatrix<int> A{ { -1, 0, -2 }, { -1, -3, -4 } };
rowmax = max<rowwise>( A ); // Results in ( -1, -1 )
constexpr ReductionFlag rowwise
Reduction flag for row-wise reduction operations.
Definition: ReductionFlag.h:77

◆ 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 );
decltype(auto) maxNorm(const DenseMatrix< MT, SO > &dm)
Computes the maximum norm for the given dense matrix.
Definition: DMatNormExpr.h:825

◆ mean() [1/2]

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

Computes the (arithmetic) mean for the given sparse matrix.

Parameters
smThe given sparse matrix for the mean computation.
Returns
The mean of the given matrix.
Exceptions
std::invalid_argumentInvalid input matrix.

This function computes the (arithmetic) mean for the given sparse matrix sm. Both the non-zero and zero elements of the sparse matrix are taken into account. Example:

CompressedMatrix<int> A{ { 1, 3, 2 }
, { 2, 6, 4 }
, { 9, 6, 3 } };
const double m = mean( A ); // Results in 4 (i.e. 36/9)
decltype(auto) mean(const DenseMatrix< MT, SO > &dm)
Computes the (arithmetic) mean for the given dense matrix.
Definition: DMatMeanExpr.h:134

In case the number of rows or columns of the given matrix is 0, a std::invalid_argument is thrown.

◆ mean() [2/2]

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

Computes the row-/columnwise mean function for the given sparse matrix.

Parameters
smThe given sparse matrix for the mean computation.
Returns
The row-/columnwise mean of the given matrix.
Exceptions
std::invalid_argumentInvalid input matrix.

This function computes the row-/columnwise (arithmetic) mean for the given sparse matrix sm. In case RF is set to rowwise, the function returns a column vector containing the mean of each row of sm. In case RF is set to columnwise, the function returns a row vector containing the mean of each column of sm. Both the non-zero and zero elements of the sparse matrix are taken into account. Example:

CompressedMatrix<int> A{ { 1, 3, 2 }
, { 2, 6, 4 }
, { 9, 6, 3 } };
DynamicVector<double,columnVector> rm;
DynamicVector<double,rowVector> cm;
rm = mean<rowwise>( A ); // Results in ( 2 4 6 )
cm = mean<columnwise>( A ); // Results in ( 4 5 3 )
constexpr bool columnVector
Transpose flag for column vectors.
Definition: TransposeFlag.h:58
constexpr bool rowVector
Transpose flag for row vectors.
Definition: TransposeFlag.h:73

In case RF is set to rowwise and the number of columns of the given matrix is 0 or in case RF is set to columnwise and the number of rows of the given matrix is 0, a std::invalid_argument is thrown.

◆ min() [1/2]

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

Returns the smallest element of the sparse matrix.

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

This function returns the smallest non-zero element of the given sparse matrix. This function can only be used for element types that support the smaller-than relationship. In case the given 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).

Note
In case the sparse matrix is not completely filled, the implicit zero elements are NOT taken into account. Example: the following compressed matrix has only 2 non-zero elements. However, the minimum of this matrix is 1:
blaze::CompressedMatrix<int> A{ { 1, 0 }, { 3, 0 } };
const int totalmin = min( A ); // Results in 1
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1339

◆ min() [2/2]

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

Returns the smallest element of each row/columns of the sparse matrix.

Parameters
smThe given sparse matrix.
Returns
The smallest elements in each row/column.

This function returns the smallest non-zero element of each row/column of the given sparse matrix sm. In case the reduction flag RF is set to blaze::columnwise, a row vector containing the smallest element of each column is returned. In case RF is set to blaze::rowwise, a column vector containing the smallest element of each row is returned.

Note
In case the sparse matrix is not completely filled, the implicit zero elements are NOT taken into account:
blaze::CompressedMatrix<int> A{ { 1, 0, 2 }, { 1, 3, 4 } };
colmin = min<columnwise>( A ); // Results in ( 1, 3, 2 )
blaze::CompressedMatrix<int> A{ { 1, 0, 2 }, { 1, 3, 4 } };
rowmin = min<rowwise>( A ); // Results in ( 1, 1 )

◆ minNorm()

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

Computes the minimum norm for the given sparse matrix.

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

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

// ... Resizing and initialization
const double min = minNorm( A );
decltype(auto) minNorm(const DenseMatrix< MT, SO > &dm)
Computes the minimum norm for the given dense matrix.
Definition: DMatNormExpr.h:851

◆ noalias()

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

Forces the non-aliased evaluation of the given sparse matrix expression sm.

Parameters
smThe input matrix.
Returns
The non-aliased sparse matrix.

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

// ... Resizing and initialization
B = noalias( A );
decltype(auto) noalias(const DenseMatrix< MT, SO > &dm)
Forces the non-aliased evaluation of the given dense matrix expression dm.
Definition: DMatNoAliasExpr.h:679

◆ 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 );
decltype(auto) norm(const DenseMatrix< MT, SO > &dm)
Computes the L2 norm for the given dense matrix.
Definition: DMatNormExpr.h:573

◆ nosimd()

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

Disables the SIMD evaluation of the given sparse matrix expression sm.

Parameters
smThe input matrix.
Returns
The SIMD-disabled sparse matrix.

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

// ... Resizing and initialization
B = nosimd( A );
decltype(auto) nosimd(const DenseMatrix< MT, SO > &dm)
Disables the SIMD evaluation of the given dense matrix expression dm.
Definition: DMatNoSIMDExpr.h:717

◆ operator!=()

template<typename MT1 , bool SO1, typename MT2 , bool SO2>
bool blaze::operator!= ( const SparseMatrix< MT1, SO1 > &  lhs,
const SparseMatrix< MT2, 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/8]

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

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:

// ... 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 sizes of the two given matrices don't match, a std::invalid_argument is thrown.

◆ operator%() [2/8]

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

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/8]

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

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%() [4/8]

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

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%() [5/8]

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

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%() [6/8]

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

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%() [7/8]

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

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/8]

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

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*() [1/9]

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:

// ... Resizing and initialization
A = a * b;
Efficient implementation of an arbitrary sized sparse vector.
Definition: CompressedVector.h:220

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/9]

template<typename MT , bool SO, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
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*() [3/9]

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

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

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

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

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

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types 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*() [4/9]

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

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

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

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

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types 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/9]

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

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

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

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

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

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types 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/9]

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

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

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

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

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

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types 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/9]

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

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

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

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

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved element types 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*() [8/9]

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

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

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

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

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved element types 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*() [9/9]

template<typename ST , typename MT , bool SO, EnableIf_t< IsScalar_v< ST > > * = nullptr>
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*=() [1/2]

template<typename MT , bool SO, typename ST >
auto blaze::operator*= ( SparseMatrix< MT, SO > &&  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
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*=() [2/2]

template<typename MT , bool SO, typename ST >
auto blaze::operator*= ( SparseMatrix< MT, SO > &  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
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+() [1/4]

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

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

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

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

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

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types 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 
)
inline

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

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

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

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types 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 
)
inline

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

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

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

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types 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 
)
inline

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

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

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

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

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types 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 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-() [2/5]

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

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

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

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

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

The operator returns an expression representing a sparse matrix of the higher-order element type of the two involved matrix element types 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, false > &  lhs,
const SparseMatrix< MT2, true > &  rhs 
)
inline

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

Parameters
lhsThe left-hand side sparse matrix for the matrix subtraction.
rhsThe right-hand side sparse matrix to be subtracted from the left-hand side matrix.
Returns
The 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-() [4/5]

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

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

Parameters
lhsThe left-hand side sparse matrix for the matrix subtraction.
rhsThe right-hand side sparse matrix to be 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-() [5/5]

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

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

Parameters
lhsThe left-hand side sparse matrix for the matrix subtraction.
rhsThe right-hand side sparse matrix to be subtracted from the left-hand side matrix.
Returns
The 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/()

template<typename MT , bool SO, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
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 >
auto blaze::operator/= ( SparseMatrix< MT, SO > &&  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
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/=() [2/2]

template<typename MT , bool SO, typename ST >
auto blaze::operator/= ( SparseMatrix< MT, SO > &  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
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==()

template<typename MT1 , bool SO1, typename MT2 , bool SO2>
bool blaze::operator== ( const SparseMatrix< MT1, SO1 > &  lhs,
const SparseMatrix< MT2, SO2 > &  rhs 
)
inline

Equality 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 equal, false if not.

◆ pow()

template<typename MT , bool SO, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
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 );
decltype(auto) pow(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise exponential value for the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1448

◆ prod() [1/2]

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

Reduces the given sparse matrix by means of multiplication.

Parameters
smThe given sparse matrix for the reduction operation.
Returns
The result of the reduction operation.

This function reduces the non-zero elements of the given sparse matrix sm by means of multiplication:

blaze::CompressedMatrix<int> A{ { 1, 2 }, { 3, 4 } };
const int totalprod = prod( A ); // Results in 24
decltype(auto) prod(const DenseMatrix< MT, SO > &dm)
Reduces the given dense matrix by means of multiplication.
Definition: DMatReduceExpr.h:2229

Please note that the evaluation order of the reduction operation is unspecified.

◆ prod() [2/2]

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

Reduces the given sparse matrix by means of multiplication.

Parameters
smThe given sparse matrix for the reduction operation.
Returns
The result of the reduction operation.

This function reduces the non-zero elements of the rows or columns of the given sparse matrix sm by means of multiplication. In case the reduction flag RF is set to blaze::columnwise, the elements of the matrix are reduced column-wise and the result is a row vector. In case RF is set to blaze::rowwise, the elements of the matrix are reduced row-wise and the result is a column vector:

blaze::CompressedMatrix<int> A{ { 1, 0, 2 }, { 1, 3, 4 } };
colsum = sum<columnwise>( A ); // Results in ( 1, 3, 8 )
blaze::CompressedMatrix<int> A{ { 1, 0, 2 }, { 1, 3, 4 } };
rowsum = sum<rowwise>( A ); // Results in ( 2, 12 )

Please note that the evaluation order of the reduction operation is unspecified.

◆ 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 );
decltype(auto) real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatMapExpr.h:1529

◆ reduce() [1/2]

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

Performs a custom reduction operation on the given sparse matrix.

Parameters
smThe given sparse matrix for the reduction computation.
opThe reduction operation.
Returns
The result of the reduction operation.

This function reduces the non-zero elements of the given sparse matrix sm by means of the given reduction operation op:

// ... Resizing and initialization
const double totalsum1 = reduce( A, blaze::Add() );
const double totalsum2 = reduce( A, []( double a, double b ){ return a + b; } );
decltype(auto) reduce(const DenseMatrix< MT, SO > &dm, OP op)
Performs a custom reduction operation on the given dense matrix.
Definition: DMatReduceExpr.h:2025
Generic wrapper for the addition operator.
Definition: Add.h:85

As demonstrated in the example it is possible to pass any binary callable as custom reduction operation. See Custom Operations for a detailed overview of the possibilities of custom operations.

Please note that the evaluation order of the reduction operation is unspecified. Thus the behavior is non-deterministic if op is not associative or not commutative. Also, the operation is undefined if the given reduction operation modifies the values.

◆ reduce() [2/2]

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

Performs a custom reduction operation on the given sparse matrix.

Parameters
smThe given sparse matrix for the reduction computation.
opThe reduction operation.
Returns
The result of the reduction operation.

This function reduces the rows or columns of the given sparse matrix sm by means of the given reduction operation op. In case the reduction flag RF is set to blaze::columnwise, the elements of the matrix are reduced column-wise and the result is a row vector. In case RF is set to blaze::rowwise, the elements of the matrix are reduced row-wise and the result is a column vector:

// ... Resizing and initialization
colsum1 = reduce<columnwise>( A, blaze::Add() );
colsum2 = reduce<columnwise>( A, []( double a, double b ){ return a + b; } );
// ... Resizing and initialization
rowsum1 = reduce<rowwise>( A, blaze::Add() );
rowsum2 = reduce<rowwise>( A, []( double a, double b ){ return a + b; } );

Please note that the evaluation order of the reduction operation is unspecified. Thus the behavior is non-deterministic if op is not associative or not commutative. Also, the operation is undefined if the given reduction operation modifies the values.

◆ repeat() [1/2]

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

Repeats the given sparse matrix.

Parameters
smThe sparse matrix to be repeated.
Returns
The repeated sparse matrix.

This function returns an expression representing the repeated sparse matrix:

blaze::CompressedMatrix<int,rowMajor> A1{ { 1, 0, -2 }, { 0, 5, 0 } };
blaze::CompressedMatrix<int,columnMajor> B1{ { 0, -1 }, { 0, 4 }, { 7, 0 } };
// ... Resizing and initialization
// Repeating the 2x3 matrix 'A1' results in
//
// ( 1 0 -2 1 0 -2 1 0 -2 )
// ( 0 5 0 0 5 0 0 5 0 )
// ( 1 0 -2 1 0 -2 1 0 -2 )
// ( 0 5 0 0 5 0 0 5 0 )
//
A2 = repeat<2UL,3UL>( A1 );
// Repeating the 3x2 matrix 'B1' results in
//
// ( 0 -1 0 -1 0 -1 )
// ( 0 4 0 4 0 4 )
// ( 7 0 7 0 7 0 )
// ( 0 -1 0 -1 0 -1 )
// ( 0 4 0 4 0 4 )
// ( 7 0 7 0 7 0 )
//
B2 = repeat<2UL,3UL>( B1 );

◆ repeat() [2/2]

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

Repeats the given sparse matrix.

Parameters
smThe sparse matrix to be repeated.
mThe number of row-wise repetitions.
nThe number of column-wise repetitions.
Returns
The repeated sparse matrix.

This function returns an expression representing the repeated sparse matrix:

blaze::CompressedMatrix<int,rowMajor> A1{ { 1, 0, -2 }, { 0, 5, 0 } };
blaze::CompressedMatrix<int,columnMajor> B1{ { 0, -1 }, { 0, 4 }, { 7, 0 } };
// ... Resizing and initialization
// Repeating the 2x3 matrix 'A1' results in
//
// ( 1 0 -2 1 0 -2 1 0 -2 )
// ( 0 5 0 0 5 0 0 5 0 )
// ( 1 0 -2 1 0 -2 1 0 -2 )
// ( 0 5 0 0 5 0 0 5 0 )
//
A2 = repeat( A1, 2UL, 3UL );
// Repeating the 3x2 matrix 'B1' results in
//
// ( 0 -1 0 -1 0 -1 )
// ( 0 4 0 4 0 4 )
// ( 7 0 7 0 7 0 )
// ( 0 -1 0 -1 0 -1 )
// ( 0 4 0 4 0 4 )
// ( 7 0 7 0 7 0 )
//
B2 = repeat( B1, 2UL, 3UL );
decltype(auto) repeat(const DenseMatrix< MT, SO > &dm, size_t m, size_t n)
Repeats the given dense matrix.
Definition: DMatRepeatExpr.h:543

◆ 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 );
decltype(auto) round(const DenseMatrix< MT, SO > &dm)
Applies the round() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1436

◆ serial()

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

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 );
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:812

◆ sign()

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

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

Parameters
smThe input matrix.
Returns
The resulting sparse matrix.

This function applies the sign() 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 sign() function:

// ... Resizing and initialization
B = sign( A );
decltype(auto) sign(const DenseMatrix< MT, SO > &dm)
Applies the sign() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1324

◆ 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 );
decltype(auto) sin(const DenseMatrix< MT, SO > &dm)
Computes the sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2044

◆ 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 );
decltype(auto) sinh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2103

◆ 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 );
decltype(auto) sqrNorm(const DenseMatrix< MT, SO > &dm)
Computes the squared L2 norm for the given dense matrix.
Definition: DMatNormExpr.h:599

◆ 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!

◆ stddev() [1/2]

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

Computes the standard deviation for the given sparse matrix.

Parameters
smThe given sparse matrix for the standard deviation computation.
Returns
The standard deviation of the given matrix.
Exceptions
std::invalid_argumentInvalid input matrix.

This function computes the standard deviation for the given sparse matrix sm. Both the non-zero and zero elements of the sparse matrix are taken into account. Example:

CompressedMatrix<int> A{ { 1, 3, 2 }
, { 2, 6, 4 }
, { 9, 6, 3 } };
const double s = stddev( A ); // Results in sqrt(6.5)
decltype(auto) stddev(const DenseMatrix< MT, SO > &dm)
Computes the standard deviation for the given dense matrix.
Definition: DMatStdDevExpr.h:83

In case the size of the given matrix is smaller than 2, a std::invalid_argument is thrown.

◆ stddev() [2/2]

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

Computes the row-/columnwise standard deviation function for the given sparse matrix.

Parameters
smThe given sparse matrix for the standard deviation computation.
Returns
The row-/columnwise standard deviation of the given matrix.
Exceptions
std::invalid_argumentInvalid input matrix.

This function computes the row-/columnwise standard deviation for the given sparse matrix sm. In case RF is set to rowwise, the function returns a column vector containing the standard deviation of each row of sm. In case RF is set to columnwise, the function returns a row vector containing the standard deviation of each column of sm. Both the non-zero and zero elements of the sparse matrix are taken into account. Example:

CompressedMatrix<int> A{ { 1, 3, 2 }
, { 2, 6, 4 }
, { 9, 6, 3 } };
DynamicVector<double,columnVector> rs;
DynamicVector<double,rowVector> cs;
rs = stddev<rowwise>( A ); // Results in ( 1 2 3 )
cs = stddev<columnwise>( A ); // Results in ( sqrt(19) sqrt(3) 1 )

In case RF is set to rowwise and the number of columns of the given matrix is smaller than 2 or in case RF is set to columnwise and the number of rows of the given matrix is smaller than 2, a std::invalid_argument is thrown.

◆ sum() [1/2]

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

Reduces the given sparse matrix by means of addition.

Parameters
smThe given sparse matrix for the reduction operation.
Returns
The result of the reduction operation.

This function reduces the non-zero elements of the given sparse matrix sm by means of addition:

blaze::CompressedMatrix<int> A{ { 1, 2 }, { 3, 4 } };
const int totalsum = sum( A ); // Results in 10
decltype(auto) sum(const DenseMatrix< MT, SO > &dm)
Reduces the given dense matrix by means of addition.
Definition: DMatReduceExpr.h:2156

Please note that the evaluation order of the reduction operation is unspecified.

◆ sum() [2/2]

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

Reduces the given sparse matrix by means of addition.

Parameters
smThe given sparse matrix for the reduction operation.
Returns
The result of the reduction operation.

This function reduces the non-zero elements of the rows or columns of the given sparse matrix sm by means of addition. In case the reduction flag RF is set to blaze::columnwise, the elements of the matrix are reduced column-wise and the result is a row vector. In case RF is set to blaze::rowwise, the elements of the matrix are reduced row-wise and the result is a column vector:

blaze::CompressedMatrix<int> A{ { 1, 0, 2 }, { 1, 3, 4 } };
colsum = sum<columnwise>( A ); // Results in ( 2, 3, 6 )
blaze::CompressedMatrix<int> A{ { 1, 0, 2 }, { 1, 3, 4 } };
rowsum = sum<rowwise>( A ); // Results in ( 3, 8 )

Please note that the evaluation order of the reduction operation is unspecified.

◆ 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 );
decltype(auto) tan(const DenseMatrix< MT, SO > &dm)
Computes the tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2277

◆ 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 );
decltype(auto) tanh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2336
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)
inline

Calculation of the transpose of the given sparse matrix.

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

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

◆ transIf()

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

Conditional calculation of the transpose of the given sparse matrix.

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

In case the given compile time condition evaluates to true, this function returns an expression representing the transpose of the given sparse matrix. Otherwise the function returns a reference to the given 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 );
decltype(auto) trunc(const DenseMatrix< MT, SO > &dm)
Applies the trunc() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1408

◆ tsmattsmatschur()

template<typename MT1 , typename MT2 , DisableIf_t<(IsUniLower_v< MT1 > &&IsUniUpper_v< MT2 >)||(IsUniUpper_v< MT1 > &&IsUniLower_v< MT2 >)||(IsStrictlyLower_v< MT1 > &&IsUpper_v< MT2 >)||(IsStrictlyUpper_v< MT1 > &&IsLower_v< MT2 >)||(IsLower_v< MT1 > &&IsStrictlyUpper_v< MT2 >)||(IsUpper_v< MT1 > &&IsStrictlyLower_v< MT2 >)||(IsZero_v< MT1 >||IsZero_v< MT2 >) > * = nullptr>
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.

◆ upperBound() [1/2]

template<typename MT , bool SO>
MT::ConstIterator blaze::upperBound ( const SparseMatrix< MT, SO > &  sm,
size_t  i,
size_t  j 
)

Returns an iterator to the first index greater than the given index.

Parameters
smThe given sparse matrix.
iThe row index of the search element. The index has to be in the range $[0..M-1]$.
jThe column index of the search element. The index has to be in the range $[0..N-1]$.
Returns
Iterator to the first index greater than the given index, end() iterator otherwise.

In case of a row-major matrix, this function returns a row iterator to the first element with an index greater than the given column index. In case of a column-major matrix, the function returns a column iterator to the first element with an index greater than the given row index. In combination with the lowerBound() function this function can be used to create a pair of iterators specifying a range of indices. Note that the returned sparse matrix iterator is subject to invalidation due to inserting operations via the function call operator, the set() function or or the insert() function!

◆ upperBound() [2/2]

template<typename MT , bool SO>
MT::Iterator blaze::upperBound ( SparseMatrix< MT, SO > &  sm,
size_t  i,
size_t  j 
)

Returns an iterator to the first index greater than the given index.

Parameters
smThe given sparse matrix.
iThe row index of the search element. The index has to be in the range $[0..M-1]$.
jThe column index of the search element. The index has to be in the range $[0..N-1]$.
Returns
Iterator to the first index greater than the given index, end() iterator otherwise.

In case of a row-major matrix, this function returns a row iterator to the first element with an index greater than the given column index. In case of a column-major matrix, the function returns a column iterator to the first element with an index greater than the given row index. In combination with the lowerBound() function this function can be used to create a pair of iterators specifying a range of indices. Note that the returned sparse matrix iterator is subject to invalidation due to inserting operations via the function call operator, the set() function or or the insert() function!

◆ var() [1/2]

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

Computes the variance for the given sparse matrix.

Parameters
smThe given sparse matrix for the variance computation.
Returns
The variance of the given matrix.
Exceptions
std::invalid_argumentInvalid input matrix.

This function computes the variance for the given sparse matrix sm. Both the non-zero and zero elements of the sparse matrix are taken into account. Example:

CompressedMatrix<int> A{ { 1, 3, 2 }
, { 2, 6, 4 }
, { 9, 6, 3 } };
const double v = var( A ); // Results in 6.5
decltype(auto) var(const DenseMatrix< MT, SO > &dm)
Computes the variance for the given dense matrix.
Definition: DMatVarExpr.h:138

In case the size of the given matrix is smaller than 2, a std::invalid_argument is thrown.

◆ var() [2/2]

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

Computes the row-/column-wise variance function for the given sparse matrix.

Parameters
smThe given sparse matrix for the variance computation.
Returns
The row-/column-wise variance of the given matrix.
Exceptions
std::invalid_argumentInvalid input matrix.

This function computes the row-/column-wise variance for the given sparse matrix sm. In case RF is set to rowwise, the function returns a column vector containing the variance of each row of sm. In case RF is set to columnwise, the function returns a row vector containing the variance of each column of dm. Both the non-zero and zero elements of the sparse matrix are taken into account. Example:

CompressedMatrix<int> A{ { 1, 3, 2 }
, { 2, 6, 4 }
, { 9, 6, 3 } };
DynamicVector<double,columnVector> rv;
DynamicVector<double,rowVector> cv;
rv = var<rowwise>( A ); // Results in ( 1 4 9 )
cv = var<columnwise>( A ); // Results in ( 19 3 1 )

In case RF is set to rowwise and the number of columns of the given matrix is smaller than 2 or in case RF is set to columnwise and the number of rows of the given matrix is smaller than 2, a std::invalid_argument is thrown.