![]() |
Blaze 3.9
|
Modules | |
Expressions | |
CompressedVector | |
ZeroVector | |
Classes | |
class | blaze::SparseVector< VT, TF > |
Base class for sparse vectors. More... | |
class | blaze::VectorAccessProxy< VT > |
Access proxy for sparse, N-dimensional vectors. More... | |
Functions | |
template<typename VT1 , typename VT2 > | |
decltype(auto) | blaze::operator* (const DenseVector< VT1, true > &lhs, const SparseVector< VT2, false > &rhs) |
Multiplication operator for the scalar product (inner product) of a dense and a sparse vector ( ![]() | |
template<typename VT1 , typename VT2 , bool TF> | |
decltype(auto) | blaze::kron (const DenseVector< VT1, TF > &lhs, const SparseVector< VT2, TF > &rhs) |
Computes the Kronecker product of a dense vector and a sparse vector ( ![]() | |
template<typename VT1 , typename VT2 , bool TF> | |
decltype(auto) | blaze::operator* (const DenseVector< VT1, TF > &lhs, const SparseVector< VT2, TF > &rhs) |
Multiplication operator for the componentwise product of a dense vector and a sparse vector ( ![]() | |
template<typename MT , typename VT > | |
decltype(auto) | blaze::operator* (const SparseMatrix< MT, false > &mat, const SparseVector< VT, false > &vec) |
Multiplication operator for the multiplication of a row-major sparse matrix and a sparse vector ( ![]() | |
template<typename VT1 , typename VT2 , bool TF> | |
decltype(auto) | blaze::operator/ (const SparseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs) |
Division operator for the componentwise division of a sparse vector and a dense vector ( ![]() | |
template<typename VT1 , typename VT2 > | |
decltype(auto) | blaze::operator* (const SparseVector< VT1, true > &lhs, const DenseVector< VT2, false > &rhs) |
Multiplication operator for the scalar product (inner product) of a sparse and a dense vector ( ![]() | |
template<typename VT1 , typename VT2 , bool TF> | |
decltype(auto) | blaze::kron (const SparseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs) |
Computes the Kronecker product of a sparse vector and a vector vector ( ![]() | |
template<typename VT1 , typename VT2 , bool TF> | |
decltype(auto) | blaze::operator* (const SparseVector< VT1, TF > &lhs, const DenseVector< VT2, TF > &rhs) |
Multiplication operator for the componentwise product of a sparse vector and a dense vector ( ![]() | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::eval (const SparseVector< VT, TF > &sv) |
Forces the evaluation of the given sparse vector expression sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::expand (const SparseVector< VT, TF > &sv, size_t expansion) |
Expansion of the given sparse vector. More... | |
template<size_t E, typename VT , bool TF> | |
decltype(auto) | blaze::expand (const SparseVector< VT, TF > &sv) |
Expansion of the given sparse vector. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::fix (SparseVector< VT, TF > &sv) noexcept |
Fixing the size of the given sparse vector. More... | |
template<typename VT , bool TF, typename OP > | |
decltype(auto) | blaze::map (const SparseVector< VT, TF > &sv, OP op) |
Evaluates the given custom operation on each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF, typename OP > | |
decltype(auto) | blaze::forEach (const SparseVector< VT, TF > &sv, OP op) |
Evaluates the given custom operation on each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::abs (const SparseVector< VT, TF > &sv) |
Applies the abs() function to each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::sign (const SparseVector< VT, TF > &sv) |
Applies the sign() function to each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::floor (const SparseVector< VT, TF > &sv) |
Applies the floor() function to each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::ceil (const SparseVector< VT, TF > &sv) |
Applies the ceil() function to each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::trunc (const SparseVector< VT, TF > &sv) |
Applies the trunc() function to each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::round (const SparseVector< VT, TF > &sv) |
Applies the round() function to each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::conj (const SparseVector< VT, TF > &sv) |
Returns a vector containing the complex conjugate of each single element of sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::ctrans (const SparseVector< VT, TF > &sv) |
Returns the conjugate transpose vector of sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::real (const SparseVector< VT, TF > &sv) |
Returns a vector containing the real parts of each single element of sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::imag (const SparseVector< VT, TF > &sv) |
Returns a vector containing the imaginary parts of each single element of sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::arg (const SparseVector< VT, TF > &sv) |
Returns a vector containing the phase angle of each single element of sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::sqrt (const SparseVector< VT, TF > &sv) |
Computes the square root of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::invsqrt (const SparseVector< VT, TF > &sv) |
Computes the inverse square root of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::cbrt (const SparseVector< VT, TF > &sv) |
Computes the cubic root of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::invcbrt (const SparseVector< VT, TF > &sv) |
Computes the inverse cubic root of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF, typename DT > | |
decltype(auto) | blaze::clamp (const SparseVector< VT, TF > &sv, const DT &min, const DT &max) |
Restricts each single element of the sparse vector sv to the range ![]() | |
template<typename VT , bool TF, typename ST , EnableIf_t< IsScalar_v< ST > > * = nullptr> | |
decltype(auto) | blaze::pow (const SparseVector< VT, TF > &sv, ST exp) |
Computes the exponential value for each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::exp (const SparseVector< VT, TF > &sv) |
Computes ![]() | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::exp2 (const SparseVector< VT, TF > &sv) |
Computes ![]() | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::exp10 (const SparseVector< VT, TF > &sv) |
Computes ![]() | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::log (const SparseVector< VT, TF > &sv) |
Computes the natural logarithm of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::log2 (const SparseVector< VT, TF > &sv) |
Computes the binary logarithm of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::log10 (const SparseVector< VT, TF > &sv) |
Computes the common logarithm of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::log1p (const SparseVector< VT, TF > &sv) |
Computes the natural logarithm of x+1 of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::lgamma (const SparseVector< VT, TF > &sv) |
Computes the natural logarithm of the absolute value of the gamma function of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::sin (const SparseVector< VT, TF > &sv) |
Computes the sine of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::asin (const SparseVector< VT, TF > &sv) |
Computes the inverse sine of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::sinh (const SparseVector< VT, TF > &sv) |
Computes the hyperbolic sine of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::asinh (const SparseVector< VT, TF > &sv) |
Computes the inverse hyperbolic sine of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::cos (const SparseVector< VT, TF > &sv) |
Computes the cosine of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::acos (const SparseVector< VT, TF > &sv) |
Computes the inverse cosine of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::cosh (const SparseVector< VT, TF > &sv) |
Computes the hyperbolic cosine of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::acosh (const SparseVector< VT, TF > &sv) |
Computes the inverse hyperbolic cosine of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::tan (const SparseVector< VT, TF > &sv) |
Computes the tangent of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::atan (const SparseVector< VT, TF > &sv) |
Computes the inverse tangent of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::tanh (const SparseVector< VT, TF > &sv) |
Computes the hyperbolic tangent of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::atanh (const SparseVector< VT, TF > &sv) |
Computes the inverse hyperbolic tangent of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::erf (const SparseVector< VT, TF > &sv) |
Computes the error function of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::erfc (const SparseVector< VT, TF > &sv) |
Computes the complementary error function of each non-zero element of the sparse vector sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::mean (const SparseVector< VT, TF > &sv) |
Computes the (arithmetic) mean for the given sparse vector. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::noalias (const SparseVector< VT, TF > &sv) |
Forces the non-aliased evaluation of the given sparse vector expression sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::norm (const SparseVector< VT, TF > &sv) |
Computes the L2 norm for the given sparse vector. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::sqrNorm (const SparseVector< VT, TF > &sv) |
Computes the squared L2 norm for the given sparse vector. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::l1Norm (const SparseVector< VT, TF > &sv) |
Computes the L1 norm for the given sparse vector. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::l2Norm (const SparseVector< VT, TF > &sv) |
Computes the L2 norm for the given sparse vector. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::l3Norm (const SparseVector< VT, TF > &sv) |
Computes the L3 norm for the given sparse vector. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::l4Norm (const SparseVector< VT, TF > &sv) |
Computes the L4 norm for the given sparse vector. More... | |
template<typename VT , bool TF, typename ST > | |
decltype(auto) | blaze::lpNorm (const SparseVector< VT, TF > &sv, ST p) |
Computes the Lp norm for the given sparse vector. More... | |
template<size_t P, typename VT , bool TF> | |
decltype(auto) | blaze::lpNorm (const SparseVector< VT, TF > &sv) |
Computes the Lp norm for the given sparse vector. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::linfNorm (const SparseVector< VT, TF > &sv) |
Computes the infinity norm for the given sparse vector. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::maxNorm (const SparseVector< VT, TF > &sv) |
Computes the maximum norm for the given sparse vector. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::minNorm (const SparseVector< VT, TF > &sv) |
Computes the minimum norm for the given sparse vector. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::sqrLength (const SparseVector< VT, TF > &sv) |
Calculation of the square length (magnitude) of the sparse vector ![]() | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::length (const SparseVector< VT, TF > &sv) |
Calculation of the length (magnitude) of the sparse vector ![]() | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::nosimd (const SparseVector< VT, TF > &sv) |
Disables the SIMD evaluation of the given sparse vector expression sv. More... | |
template<typename VT , bool TF, typename OP > | |
decltype(auto) | blaze::reduce (const SparseVector< VT, TF > &sv, OP op) |
Performs a custom reduction operation on the given sparse vector. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::sum (const SparseVector< VT, TF > &sv) |
Reduces the given sparse vector by means of addition. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::prod (const SparseVector< VT, TF > &sv) |
Reduces the given sparse vector by means of multiplication. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::min (const SparseVector< VT, TF > &sv) |
Returns the smallest element of the sparse vector. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::max (const SparseVector< VT, TF > &sv) |
Returns the largest element of the sparse vector. More... | |
template<typename VT , bool TF> | |
size_t | blaze::argmin (const SparseVector< VT, TF > &sv) |
Returns the index of the first smallest non-zero element of the sparse vector. More... | |
template<typename VT , bool TF> | |
size_t | blaze::argmax (const SparseVector< VT, TF > &sv) |
Returns the index of the first largest non-zero element of the sparse vector. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::repeat (const SparseVector< VT, TF > &sv, size_t repetitions) |
Repeats the given sparse vector. More... | |
template<size_t R0, typename VT , bool TF> | |
decltype(auto) | blaze::repeat (const SparseVector< VT, TF > &sv) |
Repeats the given sparse vector. More... | |
template<typename VT , typename ST , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr> | |
decltype(auto) | blaze::operator/ (const SparseVector< VT, TF > &vec, ST scalar) |
Division operator for the divison of a sparse vector by a scalar value ( ![]() | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::operator- (const SparseVector< VT, TF > &sv) |
Unary minus operator for the negation of a sparse vector ( ![]() | |
template<typename VT , typename ST , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr> | |
decltype(auto) | blaze::operator* (const SparseVector< VT, TF > &vec, ST scalar) |
Multiplication operator for the multiplication of a sparse vector and a scalar value ( ![]() | |
template<typename ST , typename VT , bool TF, EnableIf_t< IsScalar_v< ST > > * = nullptr> | |
decltype(auto) | blaze::operator* (ST scalar, const SparseVector< VT, TF > &vec) |
Multiplication operator for the multiplication of a scalar value and a sparse vector ( ![]() | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::serial (const SparseVector< VT, TF > &sv) |
Forces the serial evaluation of the given sparse vector expression sv. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::stddev (const SparseVector< VT, TF > &sv) |
Computes the standard deviation for the given sparse vector. More... | |
template<typename VT1 , typename VT2 , bool TF> | |
decltype(auto) | blaze::operator+ (const SparseVector< VT1, TF > &lhs, const SparseVector< VT2, TF > &rhs) |
Addition operator for the addition of two sparse vectors ( ![]() | |
template<typename VT1 , bool TF1, typename VT2 , bool TF2> | |
bool | blaze::operator== (const SparseVector< VT1, TF1 > &lhs, const SparseVector< VT2, TF2 > &rhs) |
Equality operator for the comparison of two sparse vectors. More... | |
template<typename VT1 , bool TF1, typename VT2 , bool TF2> | |
bool | blaze::operator!= (const SparseVector< VT1, TF1 > &lhs, const SparseVector< VT2, TF2 > &rhs) |
Inequality operator for the comparison of two sparse vectors. More... | |
template<typename VT1 , typename VT2 > | |
decltype(auto) | blaze::operator* (const SparseVector< VT1, true > &lhs, const SparseVector< VT2, false > &rhs) |
Multiplication operator for the scalar product (inner product) of two sparse vectors ( ![]() | |
template<typename VT1 , typename VT2 , bool TF> | |
decltype(auto) | blaze::kron (const SparseVector< VT1, TF > &lhs, const SparseVector< VT2, TF > &rhs) |
Computes the Kronecker product of two sparse vectors ( ![]() | |
template<typename VT1 , typename VT2 , bool TF> | |
decltype(auto) | blaze::operator* (const SparseVector< VT1, TF > &lhs, const SparseVector< VT2, TF > &rhs) |
Multiplication operator for the componentwise multiplication of two sparse vectors ( ![]() | |
template<typename VT1 , typename VT2 , bool TF> | |
decltype(auto) | blaze::operator- (const SparseVector< VT1, TF > &lhs, const SparseVector< VT2, TF > &rhs) |
Subtraction operator for the subtraction of two sparse vectors ( ![]() | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::trans (const SparseVector< VT, TF > &sv) |
Calculation of the transpose of the given sparse vector. More... | |
template<bool TTF, typename VT , bool TF> | |
decltype(auto) | blaze::transTo (const SparseVector< VT, TF > &sv) |
Conditional calculation of the transpose of the given sparse vector. More... | |
template<typename VT , bool TF> | |
decltype(auto) | blaze::var (const SparseVector< VT, TF > &sv) |
Computes the variance for the given sparse vector. More... | |
template<typename MT , typename VT > | |
decltype(auto) | blaze::operator* (const SparseMatrix< MT, true > &mat, const SparseVector< VT, false > &vec) |
Multiplication operator for the multiplication of a transpose sparse matrix and a sparse vector ( ![]() | |
template<typename VT , typename MT > | |
decltype(auto) | blaze::operator* (const SparseVector< VT, true > &vec, const SparseMatrix< MT, false > &mat) |
Multiplication operator for the multiplication of a transpose sparse vector and a row-major sparse matrix ( ![]() | |
template<typename VT , typename MT > | |
decltype(auto) | blaze::operator* (const SparseVector< VT, true > &vec, const SparseMatrix< MT, true > &mat) |
Multiplication operator for the multiplication of a transpose sparse vector and a column-major sparse matrix ( ![]() | |
SparseVector global functions | |
template<typename VT , bool TF> | |
BLAZE_ALWAYS_INLINE VT::Iterator | blaze::find (SparseVector< VT, TF > &sv, size_t index) |
Searches for a specific sparse vector element. More... | |
template<typename VT , bool TF> | |
BLAZE_ALWAYS_INLINE VT::ConstIterator | blaze::find (const SparseVector< VT, TF > &sv, size_t index) |
Searches for a specific sparse vector element. More... | |
template<typename VT , bool TF> | |
BLAZE_ALWAYS_INLINE VT::Iterator | blaze::lowerBound (SparseVector< VT, TF > &sv, size_t index) |
Returns an iterator to the first index not less then the given index. More... | |
template<typename VT , bool TF> | |
BLAZE_ALWAYS_INLINE VT::ConstIterator | blaze::lowerBound (const SparseVector< VT, TF > &sv, size_t index) |
Returns an iterator to the first index not less then the given index. More... | |
template<typename VT , bool TF> | |
BLAZE_ALWAYS_INLINE VT::Iterator | blaze::upperBound (SparseVector< VT, TF > &sv, size_t index) |
Returns an iterator to the first index greater then the given index. More... | |
template<typename VT , bool TF> | |
BLAZE_ALWAYS_INLINE VT::ConstIterator | blaze::upperBound (const SparseVector< VT, TF > &sv, size_t index) |
Returns an iterator to the first index greater then the given index. More... | |
SparseVector operators | |
template<typename VT , bool TF, typename ST > | |
auto | blaze::operator*= (SparseVector< VT, TF > &vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & > |
Multiplication assignment operator for the multiplication of a sparse vector and a scalar value ( ![]() | |
template<typename VT , bool TF, typename ST > | |
auto | blaze::operator*= (SparseVector< VT, TF > &&vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & > |
Multiplication assignment operator for the multiplication of a temporary sparse vector and a scalar ( ![]() | |
template<typename VT , bool TF, typename ST > | |
auto | blaze::operator/= (SparseVector< VT, TF > &vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & > |
Division assignment operator for the division of a sparse vector by a scalar value ( ![]() | |
template<typename VT , bool TF, typename ST > | |
auto | blaze::operator/= (SparseVector< VT, TF > &&vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & > |
Division assignment operator for the division of a temporary sparse vector by a scalar value ( ![]() | |
SparseVector functions | |
template<typename VT , bool TF> | |
bool | blaze::isnan (const SparseVector< VT, TF > &sv) |
Checks the given sparse vector for not-a-number elements. More... | |
template<typename VT , bool TF> | |
bool | blaze::isinf (const SparseVector< VT, TF > &sv) |
Checks the given sparse vector for infinite elements. More... | |
template<typename VT , bool TF> | |
bool | blaze::isfinite (const SparseVector< VT, TF > &sv) |
Checks the given sparse vector for finite elements. More... | |
template<RelaxationFlag RF, typename VT , bool TF> | |
bool | blaze::isUniform (const SparseVector< VT, TF > &sv) |
Checks if the given sparse vector is a uniform vector. More... | |
template<RelaxationFlag RF, typename VT , bool TF> | |
bool | blaze::isZero (const SparseVector< VT, TF > &sv) |
Checks if the given sparse vector is a zero vector. More... | |
VectorAccessProxy global functions | |
template<typename VT > | |
void | blaze::swap (const VectorAccessProxy< VT > &a, const VectorAccessProxy< VT > &b) noexcept |
Swapping the contents of two access proxies. More... | |
template<typename VT , typename T > | |
void | blaze::swap (const VectorAccessProxy< VT > &a, T &b) noexcept |
Swapping the contents of an access proxy with another element. More... | |
template<typename T , typename VT > | |
void | blaze::swap (T &a, const VectorAccessProxy< VT > &b) noexcept |
Swapping the contents of an access proxy with another element. More... | |
|
inline |
Applies the abs() function to each non-zero element of the sparse vector sv.
sv | The input vector. |
This function applies the abs() function to each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the abs() function:
|
inline |
Computes the inverse cosine of each non-zero element of the sparse vector sv.
sv | The input vector; all non-zero elements must be in the range ![]() |
The acos() function computes the inverse cosine for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the acos() function:
|
inline |
Computes the inverse hyperbolic cosine of each non-zero element of the sparse vector sv.
sv | The input vector; all non-zero elements must be in the range ![]() |
The acosh() function computes the inverse hyperbolic cosine for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the acosh() function:
|
inline |
Returns a vector containing the phase angle of each single element of sv.
sv | The integral sparse input vector. |
The arg() function calculates the phase angle of each element of the sparse input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the arg() function:
|
inline |
Returns the index of the first largest non-zero element of the sparse vector.
sv | The given sparse vector. |
This function returns the index of the first largest non-zero element of the given sparse vector. This function can only be used for element types that support the largest-than relationship. I case the given vector currently has a size of 0 or no non-zero elements, the returned index is 0.
|
inline |
Returns the index of the first smallest non-zero element of the sparse vector.
sv | The given sparse vector. |
This function returns the index of the first smallest non-zero element of the given sparse vector. This function can only be used for element types that support the smaller-than relationship. I case the given vector currently has a size of 0 or no non-zero elements, the returned index is 0.
|
inline |
Computes the inverse sine of each non-zero element of the sparse vector sv.
sv | The input vector; all non-zero elements must be in the range ![]() |
The asin() function computes the inverse sine for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the asin() function:
|
inline |
Computes the inverse hyperbolic sine of each non-zero element of the sparse vector sv.
sv | The input vector. |
The asinh() function computes the inverse hyperbolic sine for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the asinh() function:
|
inline |
Computes the inverse tangent of each non-zero element of the sparse vector sv.
sv | The input vector. |
The atan() function computes the inverse tangent for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the atan() function:
|
inline |
Computes the inverse hyperbolic tangent of each non-zero element of the sparse vector sv.
sv | The input vector; all non-zero elements must be in the range ![]() |
The atanh() function computes the inverse hyperbolic tangent for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the atanh() function:
|
inline |
Computes the cubic root of each non-zero element of the sparse vector sv.
sv | The input vector; all non-zero elements must be in the range ![]() |
The cbrt() function computes the cubic root of each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the cbrt() function:
|
inline |
Applies the ceil() function to each non-zero element of the sparse vector sv.
sv | The input vector. |
This function applies the ceil() function to each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the ceil() function:
|
inline |
Restricts each single element of the sparse vector sv to the range .
sv | The input vector. |
min | The lower delimiter. |
max | The upper delimiter. |
The clamp() function resetricts each element of the input vector sv to the range . The function returns an expression representing this operation.
The following example demonstrates the use of the clamp() function:
|
inline |
Returns a vector containing the complex conjugate of each single element of sv.
sv | The integral sparse input vector. |
The conj() function calculates the complex conjugate of each element of the sparse input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the conj() function:
|
inline |
Computes the cosine of each non-zero element of the sparse vector sv.
sv | The input vector. |
The cos() function computes the cosine for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the cos() function:
|
inline |
Computes the hyperbolic cosine of each non-zero element of the sparse vector sv.
sv | The input vector. |
The cosh() function computes the hyperbolic cosine for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the cosh() function:
|
inline |
Returns the conjugate transpose vector of sv.
sv | The input vector. |
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 sv.
The following example demonstrates the use of the ctrans() function:
Note that the ctrans() function has the same effect as manually applying the conj() and trans function in any order:
|
inline |
Computes the error function of each non-zero element of the sparse vector sv.
sv | The input vector. |
The erf() function computes the error function for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the erf() function:
|
inline |
Computes the complementary error function of each non-zero element of the sparse vector sv.
sv | The input vector. |
The erfc() function computes the complementary error function for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the erfc() function:
|
inline |
Forces the evaluation of the given sparse vector expression sv.
sv | The input vector. |
The eval function forces the evaluation of the given sparse vector expression sv. The function returns an expression representing this operation.
The following example demonstrates the use of the eval function:
|
inline |
Computes of each non-zero element of the sparse vector sv.
sv | The input vector. |
The exp() function computes for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the exp() function:
|
inline |
Computes of each non-zero element of the sparse vector sv.
sv | The input vector. |
The exp10() function computes for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the exp10() function:
|
inline |
Computes of each non-zero element of the sparse vector sv.
sv | The input vector. |
The exp2() function computes for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the exp2() function:
|
inline |
Expansion of the given sparse vector.
sv | The sparse vector to be expanded. |
This function returns an expression representing the expansion of the given sparse vector:
|
inline |
Expansion of the given sparse vector.
sv | The sparse vector to be expanded. |
expansion | The expansion. |
This function returns an expression representing the expansion of the given sparse vector:
BLAZE_ALWAYS_INLINE VT::ConstIterator blaze::find | ( | const SparseVector< VT, TF > & | sv, |
size_t | index | ||
) |
Searches for a specific sparse vector element.
sv | The given sparse vector. |
index | The index of the search element. The index has to be in the range ![]() |
This function can be used to check whether a specific element is contained in the sparse vector. It specifically searches for the element with index index. In case the element is found, the function returns an iterator to the element. Otherwise an iterator just past the last non-zero element of the sparse vector (the end() iterator) is returned. Note that the returned sparse vector iterator is subject to invalidation due to inserting operations via the subscript operator, the set() function or the insert() function!
BLAZE_ALWAYS_INLINE VT::Iterator blaze::find | ( | SparseVector< VT, TF > & | sv, |
size_t | index | ||
) |
Searches for a specific sparse vector element.
sv | The given sparse vector. |
index | The index of the search element. The index has to be in the range ![]() |
This function can be used to check whether a specific element is contained in the sparse vector. It specifically searches for the element with index index. In case the element is found, the function returns an iterator to the element. Otherwise an iterator just past the last non-zero element of the sparse vector (the end() iterator) is returned. Note that the returned sparse vector iterator is subject to invalidation due to inserting operations via the subscript operator, the set() function or the insert() function!
|
noexcept |
Fixing the size of the given sparse vector.
sv | The sparse vector to be size-fixed. |
This function returns an expression representing the size-fixed given sparse vector:
|
inline |
Applies the floor() function to each non-zero element of the sparse vector sv.
sv | The input vector. |
This function applies the floor() function to each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the floor() function:
|
inline |
Evaluates the given custom operation on each non-zero element of the sparse vector sv.
sv | The input vector. |
op | The custom operation. |
The forEach() function evaluates the given custom operation on each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the forEach() function:
|
inline |
Returns a vector containing the imaginary parts of each single element of sv.
sv | The integral sparse input vector. |
The imag() function calculates the imaginary part of each element of the sparse input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the imag() function:
|
inline |
Computes the inverse cubic root of each non-zero element of the sparse vector sv.
sv | The input vector; all non-zero elements must be in the range ![]() |
The invcbrt() function computes the inverse cubic root of each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the invcbrt() function:
|
inline |
Computes the inverse square root of each non-zero element of the sparse vector sv.
sv | The input vector; all non-zero elements must be in the range ![]() |
The invsqrt() function computes the inverse square root of each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the invsqrt() function:
|
inline |
Checks the given sparse vector for finite elements.
sv | The sparse vector to be checked for finite elements. |
This function checks if all elements of the N-dimensional sparse 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.
|
inline |
Checks the given sparse vector for infinite elements.
sv | The sparse vector to be checked for infinite elements. |
This function checks the N-dimensional sparse vector for infinite (inf) elements. If at least one element of the vector is infinite, the function returns true, otherwise it returns false.
|
inline |
Checks the given sparse vector for not-a-number elements.
sv | The sparse vector to be checked for not-a-number elements. |
This function checks the N-dimensional sparse 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.
bool blaze::isUniform | ( | const SparseVector< VT, TF > & | sv | ) |
Checks if the given sparse vector is a uniform vector.
sv | The sparse vector to be checked. |
This function checks if the given sparse 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:
Optionally, it is possible to switch between strict semantics (blaze::strict) and relaxed semantics (blaze::relaxed):
It is also possible to check if a vector expression results is a uniform vector:
However, note that this might require the complete evaluation of the expression, including the generation of a temporary vector.
bool blaze::isZero | ( | const SparseVector< VT, TF > & | sv | ) |
Checks if the given sparse vector is a zero vector.
sv | The sparse vector to be checked. |
This function checks if the given sparse 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:
Optionally, it is possible to switch between strict semantics (blaze::strict) and relaxed semantics (blaze::relaxed):
It is also possible to check if a vector expression results is a zero vector:
However, note that this might require the complete evaluation of the expression, including the generation of a temporary vector.
|
inline |
Computes the Kronecker product of a dense vector and a sparse vector ( ).
lhs | The left-hand side dense vector for the Kronecker product. |
rhs | The right-hand side sparse vector for the Kronecker product. |
This kron() function computes the Kronecker product of the given dense vector and sparse vector:
The function returns an expression representing a sparse 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.
|
inline |
Computes the Kronecker product of a sparse vector and a vector vector ( ).
lhs | The left-hand side sparse vector for the Kronecker product. |
rhs | The right-hand side dense vector for the Kronecker product. |
This kron() function computes the Kronecker product of the given sparse vector and dense vector:
The function returns an expression representing a sparse 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.
|
inline |
Computes the Kronecker product of two sparse vectors ( ).
lhs | The left-hand side sparse vector for the Kronecker product. |
rhs | The right-hand side sparse vector for the Kronecker product. |
The kron() function computes the Kronecker product of the two given sparse vectors:
The function returns an expression representing a sparse 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.
decltype(auto) blaze::l1Norm | ( | const SparseVector< VT, TF > & | sv | ) |
Computes the L1 norm for the given sparse vector.
sv | The given sparse vector for the norm computation. |
This function computes the L1 norm of the given sparse vector:
decltype(auto) blaze::l2Norm | ( | const SparseVector< VT, TF > & | sv | ) |
Computes the L2 norm for the given sparse vector.
sv | The given sparse vector for the norm computation. |
This function computes the L2 norm of the given sparse vector:
decltype(auto) blaze::l3Norm | ( | const SparseVector< VT, TF > & | sv | ) |
Computes the L3 norm for the given sparse vector.
sv | The given sparse vector for the norm computation. |
This function computes the L3 norm of the given sparse vector:
decltype(auto) blaze::l4Norm | ( | const SparseVector< VT, TF > & | sv | ) |
Computes the L4 norm for the given sparse vector.
sv | The given sparse vector for the norm computation. |
This function computes the L4 norm of the given sparse vector:
|
inline |
Calculation of the length (magnitude) of the sparse vector .
sv | The given sparse vector. |
This function calculates the actual length (magnitude) of the sparse vector. The function has the same effect as calling the norm() function on the sparse vector.
|
inline |
Computes the natural logarithm of the absolute value of the gamma function of each non-zero element of the sparse vector sv.
sv | The input vector; all non-zero elements must be in the range ![]() |
The lgamma() function computes the natural logarithm of the absolute value of the gamma function for each non-zero element. The function returns an expression representing this operation.
The following example demonstrates the use of the lgamma() function:
decltype(auto) blaze::linfNorm | ( | const SparseVector< VT, TF > & | sv | ) |
Computes the infinity norm for the given sparse vector.
sv | The given sparse vector for the norm computation. |
This function computes the infinity norm of the given sparse vector:
|
inline |
Computes the natural logarithm of each non-zero element of the sparse vector sv.
sv | The input vector; all non-zero elements must be in the range ![]() |
The log() function computes the natural logarithm for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the log() function:
|
inline |
Computes the common logarithm of each non-zero element of the sparse vector sv.
sv | The input vector; all non-zero elements must be in the range ![]() |
The log10() function computes the common logarithm for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the log10() function:
|
inline |
Computes the natural logarithm of x+1 of each non-zero element of the sparse vector sv.
sv | The input vector; all non-zero elements must be in the range ![]() |
The log1p() function computes the natural logarithm of x+1 for each non-zero element of the input vector sv. 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:
|
inline |
Computes the binary logarithm of each non-zero element of the sparse vector sv.
sv | The input vector; all non-zero elements must be in the range ![]() |
The log2() function computes the binary logarithm for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the log2() function:
BLAZE_ALWAYS_INLINE VT::ConstIterator blaze::lowerBound | ( | const SparseVector< VT, TF > & | sv, |
size_t | index | ||
) |
Returns an iterator to the first index not less then the given index.
sv | The given sparse vector. |
index | The index of the search element. The index has to be in the range ![]() |
This function returns an iterator to the first element with an index not less then the given index. In combination with the upperBound() function this function can be used to create a pair of iterators specifying a range of indices. Note that the returned sparse vector iterator is subject to invalidation due to inserting operations via the subscript operator, the set() function or the insert() function!
BLAZE_ALWAYS_INLINE VT::Iterator blaze::lowerBound | ( | SparseVector< VT, TF > & | sv, |
size_t | index | ||
) |
Returns an iterator to the first index not less then the given index.
sv | The given sparse vector. |
index | The index of the search element. The index has to be in the range ![]() |
This function returns an iterator to the first element with an index not less then the given index. In combination with the upperBound() function this function can be used to create a pair of iterators specifying a range of indices. Note that the returned sparse vector iterator is subject to invalidation due to inserting operations via the subscript operator, the set() function or the insert() function!
|
inline |
Computes the Lp norm for the given sparse vector.
sv | The given sparse vector for the norm computation. |
This function computes the Lp norm of the given sparse vector, where the norm is specified by the runtime argument P:
decltype(auto) blaze::lpNorm | ( | const SparseVector< VT, TF > & | sv, |
ST | p | ||
) |
Computes the Lp norm for the given sparse vector.
sv | The given sparse vector for the norm computation. |
p | The norm parameter (p > 0). |
This function computes the Lp norm of the given sparse vector, where the norm is specified by the runtime argument p:
|
inline |
Evaluates the given custom operation on each non-zero element of the sparse vector sv.
sv | The input vector. |
op | The custom operation. |
The map() function evaluates the given custom operation on each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the map() function:
|
inline |
Returns the largest element of the sparse vector.
sv | The given sparse vector. |
This function returns the largest non-zero element of the given sparse 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).
decltype(auto) blaze::maxNorm | ( | const SparseVector< VT, TF > & | sv | ) |
Computes the maximum norm for the given sparse vector.
sv | The given sparse vector for the norm computation. |
This function computes the maximum norm of the given sparse vector:
|
inline |
Computes the (arithmetic) mean for the given sparse vector.
sv | The given sparse vector for the mean computation. |
std::invalid_argument | Invalid input vector. |
This function computes the (arithmetic) mean for the given sparse vector sv. Both the non-zero and zero elements of the sparse vector are taken into account. Example:
In case the size of the given vector is 0, a std::invalid_argument is thrown.
|
inline |
Returns the smallest element of the sparse vector.
sv | The given sparse vector. |
This function returns the smallest non-zero element of the given sparse 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).
decltype(auto) blaze::minNorm | ( | const SparseVector< VT, TF > & | sv | ) |
Computes the minimum norm for the given sparse vector.
sv | The given sparse vector for the norm computation. |
This function computes the minimum norm of the given sparse vector:
|
inline |
Forces the non-aliased evaluation of the given sparse vector expression sv.
sv | The input vector. |
The noalias function forces the non-aliased evaluation of the given sparse vector expression sv. The function returns an expression representing this operation.
The following example demonstrates the use of the noalias function:
decltype(auto) blaze::norm | ( | const SparseVector< VT, TF > & | sv | ) |
Computes the L2 norm for the given sparse vector.
sv | The given sparse vector for the norm computation. |
This function computes the L2 norm of the given sparse vector:
|
inline |
Disables the SIMD evaluation of the given sparse vector expression sv.
sv | The input vector. |
The nosimd function disables the SIMD evaluation of the given sparse vector expression sv. The function returns an expression representing this operation.
The following example demonstrates the use of the nosimd function:
|
inline |
Inequality operator for the comparison of two sparse vectors.
lhs | The left-hand side sparse vector for the comparison. |
rhs | The right-hand side sparse vector for the comparison. |
|
inline |
Multiplication operator for the componentwise product of a dense vector and a sparse vector ( ).
lhs | The left-hand side dense vector for the component product. |
rhs | The right-hand side sparse vector for the component product. |
std::invalid_argument | Vector sizes do not match. |
This operator represents the componentwise multiplication of a dense vector and a sparse vector:
The operator returns an expression representing a sparse 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.
In case the current sizes of the two given vectors don't match, a std::invalid_argument is thrown.
|
inline |
Multiplication operator for the scalar product (inner product) of a dense and a sparse vector ( ).
lhs | The left-hand side dense vector for the inner product. |
rhs | The right-hand side sparse vector for the inner product. |
std::invalid_argument | Vector sizes do not match. |
This operator represents the scalar product (inner product) of a dense vector and a sparse vector:
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.
|
inline |
Multiplication operator for the multiplication of a row-major sparse matrix and a sparse vector ( ).
mat | The left-hand side sparse matrix for the multiplication. |
vec | The right-hand side sparse vector for the multiplication. |
std::invalid_argument | Matrix and vector sizes do not match. |
This operator represents the multiplication between a row-major sparse matrix and a sparse vector:
The operator returns an expression representing a sparse 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 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.
|
inline |
Multiplication operator for the multiplication of a transpose sparse matrix and a sparse vector ( ).
mat | The left-hand side sparse matrix for the multiplication. |
vec | The right-hand side sparse vector for the multiplication. |
std::invalid_argument | Matrix and vector sizes do not match. |
This operator represents the multiplication between a transpose sparse matrix and a sparse vector:
The operator returns an expression representing a sparse 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 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.
|
inline |
Multiplication operator for the multiplication of a sparse vector and a scalar value ( ).
vec | The left-hand side sparse vector for the multiplication. |
scalar | The right-hand side scalar value for the multiplication. |
This operator represents the multiplication between a sparse vector and a scalar value:
The operator returns a sparse vector of the higher-order element type of the involved data types VT::ElementType and ST. Note that this operator only works for scalar values of built-in data type.
|
inline |
Multiplication operator for the multiplication of a transpose sparse vector and a row-major sparse matrix ( ).
vec | The left-hand side transpose sparse vector for the multiplication. |
mat | The right-hand side row-major sparse matrix for the multiplication. |
std::invalid_argument | Vector and matrix sizes do not match. |
This operator represents the multiplication between a transpose sparse vector and a row-major sparse 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 sparse vector type VT and the sparse matrix 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.
|
inline |
Multiplication operator for the multiplication of a transpose sparse vector and a column-major sparse matrix ( ).
vec | The left-hand side transpose sparse vector for the multiplication. |
mat | The right-hand side column-major sparse matrix for the multiplication. |
std::invalid_argument | Vector and matrix sizes do not match. |
This operator represents the multiplication between a transpose sparse vector and a column-major sparse 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 sparse vector type VT and the sparse matrix 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.
|
inline |
Multiplication operator for the componentwise product of a sparse vector and a dense vector ( ).
lhs | The left-hand side sparse vector for the component product. |
rhs | The right-hand side dense vector for the component product. |
std::invalid_argument | Vector sizes do not match. |
This operator represents the componentwise multiplication of a sparse vector and a dense vector:
The operator returns an expression representing a sparse 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.
In case the current sizes of the two given vectors don't match, a std::invalid_argument is thrown.
|
inline |
Multiplication operator for the componentwise multiplication of two sparse vectors ( ).
lhs | The left-hand side sparse vector for the component product. |
rhs | The right-hand side sparse vector for the component product. |
std::invalid_argument | Vector sizes do not match. |
This operator represents the componentwise multiplication of two sparse vectors:
The operator returns a sparse 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.
In case the current sizes of the two given vectors don't match, a std::invalid_argument is thrown.
|
inline |
Multiplication operator for the scalar product (inner product) of a sparse and a dense vector ( ).
lhs | The left-hand side sparse vector for the inner product. |
rhs | The right-hand side dense vector for the inner product. |
std::invalid_argument | Vector sizes do not match. |
This operator represents the scalar product (inner product) of a sparse vector and a dense vector:
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.
|
inline |
Multiplication operator for the scalar product (inner product) of two sparse vectors ( ).
lhs | The left-hand side sparse vector for the inner product. |
rhs | The right-hand side sparse vector for the inner product. |
std::invalid_argument | Vector sizes do not match. |
This operator represents the scalar product (inner product) of two sparse vectors:
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.
|
inline |
Multiplication operator for the multiplication of a scalar value and a sparse vector ( ).
scalar | The left-hand side scalar value for the multiplication. |
vec | The right-hand side sparse vector for the multiplication. |
This operator represents the multiplication between a a scalar value and sparse vector:
The operator returns a sparse vector of the higher-order element type of the involved data types ST and VT::ElementType. Note that this operator only works for scalar values of built-in data type.
|
inline |
Multiplication assignment operator for the multiplication of a temporary sparse vector and a scalar ( ).
vec | The left-hand side temporary sparse vector for the multiplication. |
scalar | The right-hand side scalar value for the multiplication. |
std::invalid_argument | Invalid 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.
|
inline |
Multiplication assignment operator for the multiplication of a sparse vector and a scalar value ( ).
vec | The left-hand side sparse vector for the multiplication. |
scalar | The right-hand side scalar value for the multiplication. |
std::invalid_argument | Invalid 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.
|
inline |
Addition operator for the addition of two sparse vectors ( ).
lhs | The left-hand side sparse vector for the vector addition. |
rhs | The right-hand side sparse vector for the vector addition. |
std::invalid_argument | Vector sizes do not match. |
This operator represents the addition of two sparse vectors:
The operator returns a sparse 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.
|
inline |
Unary minus operator for the negation of a sparse vector ( ).
sv | The sparse vector to be negated. |
This operator represents the negation of a sparse vector:
The operator returns an expression representing the negation of the given sparse vector.
|
inline |
Subtraction operator for the subtraction of two sparse vectors ( ).
lhs | The left-hand side sparse vector for the vector subtraction. |
rhs | The right-hand side sparse vector to be subtracted from the vector. |
std::invalid_argument | Vector sizes do not match. |
This operator represents the subtraction of two sparse vectors:
The operator returns a sparse 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.
|
inline |
Division operator for the divison of a sparse vector by a scalar value ( ).
vec | The left-hand side sparse vector for the division. |
scalar | The right-hand side scalar value for the division. |
This operator represents the division of a sparse vector by a scalar value:
The operator returns a sparse vector of the higher-order element type of the involved data types VT::ElementType and ST. Note that this operator only works for scalar values of built-in data type.
|
inline |
Division operator for the componentwise division of a sparse vector and a dense vector ( ).
lhs | The left-hand side sparse vector for the component quotient. |
rhs | The right-hand side dense vector for the component quotient. |
std::invalid_argument | Vector sizes do not match. |
This operator represents the component quotient of a sparse vector and a dense vector:
The operator returns an expression representing a sparse 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.
|
inline |
Division assignment operator for the division of a temporary sparse vector by a scalar value ( ).
vec | The left-hand side temporary sparse vector for the division. |
scalar | The right-hand side scalar value for the division. |
std::invalid_argument | Invalid 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.
|
inline |
Division assignment operator for the division of a sparse vector by a scalar value ( ).
vec | The left-hand side sparse vector for the division. |
scalar | The right-hand side scalar value for the division. |
std::invalid_argument | Invalid 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.
|
inline |
Equality operator for the comparison of two sparse vectors.
lhs | The left-hand side sparse vector for the comparison. |
rhs | The right-hand side sparse vector for the comparison. |
|
inline |
Computes the exponential value for each non-zero element of the sparse vector sv.
sv | The input vector. |
exp | The scalar exponent. |
The pow() function computes the exponential value for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the pow() function:
|
inline |
Reduces the given sparse vector by means of multiplication.
sv | The given sparse vector for the reduction operation. |
This function reduces the non-zero elements of the given sparse vector sv by means of multiplication:
Please note that the evaluation order of the reduction operation is unspecified.
|
inline |
Returns a vector containing the real parts of each single element of sv.
sv | The integral sparse input vector. |
The real() function calculates the real part of each element of the sparse input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the real() function:
|
inline |
Performs a custom reduction operation on the given sparse vector.
sv | The given sparse vector for the reduction computation. |
op | The reduction operation. |
This function reduces the non-zero elements of the given sparse vector sv by means of the given reduction operation op:
As demonstrated in the example it is possible to pass any binary callable as custom reduction operation. See Custom Operations for a detailed overview of the possibilities of custom operations.
Please note that the evaluation order of the reduction operation is unspecified. Thus the behavior is non-deterministic if op is not associative or not commutative. Also, the operation is undefined if the given reduction operation modifies the values.
|
inline |
Repeats the given sparse vector.
sv | The sparse vector to be repeated. |
This function returns an expression representing the repeated sparse vector:
|
inline |
Repeats the given sparse vector.
sv | The sparse vector to be repeated. |
repetitions | The number of repetitions. |
This function returns an expression representing the repeated sparse vector:
|
inline |
Applies the round() function to each non-zero element of the sparse vector sv.
sv | The input vector. |
This function applies the round() function to each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the round() function:
|
inline |
Forces the serial evaluation of the given sparse vector expression sv.
sv | The input vector. |
The serial function forces the serial evaluation of the given sparse vector expression sv. The function returns an expression representing this operation.
The following example demonstrates the use of the serial function:
|
inline |
Applies the sign() function to each non-zero element of the sparse vector sv.
sv | The input vector. |
This function applies the sign() function to each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the sign() function:
|
inline |
Computes the sine of each non-zero element of the sparse vector sv.
sv | The input vector. |
The sin() function computes the sine for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the sin() function:
|
inline |
Computes the hyperbolic sine of each non-zero element of the sparse vector sv.
sv | The input vector. |
The sinh() function computes the hyperbolic sine for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the sinh() function:
|
inline |
Calculation of the square length (magnitude) of the sparse vector .
sv | The given sparse vector. |
This function calculates the actual square length (magnitude) of the sparse vector. The function has the same effect as calling the sqrNorm() function on the sparse vector.
decltype(auto) blaze::sqrNorm | ( | const SparseVector< VT, TF > & | sv | ) |
Computes the squared L2 norm for the given sparse vector.
sv | The given sparse vector for the norm computation. |
This function computes the squared L2 norm of the given sparse vector:
|
inline |
Computes the square root of each non-zero element of the sparse vector sv.
sv | The input vector; all non-zero elements must be in the range ![]() |
The sqrt() function computes the square root of each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the sqrt() function:
decltype(auto) blaze::stddev | ( | const SparseVector< VT, TF > & | sv | ) |
Computes the standard deviation for the given sparse vector.
sv | The given sparse vector for the standard deviation computation. |
std::invalid_argument | Invalid input vector. |
This function computes the standard deviation for the given sparse vector sv. Both the non-zero and zero elements of the sparse vector are taken into account. Example:
In case the size of the given vector is smaller than 2, a std::invalid_argument is thrown.
|
inline |
Reduces the given sparse vector by means of addition.
sv | The given sparse vector for the reduction operation. |
This function reduces the non-zero elements of the given sparse vector sv by means of addition:
Please note that the evaluation order of the reduction operation is unspecified.
|
inlinenoexcept |
Swapping the contents of two access proxies.
a | The first access proxy to be swapped. |
b | The second access proxy to be swapped. |
|
inlinenoexcept |
Swapping the contents of an access proxy with another element.
a | The access proxy to be swapped. |
b | The other element to be swapped. |
|
inlinenoexcept |
Swapping the contents of an access proxy with another element.
a | The other element to be swapped. |
b | The access proxy to be swapped. |
|
inline |
Computes the tangent of each non-zero element of the sparse vector sv.
sv | The input vector. |
The tan() function computes the tangent for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the tan() function:
|
inline |
Computes the hyperbolic tangent of each non-zero element of the sparse vector sv.
sv | The input vector; all non-zero elements must be in the range ![]() |
The tanh() function computes the hyperbolic tangent for each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the tanh() function:
|
inline |
Calculation of the transpose of the given sparse vector.
sv | The sparse vector to be transposed. |
This function returns an expression representing the transpose of the given sparse vector:
|
inline |
Conditional calculation of the transpose of the given sparse vector.
sv | The sparse vector to be transposed. |
This function transposes the given sparse 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 sparse vector with the specified transpose flag.
|
inline |
Applies the trunc() function to each non-zero element of the sparse vector sv.
sv | The input vector. |
This function applies the trunc() function to each non-zero element of the input vector sv. The function returns an expression representing this operation.
The following example demonstrates the use of the trunc() function:
BLAZE_ALWAYS_INLINE VT::ConstIterator blaze::upperBound | ( | const SparseVector< VT, TF > & | sv, |
size_t | index | ||
) |
Returns an iterator to the first index greater then the given index.
sv | The given sparse vector. |
index | The index of the search element. The index has to be in the range ![]() |
This function returns an iterator to the first element with an index greater then the given index. In combination with the lowerBound() function this function can be used to create a pair of iterators specifying a range of indices. Note that the returned sparse vector iterator is subject to invalidation due to inserting operations via the subscript operator, the set() function or the insert() function!
BLAZE_ALWAYS_INLINE VT::Iterator blaze::upperBound | ( | SparseVector< VT, TF > & | sv, |
size_t | index | ||
) |
Returns an iterator to the first index greater then the given index.
sv | The given sparse vector. |
index | The index of the search element. The index has to be in the range ![]() |
This function returns an iterator to the first element with an index greater then the given index. In combination with the lowerBound() function this function can be used to create a pair of iterators specifying a range of indices. Note that the returned sparse vector iterator is subject to invalidation due to inserting operations via the subscript operator, the set() function or the insert() function!
decltype(auto) blaze::var | ( | const SparseVector< VT, TF > & | sv | ) |
Computes the variance for the given sparse vector.
sv | The given sparse vector for the variance computation. |
std::invalid_argument | Invalid input vector. |
This function computes the variance for the given sparse vector sv. Both the non-zero and zero elements of the sparse vector are taken into account. Example:
In case the size of the given vector is smaller than 2, a std::invalid_argument is thrown.