35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATMAPEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_SMATMAPEXPR_H_ 94 :
public MatMapExpr< SparseMatrix< SMatMapExpr<MT,OP,SO>, SO > >
112 static constexpr
bool useAssign = RequiresEvaluation_v<MT>;
115 template<
typename MT2 >
117 static constexpr
bool UseAssign_v =
useAssign;
129 template<
typename MT2 >
130 static constexpr
bool UseSMPAssign_v =
131 ( ( !MT2::smpAssignable || !MT::smpAssignable ) &&
useAssign );
145 using ReturnType = decltype( std::declval<OP>()( std::declval<RN>() ) );
233 return op_(
it_->value() );
328 if( i >=
sm_.rows() ) {
331 if( j >=
sm_.columns() ) {
365 inline size_t rows() const noexcept {
376 return sm_.columns();
386 return sm_.nonZeros();
397 return sm_.nonZeros(i);
466 template<
typename T >
467 inline bool canAlias(
const T* alias )
const noexcept {
468 return sm_.canAlias( alias );
478 template<
typename T >
479 inline bool isAliased(
const T* alias )
const noexcept {
480 return sm_.isAliased( alias );
490 return sm_.canSMPAssign();
514 template<
typename MT2
529 assign( ~lhs,
map( tmp, rhs.op_ ) );
549 template<
typename MT2 >
559 assign( ~lhs, rhs.sm_ );
561 const size_t m( rhs.rows() );
563 for(
size_t i=0UL; i<m; ++i ) {
564 const auto end( (~lhs).
end(i) );
565 for(
auto element=(~lhs).
begin(i); element!=
end; ++element ) {
566 element->value() = rhs.op_( element->value() );
588 template<
typename MT2 >
589 friend inline auto assign( SparseMatrix<MT2,true>& lhs,
const SMatMapExpr& rhs )
590 -> EnableIf_t< UseAssign_v<MT2> &&
591 IsSame_v< UnderlyingNumeric_t<MT>, UnderlyingNumeric_t<MT2> > >
598 assign( ~lhs, rhs.sm_ );
600 const size_t n( rhs.columns() );
602 for(
size_t j=0UL; j<n; ++j ) {
603 const auto end( (~lhs).
end(j) );
604 for(
auto element=(~lhs).
begin(j); element!=
end; ++element ) {
605 element->value() = rhs.op_( element->value() );
627 template<
typename MT2
629 friend inline auto assign( SparseMatrix<MT2,SO2>& lhs,
const SMatMapExpr& rhs )
630 -> EnableIf_t< UseAssign_v<MT2> &&
631 !IsSame_v< UnderlyingNumeric_t<MT>, UnderlyingNumeric_t<MT2> > >
643 (~lhs).reserve( tmp.nonZeros() );
644 assign( ~lhs,
map( tmp, rhs.op_ ) );
663 template<
typename MT2
665 friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatMapExpr& rhs )
666 -> EnableIf_t< UseAssign_v<MT2> >
678 addAssign( ~lhs,
map( tmp, rhs.op_ ) );
701 template<
typename MT2
703 friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatMapExpr& rhs )
704 -> EnableIf_t< UseAssign_v<MT2> >
716 subAssign( ~lhs,
map( tmp, rhs.op_ ) );
739 template<
typename MT2
741 friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs,
const SMatMapExpr& rhs )
742 -> EnableIf_t< UseAssign_v<MT2> >
754 schurAssign( ~lhs,
map( tmp, rhs.op_ ) );
785 template<
typename MT2
788 -> EnableIf_t< UseSMPAssign_v<MT2> >
799 const RT tmp( rhs.sm_ );
823 template<
typename MT2
826 -> EnableIf_t< UseSMPAssign_v<MT2> >
837 const RT tmp( rhs.sm_ );
861 template<
typename MT2
864 -> EnableIf_t< UseSMPAssign_v<MT2> >
875 const RT tmp( rhs.sm_ );
899 template<
typename MT2
902 -> EnableIf_t< UseSMPAssign_v<MT2> >
913 const RT tmp( rhs.sm_ );
967 template<
typename MT
975 return ReturnType( ~sm, op );
998 template<
typename MT
1005 return map( ~sm, op );
1027 template<
typename MT
1033 return map( ~sm,
Abs() );
1055 template<
typename MT
1083 template<
typename MT
1111 template<
typename MT
1139 template<
typename MT
1167 template<
typename MT
1195 template<
typename MT
1232 template<
typename MT
1260 template<
typename MT
1288 template<
typename MT
1319 template<
typename MT
1350 template<
typename MT
1381 template<
typename MT
1412 template<
typename MT
1442 template<
typename MT
1472 template<
typename MT
1475 , EnableIf_t< IsNumeric_v<ST> >* =
nullptr >
1503 template<
typename MT
1509 return map( ~sm,
Exp() );
1531 template<
typename MT
1559 template<
typename MT
1590 template<
typename MT
1596 return map( ~sm,
Log() );
1621 template<
typename MT
1652 template<
typename MT
1680 template<
typename MT
1686 return map( ~sm,
Sin() );
1711 template<
typename MT
1739 template<
typename MT
1767 template<
typename MT
1795 template<
typename MT
1801 return map( ~sm,
Cos() );
1826 template<
typename MT
1854 template<
typename MT
1885 template<
typename MT
1913 template<
typename MT
1919 return map( ~sm,
Tan() );
1941 template<
typename MT
1972 template<
typename MT
2003 template<
typename MT
2031 template<
typename MT
2037 return map( ~sm,
Erf() );
2060 template<
typename MT
2090 template<
typename MT
2092 inline decltype(
auto)
abs( const SMatMapExpr<MT,Abs,SO>& sm )
2113 template<
typename MT
2115 inline decltype(
auto)
sign( const SMatMapExpr<MT,Sign,SO>& sm )
2136 template<
typename MT
2138 inline decltype(
auto)
floor( const SMatMapExpr<MT,Floor,SO>& sm )
2159 template<
typename MT
2161 inline decltype(
auto)
ceil( const SMatMapExpr<MT,Ceil,SO>& sm )
2182 template<
typename MT
2184 inline decltype(
auto)
trunc( const SMatMapExpr<MT,Trunc,SO>& sm )
2205 template<
typename MT
2207 inline decltype(
auto)
round( const SMatMapExpr<MT,Round,SO>& sm )
2235 template<
typename MT
2237 inline decltype(
auto)
conj( const SMatMapExpr<MT,Conj,TF>& sm )
2241 return sm.operand();
2265 template<
typename MT
2267 inline decltype(
auto)
conj( const SMatTransExpr<SMatMapExpr<MT,Conj,SO>,!SO>& sm )
2271 return trans( sm.operand().operand() );
2288 template<
typename MT
2290 inline decltype(
auto)
real( const SMatMapExpr<MT,Real,SO>& sm )
2311 template<
typename MT
2313 inline decltype(
auto)
imag( const SMatMapExpr<MT,Imag,SO>& sm )
Header file for the UnderlyingNumeric type trait.
Generic wrapper for the trunc() function.
Definition: Trunc.h:81
Pointer difference type of the Blaze library.
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:2014
ValueType * PointerType
Pointer return type.
Definition: SMatMapExpr.h:172
Header file for auxiliary alias declarations.
Generic wrapper for the ceil() function.
Definition: Ceil.h:81
decltype(auto) exp10(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1688
MapTrait_t< RT, OP > ResultType
Result type for expression template evaluations.
Definition: SMatMapExpr.h:139
Generic wrapper for the cbrt() function.
Definition: Cbrt.h:81
Header file for basic type definitions.
Operation operation() const
Returns a copy of the custom operation.
Definition: SMatMapExpr.h:455
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias template for the If class template.The If_t alias template provides a convenient shor...
Definition: If.h:109
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatMapExpr.h:408
Generic wrapper for the sin() function.
Definition: Sin.h:79
ReturnType_t< MT > RN
Return type of the sparse matrix expression.
Definition: SMatMapExpr.h:101
Generic wrapper for the conj() function.
Definition: Conj.h:83
Generic wrapper for the invsqrt() function.
Definition: InvSqrt.h:69
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
Header file for the serial shim.
decltype(auto) real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatMapExpr.h:1389
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:63
typename MapTrait< Args... >::Type MapTrait_t
Auxiliary alias declaration for the MapTrait class template.The MapTrait_t alias declaration provides...
Definition: MapTrait.h:160
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatMapExpr.h:232
IteratorType it_
Iterator over the elements of the sparse matrix expression.
Definition: SMatMapExpr.h:282
ConstIterator lowerBound(size_t i, size_t j) const
Returns an iterator to the first index not less then the given index.
Definition: SMatMapExpr.h:421
Header file for the IsSame and IsStrictlySame type traits.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatMapExpr.h:479
decltype(auto) ceil(const DenseMatrix< MT, SO > &dm)
Applies the ceil() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1240
Generic wrapper for the clamp() function.
Definition: Clamp.h:61
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:1271
Iterator over the elements of the sparse matrix map expression.
Definition: SMatMapExpr.h:160
Generic wrapper for the acosh() function.
Definition: Acosh.h:69
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:1572
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the map expression.
Definition: SMatMapExpr.h:112
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatMapExpr.h:264
ResultType_t< MT > RT
Result type of the sparse matrix expression.
Definition: SMatMapExpr.h:99
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatMapExpr.h:344
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatMapExpr.h:275
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatMapExpr.h:355
decltype(auto) sign(const DenseMatrix< MT, SO > &dm)
Applies the sign() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1184
Header file for the Computation base class.
size_t index() const
Access to the current index of the sparse element.
Definition: SMatMapExpr.h:242
decltype(std::declval< OP >()(std::declval< RN >())) ReturnType
Return type for expression template evaluations.
Definition: SMatMapExpr.h:145
Header file for the RequiresEvaluation type trait.
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatMapExpr.h:365
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.The ReturnType_t alias declaration provides ...
Definition: Aliases.h:410
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatMapExpr.h:445
decltype(auto) acos(const DenseMatrix< MT, SO > &dm)
Computes the inverse cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1955
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: SMatMapExpr.h:142
Expression object for the sparse matrix map() function.The SMatMapExpr class represents the compile t...
Definition: Forward.h:126
Operand sm_
Sparse matrix of the map expression.
Definition: SMatMapExpr.h:496
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes....
Definition: DenseMatrix.h:81
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes....
Definition: Forward.h:145
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
decltype(auto) erf(const DenseMatrix< MT, SO > &dm)
Computes the error function for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2160
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatMapExpr.h:165
Header file for the SparseMatrix base class.
Constraint on the data type.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatMapExpr.h:174
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Generic wrapper for the abs() function.
Definition: Abs.h:83
OP op_
The custom unary operation.
Definition: SMatMapExpr.h:283
Header file for the MatMapExpr base class.
Generic wrapper for the sqrt() function.
Definition: Sqrt.h:83
Header file for the ValueIndexPair class.
const Element operator *() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatMapExpr.h:212
Header file for the multiplication trait.
typename UnderlyingNumeric< T >::Type UnderlyingNumeric_t
Auxiliary alias declaration for the UnderlyingNumeric type trait.The UnderlyingNumeric_t alias declar...
Definition: UnderlyingNumeric.h:117
decltype(auto) cos(const DenseMatrix< MT, SO > &dm)
Computes the cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1924
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1361
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite data type of the sparse matrix expression.
Definition: SMatMapExpr.h:151
Header file for the If class template.
Generic wrapper for the imag() function.
Definition: Imag.h:74
Generic wrapper for the exp10() function.
Definition: Exp10.h:67
decltype(auto) exp2(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1660
decltype(auto) sinh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1868
Header file for the UnderlyingBuiltin type trait.
decltype(auto) asin(const DenseMatrix< MT, SO > &dm)
Computes the inverse sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1840
decltype(auto) cosh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1983
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatMapExpr.h:253
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:1162
decltype(auto) cbrt(const DenseMatrix< MT, SO > &dm)
Computes the cubic root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1510
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Generic wrapper for the log10() function.
Definition: Log10.h:69
decltype(auto) trunc(const DenseMatrix< MT, SO > &dm)
Applies the trunc() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1268
Header file for all functors.
constexpr Bind2nd< OP, A2 > bind2nd(const OP &op, const A2 &a2)
Binds the given object/value to the 2nd parameter of the given binary operation.
Definition: Bind2nd.h:154
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: SMatMapExpr.h:290
Generic wrapper for the exp2() function.
Definition: Exp2.h:67
Generic wrapper for the asin() function.
Definition: Asin.h:79
decltype(auto) atan(const DenseMatrix< MT, SO > &dm)
Computes the inverse tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2070
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatMapExpr.h:170
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:1896
Generic wrapper for the erf() function.
Definition: Erf.h:77
ConstIterator(IteratorType it, OP op)
Constructor for the ConstIterator class.
Definition: SMatMapExpr.h:190
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatMapExpr.h:312
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:1198
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatMapExpr.h:140
Constraint on the data type.
Generic wrapper for the floor() function.
Definition: Floor.h:81
decltype(auto) exp(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1632
Header file for the EnableIf class template.
decltype(auto) abs(const DenseMatrix< MT, SO > &dm)
Applies the abs() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1156
decltype(auto) log(const DenseMatrix< MT, SO > &dm)
Computes the natural logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1719
typename MultTrait< T1, T2 >::Type MultTrait_t
Auxiliary alias declaration for the MultTrait class template.The MultTrait_t alias declaration provid...
Definition: MultTrait.h:240
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.The OppositeType_t alias declaration provi...
Definition: Aliases.h:270
Header file for the IsNumeric type trait.
decltype(auto) floor(const DenseMatrix< MT, SO > &dm)
Applies the floor() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1212
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatMapExpr.h:141
decltype(auto) round(const DenseMatrix< MT, SO > &dm)
Applies the round() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1296
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SMatMapExpr.h:434
decltype(auto) tanh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2101
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:1128
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
Header file for run time assertion macros.
Generic wrapper for the pow() function.
Definition: Pow.h:63
Generic wrapper for the atanh() function.
Definition: Atanh.h:79
Generic wrapper for the invcbrt() function.
Definition: InvCbrt.h:67
Generic wrapper for the real() function.
Definition: Real.h:80
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
Generic wrapper for the asinh() function.
Definition: Asinh.h:79
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:1541
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatMapExpr.h:375
Generic wrapper for the tan() function.
Definition: Tan.h:79
Generic wrapper for the log() function.
Definition: Log.h:69
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:2132
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
Header file for all forward declarations for expression class templates.
ConstIterator_t< RemoveReference_t< Operand > > IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatMapExpr.h:168
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
Generic wrapper for the erfc() function.
Definition: Erfc.h:67
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
Generic wrapper for the cos() function.
Definition: Cos.h:69
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatMapExpr.h:396
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatMapExpr.h:467
auto smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:194
Header file for the RemoveReference type trait.
Generic wrapper for the sign() function.
Definition: Sign.h:81
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatMapExpr.h:489
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.The ConstIterator_t alias declaration pro...
Definition: Aliases.h:110
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:765
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatMapExpr.h:327
decltype(auto) sin(const DenseMatrix< MT, SO > &dm)
Computes the sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1809
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatMapExpr.h:385
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:2188
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:73
decltype(auto) sqrt(const DenseMatrix< MT, SO > &dm)
Computes the square root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1448
SMatMapExpr(const MT &sm, OP op) noexcept
Constructor for the SMatMapExpr class.
Definition: SMatMapExpr.h:299
Header file for the IsComputation type trait class.
Header file for the IsBuiltin type trait.
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
Generic wrapper for the acos() function.
Definition: Acos.h:69
decltype(auto) tan(const DenseMatrix< MT, SO > &dm)
Computes the tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2042
OppositeType_t< MT > OT
Opposite type of the sparse matrix expression.
Definition: SMatMapExpr.h:100
If_t< useAssign, const ResultType, const SMatMapExpr & > CompositeType
Data type for composite expression templates.
Definition: SMatMapExpr.h:148
ValueType & ReferenceType
Reference return type.
Definition: SMatMapExpr.h:173
Generic wrapper for the atan() function.
Definition: Atan.h:79
Generic wrapper for the round() function.
Definition: Round.h:81
Generic wrapper for the sinh() function.
Definition: Sinh.h:79
OP Operation
Data type of the custom unary operation.
Definition: SMatMapExpr.h:154
Header file for the map trait.
IteratorCategory iterator_category
The iterator category.
Definition: SMatMapExpr.h:177
decltype(auto) log10(const DenseMatrix< MT, SO > &dm)
Computes the common logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1781
Generic wrapper for the log2() function.
Definition: Log2.h:67
decltype(auto) imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatMapExpr.h:1417
Generic wrapper for the cosh() function.
Definition: Cosh.h:69
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1324
decltype(auto) log2(const DenseMatrix< MT, SO > &dm)
Computes the binary logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1750
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:1479
Generic wrapper for the tanh() function.
Definition: Tanh.h:79
Generic wrapper for the exp() function.
Definition: Exp.h:69
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
Definition: Assert.h:101
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatMapExpr.h:201
Element ValueType
Type of the underlying pointers.
Definition: SMatMapExpr.h:171
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type,...
Definition: SparseMatrix.h:61
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
Operation op_
The custom unary operation.
Definition: SMatMapExpr.h:497
decltype(auto) map(const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs, OP op)
Evaluates the given binary operation on each single element of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1121
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatMapExpr.h:222