Modules | Classes | Functions
Dense Matrices

Modules

 CustomMatrix
 
 DynamicMatrix
 
 HybridMatrix
 
 StaticMatrix
 
 Expressions
 

Classes

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

Functions

template<typename T1 , typename T2 , bool SO>
EnableIf_< IsNumeric< T1 >, bool > blaze::operator== (T1 scalar, const DenseMatrix< T2, SO > &mat)
 Equality operator for the comparison of a scalar value and a dense matrix. More...
 
template<typename T1 , typename T2 , bool SO>
EnableIf_< IsNumeric< T1 >, bool > blaze::operator!= (T1 scalar, const DenseMatrix< T2, SO > &mat)
 Inequality operator for the comparison of a scalar value and a dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::decldiag (const DenseMatrix< MT, SO > &dm)
 Declares the given dense matrix expression dm as diagonal. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::declherm (const DenseMatrix< MT, SO > &dm)
 Declares the given dense matrix expression dm as Hermitian. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::decllow (const DenseMatrix< MT, SO > &dm)
 Declares the given dense matrix expression dm as lower. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::declsym (const DenseMatrix< MT, SO > &dm)
 Declares the given dense matrix expression dm as symmetric. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::declupp (const DenseMatrix< MT, SO > &dm)
 Declares the given dense matrix expression dm as upper. More...
 
template<typename MT1 , typename MT2 , bool SO>
decltype(auto) blaze::operator+ (const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs)
 Addition operator for the addition of two dense matrices with identical storage order ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 , bool SO, typename OP >
decltype(auto) blaze::map (const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs, OP op)
 Evaluates the given binary operation on each single element of the dense matrices lhs and rhs. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::min (const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Computes the componentwise minimum of the dense matrices lhs and rhs. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::max (const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Computes the componentwise maximum of the dense matrices lhs and rhs. More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* (const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
 Multiplication operator for the multiplication of two row-major dense matrices ( $ A=B*C $). More...
 
template<typename MT1 , typename MT2 , bool SO>
decltype(auto) blaze::operator% (const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs)
 Operator for the Schur product of two dense matrices with identical storage order ( $ A=B \circ C $). More...
 
template<typename MT1 , typename MT2 , bool SO>
decltype(auto) blaze::operator- (const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs)
 Subtraction operator for the subtraction of two dense matrices with identical storage order ( $ A=B-C $). More...
 
template<typename MT , bool SO>
decltype(auto) blaze::eval (const DenseMatrix< MT, SO > &dm)
 Forces the evaluation of the given dense matrix expression dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::inv (const DenseMatrix< MT, SO > &dm)
 Calculation of the inverse of the given dense matrix. More...
 
template<typename MT , bool SO, typename OP >
decltype(auto) blaze::map (const DenseMatrix< MT, SO > &dm, OP op)
 Evaluates the given custom operation on each single element of the dense matrix dm. More...
 
template<typename MT , bool SO, typename OP >
decltype(auto) blaze::forEach (const DenseMatrix< MT, SO > &dm, OP op)
 Evaluates the given custom operation on each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::abs (const DenseMatrix< MT, SO > &dm)
 Applies the abs() function to each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::floor (const DenseMatrix< MT, SO > &dm)
 Applies the floor() function to each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::ceil (const DenseMatrix< MT, SO > &dm)
 Applies the ceil() function to each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::trunc (const DenseMatrix< MT, SO > &dm)
 Applies the trunc() function to each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::round (const DenseMatrix< MT, SO > &dm)
 Applies the round() function to each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::conj (const DenseMatrix< MT, SO > &dm)
 Returns a matrix containing the complex conjugate of each single element of dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::ctrans (const DenseMatrix< MT, SO > &dm)
 Returns the conjugate transpose matrix of dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::real (const DenseMatrix< MT, SO > &dm)
 Returns a matrix containing the real part of each single element of dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::imag (const DenseMatrix< MT, SO > &dm)
 Returns a matrix containing the imaginary part of each single element of dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::sqrt (const DenseMatrix< MT, SO > &dm)
 Computes the square root of each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::invsqrt (const DenseMatrix< MT, SO > &dm)
 Computes the inverse square root of each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::cbrt (const DenseMatrix< MT, SO > &dm)
 Computes the cubic root of each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::invcbrt (const DenseMatrix< MT, SO > &dm)
 Computes the inverse cubic root of each single element of the dense matrix dm. More...
 
template<typename MT , bool SO, typename DT >
decltype(auto) blaze::clamp (const DenseMatrix< MT, SO > &dm, const DT &min, const DT &max)
 Restricts each single element of the dense matrix dm to the range $[min..max]$. More...
 
template<typename MT , bool SO, typename ET >
decltype(auto) blaze::pow (const DenseMatrix< MT, SO > &dm, ET exp)
 Computes the exponential value for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::exp (const DenseMatrix< MT, SO > &dm)
 Computes $ e^x $ for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::exp2 (const DenseMatrix< MT, SO > &dm)
 Computes $ 2^x $ for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::exp10 (const DenseMatrix< MT, SO > &dm)
 Computes $ 10^x $ for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::log (const DenseMatrix< MT, SO > &dm)
 Computes the natural logarithm for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::log2 (const DenseMatrix< MT, SO > &dm)
 Computes the binary logarithm for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::log10 (const DenseMatrix< MT, SO > &dm)
 Computes the common logarithm for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::sin (const DenseMatrix< MT, SO > &dm)
 Computes the sine for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::asin (const DenseMatrix< MT, SO > &dm)
 Computes the inverse sine for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::sinh (const DenseMatrix< MT, SO > &dm)
 Computes the hyperbolic sine for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::asinh (const DenseMatrix< MT, SO > &dm)
 Computes the inverse hyperbolic sine for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::cos (const DenseMatrix< MT, SO > &dm)
 Computes the cosine for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::acos (const DenseMatrix< MT, SO > &dm)
 Computes the inverse cosine for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::cosh (const DenseMatrix< MT, SO > &dm)
 Computes the hyperbolic cosine for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::acosh (const DenseMatrix< MT, SO > &dm)
 Computes the inverse hyperbolic cosine for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::tan (const DenseMatrix< MT, SO > &dm)
 Computes the tangent for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::atan (const DenseMatrix< MT, SO > &dm)
 Computes the inverse tangent for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::tanh (const DenseMatrix< MT, SO > &dm)
 Computes the hyperbolic tangent for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::atanh (const DenseMatrix< MT, SO > &dm)
 Computes the inverse hyperbolic tangent for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::erf (const DenseMatrix< MT, SO > &dm)
 Computes the error function for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::erfc (const DenseMatrix< MT, SO > &dm)
 Computes the complementary error function for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO, typename ST , typename = EnableIf_< IsNumeric<ST> >>
decltype(auto) blaze::operator/ (const DenseMatrix< MT, SO > &mat, ST scalar)
 Division operator for the division of a dense matrix by a scalar value ( $ A=B/s $). More...
 
template<typename MT , bool SO>
decltype(auto) blaze::operator- (const DenseMatrix< MT, SO > &dm)
 Unary minus operator for the negation of a dense matrix ( $ A = -B $). More...
 
template<typename MT , bool SO, typename ST , typename = EnableIf_< IsNumeric<ST> >>
decltype(auto) blaze::operator* (const DenseMatrix< MT, SO > &mat, ST scalar)
 Multiplication operator for the multiplication of a dense matrix and a scalar value ( $ A=B*s $). More...
 
template<typename ST , typename MT , bool SO, typename = EnableIf_< IsNumeric<ST> >>
decltype(auto) blaze::operator* (ST scalar, const DenseMatrix< MT, SO > &mat)
 Multiplication operator for the multiplication of a scalar value and a dense matrix ( $ A=s*B $). More...
 
template<typename MT , bool SO>
decltype(auto) blaze::serial (const DenseMatrix< MT, SO > &dm)
 Forces the serial evaluation of the given dense matrix expression dm. More...
 
template<typename MT1 , typename MT2 , bool SO>
decltype(auto) blaze::operator+ (const DenseMatrix< MT1, SO > &lhs, const SparseMatrix< MT2, SO > &rhs)
 Addition operator for the addition of a dense matrix and a sparse matrix ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 , bool SO>
decltype(auto) blaze::operator+ (const SparseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs)
 Addition operator for the addition of a sparse matrix and a dense matrix ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* (const DenseMatrix< MT1, false > &lhs, const SparseMatrix< MT2, false > &rhs)
 Multiplication operator for the multiplication of a row-major dense matrix and a row-major sparse matrix ( $ A=B*C $). More...
 
template<typename MT1 , typename MT2 , bool SO>
decltype(auto) blaze::operator- (const DenseMatrix< MT1, SO > &lhs, const SparseMatrix< MT2, SO > &rhs)
 Subtraction operator for the subtraction of a dense matrix and a sparse matrix with identical storage order ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator+ (const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, true > &rhs)
 Addition operator for the addition of a row-major and a colum-major dense matrix ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator+ (const DenseMatrix< MT1, true > &lhs, const DenseMatrix< MT2, false > &rhs)
 Addition operator for the addition of a column-major and a row-major dense matrix ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 , typename OP >
decltype(auto) blaze::map (const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, true > &rhs, OP op)
 Evaluates the given binary operation on each single element of the row-major dense matrix lhs and the column-major dense matrix rhs. More...
 
template<typename MT1 , typename MT2 , typename OP >
decltype(auto) blaze::map (const DenseMatrix< MT1, true > &lhs, const DenseMatrix< MT2, false > &rhs, OP op)
 Evaluates the given binary operation on each single element of the column-major dense matrix lhs and the row-major dense matrix rhs. More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* (const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, true > &rhs)
 Multiplication operator for the multiplication of a row-major dense matrix and a column-major dense matrix ( $ A=B*C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% (const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, true > &rhs)
 Operator for the Schur product of a row-major and a column-major dense matrix ( $ A=B \circ C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator% (const DenseMatrix< MT1, true > &lhs, const DenseMatrix< MT2, false > &rhs)
 Operator for the Schur product of a column-major and a row-major dense matrix ( $ A=B \circ C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator- (const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, true > &rhs)
 Subtraction operator for the subtraction of a row-major and a column-major dense matrix ( $ A=B-C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator- (const DenseMatrix< MT1, true > &lhs, const DenseMatrix< MT2, false > &rhs)
 Subtraction operator for the subtraction of a column-major and a row-major dense matrix ( $ A=B-C $). More...
 
template<typename MT , bool SO>
decltype(auto) blaze::trans (const DenseMatrix< MT, SO > &dm)
 Calculation of the transpose of the given dense matrix. More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator+ (const DenseMatrix< MT1, false > &lhs, const SparseMatrix< MT2, true > &rhs)
 Addition operator for the addition of a row-major dense matrix and a column-major sparse matrix ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator+ (const SparseMatrix< MT2, true > &lhs, const DenseMatrix< MT1, false > &rhs)
 Addition operator for the addition of a column-major sparse matrix and a row-major dense matrix ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* (const DenseMatrix< MT1, false > &lhs, const SparseMatrix< MT2, true > &rhs)
 Multiplication operator for the multiplication of a row-major dense matrix and a column-major sparse matrix ( $ A=B*C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator- (const DenseMatrix< MT1, false > &lhs, const SparseMatrix< MT2, true > &rhs)
 Subtraction operator for the subtraction of a row-major dense matrix and a column-major sparse matrix ( $ A=B+C $). More...
 
template<typename VT1 , typename VT2 >
decltype(auto) blaze::operator* (const DenseVector< VT1, false > &lhs, const DenseVector< VT2, true > &rhs)
 Multiplication operator for the outer product of two dense vectors ( $ A=\vec{b}*\vec{c}^T $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* (const SparseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
 Multiplication operator for the multiplication of a row-major sparse matrix and a row-major dense matrix ( $ A=B*C $). More...
 
template<typename MT1 , typename MT2 , bool SO>
decltype(auto) blaze::operator- (const SparseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs)
 Subtraction operator for the subtraction of a sparse matrix and a dense matrix with identical storage order ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* (const SparseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, true > &rhs)
 Multiplication operator for the multiplication of a row-major sparse matrix and a column-major dense matrix ( $ A=B*C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator- (const SparseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, true > &rhs)
 Subtraction operator for the subtraction of a row-major sparse matrix and a column-major dense matrix ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* (const DenseMatrix< MT1, true > &lhs, const DenseMatrix< MT2, false > &rhs)
 Multiplication operator for the multiplication of a column-major dense matrix and a row-major dense matrix ( $ A=B*C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator+ (const DenseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, false > &rhs)
 Addition operator for the addition of a column-major dense matrix and a row-major sparse matrix ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator+ (const SparseMatrix< MT2, false > &lhs, const DenseMatrix< MT1, true > &rhs)
 Addition operator for the addition of a row-major sparse matrix and a column-major dense matrix ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* (const DenseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, false > &rhs)
 Multiplication operator for the multiplication of a column-major dense matrix and a row-major sparse matrix ( $ A=B*C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator- (const DenseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, false > &rhs)
 Subtraction operator for the subtraction of a column-major dense matrix and a row-major sparse matrix ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* (const DenseMatrix< MT1, true > &lhs, const DenseMatrix< MT2, true > &rhs)
 Multiplication operator for the multiplication of two column-major dense matrices ( $ A=B*C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* (const DenseMatrix< MT1, true > &lhs, const SparseMatrix< MT2, true > &rhs)
 Multiplication operator for the multiplication of a column-major dense matrix and a column-major sparse matrix ( $ A=B*C $). More...
 
template<typename VT , typename MT >
decltype(auto) blaze::operator* (const DenseVector< VT, true > &vec, const DenseMatrix< MT, true > &mat)
 Multiplication operator for the multiplication of a transpose dense vector and a column-major dense matrix ( $ \vec{y}^T=\vec{x}^T*A $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* (const SparseMatrix< MT1, true > &lhs, const DenseMatrix< MT2, false > &rhs)
 Multiplication operator for the multiplication of a column-major sparse matrix and a row-major dense matrix ( $ A=B*C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator- (const SparseMatrix< MT1, true > &lhs, const DenseMatrix< MT2, false > &rhs)
 Subtraction operator for the subtraction of a column-major sparse matrix and a row-major dense matrix ( $ A=B+C $). More...
 
template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator* (const SparseMatrix< MT1, true > &lhs, const DenseMatrix< MT2, true > &rhs)
 Multiplication operator for the multiplication of a column-major sparse matrix and a column-major dense matrix ( $ A=B*C $). More...
 
template<typename VT , typename MT >
decltype(auto) blaze::operator* (const SparseVector< VT, true > &vec, const DenseMatrix< MT, false > &mat)
 Multiplication operator for the multiplication of a transpose sparse vector and a row-major dense matrix ( $ \vec{y}^T=\vec{x}^T*A $). More...
 

DenseMatrix operators

template<typename T1 , typename T2 >
bool blaze::operator== (const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
 Equality operator for the comparison of two rwo-major dense matrices. More...
 
template<typename T1 , typename T2 >
bool blaze::operator== (const DenseMatrix< T1, true > &lhs, const DenseMatrix< T2, true > &rhs)
 Equality operator for the comparison of two column-major dense matrices. More...
 
template<typename T1 , typename T2 , bool SO>
bool blaze::operator== (const DenseMatrix< T1, SO > &lhs, const DenseMatrix< T2,!SO > &rhs)
 Equality operator for the comparison of two dense matrices with different storage order. More...
 
template<typename T1 , typename T2 , bool SO>
bool blaze::operator== (const DenseMatrix< T1, SO > &lhs, const SparseMatrix< T2, false > &rhs)
 Equality operator for the comparison of a dense matrix and a row-major sparse matrix. More...
 
template<typename T1 , typename T2 , bool SO>
bool blaze::operator== (const DenseMatrix< T1, SO > &lhs, const SparseMatrix< T2, true > &rhs)
 Equality operator for the comparison of a dense matrix and a column-major sparse matrix. More...
 
template<typename T1 , bool SO1, typename T2 , bool SO2>
bool blaze::operator== (const SparseMatrix< T1, SO1 > &lhs, const DenseMatrix< T2, SO2 > &rhs)
 Equality operator for the comparison of a sparse matrix and a dense matrix. More...
 
template<typename T1 , typename T2 >
EnableIf_< IsNumeric< T2 >, bool > blaze::operator== (const DenseMatrix< T1, false > &mat, T2 scalar)
 Equality operator for the comparison of a row-major dense matrix and a scalar value. More...
 
template<typename T1 , typename T2 >
EnableIf_< IsNumeric< T2 >, bool > blaze::operator== (const DenseMatrix< T1, true > &mat, T2 scalar)
 Equality operator for the comparison of a column-major dense matrix and a scalar value. More...
 
template<typename T1 , bool SO1, typename T2 , bool SO2>
bool blaze::operator!= (const DenseMatrix< T1, SO1 > &lhs, const DenseMatrix< T2, SO2 > &rhs)
 Inequality operator for the comparison of two dense matrices. More...
 
template<typename T1 , bool SO1, typename T2 , bool SO2>
bool blaze::operator!= (const DenseMatrix< T1, SO1 > &lhs, const SparseMatrix< T2, SO2 > &rhs)
 Inequality operator for the comparison of a dense matrix and a sparse matrix. More...
 
template<typename T1 , bool SO1, typename T2 , bool SO2>
bool blaze::operator!= (const SparseMatrix< T1, SO1 > &lhs, const DenseMatrix< T2, SO2 > &rhs)
 Inequality operator for the comparison of a sparse matrix and a dense matrix. More...
 
template<typename T1 , typename T2 , bool SO>
EnableIf_< IsNumeric< T2 >, bool > blaze::operator!= (const DenseMatrix< T1, SO > &mat, T2 scalar)
 Inequality operator for the comparison of a dense matrix and a scalar value. More...
 

DenseMatrix functions

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

Eigenvalue functions

template<typename MT , bool SO, typename VT , bool TF>
void blaze::eigen (const DenseMatrix< MT, SO > &A, DenseVector< VT, TF > &w)
 Eigenvalue computation of the given dense matrix. More...
 
template<typename MT1 , bool SO1, typename VT , bool TF, typename MT2 , bool SO2>
void blaze::eigen (const DenseMatrix< MT1, SO1 > &A, DenseVector< VT, TF > &w, DenseMatrix< MT2, SO2 > &V)
 Eigenvalue computation of the given dense matrix. More...
 

Inversion functions

template<typename MT , bool SO>
void blaze::invert (DenseMatrix< MT, SO > &dm)
 In-place inversion of the given dense matrix. More...
 
template<InversionFlag IF, typename MT , bool SO>
void blaze::invert (DenseMatrix< MT, SO > &dm)
 In-place inversion of the given dense matrix. More...
 

LLH decomposition functions

template<typename MT1 , bool SO1, typename MT2 , bool SO2>
void blaze::llh (const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &L)
 Cholesky (LLH) decomposition of the given dense matrix. More...
 

LQ decomposition functions

template<typename MT1 , bool SO1, typename MT2 , bool SO2, typename MT3 , bool SO3>
void blaze::lq (const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &L, DenseMatrix< MT3, SO3 > &Q)
 LQ decomposition of the given dense matrix. More...
 

LU decomposition functions

template<typename MT1 , bool SO1, typename MT2 , typename MT3 , typename MT4 , bool SO2>
void blaze::lu (const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO1 > &L, DenseMatrix< MT3, SO1 > &U, Matrix< MT4, SO2 > &P)
 LU decomposition of the given dense matrix. More...
 

QL decomposition functions

template<typename MT1 , bool SO1, typename MT2 , bool SO2, typename MT3 , bool SO3>
void blaze::ql (const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &Q, DenseMatrix< MT3, SO3 > &L)
 QL decomposition of the given dense matrix. More...
 

QR decomposition functions

template<typename MT1 , bool SO1, typename MT2 , bool SO2, typename MT3 , bool SO3>
void blaze::qr (const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &Q, DenseMatrix< MT3, SO3 > &R)
 QR decomposition of the given dense matrix. More...
 

RQ decomposition functions

template<typename MT1 , bool SO1, typename MT2 , bool SO2, typename MT3 , bool SO3>
void blaze::rq (const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &R, DenseMatrix< MT3, SO3 > &Q)
 RQ decomposition of the given dense matrix. More...
 

Singular value decomposition functions

template<typename MT , bool SO, typename VT , bool TF>
void blaze::svd (const DenseMatrix< MT, SO > &A, DenseVector< VT, TF > &s)
 Singular value decomposition (SVD) of the given dense general matrix. More...
 
template<typename MT1 , bool SO, typename VT , bool TF, typename MT2 , typename MT3 >
void blaze::svd (const DenseMatrix< MT1, SO > &A, DenseMatrix< MT2, SO > &U, DenseVector< VT, TF > &s, DenseMatrix< MT3, SO > &V)
 Singular value decomposition (SVD) of the given dense general matrix. More...
 
template<typename MT , bool SO, typename VT , bool TF, typename ST >
size_t blaze::svd (const DenseMatrix< MT, SO > &A, DenseVector< VT, TF > &s, ST low, ST upp)
 Singular value decomposition (SVD) of the given dense general matrix. More...
 
template<typename MT1 , bool SO, typename VT , bool TF, typename MT2 , typename MT3 , typename ST >
size_t blaze::svd (const DenseMatrix< MT1, SO > &A, DenseMatrix< MT2, SO > &U, DenseVector< VT, TF > &s, DenseMatrix< MT3, SO > &V, ST low, ST upp)
 Singular value decomposition (SVD) of the given dense general matrix. More...
 

DenseMatrix global functions

template<typename MT , bool SO>
BLAZE_ALWAYS_INLINE size_t blaze::spacing (const DenseMatrix< MT, SO > &dm) noexcept
 Returns the spacing between the beginning of two rows/columns. More...
 

Determinant functions

template<typename MT , bool SO>
ElementType_< MT > blaze::det (const DenseMatrix< MT, SO > &dm)
 Computation of the determinant of the given dense square matrix. More...
 

Detailed Description

Function Documentation

◆ abs()

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

Applies the abs() function to each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The resulting dense matrix.

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

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

◆ acos()

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

Computes the inverse cosine for each single element of the dense matrix dm.

Parameters
dmThe input matrix; all elements must be in the range $[-1..1]$.
Returns
The inverse cosine of each single element of dm.

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

// ... Resizing and initialization
B = acos( A );
Note
All 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 DenseMatrix< MT, SO > &  dm)
inline

Computes the inverse hyperbolic cosine for each single element of the dense matrix dm.

Parameters
dmThe input matrix; all elements must be in the range $[1..\infty)$.
Returns
The inverse hyperbolic cosine of each single element of dm.

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

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

◆ asin()

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

Computes the inverse sine for each single element of the dense matrix dm.

Parameters
dmThe input matrix; all elements must be in the range $[-1..1]$.
Returns
The inverse sine of each single element of dm.

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

// ... Resizing and initialization
B = asin( A );
Note
All 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 DenseMatrix< MT, SO > &  dm)
inline

Computes the inverse hyperbolic sine for each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The inverse hyperbolic sine of each single element of dm.

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

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

◆ atan()

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

Computes the inverse tangent for each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The inverse tangent of each single element of dm.

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

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

◆ atanh()

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

Computes the inverse hyperbolic tangent for each single element of the dense matrix dm.

Parameters
dmThe input matrix; all elements must be in the range $[-1..1]$.
Returns
The inverse hyperbolic tangent of each single element of dm.

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

// ... Resizing and initialization
B = atanh( A );
Note
All 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 DenseMatrix< MT, SO > &  dm)
inline

Computes the cubic root of each single element of the dense matrix dm.

Parameters
dmThe input matrix; all elements must be in the range $[0..\infty)$.
Returns
The cubic root of each single element of dm.

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

// ... Resizing and initialization
B = cbrt( A );
Note
All 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 DenseMatrix< MT, SO > &  dm)
inline

Applies the ceil() function to each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The resulting dense matrix.

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

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

◆ clamp()

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

Restricts each single element of the dense matrix dm to the range $[min..max]$.

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

The clamp() function restricts each element of the input matrix dm 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 );

◆ conj()

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

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

Parameters
dmThe input matrix.
Returns
The conjugate complex of each single element of dm.

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

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

◆ cos()

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

Computes the cosine for each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The cosine of each single element of dm.

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

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

◆ cosh()

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

Computes the hyperbolic cosine for each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The hyperbolic cosine of each single element of dm.

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

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

◆ ctrans()

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

Returns the conjugate transpose matrix of dm.

Parameters
dmThe input matrix.
Returns
The conjugate transpose of dm.

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 dm.
The following example demonstrates the use of the ctrans function:

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

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

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

◆ decldiag()

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

Declares the given dense matrix expression dm as diagonal.

Parameters
dmThe input matrix.
Returns
The redeclared dense matrix.
Exceptions
std::invalid_argumentInvalid diagonal matrix specification.

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

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

◆ declherm()

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

Declares the given dense matrix expression dm as Hermitian.

Parameters
dmThe input matrix.
Returns
The redeclared dense matrix.
Exceptions
std::invalid_argumentInvalid Hermitian matrix specification.

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

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

◆ decllow()

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

Declares the given dense matrix expression dm as lower.

Parameters
dmThe input matrix.
Returns
The redeclared dense matrix.
Exceptions
std::invalid_argumentInvalid lower matrix specification.

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

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

◆ declsym()

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

Declares the given dense matrix expression dm as symmetric.

Parameters
dmThe input matrix.
Returns
The redeclared dense matrix.
Exceptions
std::invalid_argumentInvalid symmetric matrix specification.

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

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

◆ declupp()

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

Declares the given dense matrix expression dm as upper.

Parameters
dmThe input matrix.
Returns
The redeclared dense matrix.
Exceptions
std::invalid_argumentInvalid upper matrix specification.

The declupp function declares the given dense matrix expression dm 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 );

◆ det()

template<typename MT , bool SO>
ElementType_< MT > blaze::det ( const DenseMatrix< MT, SO > &  dm)
inline

Computation of the determinant of the given dense square matrix.

Parameters
dmThe given dense matrix.
Returns
The determinant of the given matrix.
Exceptions
std::invalid_argumentInvalid non-square matrix provided.

This function computes the determinant of the given dense square matrix. The computation fails if the given matrix is not a square matrix. In this case either a compilation error is created (if possible) or a std::invalid_argument exception is thrown.

Note
The computation of the determinant is numerically unreliable since especially for large matrices the value can overflow during the computation. Please note that this function does not guarantee that it is possible to compute the determinant with the given matrix!
This function can only be used if a fitting LAPACK library is available and linked to the executable. Otherwise a linker error will be created.

◆ eigen() [1/2]

template<typename MT , bool SO, typename VT , bool TF>
void blaze::eigen ( const DenseMatrix< MT, SO > &  A,
DenseVector< VT, TF > &  w 
)
inline

Eigenvalue computation of the given dense matrix.

Parameters
AThe given general matrix.
wThe resulting vector of eigenvalues.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square matrix provided.
std::invalid_argumentVector cannot be resized.
std::runtime_errorEigenvalue computation failed.

This function computes the eigenvalues of the given n-by-n matrix. The eigenvalues are returned in the given vector w, which is resized to the correct size (if possible and necessary).

Please note that in case the given matrix is either a compile time symmetric matrix with floating point elements or an Hermitian matrix with complex elements, the resulting eigenvalues will be of floating point type and therefore the elements of the given eigenvalue vector are expected to be of floating point type. In all other cases they are expected to be of complex type. Also please note that for complex eigenvalues no order of eigenvalues can be assumed, except that complex conjugate pairs of eigenvalues appear consecutively with the eigenvalue having the positive imaginary part first.

The function fails if ...

  • ... the given matrix A is not a square matrix;
  • ... the given vector w is a fixed size vector and the size doesn't match;
  • ... the eigenvalue computation fails.

In all failure cases an exception is thrown.

Examples:

DynamicMatrix<double,rowMajor> A( 5UL, 5UL ); // The general matrix A
// ... Initialization
DynamicVector<complex<double>,columnVector> w( 5UL ); // The vector for the complex eigenvalues
eigen( A, w );
SymmetricMatrix< DynamicMatrix<double,rowMajor> > A( 5UL, 5UL ); // The symmetric matrix A
// ... Initialization
DynamicVector<double,columnVector> w( 5UL ); // The vector for the real eigenvalues
eigen( A, w );
DynamicMatrix<complex<double>,rowMajor> A( 5UL, 5UL ); // The Hermitian matrix A
// ... Initialization
DynamicVector<double,columnVector> w( 5UL ); // The vector for the real eigenvalues
eigen( A, w );
Note
This function only works for matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with matrices of any other element type results in a compile time error!
This function can only be used if a fitting LAPACK library is available and linked to the executable. Otherwise a call to this function will result in a linker error.
Further options for computing eigenvalues and eigenvectors are available via the geev(), syev(), syevd(), syevx(), heev(), heevd(), and heevx() functions.

◆ eigen() [2/2]

template<typename MT1 , bool SO1, typename VT , bool TF, typename MT2 , bool SO2>
void blaze::eigen ( const DenseMatrix< MT1, SO1 > &  A,
DenseVector< VT, TF > &  w,
DenseMatrix< MT2, SO2 > &  V 
)
inline

Eigenvalue computation of the given dense matrix.

Parameters
AThe given general matrix.
wThe resulting vector of eigenvalues.
VThe resulting matrix of eigenvectors.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square matrix provided.
std::invalid_argumentVector cannot be resized.
std::invalid_argumentMatrix cannot be resized.
std::runtime_errorEigenvalue computation failed.

This function computes the eigenvalues and eigenvectors of the given n-by-n matrix. The eigenvalues are returned in the given vector w and the eigenvectors are returned in the given matrix V, which are both resized to the correct dimensions (if possible and necessary).

Please note that in case the given matrix is either a compile time symmetric matrix with floating point elements or an Hermitian matrix with complex elements, the resulting eigenvalues will be of floating point type and therefore the elements of the given eigenvalue vector are expected to be of floating point type. In all other cases they are expected to be of complex type. Also please note that for complex eigenvalues no order of eigenvalues can be assumed, except that complex conjugate pairs of eigenvalues appear consecutively with the eigenvalue having the positive imaginary part first.

In case A is a row-major matrix, the left eigenvectors are returned in the rows of V, in case A is a column-major matrix, the right eigenvectors are returned in the columns of V. In case the given matrix is a compile time symmetric matrix with floating point elements, the resulting eigenvectors will be of floating point type and therefore the elements of the given eigenvector matrix are expected to be of floating point type. In all other cases they are expected to be of complex type.

The function fails if ...

  • ... the given matrix A is not a square matrix;
  • ... the given vector w is a fixed size vector and the size doesn't match;
  • ... the given matrix V is a fixed size matrix and the dimensions don't match;
  • ... the eigenvalue computation fails.

In all failure cases an exception is thrown.

Examples:

DynamicMatrix<double,rowMajor> A( 5UL, 5UL ); // The general matrix A
// ... Initialization
DynamicVector<complex<double>,columnVector> w( 5UL ); // The vector for the complex eigenvalues
DynamicMatrix<complex<double>,rowMajor> V( 5UL, 5UL ); // The matrix for the left eigenvectors
eigen( A, w, V );
SymmetricMatrix< DynamicMatrix<double,rowMajor> > A( 5UL, 5UL ); // The symmetric matrix A
// ... Initialization
DynamicVector<double,columnVector> w( 5UL ); // The vector for the real eigenvalues
DynamicMatrix<double,rowMajor> V( 5UL, 5UL ); // The matrix for the left eigenvectors
eigen( A, w, V );
HermitianMatrix< DynamicMatrix<complex<double>,rowMajor> > A( 5UL, 5UL ); // The Hermitian matrix A
// ... Initialization
DynamicVector<double,columnVector> w( 5UL ); // The vector for the real eigenvalues
DynamicMatrix<complex<double>,rowMajor> V( 5UL, 5UL ); // The matrix for the left eigenvectors
eigen( A, w, V );
Note
This function only works for matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with matrices of any other element type results in a compile time error!
This function can only be used if a fitting LAPACK library is available and linked to the executable. Otherwise a call to this function will result in a linker error.
Further options for computing eigenvalues and eigenvectors are available via the geev(), syev(), syevd(), syevx(), heev(), heevd(), and heevx() functions.

◆ erf()

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

Computes the error function for each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The error function of each single element of dm.

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

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

◆ erfc()

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

Computes the complementary error function for each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The complementary error function of each single element of dm.

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

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

◆ eval()

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

Forces the evaluation of the given dense matrix expression dm.

Parameters
dmThe input matrix.
Returns
The evaluated dense matrix.

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

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

◆ exp()

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

Computes $ e^x $ for each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The resulting dense matrix.

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

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

◆ exp10()

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

Computes $ 10^x $ for each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The resulting dense matrix.

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

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

◆ exp2()

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

Computes $ 2^x $ for each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The resulting dense matrix.

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

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

◆ floor()

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

Applies the floor() function to each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The resulting dense matrix.

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

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

◆ forEach()

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

Evaluates the given custom operation on each single element of the dense matrix dm.

Parameters
dmThe input matrix.
opThe custom operation.
Returns
The custom operation applied to each single element of dm.

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

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

◆ imag()

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

Returns a matrix containing the imaginary part of each single element of dm.

Parameters
dmThe input matrix.
Returns
The imaginary part of each single element of dm.

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

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

◆ inv()

template<typename MT , bool SO>
decltype(auto) blaze::inv ( const DenseMatrix< MT, SO > &  dm)
inline

Calculation of the inverse of the given dense matrix.

Parameters
dmThe dense matrix to be inverted.
Returns
The inverse of the matrix.

This function returns an expression representing the inverse of the given dense matrix:

// ... Resizing and initialization
B = inv( A );
Note
The matrix inversion can only be used for dense matrices with float, double, complex<float> or complex<double> element type. The attempt to call the function with matrices of any other element type results in a compile time error!
It is not possible to use any kind of view on the expression object returned by the inv() function. Also, it is not possible to access individual elements via the function call operator on the expression object:
row( inv( A ), 2UL ); // Compilation error: Views cannot be used on an inv() expression!
inv( A )(1,2); // Compilation error: It is not possible to access individual elements!

◆ invcbrt()

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

Computes the inverse cubic root of each single element of the dense matrix dm.

Parameters
dmThe input matrix; all elements must be in the range $(0..\infty)$.
Returns
The inverse cubic root of each single element of dm.

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

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

◆ invert() [1/2]

template<typename MT , bool SO>
void blaze::invert ( DenseMatrix< MT, SO > &  dm)
inline

In-place inversion of the given dense matrix.

Parameters
dmThe dense matrix to be inverted.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square matrix provided.
std::runtime_errorInversion of singular matrix failed.

This function inverts the given dense square matrix. The matrix inversion fails if ...

  • ... the given matrix is not a square matrix;
  • ... the given matrix is singular and not invertible.

In all failure cases an exception is thrown.

Note
The matrix inversion can only be used for dense matrices with float, double, complex<float> or complex<double> element type. The attempt to call the function with matrices of any other element type results in a compile time error!
This function can only be used if a fitting LAPACK library is available and linked to the executable. Otherwise a linker error will be created.
This function does only provide the basic exception safety guarantee, i.e. in case of an exception dm may already have been modified.

◆ invert() [2/2]

template<InversionFlag IF, typename MT , bool SO>
void blaze::invert ( DenseMatrix< MT, SO > &  dm)
inline

In-place inversion of the given dense matrix.

Parameters
dmThe dense matrix to be inverted.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square matrix provided.
std::runtime_errorInversion of singular matrix failed.

This function inverts the given dense matrix by means of the specified matrix type or matrix inversion algorithm IF (see the InversionFlag documentation):

invert<asLower>( A ); // Inversion of a lower triangular matrix
invert<asUniUpper>( A ); // Inversion of an upper unitriangular matrix
invert<byLU>( A ); // Inversion by means of an LU decomposition
invert<byLLH>( A ); // Inversion by means of a Cholesky decomposition
...

The matrix inversion fails if ...

  • ... the given matrix is not a square matrix;
  • ... the given matrix is singular and not invertible.

In all failure cases either a compilation error is created if the failure can be predicted at compile time or an exception is thrown.

Note
The matrix inversion can only be used for dense matrices with float, double, complex<float> or complex<double> element type. The attempt to call the function with matrices of any other element type results in a compile time error!
This function can only be used if a fitting LAPACK library is available and linked to the executable. Otherwise a linker error will be created.
This function does only provide the basic exception safety guarantee, i.e. in case of an exception dm may already have been modified.

◆ invsqrt()

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

Computes the inverse square root of each single element of the dense matrix dm.

Parameters
dmThe input matrix; all elements must be in the range $(0..\infty)$.
Returns
The inverse square root of each single element of dm.

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

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

◆ isDiagonal()

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

Checks if the give dense matrix is diagonal.

Parameters
dmThe dense matrix to be checked.
Returns
true if the matrix is diagonal, false if not.

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

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

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

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

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

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

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

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

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

◆ isHermitian()

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

Checks if the given dense matrix is Hermitian.

Parameters
dmThe dense matrix to be checked.
Returns
true if the matrix is Hermitian, false if not.

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

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

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

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

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

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

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

◆ isIdentity()

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

Checks if the give dense matrix is an identity matrix.

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

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

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

The following example demonstrates the use of the function:

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

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

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

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

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

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

◆ isLower()

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

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

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

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

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

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

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

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

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

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

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

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

◆ isnan()

template<typename MT , bool SO>
bool blaze::isnan ( const DenseMatrix< MT, SO > &  dm)

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

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

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

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

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

◆ isStrictlyLower()

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

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

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

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

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

The following code example demonstrates the use of the function:

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

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

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

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

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

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

◆ isStrictlyUpper()

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

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

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

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

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

The following code example demonstrates the use of the function:

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

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

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

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

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

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

◆ isSymmetric()

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

Checks if the given dense matrix is symmetric.

Parameters
dmThe dense matrix to be checked.
Returns
true if the matrix is symmetric, false if not.

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

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

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

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

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

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

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

◆ isUniform()

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

Checks if the given dense matrix is a uniform matrix.

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

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

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

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

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

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

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

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

◆ isUniLower()

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

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

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

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

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

The following code example demonstrates the use of the function:

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

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

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

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

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

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

◆ isUniUpper()

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

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

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

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

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

The following code example demonstrates the use of the function:

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

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

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

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

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

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

◆ isUpper()

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

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

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

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

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

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

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

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

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

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

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

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

◆ llh()

template<typename MT1 , bool SO1, typename MT2 , bool SO2>
void blaze::llh ( const DenseMatrix< MT1, SO1 > &  A,
DenseMatrix< MT2, SO2 > &  L 
)

Cholesky (LLH) decomposition of the given dense matrix.

Parameters
AThe matrix to be decomposed.
LThe resulting lower triangular matrix.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square matrix provided.
std::invalid_argumentDimensions of fixed size matrix do not match.
std::invalid_argumentDecomposition of singular matrix failed.

This function performs the dense matrix Cholesky (LLH) decomposition of a positive definite n-by-n matrix. The resulting decomposition has the form

\[ A = L \cdot L^{H}, \]

where L is a lower triangular n-by-n matrix. The decomposition is written to the matrix L, which is resized to the correct dimensions (if possible and necessary).

The function fails if ...

  • ... A is not a square matrix;
  • ... L is a fixed size matrix and the dimensions don't match A.

In all failure cases a std::invalid_argument exception is thrown.

Example:

// ... Initialization of A as positive definite matrix
llh( A, L );
assert( A == L * trans( L ) );
Note
This function only works for matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with matrices of any other element type results in a compile time error!
This function can only be used if a fitting LAPACK library is available and linked to the executable. Otherwise a call to this function will result in a linker error.
This function does only provide the basic exception safety guarantee, i.e. in case of an exception L may already have been modified.

◆ log()

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

Computes the natural logarithm for each single element of the dense matrix dm.

Parameters
dmThe input matrix; all elements must be in the range $[0..\infty)$.
Returns
The natural logarithm of each single element of dm.

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

// ... Resizing and initialization
B = log( A );
Note
All 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 DenseMatrix< MT, SO > &  dm)
inline

Computes the common logarithm for each single element of the dense matrix dm.

Parameters
dmThe input matrix; all elements must be in the range $[0..\infty)$.
Returns
The common logarithm of each single element of dm.

The log10() function computes common logarithm for each element of the input matrix dm. The function returns an expression representing this operation.
The following example demonstrates the use of the log10() function:

// ... Resizing and initialization
B = log10( A );
Note
All 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 DenseMatrix< MT, SO > &  dm)
inline

Computes the binary logarithm for each single element of the dense matrix dm.

Parameters
dmThe input matrix; all elements must be in the range $[0..\infty)$.
Returns
The binary logarithm of each single element of dm.

The log2() function computes binary logarithm for each element of the input matrix dm. The function returns an expression representing this operation.
The following example demonstrates the use of the log2() function:

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

◆ lq()

template<typename MT1 , bool SO1, typename MT2 , bool SO2, typename MT3 , bool SO3>
void blaze::lq ( const DenseMatrix< MT1, SO1 > &  A,
DenseMatrix< MT2, SO2 > &  L,
DenseMatrix< MT3, SO3 > &  Q 
)

LQ decomposition of the given dense matrix.

Parameters
AThe matrix to be decomposed.
LThe resulting L matrix.
QThe resulting Q matrix.
Returns
void
Exceptions
std::invalid_argumentDimensions of fixed size matrix do not match.
std::invalid_argumentSquare matrix cannot be resized to m-by-n.

This function performs the dense matrix LQ decomposition of a general m-by-n matrix. The resulting decomposition has the form

\[ A = L \cdot Q, \]

where L is a lower trapezoidal m-by-min(m,n) matrix and Q is a general min(m,n)-by-n matrix. The decomposition is written to the two distinct matrices L and Q, which are resized to the correct dimensions (if possible and necessary).

The function fails if ...

  • ... either L or Q are fixed size matrices and the dimensions don't match;
  • ... L is a compile time square matrix, but is required to be non-square.

In all failure cases a std::invalid_argument exception is thrown.

Example:

// ... Initialization of A
lq( A, L, Q );
assert( A == L * Q );
Note
This function only works for matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with matrices of any other element type results in a compile time error!
This function can only be used if a fitting LAPACK library is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ lu()

template<typename MT1 , bool SO1, typename MT2 , typename MT3 , typename MT4 , bool SO2>
void blaze::lu ( const DenseMatrix< MT1, SO1 > &  A,
DenseMatrix< MT2, SO1 > &  L,
DenseMatrix< MT3, SO1 > &  U,
Matrix< MT4, SO2 > &  P 
)

LU decomposition of the given dense matrix.

Parameters
AThe matrix to be decomposed.
LThe resulting lower triangular matrix.
UThe resulting upper triangular matrix.
PThe resulting permutation matrix.
Returns
void
Exceptions
std::invalid_argumentDimensions of fixed size matrix do not match.
std::invalid_argumentSquare matrix cannot be resized to m-by-n.

This function performs the dense matrix (P)LU decomposition of a general m-by-n matrix. The resulting decomposition is written to the three distinct matrices L, U, and P, which are resized to the correct dimensions (if possible and necessary).

In case of a column-major matrix the algorithm performs the decomposition using partial pivoting with row interchanges. The resulting decomposition has the form

\[ A = P \cdot L \cdot U, \]

where P is an m-by-m permutation matrix, which represents the pivoting indices for the applied row interchanges, L is a lower triangular matrix (lower trapezoidal if m > n), and U is an upper triangular matrix (upper trapezoidal if m < n).

In case of a row-major matrix the algorithm performs the decomposition using partial pivoting with column interchanges. The resulting decomposition has the form

\[ A = L \cdot U \cdot P, \]

where L is a lower triangular matrix (lower trapezoidal if m > n), U is an upper triangular matrix (upper trapezoidal if m < n), and P is an n-by-n permutation matrix, which represents the pivoting indices for the applied column interchanges.

The function fails if ...

  • ... either L, U, and P are fixed size matrices and the dimensions don't match;
  • ... A is a non-square m-by-n matrix, but L or U is a compile time square matrix.

In all failure cases a std::invalid_argument exception is thrown.

Examples:

// ... Resizing and initialization
lu( A, L, U, P ); // LU decomposition of a row-major matrix
assert( A == L * U * P );
// ... Resizing and initialization
lu( A, L, U, P ); // LU decomposition of a column-major matrix
assert( A == P * L * U );
Note
This function only works for matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with matrices of any other element type results in a compile time error!
This function can only be used if a fitting LAPACK library is available and linked to the executable. Otherwise a call to this function will result in a linker error.
The LU decomposition will never fail, even for singular matrices. However, in case of a singular matrix the resulting decomposition cannot be used for a matrix inversion or solving a linear system of equations.

◆ map() [1/4]

template<typename MT1 , typename MT2 , typename OP >
decltype(auto) blaze::map ( const DenseMatrix< MT1, false > &  lhs,
const DenseMatrix< MT2, true > &  rhs,
OP  op 
)
inline

Evaluates the given binary operation on each single element of the row-major dense matrix lhs and the column-major dense matrix rhs.

Parameters
lhsThe left-hand side dense matrix operand.
rhsThe right-hand side dense matrix operand.
opThe custom, binary operation.
Returns
The binary operation applied to each single element of lhs and rhs.
Exceptions
std::invalid_argumentMatrix sizes do not match.

The map() function evaluates the given binary operation on each element of the input matrices lhs and rhs. The function returns an expression representing this operation.
The following example demonstrates the use of the map() function:

// ... Resizing and initialization
C = map( A, B, []( double x, double y ){ return std::min( x, y ); } );

◆ map() [2/4]

template<typename MT , bool SO, typename OP >
decltype(auto) blaze::map ( const DenseMatrix< MT, SO > &  dm,
OP  op 
)
inline

Evaluates the given custom operation on each single element of the dense matrix dm.

Parameters
dmThe input matrix.
opThe custom operation.
Returns
The custom operation applied to each single element of dm.

The map() function evaluates the given custom operation on each element of the input matrix dm. 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 ); } );

◆ map() [3/4]

template<typename MT1 , typename MT2 , bool SO, typename OP >
decltype(auto) blaze::map ( const DenseMatrix< MT1, SO > &  lhs,
const DenseMatrix< MT2, SO > &  rhs,
OP  op 
)
inline

Evaluates the given binary operation on each single element of the dense matrices lhs and rhs.

Parameters
lhsThe left-hand side dense matrix operand.
rhsThe right-hand side dense matrix operand.
opThe custom, binary operation.
Returns
The binary operation applied to each single element of lhs and rhs.
Exceptions
std::invalid_argumentMatrix sizes do not match.

The map() function evaluates the given binary operation on each element of the input matrices lhs and rhs. The function returns an expression representing this operation.
The following example demonstrates the use of the map() function:

// ... Resizing and initialization
C = map( A, B, []( double x, double y ){ return std::min( x, y ); } );

◆ map() [4/4]

template<typename MT1 , typename MT2 , typename OP >
decltype(auto) blaze::map ( const DenseMatrix< MT1, true > &  lhs,
const DenseMatrix< MT2, false > &  rhs,
OP  op 
)
inline

Evaluates the given binary operation on each single element of the column-major dense matrix lhs and the row-major dense matrix rhs.

Parameters
lhsThe left-hand side dense matrix operand.
rhsThe right-hand side dense matrix operand.
opThe custom, binary operation.
Returns
The binary operation applied to each single element of lhs and rhs.
Exceptions
std::invalid_argumentMatrix sizes do not match.

The map() function evaluates the given binary operation on each element of the input matrices lhs and rhs. The function returns an expression representing this operation.
The following example demonstrates the use of the map() function:

// ... Resizing and initialization
C = map( A, B, []( double x, double y ){ return std::min( x, y ); } );

◆ max() [1/2]

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

Returns the largest element of the dense matrix.

Parameters
dmThe given dense matrix.
Returns
The largest dense matrix element.

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

◆ max() [2/2]

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

Computes the componentwise maximum of the dense matrices lhs and rhs.

Parameters
lhsThe left-hand side dense matrix operand.
rhsThe right-hand side dense matrix operand.
Returns
The resulting dense matrix.

This function computes the componentwise maximum of the two dense matrix lhs and rhs. The function returns an expression representing this operation.
The following example demonstrates the use of the max() function:

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

◆ min() [1/2]

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

Returns the smallest element of the dense matrix.

Parameters
dmThe given dense matrix.
Returns
The smallest dense matrix element.

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

◆ min() [2/2]

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

Computes the componentwise minimum of the dense matrices lhs and rhs.

Parameters
lhsThe left-hand side dense matrix operand.
rhsThe right-hand side dense matrix operand.
Returns
The resulting dense matrix.

This function computes the componentwise minimum of the two dense matrices lhs and rhs. The function returns an expression representing this operation.
The following example demonstrates the use of the min() function:

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

◆ operator!=() [1/5]

template<typename T1 , bool SO1, typename T2 , bool SO2>
bool blaze::operator!= ( const DenseMatrix< T1, SO1 > &  lhs,
const DenseMatrix< T2, SO2 > &  rhs 
)
inline

Inequality operator for the comparison of two dense matrices.

Parameters
lhsThe left-hand side dense matrix for the comparison.
rhsThe right-hand side dense matrix for the comparison.
Returns
true if the two matrices are not equal, false if they are equal.

◆ operator!=() [2/5]

template<typename T1 , bool SO1, typename T2 , bool SO2>
bool blaze::operator!= ( const DenseMatrix< T1, SO1 > &  lhs,
const SparseMatrix< T2, SO2 > &  rhs 
)
inline

Inequality operator for the comparison of a dense matrix and a sparse matrix.

Parameters
lhsThe left-hand side dense matrix for the comparison.
rhsThe right-hand side sparse matrix for the comparison.
Returns
true if the two matrices are not equal, false if they are equal.

◆ operator!=() [3/5]

template<typename T1 , bool SO1, typename T2 , bool SO2>
bool blaze::operator!= ( const SparseMatrix< T1, SO1 > &  lhs,
const DenseMatrix< T2, SO2 > &  rhs 
)
inline

Inequality operator for the comparison of a sparse matrix and a dense matrix.

Parameters
lhsThe left-hand side sparse matrix for the comparison.
rhsThe right-hand side dense matrix for the comparison.
Returns
true if the two matrices are not equal, false if they are equal.

◆ operator!=() [4/5]

template<typename T1 , typename T2 , bool SO>
EnableIf_< IsNumeric< T2 >, bool > blaze::operator!= ( const DenseMatrix< T1, SO > &  mat,
T2  scalar 
)
inline

Inequality operator for the comparison of a dense matrix and a scalar value.

Parameters
matThe left-hand side dense matrix for the comparison.
scalarThe right-hand side scalar value for the comparison.
Returns
true if at least one element of the matrix is different from the scalar, false if not.

If one value of the matrix is inequal to the scalar value, the inequality test returns true, otherwise false. Note that this function can only be used with built-in, numerical data types!

◆ operator!=() [5/5]

template<typename T1 , typename T2 , bool SO>
EnableIf_<IsNumeric<T1>, bool > blaze::operator!= ( T1  scalar,
const DenseMatrix< T2, SO > &  mat 
)
inline

Inequality operator for the comparison of a scalar value and a dense matrix.

Parameters
scalarThe left-hand side scalar value for the comparison.
matThe right-hand side dense matrix for the comparison.
Returns
true if at least one element of the matrix is different from the scalar, false if not.

If one value of the matrix is inequal to the scalar value, the inequality test returns true, otherwise false. Note that this function can only be used with built-in, numerical data types!

◆ operator%() [1/3]

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

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

Parameters
lhsThe left-hand side dense 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 and a column-major dense matrix:

The operator returns an expression representing a dense 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%() [2/3]

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

Operator for the Schur product of two dense matrices with identical storage order ( $ A=B \circ C $).

Parameters
lhsThe left-hand side dense 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 two dense matrices with identical storage order:

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

The operator returns an expression representing a dense 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%() [3/3]

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

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

Parameters
lhsThe left-hand side dense 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 and a row-major dense matrix:

The operator returns an expression representing a dense 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/17]

template<typename VT , typename MT >
decltype(auto) blaze::operator* ( const DenseVector< VT, true > &  vec,
const DenseMatrix< MT, true > &  mat 
)

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

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

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

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

◆ operator*() [2/17]

template<typename VT , typename MT >
decltype(auto) blaze::operator* ( const SparseVector< VT, true > &  vec,
const DenseMatrix< MT, false > &  mat 
)

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

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

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

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

◆ operator*() [3/17]

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

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

Parameters
lhsThe left-hand side matrix for the multiplication.
rhsThe right-hand side matrix for the multiplication.
Returns
The resulting matrix.
Exceptions
std::invalid_argumentMatrix sizes do not match.

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

The operator returns an expression representing a dense 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 columns of lhs and the current number of rows of rhs don't match, a std::invalid_argument is thrown.

◆ operator*() [4/17]

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

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

Parameters
lhsThe left-hand side matrix for the multiplication.
rhsThe right-hand side matrix for the multiplication.
Returns
The resulting matrix.
Exceptions
std::invalid_argumentMatrix sizes do not match.

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

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

The operator returns an expression representing a dense 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 columns of lhs and the current number of rows of rhs don't match, a std::invalid_argument is thrown.

◆ operator*() [5/17]

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

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

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

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

The operator returns an expression representing a dense 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/17]

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

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

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

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

The operator returns an expression representing a dense 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/17]

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

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

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

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

The operator returns an expression representing a dense 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*() [8/17]

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

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

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

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

The operator returns an expression representing a dense 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*() [9/17]

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

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

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

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

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

◆ operator*() [10/17]

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

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

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

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

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

◆ operator*() [11/17]

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

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

Parameters
matThe left-hand side dense 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 dense matrix and a scalar value:

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

The operator returns an expression representing a dense 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.

◆ operator*() [12/17]

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

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

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

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

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

The operator returns an expression representing a dense 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*() [13/17]

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

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

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

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

The operator returns an expression representing a dense 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*() [14/17]

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

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

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

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

The operator returns an expression representing a dense 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*() [15/17]

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

Multiplication operator for the outer product of two dense vectors ( $ A=\vec{b}*\vec{c}^T $).

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

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

The operator returns an expression representing a dense matrix of the higher-order element type of the two involved element types VT1::ElementType and VT2::ElementType. Both dense 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*() [16/17]

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

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

Parameters
lhsThe left-hand side matrix for the multiplication.
rhsThe right-hand side matrix for the multiplication.
Returns
The resulting matrix.
Exceptions
std::invalid_argumentMatrix sizes do not match.

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

The operator returns an expression representing a dense 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 columns of lhs and the current number of rows of rhs don't match, a std::invalid_argument is thrown.

◆ operator*() [17/17]

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

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

Parameters
lhsThe left-hand side matrix for the multiplication.
rhsThe right-hand side matrix for the multiplication.
Returns
The resulting matrix.
Exceptions
std::invalid_argumentMatrix sizes do not match.

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

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

The operator returns an expression representing a dense 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 columns of lhs and the current number of rows of rhs don't match, a std::invalid_argument is thrown.

◆ operator+() [1/9]

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

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

Parameters
lhsThe left-hand side dense 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 dense matrix and a row-major sparse matrix:

The operator returns an expression representing a dense 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 sizes of the two given matrices don't match, a std::invalid_argument is thrown.

◆ operator+() [2/9]

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

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

Parameters
lhsThe left-hand side sparse matrix for the matrix addition.
rhsThe right-hand side dense 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 sparse matrix and a column-major dense matrix:

The operator returns an expression representing a dense 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 sizes of the two given matrices don't match, a std::invalid_argument is thrown.

◆ operator+() [3/9]

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

Addition operator for the addition of a dense matrix and a sparse matrix ( $ A=B+C $).

Parameters
lhsThe left-hand side dense 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 dense matrix and a sparse matrix:

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

The operator returns an expression representing a dense 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 sizes 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 DenseMatrix< MT1, false > &  lhs,
const SparseMatrix< MT2, true > &  rhs 
)
inline

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

Parameters
lhsThe left-hand side dense 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 dense matrix and a column-major sparse matrix:

The operator returns an expression representing a dense 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 sizes of the two given matrices don't match, a std::invalid_argument is thrown.

◆ operator+() [5/9]

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

Addition operator for the addition of a sparse matrix and a dense matrix ( $ A=B+C $).

Parameters
lhsThe left-hand side sparse matrix for the matrix addition.
rhsThe right-hand side dense 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 sparse matrix and a dense matrix:

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

The operator returns an expression representing a dense 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 sizes 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< MT2, true > &  lhs,
const DenseMatrix< MT1, false > &  rhs 
)
inline

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

Parameters
lhsThe left-hand side sparse matrix for the matrix addition.
rhsThe right-hand side dense 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 sparse matrix and a row-major dense matrix:

The operator returns an expression representing a dense 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 sizes of the two given matrices don't match, a std::invalid_argument is thrown.

◆ operator+() [7/9]

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

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

Parameters
lhsThe left-hand side dense matrix for the matrix addition.
rhsThe right-hand side dense 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 dense matrix:

The operator returns an expression representing a dense 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+() [8/9]

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

Addition operator for the addition of two dense matrices with identical storage order ( $ A=B+C $).

Parameters
lhsThe left-hand side dense matrix for the matrix addition.
rhsThe right-hand side dense 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 dense matrices with identical storage order:

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

The operator returns an expression representing a dense 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+() [9/9]

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

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

Parameters
lhsThe left-hand side dense matrix for the matrix addition.
rhsThe right-hand side dense 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 dense matrix:

The operator returns an expression representing a dense 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/10]

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

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

Parameters
lhsThe left-hand side dense matrix for the matrix subtraction.
rhsThe right-hand side sparse matrix to be subtracted from the dense 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 dense matrix and a row-major sparse matrix:

The operator returns an expression representing a dense 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 sizes of the two given matrices don't match, a std::invalid_argument is thrown.

◆ operator-() [2/10]

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

Subtraction operator for the subtraction of a sparse matrix and a dense matrix with identical storage order ( $ A=B+C $).

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

This operator represents the subtraction of a sparse matrix and a dense matrix with identical storage order:

The operator returns an expression representing a dense 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 sizes of the two given matrices don't match, a std::invalid_argument is thrown.

◆ operator-() [3/10]

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

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

Parameters
lhsThe left-hand side sparse matrix for the matrix subtraction.
rhsThe right-hand side dense matrix to be subtracted from the sparse 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 sparse matrix and a column-major dense matrix:

The operator returns an expression representing a dense 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 sizes of the two given matrices don't match, a std::invalid_argument is thrown.

◆ operator-() [4/10]

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

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

Parameters
lhsThe left-hand side sparse matrix for the matrix subtraction.
rhsThe right-hand side dense matrix to be subtracted from the sparse 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 sparse matrix and a row-major dense matrix:

The operator returns an expression representing a dense 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 sizes of the two given matrices don't match, a std::invalid_argument is thrown.

◆ operator-() [5/10]

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

Subtraction operator for the subtraction of a dense matrix and a sparse matrix with identical storage order ( $ A=B+C $).

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

This operator represents the subtraction of a dense matrix and a sparse matrix with identical storage order:

The operator returns an expression representing a dense 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 sizes of the two given matrices don't match, a std::invalid_argument is thrown.

◆ operator-() [6/10]

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

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

Parameters
lhsThe left-hand side dense matrix for the matrix subtraction.
rhsThe right-hand side sparse matrix to be subtracted from the dense 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 dense matrix and a column-major sparse matrix:

The operator returns an expression representing a dense 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 sizes of the two given matrices don't match, a std::invalid_argument is thrown.

◆ operator-() [7/10]

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

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

Parameters
lhsThe left-hand side dense matrix for the matrix subtraction.
rhsThe right-hand side dense 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 dense matrix:

The operator returns an expression representing a dense 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-() [8/10]

template<typename MT , bool SO>
decltype(auto) blaze::operator- ( const DenseMatrix< MT, SO > &  dm)
inline

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

Parameters
dmThe dense matrix to be negated.
Returns
The negation of the matrix.

This operator represents the negation of a dense matrix:

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

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

◆ operator-() [9/10]

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

Subtraction operator for the subtraction of two dense matrices with identical storage order ( $ A=B-C $).

Parameters
lhsThe left-hand side dense matrix for the matrix subtraction.
rhsThe right-hand side dense 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 dense matrices with identical storage order:

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

The operator returns an expression representing a dense 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-() [10/10]

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

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

Parameters
lhsThe left-hand side dense matrix for the matrix subtraction.
rhsThe right-hand side dense 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 dense matrix:

The operator returns an expression representing a dense 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 , typename = EnableIf_< IsNumeric<ST> >>
decltype(auto) blaze::operator/ ( const DenseMatrix< MT, SO > &  mat,
ST  scalar 
)
inline

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

Parameters
matThe left-hand side dense 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 dense matrix by a scalar value:

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

The operator returns an expression representing a dense 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 an user assert.

◆ operator==() [1/9]

template<typename T1 , typename T2 >
bool blaze::operator== ( const DenseMatrix< T1, false > &  lhs,
const DenseMatrix< T2, false > &  rhs 
)
inline

Equality operator for the comparison of two rwo-major dense matrices.

Parameters
lhsThe left-hand side matrix for the comparison.
rhsThe right-hand side matrix for the comparison.
Returns
true if the two matrices are equal, false if not.

◆ operator==() [2/9]

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

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

Parameters
lhsThe left-hand side matrix for the comparison.
rhsThe right-hand side matrix for the comparison.
Returns
true if the two matrices are equal, false if not.

◆ operator==() [3/9]

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

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

Parameters
lhsThe left-hand side matrix for the comparison.
rhsThe right-hand side matrix for the comparison.
Returns
true if the two matrices are equal, false if not.

◆ operator==() [4/9]

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

Equality operator for the comparison of a dense matrix and a row-major sparse matrix.

Parameters
lhsThe left-hand side dense matrix for the comparison.
rhsThe right-hand side row-major sparse matrix for the comparison.
Returns
true if the two matrices are equal, false if not.

◆ operator==() [5/9]

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

Equality operator for the comparison of a dense matrix and a column-major sparse matrix.

Parameters
lhsThe left-hand side dense matrix for the comparison.
rhsThe right-hand side column-major sparse matrix for the comparison.
Returns
true if the two matrices are equal, false if not.

◆ operator==() [6/9]

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

Equality operator for the comparison of a sparse matrix and a dense matrix.

Parameters
lhsThe left-hand side sparse matrix for the comparison.
rhsThe right-hand side dense matrix for the comparison.
Returns
true if the two matrices are equal, false if not.

◆ operator==() [7/9]

template<typename T1 , typename T2 >
EnableIf_< IsNumeric< T2 >, bool > blaze::operator== ( const DenseMatrix< T1, false > &  mat,
T2  scalar 
)
inline

Equality operator for the comparison of a row-major dense matrix and a scalar value.

Parameters
matThe left-hand side row-major dense matrix for the comparison.
scalarThe right-hand side scalar value for the comparison.
Returns
true if all elements of the matrix are equal to the scalar, false if not.

If all values of the matrix are equal to the scalar value, the equality test returns true, otherwise false. Note that this function can only be used with built-in, numerical data types!

◆ operator==() [8/9]

template<typename T1 , typename T2 >
EnableIf_< IsNumeric< T2 >, bool > blaze::operator== ( const DenseMatrix< T1, true > &  mat,
T2  scalar 
)
inline

Equality operator for the comparison of a column-major dense matrix and a scalar value.

Parameters
matThe left-hand side column-major dense matrix for the comparison.
scalarThe right-hand side scalar value for the comparison.
Returns
true if all elements of the matrix are equal to the scalar, false if not.

If all values of the matrix are equal to the scalar value, the equality test returns true, otherwise false. Note that this function can only be used with built-in, numerical data types!

◆ operator==() [9/9]

template<typename T1 , typename T2 , bool SO>
EnableIf_<IsNumeric<T1>, bool > blaze::operator== ( T1  scalar,
const DenseMatrix< T2, SO > &  mat 
)
inline

Equality operator for the comparison of a scalar value and a dense matrix.

Parameters
scalarThe left-hand side scalar value for the comparison.
matThe right-hand side dense matrix for the comparison.
Returns
true if all elements of the matrix are equal to the scalar, false if not.

If all values of the matrix are equal to the scalar value, the equality test returns true, otherwise false. Note that this function can only be used with built-in, numerical data types!

◆ pow()

template<typename MT , bool SO, typename ET >
decltype(auto) blaze::pow ( const DenseMatrix< MT, SO > &  dm,
ET  exp 
)
inline

Computes the exponential value for each single element of the dense matrix dm.

Parameters
dmThe input matrix.
expThe exponent.
Returns
The exponential value of each single element of dm.

The pow() function computes the exponential value for each element of the input matrix dm. 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 );

◆ ql()

template<typename MT1 , bool SO1, typename MT2 , bool SO2, typename MT3 , bool SO3>
void blaze::ql ( const DenseMatrix< MT1, SO1 > &  A,
DenseMatrix< MT2, SO2 > &  Q,
DenseMatrix< MT3, SO3 > &  L 
)

QL decomposition of the given dense matrix.

Parameters
AThe matrix to be decomposed.
QThe resulting Q matrix.
LThe resulting L matrix.
Returns
void
Exceptions
std::invalid_argumentDimensions of fixed size matrix do not match.
std::invalid_argumentSquare matrix cannot be resized to m-by-n.

This function performs the dense matrix QL decomposition of a general m-by-n matrix. The resulting decomposition has the form

\[ A = Q \cdot L, \]

where Q is a general m-by-min(m,n) matrix and L is a lower trapezoidal min(m,n)-by-n matrix. The decomposition is written to the two distinct matrices Q and L, which are resized to the correct dimensions (if possible and necessary).

The function fails if ...

  • ... either Q or L are fixed size matrices and the dimensions don't match;
  • ... L is a compile time square matrix, but is required to be non-square.

In all failure cases a std::invalid_argument exception is thrown.

Example:

// ... Initialization of A
ql( A, Q, L );
assert( A == Q * L );
Note
This function only works for matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with matrices of any other element type results in a compile time error!
This function can only be used if a fitting LAPACK library is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ qr()

template<typename MT1 , bool SO1, typename MT2 , bool SO2, typename MT3 , bool SO3>
void blaze::qr ( const DenseMatrix< MT1, SO1 > &  A,
DenseMatrix< MT2, SO2 > &  Q,
DenseMatrix< MT3, SO3 > &  R 
)

QR decomposition of the given dense matrix.

Parameters
AThe matrix to be decomposed.
QThe resulting Q matrix.
RThe resulting R matrix.
Returns
void
Exceptions
std::invalid_argumentDimensions of fixed size matrix do not match.
std::invalid_argumentSquare matrix cannot be resized to m-by-n.

This function performs the dense matrix QR decomposition of a general m-by-n matrix. The resulting decomposition has the form

\[ A = Q \cdot R, \]

where Q is a general m-by-min(m,n) matrix and R is an upper trapezoidal min(m,n)-by-n matrix. The decomposition is written to the two distinct matrices Q and R, which are resized to the correct dimensions (if possible and necessary).

The function fails if ...

  • ... either Q or R are fixed size matrices and the dimensions don't match;
  • ... R is a compile time square matrix, but is required to be non-square.

In all failure cases a std::invalid_argument exception is thrown.

Example:

// ... Initialization of A
qr( A, Q, R );
assert( A == Q * R );
Note
This function only works for matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with matrices of any other element type results in a compile time error!
This function can only be used if a fitting LAPACK library is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ real()

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

Returns a matrix containing the real part of each single element of dm.

Parameters
dmThe input matrix.
Returns
The real part of each single element of dm.

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

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

◆ round()

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

Applies the round() function to each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The resulting dense matrix.

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

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

◆ rq()

template<typename MT1 , bool SO1, typename MT2 , bool SO2, typename MT3 , bool SO3>
void blaze::rq ( const DenseMatrix< MT1, SO1 > &  A,
DenseMatrix< MT2, SO2 > &  R,
DenseMatrix< MT3, SO3 > &  Q 
)

RQ decomposition of the given dense matrix.

Parameters
AThe matrix to be decomposed.
RThe resulting R matrix.
QThe resulting Q matrix.
Returns
void
Exceptions
std::invalid_argumentDimensions of fixed size matrix do not match.
std::invalid_argumentSquare matrix cannot be resized to m-by-n.

This function performs the dense matrix RQ decomposition of a general m-by-n matrix. The resulting decomposition has the form

\[ A = R \cdot Q, \]

where R is an upper trapezoidal m-by-min(m,n) matrix and Q is a general min(m,n)-by-n matrix. The decomposition is written to the two distinct matrices R and Q, which are resized to the correct dimensions (if possible and necessary).

The function fails if ...

  • ... either R or Q are fixed size matrices and the dimensions don't match;
  • ... R is a compile time square matrix, but is required to be non-square.

In all failure cases a std::invalid_argument exception is thrown.

Example:

// ... Initialization of A
rq( A, R, Q );
assert( A == R * Q );
Note
This function only works for matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with matrices of any other element type results in a compile time error!
This function can only be used if a fitting LAPACK library is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ serial()

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

Forces the serial evaluation of the given dense matrix expression dm.

Parameters
dmThe input matrix.
Returns
The evaluated dense matrix.

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

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

◆ sin()

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

Computes the sine for each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The sine of each single element of dm.

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

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

◆ sinh()

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

Computes the hyperbolic sine for each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The hyperbolic sine of each single element of dm.

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

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

◆ spacing()

template<typename MT , bool SO>
BLAZE_ALWAYS_INLINE size_t blaze::spacing ( const DenseMatrix< MT, SO > &  dm)
noexcept

Returns the spacing between the beginning of two rows/columns.

Parameters
dmThe given matrix.
Returns
The spacing between the beginning of two rows/columns.

◆ sqrt()

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

Computes the square root of each single element of the dense matrix dm.

Parameters
dmThe input matrix; all elements must be in the range $[0..\infty)$.
Returns
The square root of each single element of dm.

The sqrt() function computes the square root of each element of the input matrix dm. 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 elements are expected to be in the range $[0..\infty)$. No runtime checks are performed to assert this precondition!

◆ svd() [1/4]

template<typename MT , bool SO, typename VT , bool TF>
void blaze::svd ( const DenseMatrix< MT, SO > &  A,
DenseVector< VT, TF > &  s 
)
inline

Singular value decomposition (SVD) of the given dense general matrix.

Parameters
AThe given general matrix.
sThe resulting vector of singular values.
Returns
void
Exceptions
std::invalid_argumentSize of fixed size vector does not match.
std::runtime_errorSingular value decomposition failed.

This function performs the singular value decomposition of a general m-by-n matrix. The resulting min(m,n) singular values are stored in the given vector s, which is resized to the correct size (if possible and necessary).

The function fails if ...

  • ... the given vector s is a fixed size vector and the size doesn't match;
  • ... the singular value decomposition fails.

In all failure cases an exception is thrown.

Examples:

DynamicMatrix<double,rowMajor> A( 5UL, 8UL ); // The general matrix A
// ... Initialization
DynamicVector<double,columnVector> s; // The vector for the singular values
svd( A, s );
Note
This function only works for matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with matrices of any other element type results in a compile time error!
This function can only be used if a fitting LAPACK library is available and linked to the executable. Otherwise a call to this function will result in a linker error.
Further options for computing singular values and singular vectors are available via the gesvd(), gesdd(), and gesvdx() functions.

◆ svd() [2/4]

template<typename MT1 , bool SO, typename VT , bool TF, typename MT2 , typename MT3 >
void blaze::svd ( const DenseMatrix< MT1, SO > &  A,
DenseMatrix< MT2, SO > &  U,
DenseVector< VT, TF > &  s,
DenseMatrix< MT3, SO > &  V 
)
inline

Singular value decomposition (SVD) of the given dense general matrix.

Parameters
AThe given general matrix.
UThe resulting matrix of left singular vectors.
sThe resulting vector of singular values.
VThe resulting matrix of right singular vectors.
Returns
void
Exceptions
std::invalid_argumentDimensions of fixed size matrix U do not match.
std::invalid_argumentSize of fixed size vector does not match.
std::invalid_argumentDimensions of fixed size matrix V do not match.
std::runtime_errorSingular value decomposition failed.

This function performs the singular value decomposition of a general m-by-n matrix. The resulting min(m,n) singular values are stored in the given vector s, the resulting left singular vectors are stored in the given matrix U, and the resulting right singular vectors are stored in the given matrix V. s, U and V are resized to the correct dimensions (if possible and necessary).

The function fails if ...

  • ... the given matrix U is a fixed size matrix and the dimensions don't match;
  • ... the given vector s is a fixed size vector and the size doesn't match;
  • ... the given matrix V is a fixed size matrix and the dimensions don't match;
  • ... the singular value decomposition fails.

In all failure cases an exception is thrown.

Examples:

DynamicMatrix<double,rowMajor> A( 5UL, 8UL ); // The general matrix A
// ... Initialization
DynamicMatrix<double,rowMajor> U; // The matrix for the left singular vectors
DynamicVector<double,columnVector> s; // The vector for the singular values
DynamicMatrix<double,rowMajor> V; // The matrix for the right singular vectors
svd( A, U, s, V );
Note
This function only works for matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with matrices of any other element type results in a compile time error!
This function can only be used if a fitting LAPACK library is available and linked to the executable. Otherwise a call to this function will result in a linker error.
Further options for computing singular values and singular vectors are available via the gesvd(), gesdd(), and gesvdx() functions.

◆ svd() [3/4]

template<typename MT , bool SO, typename VT , bool TF, typename ST >
size_t blaze::svd ( const DenseMatrix< MT, SO > &  A,
DenseVector< VT, TF > &  s,
ST  low,
ST  upp 
)
inline

Singular value decomposition (SVD) of the given dense general matrix.

Parameters
AThe given general matrix.
sThe resulting vector of singular values.
lowThe lower bound of the interval to be searched for singular values.
uppThe upper bound of the interval to be searched for singular values.
Returns
The total number of singular values found.
Exceptions
std::invalid_argumentSize of fixed size vector does not match.
std::invalid_argumentInvalid value range provided.
std::invalid_argumentInvalid index range provided.
std::runtime_errorSingular value decomposition failed.

This function computes a specified number of singular values of the given general m-by-n matrix. The number of singular values to be computed is specified by the lower bound low and the upper bound upp, which either form an integral or a floating point range.

In case low and upp are of integral type, the function computes all singular values in the index range $[low..upp]$. The num resulting real and non-negative singular values are stored in descending order in the given vector s, which is either resized (if possible) or expected to be a num-dimensional vector.

In case low and upp are of floating point type, the function computes all singular values in the half-open interval $(low..upp]$. The resulting real and non-negative singular values are stored in descending order in the given vector s, which is either resized (if possible) or expected to be a min(m,n)-dimensional vector.

The function fails if ...

  • ... the given vector s is a fixed size vector and the size doesn't match;
  • ... the given scalar values don't form a proper range;
  • ... the singular value decomposition fails.

In all failure cases an exception is thrown.

Examples:

DynamicMatrix<double,rowMajor> A( 5UL, 8UL ); // The general matrix A
// ... Initialization
DynamicVector<double,columnVector> s; // The vector for the singular values
svd( A, s, 0, 2 );
Note
This function only works for matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with matrices of any other element type results in a compile time error!
This function can only be used if a fitting LAPACK library is available and linked to the executable. Otherwise a call to this function will result in a linker error.
Further options for computing singular values and singular vectors are available via the gesvd(), gesdd(), and gesvdx() functions.

◆ svd() [4/4]

template<typename MT1 , bool SO, typename VT , bool TF, typename MT2 , typename MT3 , typename ST >
size_t blaze::svd ( const DenseMatrix< MT1, SO > &  A,
DenseMatrix< MT2, SO > &  U,
DenseVector< VT, TF > &  s,
DenseMatrix< MT3, SO > &  V,
ST  low,
ST  upp 
)
inline

Singular value decomposition (SVD) of the given dense general matrix.

Parameters
AThe given general matrix.
UThe resulting matrix of left singular vectors.
sThe resulting vector of singular values.
VThe resulting matrix of right singular vectors.
lowThe lower bound of the interval to be searched for singular values.
uppThe upper bound of the interval to be searched for singular values.
Returns
The total number of singular values found.
Exceptions
std::invalid_argumentDimensions of fixed size matrix U do not match.
std::invalid_argumentSize of fixed size vector does not match.
std::invalid_argumentDimensions of fixed size matrix V do not match.
std::invalid_argumentInvalid value range provided.
std::invalid_argumentInvalid index range provided.
std::runtime_errorSingular value decomposition failed.

This function computes a specified number of singular values and singular vectors of the given general m-by-n matrix. The number of singular values and vectors to be computed is specified by the lower bound low and the upper bound upp, which either form an integral or a floating point range.

In case low and upp form are of integral type, the function computes all singular values in the index range $[low..upp]$. The num resulting real and non-negative singular values are stored in descending order in the given vector s, which is either resized (if possible) or expected to be a num-dimensional vector. The resulting left singular vectors are stored in the given matrix U, which is either resized (if possible) or expected to be a m-by-num matrix. The resulting right singular vectors are stored in the given matrix V, which is either resized (if possible) or expected to be a num-by-n matrix.

In case low and upp are of floating point type, the function computes all singular values in the half-open interval $(low..upp]$. The resulting real and non-negative singular values are stored in descending order in the given vector s, which is either resized (if possible) or expected to be a min(m,n)-dimensional vector. The resulting left singular vectors are stored in the given matrix U, which is either resized (if possible) or expected to be a m-by-min(m,n) matrix. The resulting right singular vectors are stored in the given matrix V, which is either resized (if possible) or expected to be a min(m,n)-by-n matrix.

The function fails if ...

  • ... the given matrix U is a fixed size matrix and the dimensions don't match;
  • ... the given vector s is a fixed size vector and the size doesn't match;
  • ... the given matrix V is a fixed size matrix and the dimensions don't match;
  • ... the given scalar values don't form a proper range;
  • ... the singular value decomposition fails.

In all failure cases an exception is thrown.

Examples:

DynamicMatrix<double,rowMajor> A( 5UL, 8UL ); // The general matrix A
// ... Initialization
DynamicMatrix<double,rowMajor> U; // The matrix for the left singular vectors
DynamicVector<double,columnVector> s; // The vector for the singular values
DynamicMatrix<double,rowMajor> V; // The matrix for the right singular vectors
svd( A, U, s, V, 0, 2 );
Note
This function only works for matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with matrices of any other element type results in a compile time error!
This function can only be used if a fitting LAPACK library is available and linked to the executable. Otherwise a call to this function will result in a linker error.
Further options for computing singular values and singular vectors are available via the gesvd(), gesdd(), and gesvdx() functions.

◆ tan()

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

Computes the tangent for each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The tangent of each single element of dm.

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

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

◆ tanh()

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

Computes the hyperbolic tangent for each single element of the dense matrix dm.

Parameters
dmThe input matrix; all elements must be in the range $[-1..1]$.
Returns
The hyperbolic tangent of each single element of dm.

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

// ... Resizing and initialization
B = tanh( A );
Note
All 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 DenseMatrix< MT, SO > &  dm)
inline

Calculation of the transpose of the given dense matrix.

Parameters
dmThe dense matrix to be transposed.
Returns
The transpose of the matrix.

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

◆ trunc()

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

Applies the trunc() function to each single element of the dense matrix dm.

Parameters
dmThe input matrix.
Returns
The resulting dense matrix.

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

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