Blaze 3.9
Modules | Classes | Functions
Dense Matrices

Modules

 CustomMatrix
 
 DynamicMatrix
 
 HybridMatrix
 
 InitializerMatrix
 
 StaticMatrix
 
 UniformMatrix
 
 Expressions
 

Classes

class  blaze::DenseMatrix< MT, SO >
 Base class for dense matrices. More...
 

Functions

template<typename MT , bool SO, typename VT1 , bool TF1, typename VT2 , bool TF2>
void blaze::solve (const DenseMatrix< MT, SO > &A, DenseVector< VT1, TF1 > &x, const DenseVector< VT2, TF2 > &b)
 Solving the given $ N \times N $ linear system of equations ( $ A*x=b $). More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2, typename MT3 , bool SO3>
void blaze::solve (const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &X, const DenseMatrix< MT3, SO3 > &B)
 Solving the given $ N \times N $ linear system of equations ( $ A*X=B $). 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::declstrlow (const DenseMatrix< MT, SO > &dm)
 Declares the given dense matrix expression dm as strictly lower. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::declstrupp (const DenseMatrix< MT, SO > &dm)
 Declares the given dense matrix expression dm as strictly upper. 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::declunilow (const DenseMatrix< MT, SO > &dm)
 Declares the given dense matrix expression dm as unilower. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::decluniupp (const DenseMatrix< MT, SO > &dm)
 Declares the given dense matrix expression dm as uniupper. 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 , bool SO1, typename MT2 , bool SO2>
bool blaze::operator== (const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Equality operator for the comparison of two dense matrices. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
bool blaze::operator!= (const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Inequality operator for the comparison of two dense matrices. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::kron (const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Computes the Kronecker product of two dense matrices ( $ A=B \otimes 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)
 Elementwise evaluation of the given binary operation on each single element of the dense matrices lhs and rhs. More...
 
template<typename MT1 , typename MT2 , typename MT3 , bool SO, typename OP >
decltype(auto) blaze::map (const DenseMatrix< MT1, SO > &dm1, const DenseMatrix< MT2, SO > &dm2, const DenseMatrix< MT3, SO > &dm3, OP op)
 Elementwise evaluation of the given ternary operation on each single element of the dense matrices dm1, dm2 and dm3. More...
 
template<typename MT1 , typename MT2 , typename MT3 , typename MT4 , bool SO, typename OP >
decltype(auto) blaze::map (const DenseMatrix< MT1, SO > &dm1, const DenseMatrix< MT2, SO > &dm2, const DenseMatrix< MT3, SO > &dm3, const DenseMatrix< MT4, SO > &dm4, OP op)
 Elementwise evaluation of the given 4-ary operation on each single element of the dense matrices dm1, dm2, dm3 and dm4. More...
 
template<typename MT1 , typename MT2 , typename MT3 , typename MT4 , typename MT5 , bool SO, typename OP >
decltype(auto) blaze::map (const DenseMatrix< MT1, SO > &dm1, const DenseMatrix< MT2, SO > &dm2, const DenseMatrix< MT3, SO > &dm3, const DenseMatrix< MT4, SO > &dm4, const DenseMatrix< MT5, SO > &dm5, OP op)
 Elementwise evaluation of the given 5-ary operation on each single element of the dense matrices dm1, dm2, dm3, dm4, and dm5. More...
 
template<typename MT1 , typename MT2 , typename MT3 , typename MT4 , typename MT5 , typename MT6 , bool SO, typename OP >
decltype(auto) blaze::map (const DenseMatrix< MT1, SO > &dm1, const DenseMatrix< MT2, SO > &dm2, const DenseMatrix< MT3, SO > &dm3, const DenseMatrix< MT4, SO > &dm4, const DenseMatrix< MT5, SO > &dm5, const DenseMatrix< MT6, SO > &dm6, OP op)
 Elementwise evaluation of the given 6-ary operation on each single element of the dense matrices dm1, dm2, dm3, dm4, dm5, and dm6. 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 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::hypot (const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Computes the componentwise hypotenous for the dense matrices lhs and rhs. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::pow (const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Computes the componentwise exponential value for the dense matrices lhs and rhs. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::atan2 (const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Computes the multi-valued inverse tangent of the dense matrices lhs and rhs. More...
 
template<typename MT1 , typename MT2 , typename MT3 , bool SO>
decltype(auto) blaze::select (const DenseMatrix< MT1, SO > &cond, const DenseMatrix< MT2, SO > &lhs, const DenseMatrix< MT3, SO > &rhs)
 Elementwise conditional selection of values from the dense matrices lhs and rhs. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::operator<< (const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Left-shift operator for the elementwise left-shift of a dense matrix. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::operator>> (const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Right-shift operator for the elementwise right-shift of a dense matrix. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::operator& (const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Bitwise AND operator for two dense matrices. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::operator| (const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Bitwise OR operator for two dense matrices. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::operator^ (const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Bitwise XOR operator for two dense matrices. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::operator&& (const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Logical AND operator for two dense matrices. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::operator|| (const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Logical OR operator for two dense matrices. 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 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::solve (const DenseMatrix< MT1, SO1 > &A, const DenseMatrix< MT2, SO2 > &B)
 Solving the given $ N \times N $ linear system of equations ( $ A*X=B $). 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::matexp (const DenseMatrix< MT, SO > &dm)
 Calculation of the exponential of the given dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::fix (DenseMatrix< MT, SO > &dm) noexcept
 Fixing the size of the given dense matrix. More...
 
template<bool SO = defaultStorageOrder, typename OP >
decltype(auto) blaze::generate (size_t m, size_t n, OP op)
 Generates a new dense matrix filled via the given custom binary operation. 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, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::min (const DenseMatrix< MT, SO > &dm, ST scalar)
 Computes the componentwise minimum of a dense matrix dm and a scalar. More...
 
template<typename ST , typename MT , bool SO, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::min (ST scalar, const DenseMatrix< MT, SO > &dm)
 Computes the componentwise minimum of a scalar and a dense matrix dm. More...
 
template<typename MT , bool SO, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::max (const DenseMatrix< MT, SO > &dm, ST scalar)
 Computes the componentwise maximum of a dense matrix dm and a scalar. More...
 
template<typename ST , typename MT , bool SO, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::max (ST scalar, const DenseMatrix< MT, SO > &dm)
 Computes the componentwise maximum of a scalar and a 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::sign (const DenseMatrix< MT, SO > &dm)
 Applies the sign() 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::arg (const DenseMatrix< MT, SO > &dm)
 Returns a matrix containing the phase angle 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 ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::pow (const DenseMatrix< MT, SO > &dm, ST 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::log1p (const DenseMatrix< MT, SO > &dm)
 Computes the natural logarithm of x+1 for each single element of the dense matrix dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::lgamma (const DenseMatrix< MT, SO > &dm)
 Computes the natural logarithm of the absolute value of the gamma function 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 , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator+ (const DenseMatrix< MT, SO > &mat, ST scalar)
 Addition operator for the addition of a dense matrix and a scalar value ( $ A=B+s $). More...
 
template<typename ST , typename MT , bool SO, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator+ (ST scalar, const DenseMatrix< MT, SO > &mat)
 Addition operator for the addition of a scalar value and a dense matrix ( $ A=s+B $). More...
 
template<typename MT , bool SO, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator- (const DenseMatrix< MT, SO > &mat, ST scalar)
 Subtraction operator for the subtraction of a dense matrix and a scalar value ( $ A=B-s $). More...
 
template<typename ST , typename MT , bool SO, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator- (ST scalar, const DenseMatrix< MT, SO > &mat)
 Subtraction operator for the subtraction of a scalar value and a dense matrix ( $ A=s-B $). More...
 
template<typename ST , typename MT , bool SO, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator/ (ST scalar, const DenseMatrix< MT, SO > &mat)
 Division operator for the division of a scalar value and a dense matrix ( $ A=s/B $). More...
 
template<typename MT , bool SO>
decltype(auto) blaze::operator<< (const DenseMatrix< MT, SO > &mat, int count)
 Left-shift operator for the uniform left-shift of a dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::operator>> (const DenseMatrix< MT, SO > &mat, int count)
 Right-shift operator for the uniform right-shift of a dense matrix. More...
 
template<typename MT , bool SO, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator& (const DenseMatrix< MT, SO > &mat, ST scalar)
 Bitwise AND operator for the bitwise AND of a dense matrix and a scalar value. More...
 
template<typename MT , bool SO, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator| (const DenseMatrix< MT, SO > &mat, ST scalar)
 Bitwise OR operator for the bitwise OR of a dense matrix and a scalar value. More...
 
template<typename MT , bool SO, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator^ (const DenseMatrix< MT, SO > &mat, ST scalar)
 Bitwise XOR operator for the bitwise XOR of a dense matrix and a scalar value. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::operator! (const DenseMatrix< MT, SO > &mat)
 Logical NOT operator for the logical NOT of a dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::mean (const DenseMatrix< MT, SO > &dm)
 Computes the (arithmetic) mean for the given dense matrix. More...
 
template<ReductionFlag RF, typename MT , bool SO>
decltype(auto) blaze::mean (const DenseMatrix< MT, SO > &dm)
 Computes the row-/column-wise mean function for the given dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::noalias (const DenseMatrix< MT, SO > &dm)
 Forces the non-aliased evaluation of the given dense matrix expression dm. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::norm (const DenseMatrix< MT, SO > &dm)
 Computes the L2 norm for the given dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::sqrNorm (const DenseMatrix< MT, SO > &dm)
 Computes the squared L2 norm for the given dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::l1Norm (const DenseMatrix< MT, SO > &dm)
 Computes the L1 norm for the given dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::l2Norm (const DenseMatrix< MT, SO > &dm)
 Computes the L2 norm for the given dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::l3Norm (const DenseMatrix< MT, SO > &dm)
 Computes the L3 norm for the given dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::l4Norm (const DenseMatrix< MT, SO > &dm)
 Computes the L4 norm for the given dense matrix. More...
 
template<typename MT , bool SO, typename ST >
decltype(auto) blaze::lpNorm (const DenseMatrix< MT, SO > &dm, ST p)
 Computes the Lp norm for the given dense matrix. More...
 
template<size_t P, typename MT , bool SO>
decltype(auto) blaze::lpNorm (const DenseMatrix< MT, SO > &dm)
 Computes the Lp norm for the given dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::linfNorm (const DenseMatrix< MT, SO > &dm)
 Computes the infinity norm for the given dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::maxNorm (const DenseMatrix< MT, SO > &dm)
 Computes the maximum norm for the given dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::minNorm (const DenseMatrix< MT, SO > &dm)
 Computes the minimum norm for the given dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::nosimd (const DenseMatrix< MT, SO > &dm)
 Disables the SIMD evaluation of the given dense matrix expression dm. More...
 
template<typename MT , bool SO, typename OP >
decltype(auto) blaze::reduce (const DenseMatrix< MT, SO > &dm, OP op)
 Performs a custom reduction operation on the given dense matrix. More...
 
template<ReductionFlag RF, typename MT , bool SO, typename OP >
decltype(auto) blaze::reduce (const DenseMatrix< MT, SO > &dm, OP op)
 Performs a custom reduction operation on the given dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::sum (const DenseMatrix< MT, SO > &dm)
 Reduces the given dense matrix by means of addition. More...
 
template<ReductionFlag RF, typename MT , bool SO>
decltype(auto) blaze::sum (const DenseMatrix< MT, SO > &dm)
 Reduces the given dense matrix by means of addition. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::prod (const DenseMatrix< MT, SO > &dm)
 Reduces the given dense matrix by means of multiplication. More...
 
template<ReductionFlag RF, typename MT , bool SO>
decltype(auto) blaze::prod (const DenseMatrix< MT, SO > &dm)
 Reduces the given dense matrix by means of multiplication. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::min (const DenseMatrix< MT, SO > &dm)
 Returns the smallest element of the dense matrix. More...
 
template<ReductionFlag RF, typename MT , bool SO>
decltype(auto) blaze::min (const DenseMatrix< MT, SO > &dm)
 Returns the smallest element of each row/columns of the dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::max (const DenseMatrix< MT, SO > &dm)
 Returns the largest element of the dense matrix. More...
 
template<ReductionFlag RF, typename MT , bool SO>
decltype(auto) blaze::max (const DenseMatrix< MT, SO > &dm)
 Returns the largest element of each row/columns of the dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::repeat (const DenseMatrix< MT, SO > &dm, size_t m, size_t n)
 Repeats the given dense matrix. More...
 
template<size_t R0, size_t R1, typename MT , bool SO>
decltype(auto) blaze::repeat (const DenseMatrix< MT, SO > &dm)
 Repeats the given dense matrix. More...
 
template<typename MT , bool SO, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
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 , EnableIf_t< IsScalar_v< ST > > * = nullptr>
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, EnableIf_t< IsScalar_v< ST > > * = nullptr>
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 with identical storage order ( $ 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 , bool SO1, typename MT2 , bool SO2>
bool blaze::operator== (const DenseMatrix< MT1, SO1 > &lhs, const SparseMatrix< MT2, SO2 > &rhs)
 Equality operator for the comparison of a dense matrix and a sparse matrix. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
bool blaze::operator== (const SparseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Equality operator for the comparison of a sparse matrix and a dense matrix. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
bool blaze::operator!= (const DenseMatrix< MT1, SO1 > &lhs, const SparseMatrix< MT2, SO2 > &rhs)
 Inequality operator for the comparison of a dense matrix and a sparse matrix. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
bool blaze::operator!= (const SparseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Inequality operator for the comparison of a sparse matrix and a dense matrix. 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 MT , bool SO>
auto blaze::softmax (const DenseMatrix< MT, SO > &dm)
 Computes the softmax function for the given dense matrix. More...
 
template<ReductionFlag RF, typename MT , bool SO>
auto blaze::softmax (const DenseMatrix< MT, SO > &dm)
 Computes the row-/columnwise softmax function for the given dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::stddev (const DenseMatrix< MT, SO > &dm)
 Computes the standard deviation for the given dense matrix. More...
 
template<ReductionFlag RF, typename MT , bool SO>
decltype(auto) blaze::stddev (const DenseMatrix< MT, SO > &dm)
 Computes the row-/columnwise standard deviation function for the given dense matrix. 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<bool B, typename MT , bool SO>
decltype(auto) blaze::transIf (const DenseMatrix< MT, SO > &dm)
 Conditional 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< MT1, true > &lhs, const DenseMatrix< MT2, 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 MT , bool SO>
decltype(auto) blaze::var (const DenseMatrix< MT, SO > &dm)
 Computes the variance for the given dense matrix. More...
 
template<ReductionFlag RF, typename MT , bool SO>
decltype(auto) blaze::var (const DenseMatrix< MT, SO > &dm)
 Computes the row-/column-wise variance function for the given dense matrix. More...
 
template<typename VT1 , typename VT2 , typename OP >
decltype(auto) blaze::map (const DenseVector< VT1, false > &lhs, const DenseVector< VT2, true > &rhs, OP op)
 Pairwise (outer) evaluation of the given binary operation on the elements of the dense vectors lhs and rhs. More...
 
template<typename VT1 , typename VT2 >
decltype(auto) blaze::operator+ (const DenseVector< VT1, false > &lhs, const DenseVector< VT2, true > &rhs)
 Addition operator for the outer sum of two dense vectors ( $ A=\vec{b}+\vec{c}^T $). More...
 
template<typename VT1 , typename VT2 >
decltype(auto) blaze::operator- (const DenseVector< VT1, false > &lhs, const DenseVector< VT2, true > &rhs)
 Addition operator for the outer difference of two dense vectors ( $ A=\vec{b}-\vec{c}^T $). 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 VT1 , typename VT2 >
decltype(auto) blaze::operator/ (const DenseVector< VT1, false > &lhs, const DenseVector< VT2, true > &rhs)
 Division operator for the outer quotient 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< MT1, false > &lhs, const DenseMatrix< MT2, 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 >
auto blaze::operator== (const DenseMatrix< T1, false > &mat, T2 scalar) -> EnableIf_t< IsScalar_v< T2 >, bool >
 Equality operator for the comparison of a row-major dense matrix and a scalar value. More...
 
template<typename T1 , typename T2 >
auto blaze::operator== (const DenseMatrix< T1, true > &mat, T2 scalar) -> EnableIf_t< IsScalar_v< T2 >, bool >
 Equality operator for the comparison of a column-major dense matrix and a scalar value. More...
 
template<typename T1 , typename T2 , bool SO>
auto blaze::operator== (T1 scalar, const DenseMatrix< T2, SO > &mat) -> EnableIf_t< IsScalar_v< T1 >, bool >
 Equality operator for the comparison of a scalar value and a dense matrix. More...
 
template<typename T1 , typename T2 , bool SO>
auto blaze::operator!= (const DenseMatrix< T1, SO > &mat, T2 scalar) -> EnableIf_t< IsScalar_v< T2 >, bool >
 Inequality operator for the comparison of a dense matrix and a scalar value. More...
 
template<typename T1 , typename T2 , bool SO>
auto blaze::operator!= (T1 scalar, const DenseMatrix< T2, SO > &mat) -> EnableIf_t< IsScalar_v< T1 >, bool >
 Inequality operator for the comparison of a scalar value and a dense matrix. More...
 
template<typename MT , bool SO, typename ST >
auto blaze::operator+= (DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Addition assignment operator for the addition of a dense matrix and a scalar value ( $ A+=s $). More...
 
template<typename MT , bool SO, typename ST >
auto blaze::operator+= (DenseMatrix< MT, SO > &&mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Addition assignment operator for the addition of a temporary dense matrix and a scalar value ( $ A+=s $). More...
 
template<typename MT , bool SO, typename ST >
auto blaze::operator-= (DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( $ A-=s $). More...
 
template<typename MT , bool SO, typename ST >
auto blaze::operator-= (DenseMatrix< MT, SO > &&mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Subtraction assignment operator for the subtraction of a temporary dense matrix and a scalar value ( $ A-=s $). More...
 
template<typename MT , bool SO, typename ST >
auto blaze::operator*= (DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( $ A*=s $). More...
 
template<typename MT , bool SO, typename ST >
auto blaze::operator*= (DenseMatrix< MT, SO > &&mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Multiplication assignment operator for the multiplication of a temporary dense matrix and a scalar value ( $ A*=s $). More...
 
template<typename MT , bool SO, typename ST >
auto blaze::operator/= (DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Division assignment operator for the division of a dense matrix by a scalar value ( $ A/=s $). More...
 
template<typename MT , bool SO, typename ST >
auto blaze::operator/= (DenseMatrix< MT, SO > &&mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Division assignment operator for the division of a temporary dense matrix by a scalar value ( $ A/=s $). More...
 
template<typename MT , bool SO>
MT & blaze::operator<<= (DenseMatrix< MT, SO > &mat, int count)
 Left-shift assignment operator for the uniform left-shift of a dense matrix. More...
 
template<typename MT , bool SO>
MT & blaze::operator<<= (DenseMatrix< MT, SO > &&mat, int count)
 Left-shift assignment operator for the uniform left-shift of a temporary dense matrix. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
MT1 & blaze::operator<<= (DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Left-shift assignment operator for the elementwise left-shift of a dense matrix. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
MT1 & blaze::operator<<= (DenseMatrix< MT1, SO1 > &&lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Left-shift assignment operator for the elementwise left-shift of a temporary dense matrix. More...
 
template<typename MT , bool SO>
MT & blaze::operator>>= (DenseMatrix< MT, SO > &mat, int count)
 Right-shift assignment operator for the uniform right-shift of a dense matrix. More...
 
template<typename MT , bool SO>
MT & blaze::operator>>= (DenseMatrix< MT, SO > &&mat, int count)
 Right-shift assignment operator for the uniform right-shift of a temporary dense matrix. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
MT1 & blaze::operator>>= (DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Right-shift assignment operator for the elementwise right-shift of a dense matrix. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
MT1 & blaze::operator>>= (DenseMatrix< MT1, SO1 > &&lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Right-shift assignment operator for the elementwise right-shift of a temporary dense. More...
 
template<typename MT , bool SO, typename ST >
auto blaze::operator&= (DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Bitwise AND assignment operator for the bitwise AND of a dense matrix and a scalar value. More...
 
template<typename MT , bool SO, typename ST >
auto blaze::operator&= (DenseMatrix< MT, SO > &&mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Bitwise AND assignment operator for the bitwise AND of a temporary dense matrix and a scalar value. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
MT1 & blaze::operator&= (DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Bitwise AND assignment operator for the bitwise AND of a dense matrix. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
MT1 & blaze::operator&= (DenseMatrix< MT1, SO1 > &&lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Bitwise AND assignment operator for the bitwise AND of a temporary dense matrix. More...
 
template<typename MT , bool SO, typename ST >
auto blaze::operator|= (DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Bitwise OR assignment operator for the bitwise OR of a dense matrix and a scalar value. More...
 
template<typename MT , bool SO, typename ST >
auto blaze::operator|= (DenseMatrix< MT, SO > &&mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Bitwise OR assignment operator for the bitwise OR of a temporary dense matrix and a scalar value. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
MT1 & blaze::operator|= (DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Bitwise OR assignment operator for the bitwise OR of a dense matrix. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
MT1 & blaze::operator|= (DenseMatrix< MT1, SO1 > &&lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Bitwise OR assignment operator for the bitwise OR of a temporary dense matrix. More...
 
template<typename MT , bool SO, typename ST >
auto blaze::operator^= (DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Bitwise XOR assignment operator for the bitwise XOR of a dense matrix and a scalar value. More...
 
template<typename MT , bool SO, typename ST >
auto blaze::operator^= (DenseMatrix< MT, SO > &&mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
 Bitwise XOR assignment operator for the bitwise XOR of a temporary dense matrix and a scalar value. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
MT1 & blaze::operator^= (DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Bitwise XOR assignment operator for the bitwise XOR of a dense matrix. More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
MT1 & blaze::operator^= (DenseMatrix< MT1, SO1 > &&lhs, const DenseMatrix< MT2, SO2 > &rhs)
 Bitwise XOR assignment operator for the bitwise XOR of a temporary dense matrix. 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<typename MT , bool SO>
bool blaze::isinf (const DenseMatrix< MT, SO > &dm)
 Checks the given dense matrix for infinite elements. More...
 
template<typename MT , bool SO>
bool blaze::isfinite (const DenseMatrix< MT, SO > &dm)
 Checks the given dense matrix for finite elements. More...
 
template<RelaxationFlag RF, typename MT , bool SO>
bool blaze::isSymmetric (const DenseMatrix< MT, SO > &dm)
 Checks if the given dense matrix is symmetric. More...
 
template<RelaxationFlag RF, typename MT , bool SO>
bool blaze::isHermitian (const DenseMatrix< MT, SO > &dm)
 Checks if the given dense matrix is Hermitian. More...
 
template<RelaxationFlag 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<RelaxationFlag RF, typename MT , bool SO>
bool blaze::isZero (const DenseMatrix< MT, SO > &dm)
 Checks if the given dense matrix is a zero matrix. More...
 
template<RelaxationFlag 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<RelaxationFlag 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<RelaxationFlag 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<RelaxationFlag 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<RelaxationFlag 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<RelaxationFlag 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<RelaxationFlag RF, typename MT , bool SO>
bool blaze::isDiagonal (const DenseMatrix< MT, SO > &dm)
 Checks if the given dense matrix is diagonal. More...
 
template<RelaxationFlag RF, typename MT , bool SO>
bool blaze::isIdentity (const DenseMatrix< MT, SO > &dm)
 Checks if the given dense matrix is an identity matrix. More...
 
template<typename MT , bool SO>
bool blaze::isPositiveDefinite (const DenseMatrix< MT, SO > &dm)
 Checks if the given dense matrix is a positive definite matrix. More...
 
template<typename MT , bool SO>
size_t blaze::rank (const DenseMatrix< MT, SO > &dm)
 Computes the rank of the given 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...
 

PLLHP decomposition functions

template<typename MT1 , bool SO1, typename MT2 , bool SO2, typename ST >
blas_int_t blaze::pllhp (const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &L, blas_int_t *P, ST tol)
 Pivoting Cholesky (PLLHP) 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, bool square)
 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 MT::ElementType * blaze::data (DenseMatrix< MT, SO > &dm) noexcept
 Low-level data access to the dense matrix elements. More...
 
template<typename MT , bool SO>
BLAZE_ALWAYS_INLINE const MT::ElementType * blaze::data (const DenseMatrix< MT, SO > &dm) noexcept
 Low-level data access to the dense matrix elements. More...
 
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_t< 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 );
Efficient implementation of a dynamic matrix.
Definition: DynamicMatrix.h:242
decltype(auto) abs(const DenseMatrix< MT, SO > &dm)
Applies the abs() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1296

◆ acos()

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

◆ arg()

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

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

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

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

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

◆ asin()

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

◆ atan()

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

◆ atan2()

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

Computes the multi-valued inverse tangent 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.
Exceptions
std::invalid_argumentMatrix sizes do not match.

This function computes the multi-valued inverse tangent 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 = atan2( A, B );
decltype(auto) atan2(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the multi-valued inverse tangent of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1484

In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

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

◆ clamp()

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

◆ conj()

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

◆ cos()

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

◆ cosh()

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

◆ ctrans()

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

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

B = trans( conj( A ) ); // Computing the conjugate transpose matrix
B = conj( trans( A ) ); // Computing the conjugate transpose matrix
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766

◆ data() [1/2]

template<typename MT , bool SO>
BLAZE_ALWAYS_INLINE const MT::ElementType * blaze::data ( const DenseMatrix< MT, SO > &  dm)
noexcept

Low-level data access to the dense matrix elements.

Parameters
dmThe given dense matrix.
Returns
Pointer to the internal element storage.

This function provides a unified interface to access the given dense matrix's internal element storage. In contrast to the data() member function, which is only available in case the matrix has some internal storage, this function can be used on all kinds of dense matrices. In case the given dense matrix does not provide low-level data access, the function returns nullptr.

◆ data() [2/2]

template<typename MT , bool SO>
BLAZE_ALWAYS_INLINE MT::ElementType * blaze::data ( DenseMatrix< MT, SO > &  dm)
noexcept

Low-level data access to the dense matrix elements.

Parameters
dmThe given dense matrix.
Returns
Pointer to the internal element storage.

This function provides a unified interface to access the given dense matrix's internal element storage. In contrast to the data() member function, which is only available in case the matrix has some internal storage, this function can be used on all kinds of dense matrices. In case the given dense matrix does not provide low-level data access, the function returns nullptr.

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

◆ declherm()

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

◆ decllow()

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

◆ declstrlow()

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

Declares the given dense matrix expression dm as strictly lower.

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

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

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

◆ declstrupp()

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

Declares the given dense matrix expression dm as strictly upper.

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

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

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

◆ declsym()

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

◆ declunilow()

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

Declares the given dense matrix expression dm as unilower.

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

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

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

◆ decluniupp()

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

Declares the given dense matrix expression dm as uniupper.

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

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

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

◆ declupp()

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

◆ det()

template<typename MT , bool SO>
ElementType_t< 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 );
Efficient implementation of an arbitrary sized vector.
Definition: DynamicVector.h:223
void eigen(const DenseMatrix< MT, SO > &A, DenseVector< VT, TF > &w)
Eigenvalue computation of the given dense matrix.
Definition: Eigen.h:351
constexpr bool rowMajor
Storage order flag for row-major matrices.
Definition: StorageOrder.h:71
constexpr bool columnVector
Transpose flag for column vectors.
Definition: TransposeFlag.h:58
SymmetricMatrix< DynamicMatrix<double,rowMajor> > A( 5UL ); // The symmetric matrix A
// ... Initialization
DynamicVector<double,columnVector> w( 5UL ); // The vector for the real eigenvalues
eigen( A, w );
Matrix adapter for symmetric matrices.
Definition: BaseTemplate.h:614
HermitianMatrix< DynamicMatrix<complex<double>,rowMajor> > A( 5UL ); // The Hermitian matrix A
// ... Initialization
DynamicVector<double,columnVector> w( 5UL ); // The vector for the real eigenvalues
eigen( A, w );
Matrix adapter for Hermitian matrices.
Definition: BaseTemplate.h:616
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, V will contain the left eigenvectors, otherwise V will contain the right eigenvectors. In case V is a row-major matrix the eigenvectors are returned in the rows of V, in case V is a column-major matrix the 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 ); // 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 ); // 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 );
decltype(auto) erf(const DenseMatrix< MT, SO > &dm)
Computes the error function for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2395

◆ erfc()

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

◆ eval()

template<typename MT , bool SO>
decltype(auto) blaze::eval ( const 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 );
decltype(auto) eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:790

◆ exp()

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

◆ exp10()

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

◆ exp2()

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

◆ fix()

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

Fixing the size of the given dense matrix.

Parameters
dmThe dense matrix to be size-fixed.
Returns
The size-fixed dense matrix.

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

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

◆ floor()

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

◆ forEach()

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

◆ generate()

template<bool SO = defaultStorageOrder, typename OP >
decltype(auto) blaze::generate ( size_t  m,
size_t  n,
OP  op 
)
inline

Generates a new dense matrix filled via the given custom binary operation.

Parameters
mThe number of rows of the matrix.
nThe number of columns of the matrix.
opThe custom binary operation.
Returns
The newly generated dense matrix.

The generate() function returns a dense matrix filled elementwise via the given custom binary operation. By default, the returned matrix is a row-major matrix, but this setting can be changed via the BLAZE_DEFAULT_STORAGE_ORDER switch. Alternatively it is possible to specify the storage order explicitly.
The following example demonstrates the use of the generate() function:

// Generates the uniform integer matrix ( ( 2, 2, 2 ), ( 2, 2, 2 ) )
A = generate( 2UL, 3UL, []( size_t i, size_t j ){ return 2; } );
// Generates the linearly spaced float matrix ( ( 2.1, 3.2, 4.3 ), ( 5.4, 6.5, 7.6 ) )
B = generate( 2UL, 3UL, []( size_t i, size_t j ){ return 2.1F + 1.1F*(i*3UL+j); } );
// Generates the logarithmically spaced double vector ( ( 1.0, 10.0 ), ( 100.0, 1000.0 ) )
C = generate<rowMajor>( 2UL, 2UL, []( size_t i, size_t j ) { return blaze::exp10( 1.0 + 1.0*(i*2UL+j) ); } );
// Generates the vector of integer vectors ( ( 1, 2 ), ( 2, 3 ), ( 3, 4 ), ( 4, 5 ) )
using VT = StaticVector<int,2UL>;
D = generate<columnMajor>( 2UL, 2UL, []( size_t i, size_t j ) { return evaluate( VT{ 1, 2 } + (i*2UL+j) ); } );
decltype(auto) generate(size_t m, size_t n, OP op)
Generates a new dense matrix filled via the given custom binary operation.
Definition: DMatGenExpr.h:675
MT::ResultType evaluate(const Matrix< MT, SO > &matrix)
Evaluates the given matrix expression.
Definition: Matrix.h:1282
constexpr bool columnMajor
Storage order flag for column-major matrices.
Definition: StorageOrder.h:99

◆ hypot()

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

Computes the componentwise hypotenous for 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.
Exceptions
std::invalid_argumentMatrix sizes do not match.

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

// ... Resizing and initialization
C = hypot( A, B );
decltype(auto) hypot(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise hypotenous for the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1412

In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

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

◆ 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.
Exceptions
std::invalid_argumentInvalid non-square matrix provided.

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

// ... Resizing and initialization
B = inv( A );
decltype(auto) inv(const DenseMatrix< MT, SO > &dm)
Calculation of the inverse of the given dense matrix.
Definition: DMatInvExpr.h:405
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!
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:137

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

◆ isDiagonal()

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

Checks if the given 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

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

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

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

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

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

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

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

◆ isfinite()

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

Checks the given dense matrix for finite elements.

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

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

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

◆ isHermitian()

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

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

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

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

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

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

◆ isIdentity()

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

Checks if the given 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

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

The following example demonstrates the use of the function:

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

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

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

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

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

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

◆ isinf()

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

Checks the given dense matrix for infinite elements.

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

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

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

◆ isLower()

template<RelaxationFlag RF, typename MT , bool SO>
bool blaze::isLower ( const 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

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

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

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

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

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

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

◆ isPositiveDefinite()

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

Checks if the given dense matrix is a positive definite matrix.

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

This function tests whether the matrix is a positive definite matrix. The following example demonstrates the use of the function:

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

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

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

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

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.

◆ isStrictlyLower()

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

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

The following code example demonstrates the use of the function:

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

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

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

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

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

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

◆ isStrictlyUpper()

template<RelaxationFlag RF, typename MT , bool SO>
bool blaze::isStrictlyUpper ( const 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

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

The following code example demonstrates the use of the function:

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

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

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

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

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

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

◆ isSymmetric()

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

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

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

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

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

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

◆ isUniform()

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

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

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

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

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

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

◆ isUniLower()

template<RelaxationFlag RF, typename MT , bool SO>
bool blaze::isUniLower ( const 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

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

The following code example demonstrates the use of the function:

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

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

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

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

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

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

◆ isUniUpper()

template<RelaxationFlag RF, typename MT , bool SO>
bool blaze::isUniUpper ( const 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

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

The following code example demonstrates the use of the function:

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

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

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

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

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

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

◆ isUpper()

template<RelaxationFlag RF, typename MT , bool SO>
bool blaze::isUpper ( const 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

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

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

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

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

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

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

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

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

◆ isZero()

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

Checks if the given dense matrix is a zero matrix.

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

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

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

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

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

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

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

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

◆ kron()

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

Computes the Kronecker product of two dense matrices ( $ A=B \otimes C $).

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

The kron() function computes the Kronecker product of the two given dense matrices:

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

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

◆ l1Norm()

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

Computes the L1 norm for the given dense matrix.

Parameters
dmThe given dense matrix for the norm computation.
Returns
The L1 norm of the given dense matrix.

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

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

◆ l2Norm()

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

Computes the L2 norm for the given dense matrix.

Parameters
dmThe given dense matrix for the norm computation.
Returns
The L2 norm of the given dense matrix.

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

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

◆ l3Norm()

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

Computes the L3 norm for the given dense matrix.

Parameters
dmThe given dense matrix for the norm computation.
Returns
The L3 norm of the given dense matrix.

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

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

◆ l4Norm()

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

Computes the L4 norm for the given dense matrix.

Parameters
dmThe given dense matrix for the norm computation.
Returns
The L4 norm of the given dense matrix.

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

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

◆ lgamma()

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

Computes the natural logarithm of the absolute value of the gamma function 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 the absolute value of the gamma function of each single element of dm.

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

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

◆ linfNorm()

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

Computes the infinity norm for the given dense matrix.

Parameters
dmThe given dense matrix for the norm computation.
Returns
The infinity norm of the given dense matrix.

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

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

◆ 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

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

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 ) );
void llh(const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &L)
Cholesky (LLH) decomposition of the given dense matrix.
Definition: LLH.h:127
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 );
decltype(auto) log(const DenseMatrix< MT, SO > &dm)
Computes the natural logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1888
Note
All 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 );
decltype(auto) log10(const DenseMatrix< MT, SO > &dm)
Computes the common logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1950
Note
All elements are expected to be in the range $[0..\infty)$. No runtime checks are performed to assert this precondition!

◆ log1p()

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

Computes the natural logarithm of x+1 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 x+1 for each single element of dm.

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

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

◆ lpNorm() [1/2]

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

Computes the Lp norm for the given dense matrix.

Parameters
dmThe given dense matrix for the norm computation.
Returns
The Lp norm of the given dense matrix.

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

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

◆ lpNorm() [2/2]

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

Computes the Lp norm for the given dense matrix.

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

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

// ... Resizing and initialization
const double lp = lpNorm( A, 2.3 );
decltype(auto) lpNorm(const DenseMatrix< MT, SO > &dm, ST p)
Computes the Lp norm for the given dense matrix.
Definition: DMatNormExpr.h:735
Note
The norm parameter p is expected to be larger than 0. This precondition is only checked by a user assertion.

◆ 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

                          \f[ A = L \cdot Q, \f]

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 );
void lq(const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &Q, DenseMatrix< MT3, SO3 > &R)
LQ decomposition of the given dense matrix.
Definition: LQ.h:179
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

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

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

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

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 );
void 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.
Definition: LU.h:222
// ... 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/9]

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

◆ map() [2/9]

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 ); } );
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1339

◆ map() [3/9]

template<typename MT1 , typename MT2 , typename MT3 , typename MT4 , typename MT5 , typename MT6 , bool SO, typename OP >
decltype(auto) blaze::map ( const DenseMatrix< MT1, SO > &  dm1,
const DenseMatrix< MT2, SO > &  dm2,
const DenseMatrix< MT3, SO > &  dm3,
const DenseMatrix< MT4, SO > &  dm4,
const DenseMatrix< MT5, SO > &  dm5,
const DenseMatrix< MT6, SO > &  dm6,
OP  op 
)
inline

Elementwise evaluation of the given 6-ary operation on each single element of the dense matrices dm1, dm2, dm3, dm4, dm5, and dm6.

Parameters
dm1The first dense matrix operand.
dm2The second dense matrix operand.
dm3The third dense matrix operand.
dm4The fourth dense matrix operand.
dm5The fifth dense matrix operand.
dm6The sixth dense matrix operand.
opThe custom, 6-ary operation.
Returns
The 6-ary operation applied to each single element of the six matrices.
Exceptions
std::invalid_argumentMatrix sizes do not match.

The map() function evaluates the given 6-ary operation on each single element of the input matrices dm1, dm2, dm3, dm4, dm5, and dm6. The function returns an expression representing this operation.
In case the current number of rows and columns of the six given matrices don't match, a std::invalid_argument is thrown.

◆ map() [4/9]

template<typename MT1 , typename MT2 , typename MT3 , typename MT4 , typename MT5 , bool SO, typename OP >
decltype(auto) blaze::map ( const DenseMatrix< MT1, SO > &  dm1,
const DenseMatrix< MT2, SO > &  dm2,
const DenseMatrix< MT3, SO > &  dm3,
const DenseMatrix< MT4, SO > &  dm4,
const DenseMatrix< MT5, SO > &  dm5,
OP  op 
)
inline

Elementwise evaluation of the given 5-ary operation on each single element of the dense matrices dm1, dm2, dm3, dm4, and dm5.

Parameters
dm1The first dense matrix operand.
dm2The second dense matrix operand.
dm3The third dense matrix operand.
dm4The fourth dense matrix operand.
dm5The fifth dense matrix operand.
opThe custom, 5-ary operation.
Returns
The 5-ary operation applied to each single element of the five matrices.
Exceptions
std::invalid_argumentMatrix sizes do not match.

The map() function evaluates the given 5-ary operation on each single element of the input matrices dm1, dm2, dm3, dm4, and dm5. The function returns an expression representing this operation.
In case the current number of rows and columns of the five given matrices don't match, a std::invalid_argument is thrown.

◆ map() [5/9]

template<typename MT1 , typename MT2 , typename MT3 , typename MT4 , bool SO, typename OP >
decltype(auto) blaze::map ( const DenseMatrix< MT1, SO > &  dm1,
const DenseMatrix< MT2, SO > &  dm2,
const DenseMatrix< MT3, SO > &  dm3,
const DenseMatrix< MT4, SO > &  dm4,
OP  op 
)
inline

Elementwise evaluation of the given 4-ary operation on each single element of the dense matrices dm1, dm2, dm3 and dm4.

Parameters
dm1The first dense matrix operand.
dm2The second dense matrix operand.
dm3The third dense matrix operand.
dm4The fourth dense matrix operand.
opThe custom, 4-ary operation.
Returns
The 4-ary operation applied to each single element of the four matrices.
Exceptions
std::invalid_argumentMatrix sizes do not match.

The map() function evaluates the given 4-ary operation on each single element of the input matrices dm1, dm2, dm3, and dm4. The function returns an expression representing this operation.
In case the current number of rows and columns of the four given matrices don't match, a std::invalid_argument is thrown.

◆ map() [6/9]

template<typename MT1 , typename MT2 , typename MT3 , bool SO, typename OP >
decltype(auto) blaze::map ( const DenseMatrix< MT1, SO > &  dm1,
const DenseMatrix< MT2, SO > &  dm2,
const DenseMatrix< MT3, SO > &  dm3,
OP  op 
)
inline

Elementwise evaluation of the given ternary operation on each single element of the dense matrices dm1, dm2 and dm3.

Parameters
dm1The first dense matrix operand.
dm2The second dense matrix operand.
dm3The third dense matrix operand.
opThe custom, ternary operation.
Returns
The ternary operation applied to each single element of the three matrices.
Exceptions
std::invalid_argumentMatrix sizes do not match.

The map() function evaluates the given ternary operation on each single element of the input matrices dm1, dm2, and dm3. The function returns an expression representing this operation.
In case the current number of rows and columns of the three given matrices don't match, a std::invalid_argument is thrown.

◆ map() [7/9]

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

Elementwise evaluation of 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 single 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 ); } );

In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

◆ map() [8/9]

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 ); } );

◆ map() [9/9]

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

Pairwise (outer) evaluation of the given binary operation on the elements of the dense vectors lhs and rhs.

Parameters
lhsThe left-hand side dense vector for the outer map.
rhsThe right-hand side transpose dense vector for the outer map.
opThe custom, binary operation.
Returns
The binary operation applied to each pair of elements of lhs and rhs.

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

// ... Resizing and initialization
A = map( a, trans(b), []( double x, double y ){ return a + b; );

◆ matexp()

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

Calculation of the exponential of the given dense matrix.

Parameters
dmThe dense matrix for the matrix exponential.
Returns
The exponential of the given matrix.

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

              \f[ e^X = \sum\limits_{k=0}^\infty \frac{1}{k!} X^k \f]

Example:

// ... Resizing and initialization
B = matexp( A );
decltype(auto) matexp(const DenseMatrix< MT, SO > &dm)
Calculation of the exponential of the given dense matrix.
Definition: DMatExpExpr.h:564
Note
The matrix exponential 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 matexp() function. Also, it is not possible to access individual elements via the function call operator on the expression object:
row( matexp( A ), 2UL ); // Compilation error: Views cannot be used on an matexp() expression!
matexp( A )(1,2); // Compilation error: It is not possible to access individual elements!

◆ max() [1/5]

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

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 given martix currently has either 0 rows or 0 columns, the returned value is the default value (e.g. 0 in case of fundamental data types).

blaze::DynamicMatrix<int> A{ { 1, 2 }, { 3, 4 } };
const int totalmax = max( A ); // Results in 4
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1375

◆ max() [2/5]

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

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

Parameters
dmThe given dense matrix.
Returns
The largest elements in each row/column.

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

blaze::DynamicMatrix<int> A{ { 1, 0, 2 }, { 1, 3, 4 } };
colmax = max<columnwise>( A ); // Results in ( 1, 3, 4 )
constexpr ReductionFlag columnwise
Reduction flag for column-wise reduction operations.
Definition: ReductionFlag.h:97
blaze::DynamicMatrix<int> A{ { 1, 0, 2 }, { 1, 3, 4 } };
rowmax = max<rowwise>( A ); // Results in ( 2, 4 )
constexpr ReductionFlag rowwise
Reduction flag for row-wise reduction operations.
Definition: ReductionFlag.h:77

◆ max() [3/5]

template<typename MT , bool SO, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::max ( const DenseMatrix< MT, SO > &  dm,
ST  scalar 
)

Computes the componentwise maximum of a dense matrix dm and a scalar.

Parameters
dmThe left-hand side dense matrix operand.
scalarThe right-hand side scalar value.
Returns
The resulting dense matrix.

This operator computes the componentwise maximum of a dense matrix dm and a uniform matrix represented by the scalar value scalar. The function returns an expression representing this operation.
The following example demonstrates the use of the max() function:

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

◆ max() [4/5]

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.
Exceptions
std::invalid_argumentMatrix sizes do not match.

This function computes the componentwise maximum of the two dense matrices 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 );

In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

◆ max() [5/5]

template<typename ST , typename MT , bool SO, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::max ( ST  scalar,
const DenseMatrix< MT, SO > &  dm 
)

Computes the componentwise maximum of a scalar and a dense matrix dm.

Parameters
scalarThe left-hand side scalar value.
dmThe right-hand side dense matrix operand.
Returns
The resulting dense matrix.

This operator computes the componentwise maximum of a uniform matrix represented by the scalar value scalar and a dense matrix dm. The function returns an expression representing this operation.
The following example demonstrates the use of the max() function:

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

◆ maxNorm()

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

Computes the maximum norm for the given dense matrix.

Parameters
dmThe given dense matrix for the norm computation.
Returns
The maximum norm of the given dense matrix.

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

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

◆ mean() [1/2]

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

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

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

This function computes the (arithmetic) mean for the given dense matrix dm. Example:

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

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

◆ mean() [2/2]

template<ReductionFlag RF, typename MT , bool SO>
decltype(auto) blaze::mean ( const DenseMatrix< MT, SO > &  dm)

Computes the row-/column-wise mean function for the given dense matrix.

Parameters
dmThe given dense matrix for the mean computation.
Returns
The row-/column-wise mean of the given matrix.
Exceptions
std::invalid_argumentInvalid input matrix.

This function computes the row-/column-wise (arithmetic) mean for the given dense matrix dm. In case RF is set to rowwise, the function returns a column vector containing the mean of each row of dm. In case RF is set to columnwise, the function returns a row vector containing the mean of each column of dm. Example:

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

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

◆ min() [1/5]

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

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 given matrix currently has either 0 rows or 0 columns, the returned value is the default value (e.g. 0 in case of fundamental data types).

blaze::DynamicMatrix<int> A{ { 1, 2 }, { 3, 4 } };
const int totalmin = min( A ); // Results in 1

◆ min() [2/5]

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

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

Parameters
dmThe given dense matrix.
Returns
The smallest elements in each row/column.

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

blaze::DynamicMatrix<int> A{ { 1, 0, 2 }, { 1, 3, 4 } };
colmin = min<columnwise>( A ); // Results in ( 1, 0, 2 )
blaze::DynamicMatrix<int> A{ { 1, 0, 2 }, { 1, 3, 4 } };
rowmin = min<rowwise>( A ); // Results in ( 0, 1 )

◆ min() [3/5]

template<typename MT , bool SO, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::min ( const DenseMatrix< MT, SO > &  dm,
ST  scalar 
)

Computes the componentwise minimum of a dense matrix dm and a scalar.

Parameters
dmThe left-hand side dense matrix operand.
scalarThe right-hand side scalar value.
Returns
The resulting dense matrix.

This operator computes the componentwise minimum of a dense matrix dm and a uniform matrix represented by the scalar value scalar. The function returns an expression representing this operation.
The following example demonstrates the use of the min() function:

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

◆ min() [4/5]

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.
Exceptions
std::invalid_argumentMatrix sizes do not match.

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

In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

◆ min() [5/5]

template<typename ST , typename MT , bool SO, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::min ( ST  scalar,
const DenseMatrix< MT, SO > &  dm 
)

Computes the componentwise minimum of a scalar and a dense matrix dm.

Parameters
scalarThe left-hand side scalar value.
dmThe right-hand side dense matrix operand.
Returns
The resulting dense matrix.

This operator computes the componentwise minimum of a uniform matrix represented by the scalar value scalar and a dense matrix dm. The function returns an expression representing this operation.
The following example demonstrates the use of the min() function:

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

◆ minNorm()

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

Computes the minimum norm for the given dense matrix.

Parameters
dmThe given dense matrix for the norm computation.
Returns
The minimum norm of the given dense matrix.

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

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

◆ noalias()

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

Forces the non-aliased evaluation of the given dense matrix expression dm.

Parameters
dmThe input matrix.
Returns
The non-aliased dense matrix.

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

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

◆ norm()

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

Computes the L2 norm for the given dense matrix.

Parameters
dmThe given dense matrix for the norm computation.
Returns
The L2 norm of the given dense matrix.

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

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

◆ nosimd()

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

Disables the SIMD evaluation of the given dense matrix expression dm.

Parameters
dmThe input matrix.
Returns
The non-aliased dense matrix.

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

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

◆ operator!()

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

Logical NOT operator for the logical NOT of a dense matrix.

Parameters
matThe dense matrix for the logical NOT.
Returns
The negated matrix.

This operator represents the logical NOT of all elements of a dense matrix:

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

◆ operator!=() [1/5]

template<typename MT1 , bool SO1, typename MT2 , bool SO2>
bool blaze::operator!= ( const DenseMatrix< MT1, SO1 > &  lhs,
const DenseMatrix< MT2, 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 MT1 , bool SO1, typename MT2 , bool SO2>
bool blaze::operator!= ( const DenseMatrix< MT1, SO1 > &  lhs,
const SparseMatrix< MT2, 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 , typename T2 , bool SO>
auto blaze::operator!= ( const DenseMatrix< T1, SO > &  mat,
T2  scalar 
) -> EnableIf_t< IsScalar_v< T2 >, bool >
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!=() [4/5]

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

template<typename T1 , typename T2 , bool SO>
auto blaze::operator!= ( T1  scalar,
const DenseMatrix< T2, SO > &  mat 
) -> EnableIf_t< IsScalar_v< T1 >, bool >
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/2]

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

Bitwise AND operator for the bitwise AND of a dense matrix and a scalar value.

Parameters
matThe left-hand side dense matrix for the bitwise AND.
scalarThe right-hand side scalar value for the bitwise AND.
Returns
The resulting matrix.

This operator represents the bitwise AND of a scalar value with all elements of a dense matrix:

// ... Resizing and initialization
B = A & 7U;

◆ operator&() [2/2]

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

Bitwise AND operator for two dense matrices.

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

This operator represents the bitwise AND of the given two dense matrices:

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

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 MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::operator&& ( const DenseMatrix< MT1, SO1 > &  lhs,
const DenseMatrix< MT2, SO2 > &  rhs 
)
inline

Logical AND operator for two dense matrices.

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

This operator represents the logical AND of the given two dense matrices:

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

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

template<typename MT , bool SO, typename ST >
auto blaze::operator&= ( DenseMatrix< MT, SO > &&  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
inline

Bitwise AND assignment operator for the bitwise AND of a temporary dense matrix and a scalar value.

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

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

◆ operator&=() [2/4]

template<typename MT , bool SO, typename ST >
auto blaze::operator&= ( DenseMatrix< MT, SO > &  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
inline

Bitwise AND assignment operator for the bitwise AND of a dense matrix and a scalar value.

Parameters
matThe left-hand side dense matrix for the bitwise AND.
scalarThe right-hand side scalar value for the bitwise AND.
Returns
Reference to the left-hand side dense matrix.
Exceptions
std::invalid_argumentInvalid bitwise AND of restricted matrix.

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

◆ operator&=() [3/4]

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

Bitwise AND assignment operator for the bitwise AND of a temporary dense matrix.

Parameters
lhsThe left-hand side temporary dense matrix for the bitwise AND operation.
rhsThe right-hand side dense matrix for the bitwise AND operation.
Returns
Reference to the dense matrix.
Exceptions
std::invalid_argumentInvalid bitwise AND of restricted matrix.

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

◆ operator&=() [4/4]

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

Bitwise AND assignment operator for the bitwise AND of a dense matrix.

Parameters
lhsThe left-hand side dense matrix for the bitwise AND operation.
rhsThe right-hand side dense matrix for the bitwise AND operation.
Returns
Reference to the dense matrix.
Exceptions
std::invalid_argumentInvalid bitwise AND of restricted matrix.

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

◆ operator*() [1/17]

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

// ... Resizing and initialization
C = A * B;
Efficient implementation of a compressed matrix.
Definition: CompressedMatrix.h:239

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*() [5/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*() [6/17]

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

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

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

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

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

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

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

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*() [10/17]

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

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*() [11/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.

◆ operator*() [12/17]

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

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:

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

◆ operator*() [13/17]

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

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*() [14/17]

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

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*() [15/17]

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

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*() [16/17]

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

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:

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

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

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

template<typename MT , bool SO, typename ST >
auto blaze::operator*= ( DenseMatrix< MT, SO > &&  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
inline

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

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

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

◆ operator*=() [2/2]

template<typename MT , bool SO, typename ST >
auto blaze::operator*= ( DenseMatrix< MT, SO > &  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
inline

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

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

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

◆ operator+() [1/12]

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

Addition operator for the addition of a dense matrix and a scalar value ( $ A=B+s $).

Parameters
matThe left-hand side dense matrix for the addition.
scalarThe right-hand side scalar value for the addition.
Returns
The matrix sum.

This operator represents the elementwise addition of a dense matrix and a uniform matrix represented by 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+() [2/12]

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+() [3/12]

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+() [4/12]

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+() [5/12]

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 with identical storage order ( $ 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+() [6/12]

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+() [7/12]

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

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

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

Addition operator for the outer sum of two dense vectors ( $ A=\vec{b}+\vec{c}^T $).

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

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

// ... Resizing and initialization
c = a + trans(b);

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.

◆ operator+() [9/12]

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

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+() [10/12]

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+() [11/12]

template<typename MT1 , typename MT2 >
decltype(auto) blaze::operator+ ( const SparseMatrix< MT1, true > &  lhs,
const DenseMatrix< MT2, 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+() [12/12]

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

Addition operator for the addition of a scalar value and a dense matrix ( $ A=s+B $).

Parameters
scalarThe left-hand side scalar value for the addition.
matThe right-hand side dense matrix for the addition.
Returns
The matrix sum.

This operator represents the elementwise addition of a uniform matrix represented by a scalar value and a 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 MT::ElementType and ST. Note that this operator only works for scalar values of built-in data type.

◆ operator+=() [1/2]

template<typename MT , bool SO, typename ST >
auto blaze::operator+= ( DenseMatrix< MT, SO > &&  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
inline

Addition assignment operator for the addition of a temporary dense matrix and a scalar value ( $ A+=s $).

Parameters
matThe left-hand side temporary dense matrix for the addition.
scalarThe right-hand side scalar value for the addition.
Returns
Reference to the left-hand side dense matrix.
Exceptions
std::invalid_argumentInvalid addition to restricted matrix.

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

◆ operator+=() [2/2]

template<typename MT , bool SO, typename ST >
auto blaze::operator+= ( DenseMatrix< MT, SO > &  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
inline

Addition assignment operator for the addition of a dense matrix and a scalar value ( $ A+=s $).

Parameters
matThe left-hand side dense matrix for the addition.
scalarThe right-hand side scalar value for the addition.
Returns
Reference to the left-hand side dense matrix.
Exceptions
std::invalid_argumentInvalid addition to restricted matrix.

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

◆ operator-() [1/13]

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-() [2/13]

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

Subtraction operator for the subtraction of a dense matrix and a scalar value ( $ A=B-s $).

Parameters
matThe left-hand side dense matrix for the subtraction.
scalarThe right-hand side scalar value for the subtraction.
Returns
The matrix difference.

This operator represents the elementwise subtraction of a uniform matrix represented by a scalar value from a dense matrix:

// ... 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-() [3/13]

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

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

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

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:

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

◆ operator-() [7/13]

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

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

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

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

Addition operator for the outer difference of two dense vectors ( $ A=\vec{b}-\vec{c}^T $).

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

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

// ... Resizing and initialization
c = a - trans(b);

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.

◆ operator-() [10/13]

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

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-() [11/13]

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

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:

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

◆ operator-() [12/13]

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

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

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

Subtraction operator for the subtraction of a scalar value and a dense matrix ( $ A=s-B $).

Parameters
scalarThe left-hand side scalar value for the subtraction.
matThe right-hand side dense matrix for the subtraction.
Returns
The matrix difference.

This operator represents the elementwise subtraction of a dense matrix from a uniform matrix represented by a scalar value:

// ... 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 MT::ElementType and ST. Note that this operator only works for scalar values of built-in data type.

◆ operator-=() [1/2]

template<typename MT , bool SO, typename ST >
auto blaze::operator-= ( DenseMatrix< MT, SO > &&  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
inline

Subtraction assignment operator for the subtraction of a temporary dense matrix and a scalar value ( $ A-=s $).

Parameters
matThe left-hand side temporary dense matrix for the subtraction.
scalarThe right-hand side scalar value for the subtraction.
Returns
Reference to the left-hand side dense matrix.
Exceptions
std::invalid_argumentInvalid subtraction from restricted matrix.

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

◆ operator-=() [2/2]

template<typename MT , bool SO, typename ST >
auto blaze::operator-= ( DenseMatrix< MT, SO > &  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
inline

Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( $ A-=s $).

Parameters
matThe left-hand side dense matrix for the subtraction.
scalarThe right-hand side scalar value for the subtraction.
Returns
Reference to the left-hand side dense matrix.
Exceptions
std::invalid_argumentInvalid subtraction from restricted matrix.

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

◆ operator/() [1/3]

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

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

Division operator for the outer quotient of two dense vectors ( $ A=\vec{b}/\vec{c}^T $).

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

This operator represents the outer quotient 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.

◆ operator/() [3/3]

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

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

Parameters
scalarThe left-hand side scalar value for the division.
matThe right-hand side dense matrix for the division.
Returns
The matrix quotient.

This operator represents the elementwise division of a uniform matrix represented by a scalar value and a 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 MT::ElementType and ST. Note that this operator only works for scalar values of built-in data type.

◆ operator/=() [1/2]

template<typename MT , bool SO, typename ST >
auto blaze::operator/= ( DenseMatrix< MT, SO > &&  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
inline

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

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

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

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

◆ operator/=() [2/2]

template<typename MT , bool SO, typename ST >
auto blaze::operator/= ( DenseMatrix< MT, SO > &  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
inline

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

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

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

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

◆ operator<<() [1/2]

template<typename MT , bool SO>
decltype(auto) blaze::operator<< ( const DenseMatrix< MT, SO > &  mat,
int  count 
)
inline

Left-shift operator for the uniform left-shift of a dense matrix.

Parameters
matThe dense matrix for the uniform left-shift operation.
countThe number of bits to shift all matrix elements.
Returns
The resulting matrix.

This operator represents the uniform left-shift of all elements of a dense matrix:

// ... Resizing and initialization
B = A << 3;

◆ operator<<() [2/2]

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

Left-shift operator for the elementwise left-shift of a dense matrix.

Parameters
lhsThe left-hand side dense matrix to be shifted.
rhsThe right-hand side dense matrix of bits to shift.
Returns
The left-shifted dense matrix.
Exceptions
std::invalid_argumentMatrix sizes do not match.

This operator represents the elementwise left-shift of a given dense matrix:

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

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

template<typename MT , bool SO>
MT & blaze::operator<<= ( DenseMatrix< MT, SO > &&  mat,
int  count 
)
inline

Left-shift assignment operator for the uniform left-shift of a temporary dense matrix.

Parameters
matThe temporary dense matrix for the uniform left-shift operation.
countThe number of bits to shift all matrix elements.
Returns
Reference to the dense matrix.
Exceptions
std::invalid_argumentInvalid left-shift of restricted matrix.

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

◆ operator<<=() [2/4]

template<typename MT , bool SO>
MT & blaze::operator<<= ( DenseMatrix< MT, SO > &  mat,
int  count 
)
inline

Left-shift assignment operator for the uniform left-shift of a dense matrix.

Parameters
matThe dense matrix for the uniform left-shift operation.
countThe number of bits to shift all matrix elements.
Returns
Reference to the dense matrix.
Exceptions
std::invalid_argumentInvalid left-shift of restricted matrix.

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

◆ operator<<=() [3/4]

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

Left-shift assignment operator for the elementwise left-shift of a temporary dense matrix.

Parameters
lhsThe left-hand side temporary dense matrix to be shifted.
rhsThe right-hand side dense matrix of bits to shift.
Returns
Reference to the dense matrix.
Exceptions
std::invalid_argumentInvalid left-shift of restricted matrix.

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

◆ operator<<=() [4/4]

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

Left-shift assignment operator for the elementwise left-shift of a dense matrix.

Parameters
lhsThe left-hand side dense matrix to be shifted.
rhsThe right-hand side dense matrix of bits to shift.
Returns
Reference to the dense matrix.
Exceptions
std::invalid_argumentInvalid left-shift of restricted matrix.

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

◆ operator==() [1/6]

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

Equality operator for the comparison of two 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/6]

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

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

◆ operator==() [3/6]

template<typename T1 , typename T2 >
auto blaze::operator== ( const DenseMatrix< T1, false > &  mat,
T2  scalar 
) -> EnableIf_t< IsScalar_v< T2 >, bool >
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==() [4/6]

template<typename T1 , typename T2 >
auto blaze::operator== ( const DenseMatrix< T1, true > &  mat,
T2  scalar 
) -> EnableIf_t< IsScalar_v< T2 >, bool >
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==() [5/6]

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

template<typename T1 , typename T2 , bool SO>
auto blaze::operator== ( T1  scalar,
const DenseMatrix< T2, SO > &  mat 
) -> EnableIf_t< IsScalar_v< T1 >, bool >
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!

◆ operator>>() [1/2]

template<typename MT , bool SO>
decltype(auto) blaze::operator>> ( const DenseMatrix< MT, SO > &  mat,
int  count 
)
inline

Right-shift operator for the uniform right-shift of a dense matrix.

Parameters
matThe dense matrix for the uniform right-shift operation.
countThe number of bits to shift all matrix elements.
Returns
The resulting matrix.

This operator represents the uniform right-shift of all elements of a dense matrix:

// ... Resizing and initialization
B = A >> 3;

◆ operator>>() [2/2]

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

Right-shift operator for the elementwise right-shift of a dense matrix.

Parameters
lhsThe left-hand side dense matrix to be shifted.
rhsThe right-hand side dense matrix of bits to shift.
Returns
The right-shifted dense matrix.
Exceptions
std::invalid_argumentMatrix sizes do not match.

This operator represents the elementwise right-shift of a given dense matrix:

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

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

template<typename MT , bool SO>
MT & blaze::operator>>= ( DenseMatrix< MT, SO > &&  mat,
int  count 
)
inline

Right-shift assignment operator for the uniform right-shift of a temporary dense matrix.

Parameters
matThe temporary dense matrix for the uniform right-shift operation.
countThe number of bits to shift all matrix elements.
Returns
Reference to the dense matrix.
Exceptions
std::invalid_argumentInvalid right-shift of restricted matrix.

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

◆ operator>>=() [2/4]

template<typename MT , bool SO>
MT & blaze::operator>>= ( DenseMatrix< MT, SO > &  mat,
int  count 
)
inline

Right-shift assignment operator for the uniform right-shift of a dense matrix.

Parameters
matThe dense matrix for the uniform right-shift operation.
countThe number of bits to shift all matrix elements.
Returns
Reference to the dense matrix.
Exceptions
std::invalid_argumentInvalid right-shift of restricted matrix.

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

◆ operator>>=() [3/4]

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

Right-shift assignment operator for the elementwise right-shift of a temporary dense.

Parameters
lhsThe left-hand side temporary dense matrix to be shifted.
rhsThe right-hand side dense matrix of bits to shift.
Returns
Reference to the dense matrix.
Exceptions
std::invalid_argumentInvalid right-shift of restricted matrix.

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

◆ operator>>=() [4/4]

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

Right-shift assignment operator for the elementwise right-shift of a dense matrix.

Parameters
lhsThe left-hand side dense matrix to be shifted.
rhsThe right-hand side dense matrix of bits to shift.
Returns
Reference to the dense matrix.
Exceptions
std::invalid_argumentInvalid right-shift of restricted matrix.

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

◆ operator^() [1/2]

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

Bitwise XOR operator for the bitwise XOR of a dense matrix and a scalar value.

Parameters
matThe left-hand side dense matrix for the bitwise XOR.
scalarThe right-hand side scalar value for the bitwise XOR.
Returns
The resulting matrix.

This operator represents the bitwise XOR of a scalar value with all elements of a dense matrix:

// ... Resizing and initialization
B = A ^ 7U;

◆ operator^() [2/2]

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

Bitwise XOR operator for two dense matrices.

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

This operator represents the bitwise XOR of the given two dense matrices:

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

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

template<typename MT , bool SO, typename ST >
auto blaze::operator^= ( DenseMatrix< MT, SO > &&  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
inline

Bitwise XOR assignment operator for the bitwise XOR of a temporary dense matrix and a scalar value.

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

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

◆ operator^=() [2/4]

template<typename MT , bool SO, typename ST >
auto blaze::operator^= ( DenseMatrix< MT, SO > &  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
inline

Bitwise XOR assignment operator for the bitwise XOR of a dense matrix and a scalar value.

Parameters
matThe left-hand side dense matrix for the bitwise XOR.
scalarThe right-hand side scalar value for the bitwise XOR.
Returns
Reference to the left-hand side dense matrix.
Exceptions
std::invalid_argumentInvalid bitwise XOR of restricted matrix.

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

◆ operator^=() [3/4]

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

Bitwise XOR assignment operator for the bitwise XOR of a temporary dense matrix.

Parameters
lhsThe left-hand side temporary dense matrix for the bitwise XOR operation.
rhsThe right-hand side dense matrix for the bitwise XOR operation.
Returns
Reference to the dense matrix.
Exceptions
std::invalid_argumentInvalid bitwise XOR of restricted matrix.

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

◆ operator^=() [4/4]

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

Bitwise XOR assignment operator for the bitwise XOR of a dense matrix.

Parameters
lhsThe left-hand side dense matrix for the bitwise XOR operation.
rhsThe right-hand side dense matrix for the bitwise XOR operation.
Returns
Reference to the dense matrix.
Exceptions
std::invalid_argumentInvalid bitwise XOR of restricted matrix.

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

◆ operator|() [1/2]

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

Bitwise OR operator for the bitwise OR of a dense matrix and a scalar value.

Parameters
matThe left-hand side dense matrix for the bitwise OR.
scalarThe right-hand side scalar value for the bitwise OR.
Returns
The resulting matrix.

This operator represents the bitwise OR of a scalar value with all elements of a dense matrix:

// ... Resizing and initialization
B = A | 7U;

◆ operator|() [2/2]

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

Bitwise OR operator for two dense matrices.

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

This operator represents the bitwise OR of the given two dense matrices:

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

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

template<typename MT , bool SO, typename ST >
auto blaze::operator|= ( DenseMatrix< MT, SO > &&  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
inline

Bitwise OR assignment operator for the bitwise OR of a temporary dense matrix and a scalar value.

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

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

◆ operator|=() [2/4]

template<typename MT , bool SO, typename ST >
auto blaze::operator|= ( DenseMatrix< MT, SO > &  mat,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, MT & >
inline

Bitwise OR assignment operator for the bitwise OR of a dense matrix and a scalar value.

Parameters
matThe left-hand side dense matrix for the bitwise OR.
scalarThe right-hand side scalar value for the bitwise OR.
Returns
Reference to the left-hand side dense matrix.
Exceptions
std::invalid_argumentInvalid bitwise OR of restricted matrix.

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

◆ operator|=() [3/4]

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

Bitwise OR assignment operator for the bitwise OR of a temporary dense matrix.

Parameters
lhsThe left-hand side temporary dense matrix for the bitwise OR operation.
rhsThe right-hand side dense matrix for the bitwise OR operation.
Returns
Reference to the dense matrix.
Exceptions
std::invalid_argumentInvalid bitwise OR of restricted matrix.

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

◆ operator|=() [4/4]

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

Bitwise OR assignment operator for the bitwise OR of a dense matrix.

Parameters
lhsThe left-hand side dense matrix for the bitwise OR operation.
rhsThe right-hand side dense matrix for the bitwise OR operation.
Returns
Reference to the dense matrix.
Exceptions
std::invalid_argumentInvalid bitwise OR of restricted matrix.

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

◆ operator||()

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

Logical OR operator for two dense matrices.

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

This operator represents the logical OR of the given two dense matrices:

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

In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

◆ pllhp()

template<typename MT1 , bool SO1, typename MT2 , bool SO2, typename ST >
blas_int_t blaze::pllhp ( const DenseMatrix< MT1, SO1 > &  A,
DenseMatrix< MT2, SO2 > &  L,
blas_int_t P,
ST  tol 
)

Pivoting Cholesky (PLLHP) decomposition of the given dense matrix.

Parameters
AThe matrix to be decomposed.
LThe resulting lower triangular matrix.
PVector with the pivoting indices.
tolThe user-defined tolerance.
Returns
The rank of A given by the number of steps the algorithm completed.
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 pivoting Cholesky (PLLHP) decomposition of a positive semi-definite n-by-n matrix. The resulting decomposition has the form

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

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:

const size_t N = 32;
// ... Initialization of A as positive semi-definite matrix
std::vector<blaze::blas_int_t> pivot(n), ipivot(n);
const size_t rank = pllhp( A, L, pivot.data(), 1E-8 );
for( size_t i=0; i<32; ++i ) {
ipivot[pivot[i]] = i;
}
const auto PLLHP( evaluate( L * ctrans( L ) ) );
const auto LLHP ( evaluate( rows( PLLHP, [&]( size_t i ){ return ipivot[i]; }, 32 ) ) );
const auto LLH ( evaluate( columns( LLHP, [&]( size_t i ){ return ipivot[i]; }, 32 ) ) );
assert( A == LLH );
int pllhp(const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &L, blas_int_t *P, ST tol)
Pivoting Cholesky (PLLHP) decomposition of the given dense matrix.
Definition: PLLHP.h:138
size_t rank(const DenseMatrix< MT, SO > &dm)
Computes the rank of the given dense matrix.
Definition: DenseMatrix.h:2715
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:644
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:660
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.

◆ pow() [1/2]

template<typename MT , bool SO, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::pow ( const DenseMatrix< MT, SO > &  dm,
ST  exp 
)
inline

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

Parameters
dmThe input matrix.
expThe scalar 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 );
decltype(auto) pow(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise exponential value for the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1448

◆ pow() [2/2]

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

Computes the componentwise exponential value for 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.
Exceptions
std::invalid_argumentMatrix sizes do not match.

The pow() function computes the componentwise exponential value for the two dense matrices lhs and rhs. The function returns an expression representing this operation.
The following example demonstrates the use of the pow() function:

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

In case the current number of rows and columns of the two given matrices don't match, a std::invalid_argument is thrown.

◆ prod() [1/2]

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

Reduces the given dense matrix by means of multiplication.

Parameters
dmThe given dense matrix for the reduction operation.
Returns
The result of the reduction operation.

This function reduces the given dense matrix dm by means of multiplication:

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

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

◆ prod() [2/2]

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

Reduces the given dense matrix by means of multiplication.

Parameters
dmThe given dense matrix for the reduction operation.
Returns
The result of the reduction operation.

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

blaze::DynamicMatrix<int> A{ { 1, 0, 2 }, { 1, 3, 4 } };
colprod = prod<columnwise>( A ); // Results in ( 1, 0, 8 )
blaze::DynamicMatrix<int> A{ { 1, 0, 2 }, { 1, 3, 4 } };
rowprod = prod<rowwise>( A ); // Results in ( 0, 12 )

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

◆ 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

                          \f[ A = Q \cdot L, \f]

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 );
void ql(const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &Q, DenseMatrix< MT3, SO3 > &L)
QL decomposition of the given dense matrix.
Definition: QL.h:179
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

                          \f[ A = Q \cdot R, \f]

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 );
void qr(const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &Q, DenseMatrix< MT3, SO3 > &R)
QR decomposition of the given dense matrix.
Definition: QR.h:179
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.

◆ rank()

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

Computes the rank of the given dense matrix.

Parameters
dmThe dense matrix for the rank computation.
Returns
The rank of the given dense matrix.

This function computes the rank of the given dense matrix dm. The rank is determined as the number of singular values greater than a given tolerance. This tolerance is computed as

tolerance = max(m,n) * max(s) * epsilon,
constexpr Epsilon epsilon
Global Epsilon instance.
Definition: Epsilon.h:906

where m is the number of rows of dm, n is the number of columns of dm, max(s) is the maximum singular value of dm and epsilon is the difference between 1 and the least value greater than 1 that is representable by the floating point type of the singular values. Example:

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

◆ reduce() [1/2]

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

Performs a custom reduction operation on the given dense matrix.

Parameters
dmThe given dense matrix for the reduction computation.
opThe reduction operation.
Returns
The result of the reduction operation.

This function reduces the given dense matrix dm by means of the given reduction operation op:

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

As demonstrated in the example it is possible to pass any binary callable as custom reduction operation. However, for instance in the case of lambdas the vectorization of the reduction operation is compiler dependent and might not perform at peak performance. However, it is also possible to create vectorized custom operations. See Custom Operations for a detailed overview of the possibilities of custom operations.

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

◆ reduce() [2/2]

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

Performs a custom reduction operation on the given dense matrix.

Parameters
dmThe given dense matrix for the reduction computation.
opThe reduction operation.
Returns
The result of the reduction operation.

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

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

As demonstrated in the examples it is possible to pass any binary callable as custom reduction operation. However, for instance in the case of lambdas the vectorization of the reduction operation is compiler dependent and might not perform at peak performance. However, it is also possible to create vectorized custom operations. See Custom Operations for a detailed overview of the possibilities of custom operations.

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

◆ repeat() [1/2]

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

Repeats the given dense matrix.

Parameters
dmThe dense matrix to be repeated.
Returns
The repeated dense matrix.

This function returns an expression representing the repeated dense matrix:

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

◆ repeat() [2/2]

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

Repeats the given dense matrix.

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

This function returns an expression representing the repeated dense matrix:

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

◆ round()

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

◆ 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

                          \f[ A = R \cdot Q, \f]

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 );
void rq(const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &R, DenseMatrix< MT3, SO3 > &Q)
RQ decomposition of the given dense matrix.
Definition: RQ.h:180
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.

◆ select()

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

Elementwise conditional selection of values from the dense matrices lhs and rhs.

Parameters
condThe dense matrix containing the selection conditions.
lhsThe true-case dense matrix.
rhsThe false-case dense matrix.
Returns
The resulting dense matrix.
Exceptions
std::invalid_argumentMatrix sizes do not match.

This function performs an elementwise conditional selection of values from the two given dense matrices lhs and rhs. In case an element in the cond matrix evaluates to true, the according element of lhs is selected, in case the cond element evaluates to false, the according element of rhs is selected. The function returns an expression representing this operation.
The following example demonstrates the use of the selec() function:

blaze::DynamicMatrix<bool> cond{ { true, false }, { true false } };
blaze::DynamicMatrix<int> A{ { 1, -1 }, { 1, -1 } };
blaze::DynamicMatrix<int> B{ { -2, 2 }, { -2, 2 } };
// ... Resizing and initialization
C = select( cond, A, B ); // Results in ( 1, 2 ) ( 1, 2 )
decltype(auto) select(const DenseMatrix< MT1, SO > &cond, const DenseMatrix< MT2, SO > &lhs, const DenseMatrix< MT3, SO > &rhs)
Elementwise conditional selection of values from the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1528

In case the current number of rows and columns of the three given matrices don't match, a std::invalid_argument is thrown.

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

◆ sign()

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

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

Parameters
dmThe input matrix.
Returns
The resulting dense matrix.

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

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

◆ sin()

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

◆ sinh()

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

◆ softmax() [1/2]

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

Computes the softmax function for the given dense matrix.

Parameters
dmThe given dense matrix for the softmax computation.
Returns
The resulting matrix.

This function computes the softmax function (i.e. the normalized exponential function) for the given dense matrix dm (see also https://en.wikipedia.org/wiki/Softmax_function). The resulting dense matrix consists of real values in the range (0..1], which add up to 1.

// Creating the matrix
// ( 1 2 3 )
// ( 4 1 2 )
// ( 3 4 1 )
, { 4.0, 1.0, 2.0 }
, { 3.0, 4.0, 1.0 } };
// Computing the total softmax of A (sum(B) == 1)
// ( 0.0157764 0.0428847 0.116573 )
// ( 0.316878 0.0157764 0.0428847 )
// ( 0.116573 0.316878 0.0157764 )
B = softmax( A );
Efficient implementation of a fixed-sized matrix.
Definition: StaticMatrix.h:249
auto softmax(const DenseMatrix< MT, SO > &dm)
Computes the softmax function for the given dense matrix.
Definition: DMatSoftmaxExpr.h:88

◆ softmax() [2/2]

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

Computes the row-/columnwise softmax function for the given dense matrix.

Parameters
dmThe given dense matrix for the softmax computation.
Returns
The resulting matrix.

This function computes the row-/columnwise softmax function (i.e. the normalized exponential function) for the given dense matrix dm (see also https://en.wikipedia.org/wiki/Softmax_function). The resulting dense matrix consists of real values in the range (0..1], which add up to the numbers of rows or columns, respectively.

// Creating the matrix
// ( 1 2 3 )
// ( 4 1 2 )
// ( 3 4 1 )
, { 4.0, 1.0, 2.0 }
, { 3.0, 4.0, 1.0 } };
// Computing the rowwise softmax of A (sum(B) == 3)
// ( 0.0900306 0.244728 0.665241 )
// ( 0.843795 0.0420101 0.114195 )
// ( 0.259496 0.705385 0.035119 )
B = softmax<rowwise>( A );
// Computing the columnwise softmax of A (sum(C) == 3)
// ( 0.035119 0.114195 0.665241 )
// ( 0.705385 0.0420101 0.244728 )
// ( 0.259496 0.843795 0.0900306 )
C = softmax<columnwise>( A );

◆ solve() [1/3]

template<typename MT , bool SO, typename VT1 , bool TF1, typename VT2 , bool TF2>
void blaze::solve ( const DenseMatrix< MT, SO > &  A,
DenseVector< VT1, TF1 > &  x,
const DenseVector< VT2, TF2 > &  b 
)

Solving the given $ N \times N $ linear system of equations ( $ A*x=b $).

Parameters
AThe NxN dense system matrix.
xThe dense solution vector.
bThe N-dimensional dense right-hand side vector.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square system matrix provided.
std::invalid_argumentInvalid right-hand side vector provided.
std::runtime_errorSolving LSE with singular system matrix failed.

This function computes a solution for the given linear system of equations $ A*x=b $, where A is the given system matrix, x is the solution vector, and b is the given right-hand side vector.

blaze::DynamicMatrix<double> A; // The square general system matrix
blaze::DynamicVector<double> b; // The right-hand side vector
// ... Resizing and initialization
blaze::DynamicVector<double> x; // The solution vector
solve( A, x, b );
void solve(const DenseMatrix< MT, SO > &A, DenseVector< VT1, TF1 > &x, const DenseVector< VT2, TF2 > &b)
Solving the given linear system of equations ( ).
Definition: LSE.h:6343

The solve() function will automatically select the most suited direct solver algorithm depending on the size and type of the given system matrix. For small matrices of up to 6x6, both functions use manually optimized kernels for maximum performance. For matrices larger than 6x6 the computation is performed by means of the most suited LAPACK solver method.

In case the type of the matrix does not provide additional compile time information about its structure (symmetric, lower, upper, diagonal, ...), the information can be provided manually by means of declaration operations when calling the solve() function:

blaze::DynamicMatrix<double> A; // The square lower system matrix
blaze::DynamicVector<double> b; // The right-hand side vector
// ... Resizing and initialization
blaze::DynamicVector<double> x; // The solution vector
solve( declsym( A ), x, b ); // Solving the LSE with a symmetric system matrix
solve( declherm( A ), x, b ); // Solving the LSE with an Hermitian system matrix
solve( decllow( A ), x, b ); // Solving the LSE with a lower system matrix
solve( declunilow( A ), x, b ); // Solving the LSE with an unilower system matrix
solve( declupp( A ), x, b ); // Solving the LSE with an upper system matrix
solve( decluniupp( A ), x, b ); // Solving the LSE with an uniupper system matrix
solve( decldiag( A ), x, b ); // Solving the LSE with a diagonal system matrix

The function fails if ...

  • ... the given system matrix is not a square matrix;
  • ... the size of the right-hand side vector doesn't match the dimensions of the system matrix;
  • ... the given system matrix is singular.

In all failure cases an exception is thrown.

Note
This function can only be used for dense matrices and vector with float, double, complex<float> or complex<double> element type. The attempt to call the function with matrices and vectors 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 x may already have been modified.

◆ solve() [2/3]

template<typename MT1 , bool SO1, typename MT2 , bool SO2>
decltype(auto) blaze::solve ( const DenseMatrix< MT1, SO1 > &  A,
const DenseMatrix< MT2, SO2 > &  B 
)
inline

Solving the given $ N \times N $ linear system of equations ( $ A*X=B $).

Parameters
AThe NxN dense system matrix.
BThe NxRHS-dimensional dense right-hand side matrix.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square system matrix provided.
std::invalid_argumentInvalid right-hand side matrix provided.

This function returns an expression representing the solution of the given dense linear system of equations (LSE):

// ... Resizing and initialization
X = solve( A, B );

The solve() function will automatically select the most suited direct solver algorithm depending on the size and type of the given system matrix. For small matrices of up to 6x6, both functions use manually optimized kernels for maximum performance. For matrices larger than 6x6 the computation is performed by means of the most suited LAPACK solver method.

In case the type of the matrix does not provide additional compile time information about its structure (symmetric, lower, upper, diagonal, ...), the information can be provided manually by means of declaration operations when calling the solve() function:

blaze::DynamicMatrix<double> A; // The square lower system matrix
blaze::DynamicMatrix<double> B; // The right-hand side matrix
// ... Resizing and initialization
blaze::DynamicMatrix<double> X; // The solution matrix
X = solve( declsym( A ), B ); // Solving the LSE with a symmetric system matrix
X = solve( declherm( A ), B ); // Solving the LSE with an Hermitian system matrix
X = solve( decllow( A ), B ); // Solving the LSE with a lower system matrix
X = solve( declunilow( A ), B ); // Solving the LSE with an unilower system matrix
X = solve( declupp( A ), B ); // Solving the LSE with an upper system matrix
X = solve( decluniupp( A ), B ); // Solving the LSE with an uniupper system matrix
X = solve( decldiag( A ), B ); // Solving the LSE with a diagonal system matrix

The function fails if ...

  • ... the given system matrix is not a square matrix;
  • ... the number of rows of the right-hand side matrix doesn't match the dimensions of the system matrix.

In all failure cases an exception is thrown.

Note
The solve() function 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.
It is not possible to use any kind of view on the expression object returned by the solve() function. Also, it is not possible to access individual elements via the function call operator on the expression object:
rows( solve( A, B ), { 2UL, 4UL } ); // Compilation error: Views cannot be used on an solve() expression!
solve( A, B )(1,2); // Compilation error: It is not possible to access individual elements!

◆ solve() [3/3]

template<typename MT1 , bool SO1, typename MT2 , bool SO2, typename MT3 , bool SO3>
void blaze::solve ( const DenseMatrix< MT1, SO1 > &  A,
DenseMatrix< MT2, SO2 > &  X,
const DenseMatrix< MT3, SO3 > &  B 
)

Solving the given $ N \times N $ linear system of equations ( $ A*X=B $).

Parameters
AThe NxN dense system matrix.
XThe dense solution matrix.
BThe N-dimensional dense right-hand side matrix.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square system matrix provided.
std::invalid_argumentInvalid right-hand side matrix provided.
std::runtime_errorSolving LSE with singular system matrix failed.

This function computes a solution for the given linear system of equations $ A*X=B $, where A is the given system matrix, the columns of X are the solution vectors, and the columns of B are the given right-hand side vectors.

blaze::DynamicMatrix<double> A; // The square general system matrix
blaze::DynamicMatrix<double> B; // The right-hand side matrix
// ... Resizing and initialization
blaze::DynamicMatrix<double> X; // The solution matrix
solve( A, X, B );

The solve() function will automatically select the most suited direct solver algorithm depending on the size and type of the given system matrix. For small matrices of up to 6x6, both functions use manually optimized kernels for maximum performance. For matrices larger than 6x6 the computation is performed by means of the most suited LAPACK solver method.

In case the type of the matrix does not provide additional compile time information about its structure (symmetric, lower, upper, diagonal, ...), the information can be provided manually by means of declaration operations when calling the solve() function:

blaze::DynamicMatrix<double> A; // The square lower system matrix
blaze::DynamicMatrix<double> B; // The right-hand side matrix
// ... Resizing and initialization
blaze::DynamicMatrix<double> X; // The solution matrix
solve( declsym( A ), X, B ); // Solving the LSE with a symmetric system matrix
solve( declherm( A ), X, B ); // Solving the LSE with an Hermitian system matrix
solve( decllow( A ), X, B ); // Solving the LSE with a lower system matrix
solve( declunilow( A ), X, B ); // Solving the LSE with an unilower system matrix
solve( declupp( A ), X, B ); // Solving the LSE with an upper system matrix
solve( decluniupp( A ), X, B ); // Solving the LSE with an uniupper system matrix
solve( decldiag( A ), X, B ); // Solving the LSE with a diagonal system matrix

The function fails if ...

  • ... the given system matrix is not a square matrix;
  • ... the number of rows of the right-hand side matrix doesn't match the dimensions of the system matrix;
  • ... the given system matrix is singular.

In all failure cases an exception is thrown.

Note
The solve() function 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 X may already have been modified.

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

◆ sqrNorm()

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

Computes the squared L2 norm for the given dense matrix.

Parameters
dmThe given dense matrix for the norm computation.
Returns
The squared L2 norm of the given dense matrix.

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

// ... Resizing and initialization
const double l2 = sqrNorm( A );
decltype(auto) sqrNorm(const DenseMatrix< MT, SO > &dm)
Computes the squared L2 norm for the given dense matrix.
Definition: DMatNormExpr.h:599

◆ sqrt()

template<typename MT , bool SO>
decltype(auto) blaze::sqrt ( const 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!

◆ stddev() [1/2]

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

Computes the standard deviation for the given dense matrix.

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

This function computes the standard deviation for the given dense matrix dm. Example:

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

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

◆ stddev() [2/2]

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

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

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

This function computes the row-/columnwise standard deviation for the given dense matrix dm. In case RF is set to rowwise, the function returns a column vector containing the standard deviation of each row of dm. In case RF is set to columnwise, the function returns a row vector containing the standard deviation of each column of dm. Example:

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

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

◆ sum() [1/2]

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

Reduces the given dense matrix by means of addition.

Parameters
dmThe given dense matrix for the reduction operation.
Returns
The result of the reduction operation.

This function reduces the given dense matrix dm by means of addition:

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

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

◆ sum() [2/2]

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

Reduces the given dense matrix by means of addition.

Parameters
dmThe given dense matrix for the reduction operation.
Returns
The result of the reduction operation.

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

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

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

◆ 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 );
void svd(const DenseMatrix< MT, SO > &A, DenseVector< VT, TF > &s)
Singular value decomposition (SVD) of the given dense general matrix.
Definition: SVD.h:135
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 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() [3/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,
bool  square 
)
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.
squareDefaults to False. If True, will make sure U and V are square matrices.
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() [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 );
decltype(auto) tan(const DenseMatrix< MT, SO > &dm)
Computes the tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2277

◆ tanh()

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

◆ transIf()

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

Conditional calculation of the transpose of the given dense matrix.

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

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

◆ var() [1/2]

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

Computes the variance for the given dense matrix.

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

This function computes the variance for the given dense matrix dm. Example:

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

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

◆ var() [2/2]

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

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

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

This function computes the row-/column-wise variance for the given dense matrix dm. In case RF is set to rowwise, the function returns a column vector containing the variance of each row of dm. In case RF is set to columnwise, the function returns a row vector containing the variance of each column of dm. Example:

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

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