Blaze 3.9
Modules | Classes | Functions
Dense Vectors

Modules

 CustomVector
 
 DynamicVector
 
 HybridVector
 
 InitializerVector
 
 StaticVector
 
 UniformVector
 
 Expressions
 

Classes

class  blaze::DenseVector< VT, TF >
 Base class for N-dimensional dense vectors. More...
 

Functions

template<typename MT , typename VT >
decltype(auto) blaze::operator* (const DenseMatrix< MT, false > &mat, const DenseVector< VT, false > &vec)
 Multiplication operator for the multiplication of a row-major dense matrix and a dense vector ( $ \vec{y}=A*\vec{x} $). More...
 
template<typename MT , bool SO, typename VT , bool TF>
decltype(auto) blaze::solve (const DenseMatrix< MT, SO > &A, const DenseVector< VT, TF > &b)
 Solving the given $ N \times N $ linear system of equations ( $ A*x=b $). More...
 
template<typename MT , bool SO>
decltype(auto) blaze::eigen (const DenseMatrix< MT, SO > &dm)
 Calculation of the eigenvalues of the given dense matrix. More...
 
template<typename MT , bool SO>
decltype(auto) blaze::svd (const DenseMatrix< MT, SO > &dm)
 Calculation of the singular values of the given dense matrix. More...
 
template<typename MT , typename VT >
decltype(auto) blaze::operator* (const DenseMatrix< MT, false > &mat, const SparseVector< VT, false > &vec)
 Multiplication operator for the multiplication of a row-major dense matrix and a sparse vector ( $ \vec{y}=A*\vec{x} $). More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator+ (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Addition operator for the addition of two dense vectors ( $ \vec{a}=\vec{b}+\vec{c} $). More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator% (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Operator for the cross product of two dense vectors ( $ \vec{a}=\vec{b} \times \vec{c} $). More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator/ (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Division operator for the componentwise quotient of two dense vectors ( $ \vec{a}=\vec{b}/\vec{c} $). More...
 
template<typename VT1 , bool TF1, typename VT2 , bool TF2>
bool blaze::operator== (const DenseVector< VT1, TF1 > &lhs, const DenseVector< VT2, TF2 > &rhs)
 Equality operator for the comparison of two dense vectors. More...
 
template<typename VT1 , bool TF1, typename VT2 , bool TF2>
bool blaze::operator!= (const DenseVector< VT1, TF1 > &lhs, const DenseVector< VT2, TF2 > &rhs)
 Inequality operator for the comparison of two dense vectors. More...
 
template<typename VT1 , typename VT2 >
decltype(auto) blaze::operator* (const DenseVector< VT1, true > &lhs, const DenseVector< VT2, false > &rhs)
 Multiplication operator for the scalar product (inner product) of two dense vectors ( $ s=\vec{a}*\vec{b} $). More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::kron (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Computes the Kronecker product of two dense vectors ( $ a=b \otimes c $). More...
 
template<typename VT1 , typename VT2 , bool TF, typename OP >
decltype(auto) blaze::map (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs, OP op)
 Elementwise evaluation of the given binary operation on each single element of the dense vectors lhs and rhs. More...
 
template<typename VT1 , typename VT2 , typename VT3 , bool TF, typename OP >
decltype(auto) blaze::map (const DenseVector< VT1, TF > &dv1, const DenseVector< VT2, TF > &dv2, const DenseVector< VT3, TF > &dv3, OP op)
 Elementwise evaluation of the given ternary operation on each single element of the dense vectors dv1, dv2, and dv3. More...
 
template<typename VT1 , typename VT2 , typename VT3 , typename VT4 , bool TF, typename OP >
decltype(auto) blaze::map (const DenseVector< VT1, TF > &dv1, const DenseVector< VT2, TF > &dv2, const DenseVector< VT3, TF > &dv3, const DenseVector< VT4, TF > &dv4, OP op)
 Elementwise evaluation of the given 4-ary operation on each single element of the dense vectors dv1, dv2, dv3, and dv4. More...
 
template<typename VT1 , typename VT2 , typename VT3 , typename VT4 , typename VT5 , bool TF, typename OP >
decltype(auto) blaze::map (const DenseVector< VT1, TF > &dv1, const DenseVector< VT2, TF > &dv2, const DenseVector< VT3, TF > &dv3, const DenseVector< VT4, TF > &dv4, const DenseVector< VT5, TF > &dv5, OP op)
 Elementwise evaluation of the given 5-ary operation on each single element of the dense vectors dv1, dv2, dv3, dv4, and dv5. More...
 
template<typename VT1 , typename VT2 , typename VT3 , typename VT4 , typename VT5 , typename VT6 , bool TF, typename OP >
decltype(auto) blaze::map (const DenseVector< VT1, TF > &dv1, const DenseVector< VT2, TF > &dv2, const DenseVector< VT3, TF > &dv3, const DenseVector< VT4, TF > &dv4, const DenseVector< VT5, TF > &dv5, const DenseVector< VT6, TF > &dv6, OP op)
 Elementwise evaluation of the given 6-ary operation on each single element of the dense vectors dv1, dv2, dv3, dv4, dv5, and dv6. More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::min (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Computes the componentwise minimum of the dense vectors lhs and rhs. More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::max (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Computes the componentwise maximum of the dense vectors lhs and rhs. More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::hypot (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Computes the componentwise hypotenous for the dense vectors lhs and rhs. More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::pow (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Computes the componentwise exponential value for the dense vectors lhs and rhs. More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::atan2 (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Computes the multi-valued inverse tangent of the dense vectors lhs and rhs. More...
 
template<typename VT1 , typename VT2 , typename VT3 , bool TF>
decltype(auto) blaze::select (const DenseVector< VT1, TF > &cond, const DenseVector< VT2, TF > &lhs, const DenseVector< VT3, TF > &rhs)
 Elementwise conditional selection of values from the dense vectors lhs and rhs. More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator<< (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Left-shift operator for the elementwise left-shift of a dense vector. More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator>> (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Right-shift operator for the elementwise right-shift of a dense vector. More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator& (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Bitwise AND operator for two dense vectors. More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator| (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Bitwise OR operator for two dense vectors. More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator^ (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Bitwise XOR operator for two dense vectors. More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator&& (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Logical AND operator for two dense vectors. More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator|| (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Logical OR operator for two dense vectors. More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator* (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Multiplication operator for the componentwise product of two dense vectors ( $ \vec{a}=\vec{b}*\vec{c} $). More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator- (const DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Subtraction operator for the subtraction of two dense vectors ( $ \vec{a}=\vec{b}-\vec{c} $). More...
 
template<typename VT , bool TF>
decltype(auto) blaze::eval (const DenseVector< VT, TF > &dv)
 Forces the evaluation of the given dense vector expression dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::expand (const DenseVector< VT, TF > &dv, size_t expansion)
 Expansion of the given dense vector. More...
 
template<size_t E, typename VT , bool TF>
decltype(auto) blaze::expand (const DenseVector< VT, TF > &dv)
 Expansion of the given dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::fix (DenseVector< VT, TF > &dv) noexcept
 Fixing the size of the given dense vector. More...
 
template<bool TF = defaultTransposeFlag, typename OP >
decltype(auto) blaze::generate (size_t size, OP op)
 Generates a new dense vector filled via the given custom unary operation. More...
 
template<bool TF = defaultTransposeFlag, typename T >
decltype(auto) blaze::linspace (size_t size, T start, T end)
 Generates a new dense vector filled with linearly spaced elements. More...
 
template<bool TF = defaultTransposeFlag, typename T >
decltype(auto) blaze::logspace (size_t size, T start, T end)
 Generates a new dense vector filled with logarithmically spaced elements. More...
 
template<typename VT , bool TF, typename OP >
decltype(auto) blaze::map (const DenseVector< VT, TF > &dv, OP op)
 Evaluates the given custom operation on each single element of the dense vector dv. More...
 
template<typename VT , bool TF, typename OP >
decltype(auto) blaze::forEach (const DenseVector< VT, TF > &dv, OP op)
 Evaluates the given custom operation on each single element of the dense vector dv. More...
 
template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::min (const DenseVector< VT, TF > &dv, ST scalar)
 Computes the componentwise minimum of a dense vector dv and a scalar. More...
 
template<typename ST , typename VT , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::min (ST scalar, const DenseVector< VT, TF > &dv)
 Computes the componentwise minimum of a scalar and a dense vector dv. More...
 
template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::max (const DenseVector< VT, TF > &dv, ST scalar)
 Computes the componentwise maximum of a dense vector dv and a scalar. More...
 
template<typename ST , typename VT , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::max (ST scalar, const DenseVector< VT, TF > &dv)
 Computes the componentwise maximum of a scalar and a dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::abs (const DenseVector< VT, TF > &dv)
 Applies the abs() function to each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::sign (const DenseVector< VT, TF > &dv)
 Applies the sign() function to each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::floor (const DenseVector< VT, TF > &dv)
 Applies the floor() function to each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::ceil (const DenseVector< VT, TF > &dv)
 Applies the ceil() function to each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::trunc (const DenseVector< VT, TF > &dv)
 Applies the trunc() function to each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::round (const DenseVector< VT, TF > &dv)
 Applies the round() function to each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::conj (const DenseVector< VT, TF > &dv)
 Returns a vector containing the complex conjugate of each single element of dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::ctrans (const DenseVector< VT, TF > &dv)
 Returns the conjugate transpose vector of dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::real (const DenseVector< VT, TF > &dv)
 Returns a vector containing the real part of each single element of dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::imag (const DenseVector< VT, TF > &dv)
 Returns a vector containing the imaginary part of each single element of dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::arg (const DenseVector< VT, TF > &dv)
 Returns a vector containing the phase angle of each single element of dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::sqrt (const DenseVector< VT, TF > &dv)
 Computes the square root of each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::invsqrt (const DenseVector< VT, TF > &dv)
 Computes the inverse square root of each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::cbrt (const DenseVector< VT, TF > &dv)
 Computes the cubic root of each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::invcbrt (const DenseVector< VT, TF > &dv)
 Computes the inverse cubic root of each single element of the dense vector dv. More...
 
template<typename VT , bool TF, typename DT >
decltype(auto) blaze::clamp (const DenseVector< VT, TF > &dv, const DT &min, const DT &max)
 Restricts each single element of the dense vector dv to the range $[min..max]$. More...
 
template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::pow (const DenseVector< VT, TF > &dv, ST exp)
 Computes the exponential value for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::exp (const DenseVector< VT, TF > &dv)
 Computes $ e^x $ for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::exp2 (const DenseVector< VT, TF > &dv)
 Computes $ 2^x $ for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::exp10 (const DenseVector< VT, TF > &dv)
 Computes $ 10^x $ for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::log (const DenseVector< VT, TF > &dv)
 Computes the natural logarithm for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::log2 (const DenseVector< VT, TF > &dv)
 Computes the binary logarithm for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::log10 (const DenseVector< VT, TF > &dv)
 Computes the common logarithm for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::log1p (const DenseVector< VT, TF > &dv)
 Computes the natural logarithm of x+1 for each single element of the dense vector dv. More...
 
template<typename VT , bool SO>
decltype(auto) blaze::lgamma (const DenseVector< VT, SO > &dv)
 Computes the natural logarithm of the absolute value of the gamma function for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::sin (const DenseVector< VT, TF > &dv)
 Computes the sine for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::asin (const DenseVector< VT, TF > &dv)
 Computes the inverse sine for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::sinh (const DenseVector< VT, TF > &dv)
 Computes the hyperbolic sine for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::asinh (const DenseVector< VT, TF > &dv)
 Computes the inverse hyperbolic sine for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::cos (const DenseVector< VT, TF > &dv)
 Computes the cosine for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::acos (const DenseVector< VT, TF > &dv)
 Computes the inverse cosine for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::cosh (const DenseVector< VT, TF > &dv)
 Computes the hyperbolic cosine for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::acosh (const DenseVector< VT, TF > &dv)
 Computes the inverse hyperbolic cosine for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::tan (const DenseVector< VT, TF > &dv)
 Computes the tangent for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::atan (const DenseVector< VT, TF > &dv)
 Computes the inverse tangent for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::tanh (const DenseVector< VT, TF > &dv)
 Computes the hyperbolic tangent for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::atanh (const DenseVector< VT, TF > &dv)
 Computes the inverse hyperbolic tangent for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::erf (const DenseVector< VT, TF > &dv)
 Computes the error function for each single element of the dense vector dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::erfc (const DenseVector< VT, TF > &dv)
 Computes the complementary error function for each single element of the dense vector dv. More...
 
template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator+ (const DenseVector< VT, TF > &vec, ST scalar)
 Addition operator for the addition of a dense vector and a scalar value ( $ \vec{a}=\vec{b}+s $). More...
 
template<typename ST , typename VT , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator+ (ST scalar, const DenseVector< VT, TF > &vec)
 Addition operator for the addition of a scalar value and a dense vector ( $ \vec{a}=s+\vec{b} $). More...
 
template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator- (const DenseVector< VT, TF > &vec, ST scalar)
 Subtraction operator for the subtraction of a dense vector and a scalar value ( $ \vec{a}=\vec{b}-s $). More...
 
template<typename ST , typename VT , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator- (ST scalar, const DenseVector< VT, TF > &vec)
 Subtraction operator for the subtraction of a scalar value and a dense vector ( $ \vec{a}=s-\vec{b} $). More...
 
template<typename ST , typename VT , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator/ (ST scalar, const DenseVector< VT, TF > &vec)
 Division operator for the division of a scalar value and a dense vector ( $ \vec{a}=s/\vec{b} $). More...
 
template<typename VT , bool TF>
decltype(auto) blaze::operator<< (const DenseVector< VT, TF > &vec, int count)
 Left-shift operator for the uniform left-shift of a dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::operator>> (const DenseVector< VT, TF > &vec, int count)
 Right-shift operator for the uniform right-shift of a dense vector. More...
 
template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator& (const DenseVector< VT, TF > &vec, ST scalar)
 Bitwise AND operator for the bitwise AND of a dense vector and a scalar value. More...
 
template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator| (const DenseVector< VT, TF > &vec, ST scalar)
 Bitwise OR operator for the bitwise OR of a dense vector and a scalar value. More...
 
template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator^ (const DenseVector< VT, TF > &vec, ST scalar)
 Bitwise XOR operator for the bitwise XOR of a dense vector and a scalar value. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::operator! (const DenseVector< VT, TF > &vec)
 Logical NOT operator for the logical NOT of a dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::mean (const DenseVector< VT, TF > &dv)
 Computes the (arithmetic) mean for the given dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::noalias (const DenseVector< VT, TF > &dv)
 Forces the non-aliased evaluation of the given dense vector expression dv. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::norm (const DenseVector< VT, TF > &dv)
 Computes the L2 norm for the given dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::sqrNorm (const DenseVector< VT, TF > &dv)
 Computes the squared L2 norm for the given dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::l1Norm (const DenseVector< VT, TF > &dv)
 Computes the L1 norm for the given dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::l2Norm (const DenseVector< VT, TF > &dv)
 Computes the L2 norm for the given dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::l3Norm (const DenseVector< VT, TF > &dv)
 Computes the L3 norm for the given dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::l4Norm (const DenseVector< VT, TF > &dv)
 Computes the L4 norm for the given dense vector. More...
 
template<typename VT , bool TF, typename ST >
decltype(auto) blaze::lpNorm (const DenseVector< VT, TF > &dv, ST p)
 Computes the Lp norm for the given dense vector. More...
 
template<size_t P, typename VT , bool TF>
decltype(auto) blaze::lpNorm (const DenseVector< VT, TF > &dv)
 Computes the Lp norm for the given dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::linfNorm (const DenseVector< VT, TF > &dv)
 Computes the infinity norm for the given dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::maxNorm (const DenseVector< VT, TF > &dv)
 Computes the maximum norm for the given dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::minNorm (const DenseVector< VT, TF > &dv)
 Computes the minimum norm for the given dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::sqrLength (const DenseVector< VT, TF > &dv)
 Calculation of the square length (magnitude) of the dense vector $|\vec{a}|^2$. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::length (const DenseVector< VT, TF > &dv)
 Calculation of the length (magnitude) of the dense vector $|\vec{a}|$. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::nosimd (const DenseVector< VT, TF > &dv)
 Disables the SIMD evaluation of the given dense vector expression dv. More...
 
template<typename VT , bool TF, typename OP >
decltype(auto) blaze::reduce (const DenseVector< VT, TF > &dv, OP op)
 Performs a custom reduction operation on the given dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::sum (const DenseVector< VT, TF > &dv)
 Reduces the given dense vector by means of addition. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::prod (const DenseVector< VT, TF > &dv)
 Reduces the given dense vector by means of multiplication. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::min (const DenseVector< VT, TF > &dv)
 Returns the smallest element of the dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::max (const DenseVector< VT, TF > &dv)
 Returns the largest element of the dense vector. More...
 
template<typename VT , bool TF>
size_t blaze::argmin (const DenseVector< VT, TF > &dv)
 Returns the index of the first smallest element of the dense vector. More...
 
template<typename VT , bool TF>
size_t blaze::argmax (const DenseVector< VT, TF > &dv)
 Returns the index of the first largest element of the dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::repeat (const DenseVector< VT, TF > &dv, size_t repetitions)
 Repeats the given dense vector. More...
 
template<size_t R0, typename VT , bool TF>
decltype(auto) blaze::repeat (const DenseVector< VT, TF > &dv)
 Repeats the given dense vector. More...
 
template<typename VT , typename ST , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator/ (const DenseVector< VT, TF > &vec, ST scalar)
 Division operator for the divison of a dense vector by a scalar value ( $ \vec{a}=\vec{b}/s $). More...
 
template<typename VT , bool TF>
decltype(auto) blaze::operator- (const DenseVector< VT, TF > &dv)
 Unary minus operator for the negation of a dense vector ( $ \vec{a} = -\vec{b} $). More...
 
template<typename VT , typename ST , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator* (const DenseVector< VT, TF > &vec, ST scalar)
 Multiplication operator for the multiplication of a dense vector and a scalar value ( $ \vec{a}=\vec{b}*s $). More...
 
template<typename ST , typename VT , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator* (ST scalar, const DenseVector< VT, TF > &vec)
 Multiplication operator for the multiplication of a scalar value and a dense vector ( $ \vec{a}=s*\vec{b} $). More...
 
template<typename VT , bool TF>
decltype(auto) blaze::serial (const DenseVector< VT, TF > &dv)
 Forces the serial evaluation of the given dense vector expression dv. More...
 
template<typename VT , bool TF>
auto blaze::softmax (const DenseVector< VT, TF > &dv)
 Computes the softmax function for the given dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::stddev (const DenseVector< VT, TF > &dv)
 Computes the standard deviation for the given dense vector. More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator+ (const DenseVector< VT1, TF > &lhs, const SparseVector< VT2, TF > &rhs)
 Addition operator for the addition of a dense vector and a sparse vector ( $ \vec{a}=\vec{b}+\vec{c} $). More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator+ (const SparseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Addition operator for the addition of a sparse vector and a dense vector ( $ \vec{a}=\vec{b}+\vec{c} $). More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator% (const DenseVector< VT1, TF > &lhs, const SparseVector< VT2, TF > &rhs)
 Operator for the cross product of a dense vector and a sparse vector ( $ \vec{a}=\vec{b} \times \vec{c} $). More...
 
template<typename VT1 , bool TF1, typename VT2 , bool TF2>
bool blaze::operator== (const DenseVector< VT1, TF1 > &lhs, const SparseVector< VT2, TF2 > &rhs)
 Equality operator for the comparison of a dense vector and a sparse vector. More...
 
template<typename VT1 , bool TF1, typename VT2 , bool TF2>
bool blaze::operator== (const SparseVector< VT1, TF1 > &lhs, const DenseVector< VT2, TF2 > &rhs)
 Equality operator for the comparison of a sparse vector and a dense vector. More...
 
template<typename VT1 , bool TF1, typename VT2 , bool TF2>
bool blaze::operator!= (const DenseVector< VT1, TF1 > &lhs, const SparseVector< VT2, TF2 > &rhs)
 Inequality operator for the comparison of a dense vector and a sparse vector. More...
 
template<typename VT1 , bool TF1, typename VT2 , bool TF2>
bool blaze::operator!= (const SparseVector< VT1, TF1 > &lhs, const DenseVector< VT2, TF2 > &rhs)
 Inequality operator for the comparison of a sparse vector and a dense vector. More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator- (const DenseVector< VT1, TF > &lhs, const SparseVector< VT2, TF > &rhs)
 Subtraction operator for the subtraction of a dense vector and a sparse vector ( $ \vec{a}=\vec{b}-\vec{c} $). More...
 
template<typename VT , bool TF>
decltype(auto) blaze::trans (const DenseVector< VT, TF > &dv)
 Calculation of the transpose of the given dense vector. More...
 
template<bool TTF, typename VT , bool TF>
decltype(auto) blaze::transTo (const DenseVector< VT, TF > &dv)
 Conditional calculation of the transpose of the given dense vector. More...
 
template<typename VT , bool TF>
decltype(auto) blaze::var (const DenseVector< VT, TF > &dv)
 Computes the variance for the given dense vector. More...
 
template<typename MT , typename VT >
decltype(auto) blaze::operator* (const SparseMatrix< MT, false > &mat, const DenseVector< VT, false > &vec)
 Multiplication operator for the multiplication of a row-major sparse matrix and a dense vector ( $ \vec{y}=A*\vec{x} $). More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator% (const SparseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Operator for the cross product of a sparse vector and a dense vector ( $ \vec{a}=\vec{b} \times \vec{c} $). More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator- (const SparseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Subtraction operator for the subtraction of a sparse vector and a dense vector ( $ \vec{a}=\vec{b}-\vec{c} $). More...
 
template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator% (const SparseVector< VT1, TF > &lhs, const SparseVector< VT2, TF > &rhs)
 Operator for the cross product of two sparse vectors ( $ \vec{a}=\vec{b} \times \vec{c} $). More...
 
template<typename MT , typename VT >
decltype(auto) blaze::operator* (const DenseMatrix< MT, true > &mat, const DenseVector< VT, false > &vec)
 Multiplication operator for the multiplication of a column-major dense matrix and a dense vector ( $ \vec{y}=A*\vec{x} $). More...
 
template<typename MT , typename VT >
decltype(auto) blaze::operator* (const DenseMatrix< MT, true > &mat, const SparseVector< VT, false > &vec)
 Multiplication operator for the multiplication of a column-major dense matrix and a sparse vector ( $ \vec{y}=A*\vec{x} $). More...
 
template<typename VT , typename MT >
decltype(auto) blaze::operator* (const DenseVector< VT, true > &vec, const DenseMatrix< MT, false > &mat)
 Multiplication operator for the multiplication of a transpose dense vector and a row-major dense matrix ( $ \vec{y}^T=\vec{x}^T*A $). More...
 
template<typename VT , typename MT >
decltype(auto) blaze::operator* (const DenseVector< VT, true > &vec, const SparseMatrix< MT, false > &mat)
 Multiplication operator for the multiplication of a transpose dense vector and a row-major sparse matrix ( $ \vec{y}^T=\vec{x}^T*A $). More...
 
template<typename VT , typename MT >
decltype(auto) blaze::operator* (const DenseVector< VT, true > &vec, const SparseMatrix< MT, true > &mat)
 Multiplication operator for the multiplication of a transpose dense vector and a column-major sparse matrix ( $ \vec{y}^T=\vec{x}^T*A $). More...
 
template<typename MT , typename VT >
decltype(auto) blaze::operator* (const SparseMatrix< MT, true > &mat, const DenseVector< VT, false > &vec)
 Multiplication operator for the multiplication of a column-major sparse matrix and a dense vector ( $ \vec{y}=A*\vec{x} $). More...
 
template<typename VT , typename MT >
decltype(auto) blaze::operator* (const SparseVector< VT, true > &vec, const DenseMatrix< MT, true > &mat)
 Multiplication operator for the multiplication of a transpose sparse vector and a column-major dense matrix ( $ \vec{y}^T=\vec{x}^T*A $). More...
 

DenseVector operators

template<typename T1 , typename T2 , bool TF>
auto blaze::operator== (const DenseVector< T1, TF > &vec, T2 scalar) -> EnableIf_t< IsScalar_v< T2 >, bool >
 Equality operator for the comparison of a dense vector and a scalar value. More...
 
template<typename T1 , typename T2 , bool TF>
auto blaze::operator== (T1 scalar, const DenseVector< T2, TF > &vec) -> EnableIf_t< IsScalar_v< T1 >, bool >
 Equality operator for the comparison of a scalar value and a dense vector. More...
 
template<typename T1 , typename T2 , bool TF>
auto blaze::operator!= (const DenseVector< T1, TF > &vec, T2 scalar) -> EnableIf_t< IsScalar_v< T2 >, bool >
 Inequality operator for the comparison of a dense vector and a scalar value. More...
 
template<typename T1 , typename T2 , bool TF>
auto blaze::operator!= (T1 scalar, const DenseVector< T2, TF > &vec) -> EnableIf_t< IsScalar_v< T1 >, bool >
 Inequality operator for the comparison of a scalar value and a dense vector. More...
 
template<typename VT , bool TF, typename ST >
auto blaze::operator+= (DenseVector< VT, TF > &vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
 Addition assignment operator for the addition of a dense vector and a scalar value ( $ \vec{a}+=s $). More...
 
template<typename VT , bool TF, typename ST >
auto blaze::operator+= (DenseVector< VT, TF > &&vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
 Addition assignment operator for the addition of a temporary dense vector and a scalar value ( $ \vec{v}+=s $). More...
 
template<typename VT , bool TF, typename ST >
auto blaze::operator-= (DenseVector< VT, TF > &vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
 Subtraction assignment operator for the subtraction of a dense vector and a scalar value ( $ \vec{a}-=s $). More...
 
template<typename VT , bool TF, typename ST >
auto blaze::operator-= (DenseVector< VT, TF > &&vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
 Subtraction assignment operator for the subtraction of a temporary dense vector and a scalar value ( $ \vec{v}-=s $). More...
 
template<typename VT , bool TF, typename ST >
auto blaze::operator*= (DenseVector< VT, TF > &vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
 Multiplication assignment operator for the multiplication of a dense vector and a scalar value ( $ \vec{a}*=s $). More...
 
template<typename VT , bool TF, typename ST >
auto blaze::operator*= (DenseVector< VT, TF > &&vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
 Multiplication assignment operator for the multiplication of a temporary dense vector and a scalar value ( $ \vec{v}*=s $). More...
 
template<typename VT , bool TF, typename ST >
auto blaze::operator/= (DenseVector< VT, TF > &vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
 Division assignment operator for the division of a dense vector by a scalar value ( $ \vec{a}/=s $). More...
 
template<typename VT , bool TF, typename ST >
auto blaze::operator/= (DenseVector< VT, TF > &&vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
 Division assignment operator for the division of a temporary dense vector by a scalar value ( $ \vec{a}/=s $). More...
 
template<typename VT , bool TF>
VT & blaze::operator<<= (DenseVector< VT, TF > &vec, int count)
 Left-shift assignment operator for the uniform left-shift of a dense vector. More...
 
template<typename VT , bool TF>
VT & blaze::operator<<= (DenseVector< VT, TF > &&vec, int count)
 Left-shift assignment operator for the uniform shift of a temporary dense vector. More...
 
template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator<<= (DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Left-shift assignment operator for the elementwise left-shift of a dense vector. More...
 
template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator<<= (DenseVector< VT1, TF > &&lhs, const DenseVector< VT2, TF > &rhs)
 Left-shift assignment operator for the elementwise left-shift of a temporary dense vector. More...
 
template<typename VT , bool TF>
VT & blaze::operator>>= (DenseVector< VT, TF > &vec, int count)
 Right-shift assignment operator for the uniform right-shift of a dense vector. More...
 
template<typename VT , bool TF>
VT & blaze::operator>>= (DenseVector< VT, TF > &&vec, int count)
 Right-shift assignment operator for the uniform shift of a temporary dense vector. More...
 
template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator>>= (DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Right-shift assignment operator for the elementwise right-shift of a dense vector. More...
 
template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator>>= (DenseVector< VT1, TF > &&lhs, const DenseVector< VT2, TF > &rhs)
 Right-shift assignment operator for the elementwise right-shift of a temporary dense. More...
 
template<typename VT , bool TF, typename ST >
auto blaze::operator&= (DenseVector< VT, TF > &vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
 Bitwise AND assignment operator for the bitwise AND of a dense vector and a scalar value. More...
 
template<typename VT , bool TF, typename ST >
auto blaze::operator&= (DenseVector< VT, TF > &&vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
 Bitwise AND assignment operator for the bitwise AND of a temporary dense vector and a scalar value. More...
 
template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator&= (DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Bitwise AND assignment operator for the bitwise AND of a dense vector. More...
 
template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator&= (DenseVector< VT1, TF > &&lhs, const DenseVector< VT2, TF > &rhs)
 Bitwise AND assignment operator for the bitwise AND of a temporary dense vector. More...
 
template<typename VT , bool TF, typename ST >
auto blaze::operator|= (DenseVector< VT, TF > &vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
 Bitwise OR assignment operator for the bitwise OR of a dense vector and a scalar value. More...
 
template<typename VT , bool TF, typename ST >
auto blaze::operator|= (DenseVector< VT, TF > &&vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
 Bitwise OR assignment operator for the bitwise OR of a temporary dense vector and a scalar value. More...
 
template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator|= (DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Bitwise OR assignment operator for the bitwise OR of a dense vector. More...
 
template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator|= (DenseVector< VT1, TF > &&lhs, const DenseVector< VT2, TF > &rhs)
 Bitwise OR assignment operator for the bitwise OR of a temporary dense vector. More...
 
template<typename VT , bool TF, typename ST >
auto blaze::operator^= (DenseVector< VT, TF > &vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
 Bitwise XOR assignment operator for the bitwise XOR of a dense vector and a scalar value. More...
 
template<typename VT , bool TF, typename ST >
auto blaze::operator^= (DenseVector< VT, TF > &&vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
 Bitwise XOR assignment operator for the bitwise XOR of a temporary dense vector and a scalar value. More...
 
template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator^= (DenseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs)
 Bitwise XOR assignment operator for the bitwise XOR of a dense vector. More...
 
template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator^= (DenseVector< VT1, TF > &&lhs, const DenseVector< VT2, TF > &rhs)
 Bitwise XOR assignment operator for the bitwise XOR of a temporary dense vector. More...
 

DenseVector functions

template<typename VT , bool TF>
bool blaze::isnan (const DenseVector< VT, TF > &dv)
 Checks the given dense vector for not-a-number elements. More...
 
template<typename VT , bool TF>
bool blaze::isinf (const DenseVector< VT, TF > &dv)
 Checks the given dense vector for infinite elements. More...
 
template<typename VT , bool TF>
bool blaze::isfinite (const DenseVector< VT, TF > &dv)
 Checks the given dense vector for finite elements. More...
 
template<typename VT , bool TF>
bool blaze::isDivisor (const DenseVector< VT, TF > &dv)
 Returns whether the given dense vector is a valid divisor. More...
 
template<RelaxationFlag RF, typename VT , bool TF>
bool blaze::isUniform (const DenseVector< VT, TF > &dv)
 Checks if the given dense vector is a uniform vector. More...
 
template<RelaxationFlag RF, typename VT , bool TF>
bool blaze::isZero (const DenseVector< VT, TF > &dv)
 Checks if the given dense vector is a zero vector. More...
 

DenseVector global functions

template<typename VT , bool TF>
BLAZE_ALWAYS_INLINE VT::ElementType * blaze::data (DenseVector< VT, TF > &dv) noexcept
 Low-level data access to the dense vector elements. More...
 
template<typename VT , bool TF>
BLAZE_ALWAYS_INLINE const VT::ElementType * blaze::data (const DenseVector< VT, TF > &dv) noexcept
 Low-level data access to the dense vector elements. More...
 

Detailed Description

Function Documentation

◆ abs()

template<typename VT , bool TF>
decltype(auto) blaze::abs ( const DenseVector< VT, TF > &  dv)
inline

Applies the abs() function to each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The resulting dense vector.

This function applies the abs() function to each element of the input vector dv. 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 an arbitrary sized vector.
Definition: DynamicVector.h:223
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 VT , bool TF>
decltype(auto) blaze::acos ( const DenseVector< VT, TF > &  dv)
inline

Computes the inverse cosine for each single element of the dense vector dv.

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

The acos() function computes the inverse cosine for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::acosh ( const DenseVector< VT, TF > &  dv)
inline

Computes the inverse hyperbolic cosine for each single element of the dense vector dv.

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

The acosh() function computes the inverse hyperbolic cosine for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::arg ( const DenseVector< VT, TF > &  dv)
inline

Returns a vector containing the phase angle of each single element of dv.

Parameters
dvThe input vector.
Returns
The phase angle of each single element of dv.

The arg() function calculates the phase angle of each element of the input vector dv. 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

◆ argmax()

template<typename VT , bool TF>
size_t blaze::argmax ( const DenseVector< VT, TF > &  dv)
inline

Returns the index of the first largest element of the dense vector.

Parameters
dvThe given dense vector.
Returns
The index of the first largest dense vector element.

This function returns the index of the first largest element of the given dense vector. This function can only be used for element types that support the smaller-than relationship. In case the given vector currently has a size of 0, the returned index is 0.

blaze::DynamicVector<int> a{ 1, -2, 3, 0 };
const size_t maxindex = argmax( a ); // Results in 2
size_t argmax(const DenseVector< VT, TF > &dv)
Returns the index of the first largest element of the dense vector.
Definition: DVecReduceExpr.h:584

◆ argmin()

template<typename VT , bool TF>
size_t blaze::argmin ( const DenseVector< VT, TF > &  dv)
inline

Returns the index of the first smallest element of the dense vector.

Parameters
dvThe given dense vector.
Returns
The index of the first smallest dense vector element.

This function returns the index of the first smallest element of the given dense vector. This function can only be used for element types that support the smaller-than relationship. In case the given vector currently has a size of 0, the returned index is 0.

blaze::DynamicVector<int> a{ 1, -2, 3, 0 };
const size_t minindex = argmin( a ); // Results in 1
size_t argmin(const DenseVector< VT, TF > &dv)
Returns the index of the first smallest element of the dense vector.
Definition: DVecReduceExpr.h:542

◆ asin()

template<typename VT , bool TF>
decltype(auto) blaze::asin ( const DenseVector< VT, TF > &  dv)
inline

Computes the inverse sine for each single element of the dense vector dv.

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

The asin() function computes the inverse sine for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::asinh ( const DenseVector< VT, TF > &  dv)
inline

Computes the inverse hyperbolic sine for each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The inverse hyperbolic sine of each single element of dv.

The asinh() function computes the inverse hyperbolic sine for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::atan ( const DenseVector< VT, TF > &  dv)
inline

Computes the inverse tangent for each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The inverse tangent of each single element of dv.

The atan() function computes the inverse tangent for each element of the input vector dv. 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 VT1 , typename VT2 , bool TF>
decltype(auto) blaze::atan2 ( const DenseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

Computes the multi-valued inverse tangent of the dense vectors lhs and rhs.

Parameters
lhsThe left-hand side dense vector operand.
rhsThe right-hand side dense vector operand.
Returns
The resulting dense vector.
Exceptions
std::invalid_argumentVector sizes do not match.

This function computes the multi-valued inverse tangent of the two dense vectors lhs and rhs. The function returns an expression representing this operation.
The following example demonstrates the use of the atan2() 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 sizes of the two given vectors don't match, a std::invalid_argument is thrown.

◆ atanh()

template<typename VT , bool TF>
decltype(auto) blaze::atanh ( const DenseVector< VT, TF > &  dv)
inline

Computes the inverse hyperbolic tangent for each single element of the dense vector dv.

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

The atanh() function computes the inverse hyperbolic tangent for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::cbrt ( const DenseVector< VT, TF > &  dv)
inline

Computes the cubic root of each single element of the dense vector dv.

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

The cbrt() function computes the cubic root of each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::ceil ( const DenseVector< VT, TF > &  dv)
inline

Applies the ceil() function to each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The resulting dense vector.

This function applies the ceil() function to each element of the input vector dv. 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 VT , bool TF, typename DT >
decltype(auto) blaze::clamp ( const DenseVector< VT, TF > &  dv,
const DT &  min,
const DT &  max 
)
inline

Restricts each single element of the dense vector dv to the range $[min..max]$.

Parameters
dvThe input vector.
minThe lower delimiter.
maxThe upper delimiter.
Returns
The vector with restricted elements.

The clamp() function restricts each element of the input vector dv 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 VT , bool TF>
decltype(auto) blaze::conj ( const DenseVector< VT, TF > &  dv)
inline

Returns a vector containing the complex conjugate of each single element of dv.

Parameters
dvThe input vector.
Returns
The complex conjugate of each single element of dv.

The conj() function calculates the complex conjugate of each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::cos ( const DenseVector< VT, TF > &  dv)
inline

Computes the cosine for each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The cosine of each single element of dv.

The cos() function computes the cosine for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::cosh ( const DenseVector< VT, TF > &  dv)
inline

Computes the hyperbolic cosine for each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The hyperbolic cosine of each single element of dv.

The cosh() function computes the hyperbolic cosine for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::ctrans ( const DenseVector< VT, TF > &  dv)
inline

Returns the conjugate transpose vector of dv.

Parameters
dvThe input vector.
Returns
The conjugate transpose of dv.

The ctrans() function returns an expression representing the conjugate transpose (also called adjoint matrix, Hermitian conjugate matrix or transjugate matrix) of the given input vector dv.
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 vector
b = conj( trans( a ) ); // Computing the conjugate transpose vector
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 VT , bool TF>
BLAZE_ALWAYS_INLINE const VT::ElementType * blaze::data ( const DenseVector< VT, TF > &  dv)
noexcept

Low-level data access to the dense vector elements.

Parameters
dvThe given dense vector.
Returns
Pointer to the internal element storage.

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

◆ data() [2/2]

template<typename VT , bool TF>
BLAZE_ALWAYS_INLINE VT::ElementType * blaze::data ( DenseVector< VT, TF > &  dv)
noexcept

Low-level data access to the dense vector elements.

Parameters
dvThe given dense vector.
Returns
Pointer to the internal element storage.

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

◆ eigen()

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

Calculation of the eigenvalues of the given dense matrix.

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

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

// ... Resizing and initialization
B = eigen( A );
Efficient implementation of a dynamic matrix.
Definition: DynamicMatrix.h:242
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
Note
The eigen() 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!
It is not possible to use any kind of view on the expression object returned by the eigen() function. Also, it is not possible to access individual elements via the subscript operator on the expression object:
subvector( eigen( A ), 2, 4 ); // Compilation error: Views cannot be used on an eigen() expression!
eigen( A )[1]; // Compilation error: It is not possible to access individual elements!
decltype(auto) subvector(Vector< VT, TF > &, RSAs...)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:158

◆ erf()

template<typename VT , bool TF>
decltype(auto) blaze::erf ( const DenseVector< VT, TF > &  dv)
inline

Computes the error function for each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The error function of each single element of dv.

The erf() function computes the error function for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::erfc ( const DenseVector< VT, TF > &  dv)
inline

Computes the complementary error function for each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The complementary error function of each single element of dv.

The erfc() function computes the complementary error function for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::eval ( const DenseVector< VT, TF > &  dv)
inline

Forces the evaluation of the given dense vector expression dv.

Parameters
dvThe input vector.
Returns
The evaluated dense vector.

The eval function forces the evaluation of the given dense vector expression dv. The function returns an expression representing this 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 VT , bool TF>
decltype(auto) blaze::exp ( const DenseVector< VT, TF > &  dv)
inline

Computes $ e^x $ for each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The resulting dense vector.

The exp() function computes $ e^x $ for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::exp10 ( const DenseVector< VT, TF > &  dv)
inline

Computes $ 10^x $ for each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The resulting dense vector.

The exp10() function computes $ 10^x $ for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::exp2 ( const DenseVector< VT, TF > &  dv)
inline

Computes $ 2^x $ for each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The resulting dense vector.

The exp2() function computes $ 2^x $ for each element of the input vector dv. 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

◆ expand() [1/2]

template<size_t E, typename VT , bool TF>
decltype(auto) blaze::expand ( const DenseVector< VT, TF > &  dv)
inline

Expansion of the given dense vector.

Parameters
dvThe dense vector to be expanded.
Returns
The expansion of the vector.

This function returns an expression representing the expansion of the given dense vector:

// ... Resizing and initialization
// Expansion of the column vector 'a' to a 4x3 column-major matrix
//
// ( 1 1 1 )
// ( 5 5 5 )
// ( -2 -2 -2 )
// ( 4 4 4 )
//
A = expand<3UL>( a );
// Expansion of the row vector 'b' to a 3x4 row-major matrix
//
// ( 3, -1, 7, 0 )
// ( 3, -1, 7, 0 )
// ( 3, -1, 7, 0 )
//
B = expand<3UL>( b );
constexpr bool columnMajor
Storage order flag for column-major matrices.
Definition: StorageOrder.h:99
constexpr bool columnVector
Transpose flag for column vectors.
Definition: TransposeFlag.h:58
constexpr bool rowVector
Transpose flag for row vectors.
Definition: TransposeFlag.h:73

◆ expand() [2/2]

template<typename VT , bool TF>
decltype(auto) blaze::expand ( const DenseVector< VT, TF > &  dv,
size_t  expansion 
)
inline

Expansion of the given dense vector.

Parameters
dvThe dense vector to be expanded.
expansionThe expansion.
Returns
The expansion of the vector.

This function returns an expression representing the expansion of the given dense vector:

// ... Resizing and initialization
// Expansion of the column vector 'a' to a 4x3 column-major matrix
//
// ( 1 1 1 )
// ( 5 5 5 )
// ( -2 -2 -2 )
// ( 4 4 4 )
//
A = expand( a, 3UL );
// Expansion of the row vector 'b' to a 3x4 row-major matrix
//
// ( 3, -1, 7, 0 )
// ( 3, -1, 7, 0 )
// ( 3, -1, 7, 0 )
//
B = expand( b, 3UL );
decltype(auto) expand(const DenseVector< VT, TF > &dv, size_t expansion)
Expansion of the given dense vector.
Definition: DVecExpandExpr.h:746

◆ fix()

template<typename VT , bool TF>
decltype(auto) blaze::fix ( DenseVector< VT, TF > &  dv)
noexcept

Fixing the size of the given dense vector.

Parameters
dvThe dense vector to be size-fixed.
Returns
The size-fixed dense vector.

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

// ... 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 VT , bool TF>
decltype(auto) blaze::floor ( const DenseVector< VT, TF > &  dv)
inline

Applies the floor() function to each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The resulting dense vector.

This function applies the floor() function to each element of the input vector dv. 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 VT , bool TF, typename OP >
decltype(auto) blaze::forEach ( const DenseVector< VT, TF > &  dv,
OP  op 
)
inline

Evaluates the given custom operation on each single element of the dense vector dv.

Parameters
dvThe input vector.
opThe custom operation.
Returns
The custom operation applied to each single element of dv.

The forEach() function evaluates the given custom operation on each element of the input vector dv. 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 TF = defaultTransposeFlag, typename OP >
decltype(auto) blaze::generate ( size_t  size,
OP  op 
)
inline

Generates a new dense vector filled via the given custom unary operation.

Parameters
sizeThe size/dimension of the vector.
opThe custom unary operation.
Returns
The newly generated dense vector.

The generate() function returns a dense vector filled elementwise via the given custom unary operation. By default, the returned vector is a column vector, but this setting can be changed via the BLAZE_DEFAULT_TRANSPOSE_FLAG switch. Alternatively it is possible to specify the transpose flag explicitly.
The following example demonstrates the use of the generate() function:

// Generates the uniform integer vector ( 2, 2, 2, 2, 2 )
a = generate( 5UL, []( size_t index ){ return 2; } );
// Generates the linearly spaced float vector ( 2.1, 3.2, 4.3, 5.4 )
b = generate( 4UL, []( size_t index ){ return 2.1F + 1.1F*index; } );
// Generates the logarithmically spaced double vector ( 1.0, 10.0, 100.0, 1000.0 )
c = generate<columnVector>( 4UL, []( size_t index ){ return blaze::exp10( 1.0 + 1.0*index ); } );
// Generates the vector of integer vectors ( ( 1, 2 ), ( 2, 3 ), ( 3, 4 ), ( 4, 5 ) )
using VT = StaticVector<int,2UL>;
d = generate<rowVector>( 4UL, []( size_t index ) { return evaluate( VT{ 1, 2 } + index ); } );
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

◆ hypot()

template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::hypot ( const DenseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

Computes the componentwise hypotenous for the dense vectors lhs and rhs.

Parameters
lhsThe left-hand side dense vector operand.
rhsThe right-hand side dense vector operand.
Returns
The resulting dense vector
Exceptions
std::invalid_argumentVector sizes do not match.

The hypot() function computes the componentwise hypotenous for the two dense vectors 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 sizes of the two given vectors don't match, a std::invalid_argument is thrown.

◆ imag()

template<typename VT , bool TF>
decltype(auto) blaze::imag ( const DenseVector< VT, TF > &  dv)
inline

Returns a vector containing the imaginary part of each single element of dv.

Parameters
dvThe input vector.
Returns
The imaginary part of each single element of dv.

The imag() function calculates the imaginary part of each element of the input vector dv. The function returns an expression representing this operation.
The following example demonstrates the use of the imag() function:

// ... Resizing and initialization
b = imag( a );
decltype(auto) imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatMapExpr.h:1557

◆ invcbrt()

template<typename VT , bool TF>
decltype(auto) blaze::invcbrt ( const DenseVector< VT, TF > &  dv)
inline

Computes the inverse cubic root of each single element of the dense vector dv.

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

The invcbrt() function computes the inverse cubic root of each element of the input vector dv. 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!

◆ invsqrt()

template<typename VT , bool TF>
decltype(auto) blaze::invsqrt ( const DenseVector< VT, TF > &  dv)
inline

Computes the inverse square root of each single element of the dense vector dv.

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

The invsqrt() function computes the inverse square root of each element of the input vector dv. 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!

◆ isDivisor()

template<typename VT , bool TF>
bool blaze::isDivisor ( const DenseVector< VT, TF > &  dv)

Returns whether the given dense vector is a valid divisor.

Parameters
dvThe dense vector to be tested.
Returns
true in case the given vector is a valid divisor, false otherwise.

This function checks if the given dense vector is a valid divisor. If all elements of the vector are valid divisors the function returns true, if at least one element of the vector is not a valid divisor, the function returns false.

StaticVector<int,3UL> a{ 1, -1, 2 }; // isDivisor( a ) returns true
StaticVector<int,3UL> b{ 1, -1, 0 }; // isDivisor( b ) returns false
Efficient implementation of a fixed-sized vector.
Definition: StaticVector.h:230

◆ isfinite()

template<typename VT , bool TF>
bool blaze::isfinite ( const DenseVector< VT, TF > &  dv)

Checks the given dense vector for finite elements.

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

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

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

◆ isinf()

template<typename VT , bool TF>
bool blaze::isinf ( const DenseVector< VT, TF > &  dv)

Checks the given dense vector for infinite elements.

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

This function checks the N-dimensional dense vector for infinite elements. If at least one element of the vector is infinite, the function returns true, otherwise it returns false.

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

◆ isnan()

template<typename VT , bool TF>
bool blaze::isnan ( const DenseVector< VT, TF > &  dv)

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

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

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

// ... Resizing and 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

◆ isUniform()

template<RelaxationFlag RF, typename VT , bool TF>
bool blaze::isUniform ( const DenseVector< VT, TF > &  dv)

Checks if the given dense vector is a uniform vector.

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

This function checks if the given dense vector is a uniform vector. The vector 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 vector expression results is a uniform vector:

if( isUniform( a + b ) ) { ... }

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

◆ isZero()

template<RelaxationFlag RF, typename VT , bool TF>
bool blaze::isZero ( const DenseVector< VT, TF > &  dv)

Checks if the given dense vector is a zero vector.

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

This function checks if the given dense vector is a zero vector. The vector 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 vector expression results is a zero vector:

if( isZero( a + b ) ) { ... }

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

◆ kron()

template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::kron ( const DenseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

Computes the Kronecker product of two dense vectors ( $ a=b \otimes c $).

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

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

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

◆ l1Norm()

template<typename VT , bool TF>
decltype(auto) blaze::l1Norm ( const DenseVector< VT, TF > &  dv)
inline

Computes the L1 norm for the given dense vector.

Parameters
dvThe given dense vector for the norm computation.
Returns
The L1 norm of the given dense vector.

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

// ... 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 VT , bool TF>
decltype(auto) blaze::l2Norm ( const DenseVector< VT, TF > &  dv)
inline

Computes the L2 norm for the given dense vector.

Parameters
dvThe given dense vector for the norm computation.
Returns
The L2 norm of the given dense vector.

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

// ... 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 VT , bool TF>
decltype(auto) blaze::l3Norm ( const DenseVector< VT, TF > &  dv)
inline

Computes the L3 norm for the given dense vector.

Parameters
dvThe given dense vector for the norm computation.
Returns
The L3 norm of the given dense vector.

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

// ... 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 VT , bool TF>
decltype(auto) blaze::l4Norm ( const DenseVector< VT, TF > &  dv)
inline

Computes the L4 norm for the given dense vector.

Parameters
dvThe given dense vector for the norm computation.
Returns
The L4 norm of the given dense vector.

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

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

◆ length()

template<typename VT , bool TF>
decltype(auto) blaze::length ( const DenseVector< VT, TF > &  dv)
inline

Calculation of the length (magnitude) of the dense vector $|\vec{a}|$.

Parameters
dvThe given dense vector.
Returns
The length (magnitude) of the dense vector.

This function calculates the actual length (magnitude) of the dense vector. The function has the same effect as calling the norm() function on the dense vector.

◆ lgamma()

template<typename VT , bool SO>
decltype(auto) blaze::lgamma ( const DenseVector< VT, SO > &  dv)
inline

Computes the natural logarithm of the absolute value of the gamma function for each single element of the dense vector dv.

Parameters
dvThe input vector; 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 dv.

The lgamma() function computes the natural logarithm of the absolute value of the gamma function for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::linfNorm ( const DenseVector< VT, TF > &  dv)
inline

Computes the infinity norm for the given dense vector.

Parameters
dvThe given dense vector for the norm computation.
Returns
The infinity norm of the given dense vector.

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

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

◆ linspace()

template<bool TF = defaultTransposeFlag, typename T >
decltype(auto) blaze::linspace ( size_t  size,
start,
end 
)
inline

Generates a new dense vector filled with linearly spaced elements.

Parameters
sizeThe size/dimension of the given vector.
startThe value of the first element.
endThe value of the last element.
Returns
The newly generated dense vector.

The linspace() function returns a dense vector filled with linearly spaced elements from start to end. By default, the returned vector is a column vector, but this setting can be changed via the BLAZE_DEFAULT_TRANSPOSE_FLAG switch. Alternatively it is possible to specify the transpose flag explicitly.
The following example demonstrates the use of the linspace() function:

// Generates the linearly spaced integer vector ( 2, 3, 4, 5, 6 )
a = linspace( 5UL, 2, 6 );
// Generates the linearly spaced integer vector ( 6, 5, 4, 3, 2 )
b = linspace<columnVector>( 5UL, 6, 2 );
// Generates the linearly spaced float vector ( 2.1, 3.2, 4.3, 5.4 )
c = linspace<rowVector>( 4UL, 2.1F, 5.4F );
decltype(auto) linspace(size_t size, T start, T end)
Generates a new dense vector filled with linearly spaced elements.
Definition: DVecGenExpr.h:648

◆ log()

template<typename VT , bool TF>
decltype(auto) blaze::log ( const DenseVector< VT, TF > &  dv)
inline

Computes the natural logarithm for each single element of the dense vector dv.

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

The log() function computes natural logarithm for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::log10 ( const DenseVector< VT, TF > &  dv)
inline

Computes the common logarithm for each single element of the dense vector dv.

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

The log10() function computes common logarithm for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::log1p ( const DenseVector< VT, TF > &  dv)
inline

Computes the natural logarithm of x+1 for each single element of the dense vector dv.

Parameters
dvThe input vector; all elements must be in the range $[-1..\infty)$.
Returns
The natural logarithm of x+1 of each single element of dv.

The log1p() function computes the natural logarithm of x+1 for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::log2 ( const DenseVector< VT, TF > &  dv)
inline

Computes the binary logarithm for each single element of the dense vector dv.

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

The log2() function computes binary logarithm for each element of the input vector dv. 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!

◆ logspace()

template<bool TF = defaultTransposeFlag, typename T >
decltype(auto) blaze::logspace ( size_t  size,
start,
end 
)
inline

Generates a new dense vector filled with logarithmically spaced elements.

Parameters
sizeThe size/dimension of the given vector.
startThe value of the first element.
endThe value of the last element.
Returns
The newly generated dense vector.

The logspace() function returns a dense vector filled with logarithmically spaced elements from start to end. By default, the returned vector is a column vector, but this setting can be changed via the BLAZE_DEFAULT_TRANSPOSE_FLAG switch. Alternatively it is possible to specify the transpose flag explicitly.
The following example demonstrates the use of the logspace() function:

// Generates the logarithmically spaced double vector ( 1, 10, 100, 1000 )
a = logspace( 4UL, 0, 3 );
// Generates the logarithmically spaced double vector ( 1000.0, 100.0, 10.0, 1.0 )
b = logspace<rowVector>( 4UL, 3.0, 0.0 );
decltype(auto) logspace(size_t size, T start, T end)
Generates a new dense vector filled with logarithmically spaced elements.
Definition: DVecGenExpr.h:704

◆ lpNorm() [1/2]

template<size_t P, typename VT , bool TF>
decltype(auto) blaze::lpNorm ( const DenseVector< VT, TF > &  dv)
inline

Computes the Lp norm for the given dense vector.

Parameters
dvThe given dense vector for the norm computation.
Returns
The Lp norm of the given dense vector.

This function computes the Lp norm of the given dense vector, 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 VT , bool TF, typename ST >
decltype(auto) blaze::lpNorm ( const DenseVector< VT, TF > &  dv,
ST  p 
)
inline

Computes the Lp norm for the given dense vector.

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

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

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

◆ map() [1/6]

template<typename VT , bool TF, typename OP >
decltype(auto) blaze::map ( const DenseVector< VT, TF > &  dv,
OP  op 
)
inline

Evaluates the given custom operation on each single element of the dense vector dv.

Parameters
dvThe input vector.
opThe custom operation.
Returns
The custom operation applied to each single element of dv.

The map() function evaluates the given custom operation on each element of the input vector dv. 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/6]

template<typename VT1 , typename VT2 , typename VT3 , typename VT4 , typename VT5 , typename VT6 , bool TF, typename OP >
decltype(auto) blaze::map ( const DenseVector< VT1, TF > &  dv1,
const DenseVector< VT2, TF > &  dv2,
const DenseVector< VT3, TF > &  dv3,
const DenseVector< VT4, TF > &  dv4,
const DenseVector< VT5, TF > &  dv5,
const DenseVector< VT6, TF > &  dv6,
OP  op 
)
inline

Elementwise evaluation of the given 6-ary operation on each single element of the dense vectors dv1, dv2, dv3, dv4, dv5, and dv6.

Parameters
dv1The first dense vector operand.
dv2The second dense vector operand.
dv3The third dense vector operand.
dv4The fourth dense vector operand.
dv5The fifth dense vector operand.
dv6The sixth dense vector operand.
opThe custom, 6-ary operation.
Returns
The 6-ary operation applied to each single element of the six vectors.
Exceptions
std::invalid_argumentVector sizes do not match.

The map() function evaluates the given 6-ary operation on each single element of the input vectors dv1, dv2, dv3, dv4, dv5, and dv6. The function returns an expression representing this operation.
In case the current sizes of the six given vectors don't match, a std::invalid_argument is thrown.

◆ map() [3/6]

template<typename VT1 , typename VT2 , typename VT3 , typename VT4 , typename VT5 , bool TF, typename OP >
decltype(auto) blaze::map ( const DenseVector< VT1, TF > &  dv1,
const DenseVector< VT2, TF > &  dv2,
const DenseVector< VT3, TF > &  dv3,
const DenseVector< VT4, TF > &  dv4,
const DenseVector< VT5, TF > &  dv5,
OP  op 
)
inline

Elementwise evaluation of the given 5-ary operation on each single element of the dense vectors dv1, dv2, dv3, dv4, and dv5.

Parameters
dv1The first dense vector operand.
dv2The second dense vector operand.
dv3The third dense vector operand.
dv4The fourth dense vector operand.
dv5The fifth dense vector operand.
opThe custom, 5-ary operation.
Returns
The 5-ary operation applied to each single element of the five vectors.
Exceptions
std::invalid_argumentVector sizes do not match.

The map() function evaluates the given 5-ary operation on each single element of the input vectors dv1, dv2, dv3, dv4, and dv5. The function returns an expression representing this operation.
In case the current sizes of the five given vectors don't match, a std::invalid_argument is thrown.

◆ map() [4/6]

template<typename VT1 , typename VT2 , typename VT3 , typename VT4 , bool TF, typename OP >
decltype(auto) blaze::map ( const DenseVector< VT1, TF > &  dv1,
const DenseVector< VT2, TF > &  dv2,
const DenseVector< VT3, TF > &  dv3,
const DenseVector< VT4, TF > &  dv4,
OP  op 
)
inline

Elementwise evaluation of the given 4-ary operation on each single element of the dense vectors dv1, dv2, dv3, and dv4.

Parameters
dv1The first dense vector operand.
dv2The second dense vector operand.
dv3The third dense vector operand.
dv4The fourth dense vector operand.
opThe custom, 4-ary operation.
Returns
The 4-ary operation applied to each single element of the four vectors.
Exceptions
std::invalid_argumentVector sizes do not match.

The map() function evaluates the given 4-ary operation on each single element of the input vectors dv1, dv2, dv3, and dv4. The function returns an expression representing this operation.
In case the current sizes of the four given vectors don't match, a std::invalid_argument is thrown.

◆ map() [5/6]

template<typename VT1 , typename VT2 , typename VT3 , bool TF, typename OP >
decltype(auto) blaze::map ( const DenseVector< VT1, TF > &  dv1,
const DenseVector< VT2, TF > &  dv2,
const DenseVector< VT3, TF > &  dv3,
OP  op 
)
inline

Elementwise evaluation of the given ternary operation on each single element of the dense vectors dv1, dv2, and dv3.

Parameters
dv1The first dense vector operand.
dv2The second dense vector operand.
dv3The third dense vector operand.
opThe custom, ternary operation.
Returns
The ternary operation applied to each single element of the three vectors.
Exceptions
std::invalid_argumentVector sizes do not match.

The map() function evaluates the given ternary operation on each single element of the input vectors dv1, dv2, and dv3. The function returns an expression representing this operation.
In case the current sizes of the three given vectors don't match, a std::invalid_argument is thrown.

◆ map() [6/6]

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

Elementwise evaluation of the given binary operation on each single element of the dense vectors lhs and rhs.

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

The map() function evaluates the given binary operation on each single element 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
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

In case the current sizes of the two given vectors don't match, a std::invalid_argument is thrown.

◆ max() [1/4]

template<typename VT , bool TF>
decltype(auto) blaze::max ( const DenseVector< VT, TF > &  dv)
inline

Returns the largest element of the dense vector.

Parameters
dvThe given dense vector.
Returns
The largest dense vector element.

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

blaze::DynamicVector<int> a{ 1, -2, 3, 0 };
const int totalmax = max( a ); // Results in 3
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/4]

template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::max ( const DenseVector< VT, TF > &  dv,
ST  scalar 
)

Computes the componentwise maximum of a dense vector dv and a scalar.

Parameters
dvThe left-hand side dense vector operand.
scalarThe right-hand side scalar value.
Returns
The resulting dense vector.

This operator computes the componentwise maximum of a dense vector dv and a uniform vector 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 );

In case the current sizes of the two given vectors don't match, a std::invalid_argument is thrown.

◆ max() [3/4]

template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::max ( const DenseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

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

Parameters
lhsThe left-hand side dense vector operand.
rhsThe right-hand side dense vector operand.
Returns
The resulting dense vector.
Exceptions
std::invalid_argumentVector sizes do not match.

This function computes the componentwise maximum of the two dense vectors 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 sizes of the two given vectors don't match, a std::invalid_argument is thrown.

◆ max() [4/4]

template<typename ST , typename VT , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::max ( ST  scalar,
const DenseVector< VT, TF > &  dv 
)

Computes the componentwise maximum of a scalar and a dense vector dv.

Parameters
scalarThe left-hand side scalar value.
dvThe right-hand side dense vector operand.
Returns
The resulting dense vector.

This operator computes the componentwise maximum of a uniform vector represented by the scalar value scalar and a dense vector dv. 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 VT , bool TF>
decltype(auto) blaze::maxNorm ( const DenseVector< VT, TF > &  dv)
inline

Computes the maximum norm for the given dense vector.

Parameters
dvThe given dense vector for the norm computation.
Returns
The maximum norm of the given dense vector.

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

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

template<typename VT , bool TF>
decltype(auto) blaze::mean ( const DenseVector< VT, TF > &  dv)
inline

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

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

This function computes the (arithmetic) mean for the given dense vector dv. Example:

DynamicVector<int> v{ 1, 4, 3, 6, 7 };
const double m = mean( v ); // Results in 4.2 (i.e. 21/5)
decltype(auto) mean(const DenseMatrix< MT, SO > &dm)
Computes the (arithmetic) mean for the given dense matrix.
Definition: DMatMeanExpr.h:134

In case the size of the given vector is 0, a std::invalid_argument is thrown.

◆ min() [1/4]

template<typename VT , bool TF>
decltype(auto) blaze::min ( const DenseVector< VT, TF > &  dv)
inline

Returns the smallest element of the dense vector.

Parameters
dvThe given dense vector.
Returns
The smallest dense vector element.

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

blaze::DynamicVector<int> a{ 1, -2, 3, 0 };
const int totalmin = min( a ); // Results in -2

◆ min() [2/4]

template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::min ( const DenseVector< VT, TF > &  dv,
ST  scalar 
)

Computes the componentwise minimum of a dense vector dv and a scalar.

Parameters
dvThe left-hand side dense vector operand.
scalarThe right-hand side scalar value.
Returns
The resulting dense vector.

This operator computes the componentwise minimum of a dense vector dv and a uniform vector 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() [3/4]

template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::min ( const DenseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

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

Parameters
lhsThe left-hand side dense vector operand.
rhsThe right-hand side dense vector operand.
Returns
The resulting dense vector.
Exceptions
std::invalid_argumentVector sizes do not match.

This function computes the componentwise minimum of the two dense vectors 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 sizes of the two given vectors don't match, a std::invalid_argument is thrown.

◆ min() [4/4]

template<typename ST , typename VT , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::min ( ST  scalar,
const DenseVector< VT, TF > &  dv 
)

Computes the componentwise minimum of a scalar and a dense vector dv.

Parameters
scalarThe left-hand side scalar value.
dvThe right-hand side dense vector operand.
Returns
The resulting dense vector.

This operator computes the componentwise minimum of a uniform vector represented by the scalar value scalar and a dense vector dv. 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 VT , bool TF>
decltype(auto) blaze::minNorm ( const DenseVector< VT, TF > &  dv)
inline

Computes the minimum norm for the given dense vector.

Parameters
dvThe given dense vector for the norm computation.
Returns
The minimum norm of the given dense vector.

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

// ... 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 VT , bool TF>
decltype(auto) blaze::noalias ( const DenseVector< VT, TF > &  dv)
inline

Forces the non-aliased evaluation of the given dense vector expression dv.

Parameters
dvThe input vector.
Returns
The non-aliased dense vector.

The noalias function forces the non-aliased evaluation of the given dense vector expression dv. The function returns an expression representing this 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 VT , bool TF>
decltype(auto) blaze::norm ( const DenseVector< VT, TF > &  dv)
inline

Computes the L2 norm for the given dense vector.

Parameters
dvThe given dense vector for the norm computation.
Returns
The L2 norm of the given dense vector.

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

// ... 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 VT , bool TF>
decltype(auto) blaze::nosimd ( const DenseVector< VT, TF > &  dv)
inline

Disables the SIMD evaluation of the given dense vector expression dv.

Parameters
dvThe input vector.
Returns
The SIMD-disabled dense vector.

The nosimd function disables the SIMD evaluation of the given dense vector expression dv. 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 VT , bool TF>
decltype(auto) blaze::operator! ( const DenseVector< VT, TF > &  vec)
inline

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

Parameters
vecThe dense vector for the logical NOT.
Returns
The negated vector.

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

// ... Resizing and initialization
b = !a;

◆ operator!=() [1/5]

template<typename T1 , typename T2 , bool TF>
auto blaze::operator!= ( const DenseVector< T1, TF > &  vec,
T2  scalar 
) -> EnableIf_t< IsScalar_v< T2 >, bool >
inline

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

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

If one value of the vector 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!=() [2/5]

template<typename VT1 , bool TF1, typename VT2 , bool TF2>
bool blaze::operator!= ( const DenseVector< VT1, TF1 > &  lhs,
const DenseVector< VT2, TF2 > &  rhs 
)
inline

Inequality operator for the comparison of two dense vectors.

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

◆ operator!=() [3/5]

template<typename VT1 , bool TF1, typename VT2 , bool TF2>
bool blaze::operator!= ( const DenseVector< VT1, TF1 > &  lhs,
const SparseVector< VT2, TF2 > &  rhs 
)
inline

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

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

◆ operator!=() [4/5]

template<typename VT1 , bool TF1, typename VT2 , bool TF2>
bool blaze::operator!= ( const SparseVector< VT1, TF1 > &  lhs,
const DenseVector< VT2, TF2 > &  rhs 
)
inline

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

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

◆ operator!=() [5/5]

template<typename T1 , typename T2 , bool TF>
auto blaze::operator!= ( T1  scalar,
const DenseVector< T2, TF > &  vec 
) -> EnableIf_t< IsScalar_v< T1 >, bool >
inline

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

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

If one value of the vector 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/4]

template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator% ( const DenseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

Operator for the cross product of two dense vectors ( $ \vec{a}=\vec{b} \times \vec{c} $).

Parameters
lhsThe left-hand side dense vector for the cross product.
rhsThe right-hand side dense vector for the cross product.
Returns
The cross product of the two vectors.
Exceptions
std::invalid_argumentInvalid vector size for cross product.

This operator represents the cross product of two dense vectors:

blaze::DynamicVector<double> a( 3UL ), b( 3UL );
// ... Resizing and initialization
c = a % b;

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

◆ operator%() [2/4]

template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator% ( const DenseVector< VT1, TF > &  lhs,
const SparseVector< VT2, TF > &  rhs 
)
inline

Operator for the cross product of a dense vector and a sparse vector ( $ \vec{a}=\vec{b} \times \vec{c} $).

Parameters
lhsThe left-hand side dense vector for the cross product.
rhsThe right-hand side sparse vector for the cross product.
Returns
The cross product of the two vectors.
Exceptions
std::invalid_argumentInvalid vector size for cross product.

This operator represents the cross product of a dense vector and a sparse vector:

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

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

◆ operator%() [3/4]

template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator% ( const SparseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

Operator for the cross product of a sparse vector and a dense vector ( $ \vec{a}=\vec{b} \times \vec{c} $).

Parameters
lhsThe left-hand side sparse vector for the cross product.
rhsThe right-hand side dense vector for the cross product.
Returns
The cross product of the two vectors.
Exceptions
std::invalid_argumentInvalid vector size for cross product.

This operator represents the cross product of a sparse vector and a dense vector:

// ... Resizing and initialization
c = a % b;

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

◆ operator%() [4/4]

template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator% ( const SparseVector< VT1, TF > &  lhs,
const SparseVector< VT2, TF > &  rhs 
)
inline

Operator for the cross product of two sparse vectors ( $ \vec{a}=\vec{b} \times \vec{c} $).

Parameters
lhsThe left-hand side sparse vector for the cross product.
rhsThe right-hand side sparse vector for the cross product.
Returns
The cross product of the two sparse vectors.
Exceptions
std::invalid_argumentInvalid vector size for cross product.

This operator represents the cross product of two sparse vectors:

// ... Resizing and initialization
c = a % b;

The operator returns a dense vector of the higher-order element type of the two involved vector element types VT1::ElementType and VT2::ElementType. Both vector types VT1 and VT2 as well as the two element types VT1::ElementType and VT2::ElementType have to be supported by the CrossTrait class template.
In case the current sizes of the two given vectors don't match, a std::invalid_argument is thrown.

◆ operator&() [1/2]

template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator& ( const DenseVector< VT, TF > &  vec,
ST  scalar 
)
inline

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

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

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

// ... Resizing and initialization
b = a & 7U;

◆ operator&() [2/2]

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

Bitwise AND operator for two dense vectors.

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

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

// ... Resizing and initialization
c = a & b;

In case the current sizes of the two given vectors don't match, a std::invalid_argument is thrown.

◆ operator&&()

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

Logical AND operator for two dense vectors.

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

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

// ... Resizing and initialization
c = a && b;

In case the current sizes of the two given vectors don't match, a std::invalid_argument is thrown.

◆ operator&=() [1/4]

template<typename VT , bool TF, typename ST >
auto blaze::operator&= ( DenseVector< VT, TF > &&  vec,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, VT & >
inline

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

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

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

◆ operator&=() [2/4]

template<typename VT , bool TF, typename ST >
auto blaze::operator&= ( DenseVector< VT, TF > &  vec,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, VT & >
inline

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

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

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

◆ operator&=() [3/4]

template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator&= ( DenseVector< VT1, TF > &&  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

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

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

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

◆ operator&=() [4/4]

template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator&= ( DenseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

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

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

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

◆ operator*() [1/14]

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

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

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

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

The operator returns an expression representing a dense vector of the higher-order element type of the two involved element types MT::ElementType and VT::ElementType. Both the dense matrix type MT and the dense vector type VT as well as the two element types MT::ElementType and VT::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 columns of the matrix mat, a std::invalid_argument is thrown.

◆ operator*() [2/14]

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

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

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

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

The operator returns an expression representing a dense vector of the higher-order element type of the two involved element types MT::ElementType and VT::ElementType. Both the dense matrix type MT and the sparse vector type VT as well as the two element types MT::ElementType and VT::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 columns of the matrix mat, a std::invalid_argument is thrown.

◆ operator*() [3/14]

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

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

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

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

The operator returns an expression representing a dense vector of the higher-order element type of the two involved element types MT::ElementType and VT::ElementType. Both the dense matrix type MT and the dense vector type VT as well as the two element types MT::ElementType and VT::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 columns of the matrix mat, a std::invalid_argument is thrown.

◆ operator*() [4/14]

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

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

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

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

The operator returns an expression representing a dense vector of the higher-order element type of the two involved element types MT::ElementType and VT::ElementType. Both the dense matrix type MT and the sparse vector type VT as well as the two element types MT::ElementType and VT::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 columns of the matrix mat, a std::invalid_argument is thrown.

◆ operator*() [5/14]

template<typename VT , typename ST , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator* ( const DenseVector< VT, TF > &  vec,
ST  scalar 
)
inline

Multiplication operator for the multiplication of a dense vector and a scalar value ( $ \vec{a}=\vec{b}*s $).

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

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

// ... Resizing and initialization
b = a * 1.25;

The operator returns an expression representing a dense vector of the higher-order element type of the involved data types VT::ElementType and ST. Both data types VT::ElementType and ST have to be supported by the MultTrait class template. Note that this operator only works for scalar values of built-in data type.

◆ operator*() [6/14]

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

Multiplication operator for the multiplication of a transpose dense vector and a row-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 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 dense vector and a row-major dense matrix:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Multiplication operator for the componentwise product of two dense vectors ( $ \vec{a}=\vec{b}*\vec{c} $).

Parameters
lhsThe left-hand side dense vector for the component product.
rhsThe right-hand side dense vector for the component product.
Returns
The product of the two vectors.
Exceptions
std::invalid_argumentVector sizes do not match.

This operator represents the component product of two dense vectors:

// ... Resizing and initialization
c = a * b;

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

◆ operator*() [10/14]

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

Multiplication operator for the scalar product (inner product) of two dense vectors ( $ s=\vec{a}*\vec{b} $).

Parameters
lhsThe left-hand side dense vector for the inner product.
rhsThe right-hand side dense vector for the inner product.
Returns
The scalar product.
Exceptions
std::invalid_argumentVector sizes do not match.

This operator represents the scalar product (inner product) of two dense vectors:

blaze::double res;
// ... Resizing and initialization
res = trans(a) * b;

The operator returns a scalar value of the higher-order element type of the two involved vector element types VT1::ElementType and VT2::ElementType. Both vector types VT1 and VT2 as well as the two element types VT1::ElementType and VT2::ElementType have to be supported by the MultTrait class template.
In case the current sizes of the two given vectors don't match, a std::invalid_argument is thrown.

◆ operator*() [11/14]

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

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

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

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

The operator returns an expression representing a dense vector of the higher-order element type of the two involved element types MT::ElementType and VT::ElementType. Both the sparse matrix type MT and the dense vector type VT as well as the two element types MT::ElementType and VT::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 columns of the matrix mat, a std::invalid_argument is thrown.

◆ operator*() [12/14]

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

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

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

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

The operator returns an expression representing a dense vector of the higher-order element type of the two involved element types MT::ElementType and VT::ElementType. Both the sparse matrix type MT and the dense vector type VT as well as the two element types MT::ElementType and VT::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 columns of the matrix mat, a std::invalid_argument is thrown.

◆ operator*() [13/14]

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

Multiplication operator for the multiplication of a transpose sparse vector and a column-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 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 sparse vector and a column-major dense matrix:

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

◆ operator*() [14/14]

template<typename ST , typename VT , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator* ( ST  scalar,
const DenseVector< VT, TF > &  vec 
)
inline

Multiplication operator for the multiplication of a scalar value and a dense vector ( $ \vec{a}=s*\vec{b} $).

Parameters
scalarThe left-hand side scalar value for the multiplication.
vecThe right-hand side vector for the multiplication.
Returns
The scaled result vector.

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

// ... Resizing and initialization
b = 1.25 * a;

The operator returns an expression representing a dense vector of the higher-order element type of the involved data types ST and VT::ElementType. Both data types ST and VT::ElementType have to be supported by the MultTrait class template. Note that this operator only works for scalar values of built-in data type.

◆ operator*=() [1/2]

template<typename VT , bool TF, typename ST >
auto blaze::operator*= ( DenseVector< VT, TF > &&  vec,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, VT & >
inline

Multiplication assignment operator for the multiplication of a temporary dense vector and a scalar value ( $ \vec{v}*=s $).

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

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

◆ operator*=() [2/2]

template<typename VT , bool TF, typename ST >
auto blaze::operator*= ( DenseVector< VT, TF > &  vec,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, VT & >
inline

Multiplication assignment operator for the multiplication of a dense vector and a scalar value ( $ \vec{a}*=s $).

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

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

◆ operator+() [1/5]

template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator+ ( const DenseVector< VT, TF > &  vec,
ST  scalar 
)
inline

Addition operator for the addition of a dense vector and a scalar value ( $ \vec{a}=\vec{b}+s $).

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

This operator represents the elementwise addition of a dense vector and a uniform vector represented by a scalar value:

// ... Resizing and initialization
b = a + 1.25;

The operator returns an expression representing a dense vector of the higher-order element type of the involved data types VT::ElementType and ST. Both data types VT::ElementType and ST have to be supported by the AddTrait class template. Note that this operator only works for scalar values of built-in data type.

◆ operator+() [2/5]

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

Addition operator for the addition of two dense vectors ( $ \vec{a}=\vec{b}+\vec{c} $).

Parameters
lhsThe left-hand side dense vector for the vector addition.
rhsThe right-hand side dense vector for the vector addition.
Returns
The sum of the two vectors.
Exceptions
std::invalid_argumentVector sizes do not match.

This operator represents the addition of two dense vectors:

// ... Resizing and initialization
c = a + b;

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

◆ operator+() [3/5]

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

Addition operator for the addition of a dense vector and a sparse vector ( $ \vec{a}=\vec{b}+\vec{c} $).

Parameters
lhsThe left-hand side dense vector for the vector addition.
rhsThe right-hand side sparse vector for the vector addition.
Returns
The sum of the two vectors.
Exceptions
std::invalid_argumentVector sizes do not match.

This operator represents the addition of a dense vector and a sparse vector:

// ... Resizing and initialization
c = a + b;

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

◆ operator+() [4/5]

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

Addition operator for the addition of a sparse vector and a dense vector ( $ \vec{a}=\vec{b}+\vec{c} $).

Parameters
lhsThe left-hand side sparse vector for the vector addition.
rhsThe right-hand side dense vector for the vector addition.
Returns
The sum of the two vectors.
Exceptions
std::invalid_argumentVector sizes do not match.

This operator represents the addition of a sparse vector and a dense vector:

// ... Resizing and initialization
c = a + b;

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

◆ operator+() [5/5]

template<typename ST , typename VT , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator+ ( ST  scalar,
const DenseVector< VT, TF > &  vec 
)
inline

Addition operator for the addition of a scalar value and a dense vector ( $ \vec{a}=s+\vec{b} $).

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

This operator represents the elementwise addition of a uniform vector represented by a scalar value and a dense vector:

// ... Resizing and initialization
b = 1.25 + a;

The operator returns an expression representing a dense vector of the higher-order element type of the involved data types VT::ElementType and ST. Both data types VT::ElementType and ST have to be supported by the AddTrait class template. Note that this operator only works for scalar values of built-in data type.

◆ operator+=() [1/2]

template<typename VT , bool TF, typename ST >
auto blaze::operator+= ( DenseVector< VT, TF > &&  vec,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, VT & >
inline

Addition assignment operator for the addition of a temporary dense vector and a scalar value ( $ \vec{v}+=s $).

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

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

◆ operator+=() [2/2]

template<typename VT , bool TF, typename ST >
auto blaze::operator+= ( DenseVector< VT, TF > &  vec,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, VT & >
inline

Addition assignment operator for the addition of a dense vector and a scalar value ( $ \vec{a}+=s $).

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

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

◆ operator-() [1/6]

template<typename VT , bool TF>
decltype(auto) blaze::operator- ( const DenseVector< VT, TF > &  dv)
inline

Unary minus operator for the negation of a dense vector ( $ \vec{a} = -\vec{b} $).

Parameters
dvThe dense vector to be negated.
Returns
The negation of the vector.

This operator represents the negation of a dense vector:

// ... Resizing and initialization
b = -a;

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

◆ operator-() [2/6]

template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator- ( const DenseVector< VT, TF > &  vec,
ST  scalar 
)
inline

Subtraction operator for the subtraction of a dense vector and a scalar value ( $ \vec{a}=\vec{b}-s $).

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

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

// ... Resizing and initialization
b = a - 1.25;

The operator returns an expression representing a dense vector of the higher-order element type of the involved data types VT::ElementType and ST. Both data types VT::ElementType and ST have to be supported by the SubTrait class template. Note that this operator only works for scalar values of built-in data type.

◆ operator-() [3/6]

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

Subtraction operator for the subtraction of two dense vectors ( $ \vec{a}=\vec{b}-\vec{c} $).

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

This operator represents the subtraction of two dense vectors:

// ... Resizing and initialization
c = a - b;

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

◆ operator-() [4/6]

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

Subtraction operator for the subtraction of a dense vector and a sparse vector ( $ \vec{a}=\vec{b}-\vec{c} $).

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

This operator represents the subtraction of a dense vector and a sparse vector:

// ... Resizing and initialization
c = a - b;

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

◆ operator-() [5/6]

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

Subtraction operator for the subtraction of a sparse vector and a dense vector ( $ \vec{a}=\vec{b}-\vec{c} $).

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

This operator represents the subtraction of a sparse vector and a dense vector:

// ... Resizing and initialization
c = a - b;

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

◆ operator-() [6/6]

template<typename ST , typename VT , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator- ( ST  scalar,
const DenseVector< VT, TF > &  vec 
)
inline

Subtraction operator for the subtraction of a scalar value and a dense vector ( $ \vec{a}=s-\vec{b} $).

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

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

// ... Resizing and initialization
b = 1.25 - a;

The operator returns an expression representing a dense vector of the higher-order element type of the involved data types VT::ElementType and ST. Both data types VT::ElementType and ST have to be supported by the SubTrait class template. Note that this operator only works for scalar values of built-in data type.

◆ operator-=() [1/2]

template<typename VT , bool TF, typename ST >
auto blaze::operator-= ( DenseVector< VT, TF > &&  vec,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, VT & >
inline

Subtraction assignment operator for the subtraction of a temporary dense vector and a scalar value ( $ \vec{v}-=s $).

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

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

◆ operator-=() [2/2]

template<typename VT , bool TF, typename ST >
auto blaze::operator-= ( DenseVector< VT, TF > &  vec,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, VT & >
inline

Subtraction assignment operator for the subtraction of a dense vector and a scalar value ( $ \vec{a}-=s $).

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

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

◆ operator/() [1/3]

template<typename VT , typename ST , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator/ ( const DenseVector< VT, TF > &  vec,
ST  scalar 
)
inline

Division operator for the divison of a dense vector by a scalar value ( $ \vec{a}=\vec{b}/s $).

Parameters
vecThe left-hand side dense vector for the division.
scalarThe right-hand side scalar value for the division.
Returns
The scaled result vector.

This operator represents the division of a dense vector by a scalar value:

// ... Resizing and initialization
b = a / 0.24;

The operator returns an expression representing a dense vector of the higher-order element type of the involved data types VT::ElementType and ST. Both data types VT::ElementType and ST have to be supported by the DivTrait class template. 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 , bool TF>
decltype(auto) blaze::operator/ ( const DenseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

Division operator for the componentwise quotient of two dense vectors ( $ \vec{a}=\vec{b}/\vec{c} $).

Parameters
lhsThe left-hand side dense vector for the component quotient.
rhsThe right-hand side dense vector for the component quotient.
Returns
The quotient of the two vectors.
Exceptions
std::invalid_argumentVector sizes do not match.

This operator represents the component quotient of two dense vectors:

// ... Resizing and initialization
c = a / b;

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

◆ operator/() [3/3]

template<typename ST , typename VT , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator/ ( ST  scalar,
const DenseVector< VT, TF > &  vec 
)
inline

Division operator for the division of a scalar value and a dense vector ( $ \vec{a}=s/\vec{b} $).

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

This operator represents the elementwise division of a uniform vector represented by a scalar value and a dense vector:

// ... Resizing and initialization
b = 1.25 / a;

The operator returns an expression representing a dense vector of the higher-order element type of the involved data types VT::ElementType and ST. Both data types VT::ElementType and ST have to be supported by the DivTrait class template. Note that this operator only works for scalar values of built-in data type.

◆ operator/=() [1/2]

template<typename VT , bool TF, typename ST >
auto blaze::operator/= ( DenseVector< VT, TF > &&  vec,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, VT & >
inline

Division assignment operator for the division of a temporary dense vector by a scalar value ( $ \vec{a}/=s $).

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

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

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

◆ operator/=() [2/2]

template<typename VT , bool TF, typename ST >
auto blaze::operator/= ( DenseVector< VT, TF > &  vec,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, VT & >
inline

Division assignment operator for the division of a dense vector by a scalar value ( $ \vec{a}/=s $).

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

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

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

◆ operator<<() [1/2]

template<typename VT , bool TF>
decltype(auto) blaze::operator<< ( const DenseVector< VT, TF > &  vec,
int  count 
)
inline

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

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

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

// ... Resizing and initialization
b = a << 3;

◆ operator<<() [2/2]

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

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

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

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

// ... Resizing and initialization
c = a << b;

In case the current sizes of the two given vectors don't match, a std::invalid_argument is thrown.

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

template<typename VT , bool TF>
VT & blaze::operator<<= ( DenseVector< VT, TF > &&  vec,
int  count 
)
inline

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

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

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

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

template<typename VT , bool TF>
VT & blaze::operator<<= ( DenseVector< VT, TF > &  vec,
int  count 
)
inline

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

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

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

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

template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator<<= ( DenseVector< VT1, TF > &&  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

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

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

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

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

template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator<<= ( DenseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

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

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

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

◆ operator==() [1/5]

template<typename T1 , typename T2 , bool TF>
auto blaze::operator== ( const DenseVector< T1, TF > &  vec,
T2  scalar 
) -> EnableIf_t< IsScalar_v< T2 >, bool >
inline

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

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

If all values of the vector 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==() [2/5]

template<typename VT1 , bool TF1, typename VT2 , bool TF2>
bool blaze::operator== ( const DenseVector< VT1, TF1 > &  lhs,
const DenseVector< VT2, TF2 > &  rhs 
)
inline

Equality operator for the comparison of two dense vectors.

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

◆ operator==() [3/5]

template<typename VT1 , bool TF1, typename VT2 , bool TF2>
bool blaze::operator== ( const DenseVector< VT1, TF1 > &  lhs,
const SparseVector< VT2, TF2 > &  rhs 
)
inline

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

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

◆ operator==() [4/5]

template<typename VT1 , bool TF1, typename VT2 , bool TF2>
bool blaze::operator== ( const SparseVector< VT1, TF1 > &  lhs,
const DenseVector< VT2, TF2 > &  rhs 
)
inline

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

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

◆ operator==() [5/5]

template<typename T1 , typename T2 , bool TF>
auto blaze::operator== ( T1  scalar,
const DenseVector< T2, TF > &  vec 
) -> EnableIf_t< IsScalar_v< T1 >, bool >
inline

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

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

If all values of the vector 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 VT , bool TF>
decltype(auto) blaze::operator>> ( const DenseVector< VT, TF > &  vec,
int  count 
)
inline

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

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

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

// ... Resizing and initialization
b = a >> 3;

◆ operator>>() [2/2]

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

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

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

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

// ... Resizing and initialization
c = a >> b;

In case the current sizes of the two given vectors don't match, a std::invalid_argument is thrown.

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

template<typename VT , bool TF>
VT & blaze::operator>>= ( DenseVector< VT, TF > &&  vec,
int  count 
)
inline

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

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

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

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

template<typename VT , bool TF>
VT & blaze::operator>>= ( DenseVector< VT, TF > &  vec,
int  count 
)
inline

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

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

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

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

template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator>>= ( DenseVector< VT1, TF > &&  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

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

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

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

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

template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator>>= ( DenseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

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

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

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

◆ operator^() [1/2]

template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator^ ( const DenseVector< VT, TF > &  vec,
ST  scalar 
)
inline

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

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

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

// ... Resizing and initialization
b = a ^ 7U;

◆ operator^() [2/2]

template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator^ ( const DenseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

Bitwise XOR operator for two dense vectors.

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

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

// ... Resizing and initialization
c = a ^ b;

In case the current sizes of the two given vectors don't match, a std::invalid_argument is thrown.

◆ operator^=() [1/4]

template<typename VT , bool TF, typename ST >
auto blaze::operator^= ( DenseVector< VT, TF > &&  vec,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, VT & >
inline

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

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

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

◆ operator^=() [2/4]

template<typename VT , bool TF, typename ST >
auto blaze::operator^= ( DenseVector< VT, TF > &  vec,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, VT & >
inline

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

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

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

◆ operator^=() [3/4]

template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator^= ( DenseVector< VT1, TF > &&  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

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

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

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

◆ operator^=() [4/4]

template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator^= ( DenseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

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

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

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

◆ operator|() [1/2]

template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::operator| ( const DenseVector< VT, TF > &  vec,
ST  scalar 
)
inline

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

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

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

// ... Resizing and initialization
b = a | 7U;

◆ operator|() [2/2]

template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator| ( const DenseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

Bitwise OR operator for two dense vectors.

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

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

// ... Resizing and initialization
c = a | b;

In case the current sizes of the two given vectors don't match, a std::invalid_argument is thrown.

◆ operator|=() [1/4]

template<typename VT , bool TF, typename ST >
auto blaze::operator|= ( DenseVector< VT, TF > &&  vec,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, VT & >
inline

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

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

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

◆ operator|=() [2/4]

template<typename VT , bool TF, typename ST >
auto blaze::operator|= ( DenseVector< VT, TF > &  vec,
ST  scalar 
) -> EnableIf_t< IsScalar_v< ST >, VT & >
inline

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

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

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

◆ operator|=() [3/4]

template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator|= ( DenseVector< VT1, TF > &&  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

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

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

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

◆ operator|=() [4/4]

template<typename VT1 , typename VT2 , bool TF>
VT1 & blaze::operator|= ( DenseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

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

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

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

◆ operator||()

template<typename VT1 , typename VT2 , bool TF>
decltype(auto) blaze::operator|| ( const DenseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

Logical OR operator for two dense vectors.

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

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

// ... Resizing and initialization
c = a || b;

In case the current sizes of the two given vectors don't match, a std::invalid_argument is thrown.

◆ pow() [1/2]

template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr>
decltype(auto) blaze::pow ( const DenseVector< VT, TF > &  dv,
ST  exp 
)
inline

Computes the exponential value for each single element of the dense vector dv.

Parameters
dvThe input vector.
expThe scalar exponent.
Returns
The exponential value of each single element of dv.

The pow() function computes the exponential value for each element of the input vector dv. 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 VT1 , typename VT2 , bool TF>
decltype(auto) blaze::pow ( const DenseVector< VT1, TF > &  lhs,
const DenseVector< VT2, TF > &  rhs 
)
inline

Computes the componentwise exponential value for the dense vectors lhs and rhs.

Parameters
lhsThe left-hand side dense vector operand.
rhsThe right-hand side dense vector operand.
Returns
The resulting dense vector
Exceptions
std::invalid_argumentVector sizes do not match.

The pow() function computes the componentwise exponential value for the two dense vectors 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 sizes of the two given vectors don't match, a std::invalid_argument is thrown.

◆ prod()

template<typename VT , bool TF>
decltype(auto) blaze::prod ( const DenseVector< VT, TF > &  dv)
inline

Reduces the given dense vector by means of multiplication.

Parameters
dvThe given dense vector for the reduction operation.
Returns
The result of the reduction operation.

This function reduces the given dense vector dv by means of multiplication:

blaze::DynamicVector<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.

◆ real()

template<typename VT , bool TF>
decltype(auto) blaze::real ( const DenseVector< VT, TF > &  dv)
inline

Returns a vector containing the real part of each single element of dv.

Parameters
dvThe input vector.
Returns
The real part of each single element of dv.

The real() function calculates the real part of each element of the input vector dv. 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()

template<typename VT , bool TF, typename OP >
decltype(auto) blaze::reduce ( const DenseVector< VT, TF > &  dv,
OP  op 
)
inline

Performs a custom reduction operation on the given dense vector.

Parameters
dvThe given dense vector for the reduction computation.
opThe reduction operation.
Returns
The result of the reduction operation.

This function reduces the given dense vector dv 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.

◆ repeat() [1/2]

template<size_t R0, typename VT , bool TF>
decltype(auto) blaze::repeat ( const DenseVector< VT, TF > &  dv)
inline

Repeats the given dense vector.

Parameters
dvThe dense vector to be repeated.
Returns
The repeated dense vector.

This function returns an expression representing the repeated dense vector:

// ... Resizing and initialization
a2 = repeat<3UL>( a1 ); // Results in ( 1, 0, -2, 1, 0, -2, 1, 0, -2 )
b2 = repeat<3UL>( b1 ); // Results in ( 0, -1, 7, 0, -1, 7, 0, -1, 7 )

◆ repeat() [2/2]

template<typename VT , bool TF>
decltype(auto) blaze::repeat ( const DenseVector< VT, TF > &  dv,
size_t  repetitions 
)
inline

Repeats the given dense vector.

Parameters
dvThe dense vector to be repeated.
repetitionsThe number of repetitions.
Returns
The repeated dense vector.

This function returns an expression representing the repeated dense vector:

// ... Resizing and initialization
a2 = repeat( a1, 3UL ); // Results in ( 1, 0, -2, 1, 0, -2, 1, 0, -2 )
b2 = repeat( b1, 3UL ); // Results in ( 0, -1, 7, 0, -1, 7, 0, -1, 7 )
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 VT , bool TF>
decltype(auto) blaze::round ( const DenseVector< VT, TF > &  dv)
inline

Applies the round() function to each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The resulting dense vector.

This function applies the round() function to each element of the input vector dv. 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

◆ select()

template<typename VT1 , typename VT2 , typename VT3 , bool TF>
decltype(auto) blaze::select ( const DenseVector< VT1, TF > &  cond,
const DenseVector< VT2, TF > &  lhs,
const DenseVector< VT3, TF > &  rhs 
)
inline

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

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

This function performs an elementwise conditional selection of values from the two given dense vectors lhs and rhs. In case an element in the cond vector 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::DynamicVector<bool> cond{ true, false, true false };
blaze::DynamicVector<int> a{ 1, -1, 1, -1 };
blaze::DynamicVector<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 sizes of the three given vectors don't match, a std::invalid_argument is thrown.

◆ serial()

template<typename VT , bool TF>
decltype(auto) blaze::serial ( const DenseVector< VT, TF > &  dv)
inline

Forces the serial evaluation of the given dense vector expression dv.

Parameters
dvThe input vector.
Returns
The evaluated dense vector.

The serial function forces the serial evaluation of the given dense vector expression dv. The function returns an expression representing this 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 VT , bool TF>
decltype(auto) blaze::sign ( const DenseVector< VT, TF > &  dv)
inline

Applies the sign() function to each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The resulting dense vector.

This function applies the sign() function to each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::sin ( const DenseVector< VT, TF > &  dv)
inline

Computes the sine for each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The sine of each single element of dv.

The sin() function computes the sine for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::sinh ( const DenseVector< VT, TF > &  dv)
inline

Computes the hyperbolic sine for each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The hyperbolic sine of each single element of dv.

The sinh() function computes the hyperbolic sine for each element of the input vector dv. 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()

template<typename VT , bool TF>
auto blaze::softmax ( const DenseVector< VT, TF > &  dv)

Computes the softmax function for the given dense vector.

Parameters
dvThe given dense vector for the softmax computation.
Returns
The resulting dense vector.

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

◆ solve()

template<typename MT , bool SO, typename VT , bool TF>
decltype(auto) blaze::solve ( const DenseMatrix< MT, SO > &  A,
const DenseVector< VT, TF > &  b 
)
inline

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

Parameters
AThe NxN dense system matrix.
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.

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

// ... Resizing and initialization
x = solve( A, 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
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
decltype(auto) decldiag(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as diagonal.
Definition: DMatDeclDiagExpr.h:978
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1004
decltype(auto) decllow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as lower.
Definition: DMatDeclLowExpr.h:1004
decltype(auto) decluniupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as uniupper.
Definition: DMatDeclUniUppExpr.h:1005
decltype(auto) declherm(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as Hermitian.
Definition: DMatDeclHermExpr.h:1005
decltype(auto) declsym(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as symmetric.
Definition: DMatDeclSymExpr.h:1005
decltype(auto) declunilow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as unilower.
Definition: DMatDeclUniLowExpr.h:1004

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.

In all failure cases an exception is thrown.

Note
The solve() function can only be used for dense matrices and vectors 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.
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:
row( solve( A, b ), 2UL ); // Compilation error: Views cannot be used on an solve() expression!
solve( A, b )[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

◆ sqrLength()

template<typename VT , bool TF>
decltype(auto) blaze::sqrLength ( const DenseVector< VT, TF > &  dv)
inline

Calculation of the square length (magnitude) of the dense vector $|\vec{a}|^2$.

Parameters
dvThe given dense vector.
Returns
The square length (magnitude) of the dense vector.

This function calculates the actual square length (magnitude) of the dense vector. The function has the same effect as calling the sqrNorm() function on the dense vector.

◆ sqrNorm()

template<typename VT , bool TF>
decltype(auto) blaze::sqrNorm ( const DenseVector< VT, TF > &  dv)
inline

Computes the squared L2 norm for the given dense vector.

Parameters
dvThe given dense vector for the norm computation.
Returns
The squared L2 norm of the given dense vector.

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

// ... 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 VT , bool TF>
decltype(auto) blaze::sqrt ( const DenseVector< VT, TF > &  dv)
inline

Computes the square root of each single element of the dense vector dv.

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

The sqrt() function computes the square root of each element of the input vector dv. 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()

template<typename VT , bool TF>
decltype(auto) blaze::stddev ( const DenseVector< VT, TF > &  dv)

Computes the standard deviation for the given dense vector.

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

This function computes the standard deviation for the given dense vector dv. Example:

DynamicVector<int> v{ 1, 4, 3, 6, 7 };
const double m = stddev( v ); // Results in 2.38747
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 vector is smaller than 2, a std::invalid_argument is thrown.

◆ sum()

template<typename VT , bool TF>
decltype(auto) blaze::sum ( const DenseVector< VT, TF > &  dv)
inline

Reduces the given dense vector by means of addition.

Parameters
dvThe given dense vector for the reduction operation.
Returns
The result of the reduction operation.

This function reduces the given dense vector dv by means of addition:

blaze::DynamicVector<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.

◆ svd()

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

Calculation of the singular values of the given dense matrix.

Parameters
dmThe given general matrix.
Returns
The singular values of the matrix.

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

// ... Resizing and initialization
B = svd( A );
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
The svd() 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!
It is not possible to use any kind of view on the expression object returned by the svd() function. Also, it is not possible to access individual elements via the subscript operator on the expression object:
subvector( svd( A ), 2, 4 ); // Compilation error: Views cannot be used on an svd() expression!
svd( A )[1]; // Compilation error: It is not possible to access individual elements!

◆ tan()

template<typename VT , bool TF>
decltype(auto) blaze::tan ( const DenseVector< VT, TF > &  dv)
inline

Computes the tangent for each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The tangent of each single element of dv.

The tan() function computes the tangent for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::tanh ( const DenseVector< VT, TF > &  dv)
inline

Computes the hyperbolic tangent for each single element of the dense vector dv.

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

The tanh() function computes the hyperbolic tangent for each element of the input vector dv. 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 VT , bool TF>
decltype(auto) blaze::trans ( const DenseVector< VT, TF > &  dv)
inline

Calculation of the transpose of the given dense vector.

Parameters
dvThe dense vector to be transposed.
Returns
The transpose of the dense vector.

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

◆ transTo()

template<bool TTF, typename VT , bool TF>
decltype(auto) blaze::transTo ( const DenseVector< VT, TF > &  dv)
inline

Conditional calculation of the transpose of the given dense vector.

Parameters
dvThe dense vector to be transposed.
Returns
The dense vector with the specified transpose flag.

This function transposes the given dense vector in case the target transpose flag is different from the current transpose flag of the vector and performs no action if the two transpose flags match. It returns an expression representing the the given dense vector with the specified transpose flag.

◆ trunc()

template<typename VT , bool TF>
decltype(auto) blaze::trunc ( const DenseVector< VT, TF > &  dv)
inline

Applies the trunc() function to each single element of the dense vector dv.

Parameters
dvThe input vector.
Returns
The resulting dense vector.

This function applies the trunc() function to each element of the input vector dv. 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()

template<typename VT , bool TF>
decltype(auto) blaze::var ( const DenseVector< VT, TF > &  dv)

Computes the variance for the given dense vector.

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

This function computes the variance for the given dense vector dv. Example:

DynamicVector<int> v{ 1, 4, 3, 6, 7 };
const double m = var( v ); // Results in 5.7
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 vector is smaller than 2, a std::invalid_argument is thrown.