35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATFOREACHEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATFOREACHEXPR_H_
104 template<
typename MT
107 class SMatForEachExpr :
public SparseMatrix< SMatForEachExpr<MT,OP,SO>, SO >
108 ,
private MatForEachExpr
109 ,
private Computation
129 template<
typename MT2 >
132 enum :
bool { value = useAssign };
145 template<
typename MT2 >
146 struct UseSMPAssign {
147 enum :
bool { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
161 typedef decltype( std::declval<OP>()( std::declval<RN>() ) )
ReturnType;
229 return Element(
op_( it_->value() ), it_->index() );
249 return op_( it_->value() );
270 return it_ == rhs.
it_;
281 return it_ != rhs.
it_;
291 inline DifferenceType
operator-(
const ConstIterator& rhs )
const {
292 return it_ - rhs.
it_;
306 enum :
bool { smpAssignable = MT::smpAssignable };
344 if( i >=
sm_.rows() ) {
347 if( j >=
sm_.columns() ) {
381 inline size_t rows() const noexcept {
392 return sm_.columns();
402 return sm_.nonZeros();
413 return sm_.nonZeros(i);
482 template<
typename T >
483 inline bool canAlias(
const T* alias )
const noexcept {
484 return sm_.canAlias( alias );
494 template<
typename T >
495 inline bool isAliased(
const T* alias )
const noexcept {
496 return sm_.isAliased( alias );
506 return sm_.canSMPAssign();
530 template<
typename MT2
544 const RT tmp(
serial( rhs.sm_ ) );
545 assign( ~lhs,
forEach( tmp, rhs.op_ ) );
565 template<
typename MT2 >
577 assign( ~lhs, rhs.sm_ );
579 const size_t m( rhs.rows() );
581 for(
size_t i=0UL; i<m; ++i ) {
582 const Iterator
end( (~lhs).
end(i) );
583 for( Iterator element=(~lhs).
begin(i); element!=
end; ++element ) {
584 element->value() = rhs.op_( element->value() );
606 template<
typename MT2 >
607 friend inline EnableIf_< And< UseAssign<MT2>
608 , IsSame< UnderlyingNumeric<MT>, UnderlyingNumeric<MT2> > > >
618 assign( ~lhs, rhs.sm_ );
620 const size_t n( rhs.columns() );
622 for(
size_t j=0UL; j<n; ++j ) {
623 const Iterator
end( (~lhs).
end(j) );
624 for( Iterator element=(~lhs).
begin(j); element!=
end; ++element ) {
625 element->value() = rhs.op_( element->value() );
646 template<
typename MT2
648 friend inline EnableIf_< And< UseAssign<MT2>
649 , Not< IsSame< UnderlyingNumeric<MT>, UnderlyingNumeric<MT2> > > > >
661 const RT tmp(
serial( rhs.sm_ ) );
662 (~lhs).reserve( tmp.nonZeros() );
663 assign( ~lhs,
forEach( tmp, rhs.op_ ) );
682 template<
typename MT2
684 friend inline EnableIf_< UseAssign<MT2> >
696 const RT tmp(
serial( rhs.sm_ ) );
697 addAssign( ~lhs,
forEach( tmp, rhs.op_ ) );
720 template<
typename MT2
722 friend inline EnableIf_< UseAssign<MT2> >
734 const RT tmp(
serial( rhs.sm_ ) );
735 subAssign( ~lhs,
forEach( tmp, rhs.op_ ) );
766 template<
typename MT2
768 friend inline EnableIf_< UseSMPAssign<MT2> >
780 const RT tmp( rhs.sm_ );
804 template<
typename MT2
806 friend inline EnableIf_< UseSMPAssign<MT2> >
818 const RT tmp( rhs.sm_ );
842 template<
typename MT2
844 friend inline EnableIf_< UseSMPAssign<MT2> >
856 const RT tmp( rhs.sm_ );
910 template<
typename MT
939 template<
typename MT
967 template<
typename MT
995 template<
typename MT
1023 template<
typename MT
1060 template<
typename MT
1088 template<
typename MT
1116 template<
typename MT
1147 template<
typename MT
1178 template<
typename MT
1209 template<
typename MT
1240 template<
typename MT
1270 template<
typename MT
1273 inline const SMatForEachExpr<MT,Clip<DT>,SO>
1278 return SMatForEachExpr<MT,Clip<DT>,SO>( ~sm,
Clip<DT>(
min,
max ) );
1301 template<
typename MT
1332 template<
typename MT
1363 template<
typename MT
1394 template<
typename MT
1422 template<
typename MT
1453 template<
typename MT
1481 template<
typename MT
1509 template<
typename MT
1537 template<
typename MT
1568 template<
typename MT
1596 template<
typename MT
1627 template<
typename MT
1655 template<
typename MT
1683 template<
typename MT
1714 template<
typename MT
1745 template<
typename MT
1773 template<
typename MT
1802 template<
typename MT
1832 template<
typename MT
1834 inline const SMatForEachExpr<MT,Abs,SO>&
abs(
const SMatForEachExpr<MT,Abs,SO>& sm )
1855 template<
typename MT
1857 inline const SMatForEachExpr<MT,Floor,SO>&
floor(
const SMatForEachExpr<MT,Floor,SO>& sm )
1878 template<
typename MT
1880 inline const SMatForEachExpr<MT,Ceil,SO>&
ceil(
const SMatForEachExpr<MT,Ceil,SO>& sm )
1908 template<
typename MT
1910 inline typename SMatForEachExpr<MT,Conj,TF>::Operand
conj(
const SMatForEachExpr<MT,Conj,TF>& sm )
1914 return sm.operand();
1938 template<
typename MT
1940 inline const SMatTransExpr<MT,!SO>
conj(
const SMatTransExpr<SMatForEachExpr<MT,Conj,SO>,!SO>& sm )
1944 return SMatTransExpr<MT,!SO>( sm.operand().operand() );
1961 template<
typename MT
1963 inline const SMatForEachExpr<MT,Real,SO>&
real(
const SMatForEachExpr<MT,Real,SO>& sm )
1984 template<
typename MT
1986 inline const SMatForEachExpr<MT,Imag,SO>&
imag(
const SMatForEachExpr<MT,Imag,SO>& sm )
2006 template<
typename MT,
typename OP,
bool SO >
2023 template<
typename MT,
typename OP,
bool SO >
2040 template<
typename MT,
bool SO >
2045 template<
typename MT,
bool SO >
2050 template<
typename MT,
bool SO >
2055 template<
typename MT,
bool SO >
2060 template<
typename MT,
bool SO >
2065 template<
typename MT,
bool SO >
2070 template<
typename MT,
bool SO >
2075 template<
typename MT,
bool SO >
2080 template<
typename MT,
bool SO >
2085 template<
typename MT,
bool SO >
2090 template<
typename MT,
typename ET,
bool SO >
2095 template<
typename MT,
bool SO >
2100 template<
typename MT,
bool SO >
2105 template<
typename MT,
bool SO >
2110 template<
typename MT,
bool SO >
2115 template<
typename MT,
bool SO >
2120 template<
typename MT,
bool SO >
2125 template<
typename MT,
bool SO >
2130 template<
typename MT,
bool SO >
2135 template<
typename MT,
bool SO >
2140 template<
typename MT,
bool SO >
2145 template<
typename MT,
bool SO >
2150 template<
typename MT,
bool SO >
2155 template<
typename MT,
bool SO >
2160 template<
typename MT,
bool SO >
2165 template<
typename MT,
bool SO >
2170 template<
typename MT,
bool SO >
2175 template<
typename MT,
bool SO >
2193 template<
typename MT,
bool SO >
2198 template<
typename MT,
bool SO >
2203 template<
typename MT,
bool SO >
2208 template<
typename MT,
bool SO >
2213 template<
typename MT,
bool SO >
2218 template<
typename MT,
bool SO >
2220 :
public BoolConstant< IsBuiltin< ElementType_<MT> >::value >
2223 template<
typename MT,
bool SO >
2228 template<
typename MT,
bool SO >
2233 template<
typename MT,
bool SO >
2238 template<
typename MT,
bool SO >
2243 template<
typename MT,
typename ET,
bool SO >
2248 template<
typename MT,
bool SO >
2253 template<
typename MT,
bool SO >
2258 template<
typename MT,
bool SO >
2263 template<
typename MT,
bool SO >
2268 template<
typename MT,
bool SO >
2273 template<
typename MT,
bool SO >
2278 template<
typename MT,
bool SO >
2283 template<
typename MT,
bool SO >
2288 template<
typename MT,
bool SO >
2293 template<
typename MT,
bool SO >
2298 template<
typename MT,
bool SO >
2303 template<
typename MT,
bool SO >
2308 template<
typename MT,
bool SO >
2313 template<
typename MT,
bool SO >
2318 template<
typename MT,
bool SO >
2323 template<
typename MT,
bool SO >
2328 template<
typename MT,
bool SO >
2346 template<
typename MT,
typename OP,
bool SO >
2364 template<
typename MT,
typename ET,
bool SO >
2382 template<
typename MT,
typename OP,
bool SO >
2400 template<
typename MT,
typename OP,
bool SO >
2418 template<
typename MT,
typename ET,
bool SO >
2436 template<
typename MT,
typename OP,
bool SO >
2454 template<
typename MT >
2459 using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT> >
2460 , SMatForEachExpr<MT,Abs,false>
2470 template<
typename MT >
2475 using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT> >
2476 , SMatForEachExpr<MT,Abs,true>
2486 template<
typename MT >
2491 using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT> >
2492 , Operand_< SMatForEachExpr<MT,Conj,false> >
2502 template<
typename MT >
2507 using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT> >
2508 , Operand_< SMatForEachExpr<MT,Conj,true> >
2518 template<
typename MT >
2519 struct SMatForEachExprTrait< SMatTransExpr<
SMatForEachExpr<MT,Conj,true>, false >, Conj >
2523 using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT> >
2524 , SMatTransExpr<MT,false>
2534 template<
typename MT >
2535 struct TSMatForEachExprTrait< SMatTransExpr<
SMatForEachExpr<MT,Conj,false>, true >, Conj >
2539 using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT> >
2540 , SMatTransExpr<MT,true>
2550 template<
typename MT >
2555 using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT> >
2556 , SMatForEachExpr<MT,Real,false>
2566 template<
typename MT >
2571 using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT> >
2572 , SMatForEachExpr<MT,Real,true>
2582 template<
typename MT,
typename OP,
bool SO,
bool AF >
2587 using Type = ForEachExprTrait_< SubmatrixExprTrait_<const MT,AF>, OP >;
2596 template<
typename MT,
typename OP,
bool SO >
2601 using Type = ForEachExprTrait_< RowExprTrait_<const MT>, OP >;
2610 template<
typename MT,
typename OP,
bool SO >
2615 using Type = ForEachExprTrait_< ColumnExprTrait_<const MT>, OP >;
ConstIterator lowerBound(size_t i, size_t j) const
Returns an iterator to the first index not less then the given index.
Definition: SMatForEachExpr.h:437
Pointer difference type of the Blaze library.
ReturnType_< MT > RN
Return type of the sparse matrix expression.
Definition: SMatForEachExpr.h:115
const DMatForEachExpr< MT, Conj, SO > conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatForEachExpr.h:1158
Header file for auxiliary alias declarations.
Generic wrapper for the ceil() function.
Definition: Ceil.h:62
OP op_
The custom unary operation.
Definition: SMatForEachExpr.h:299
const DMatForEachExpr< MT, Log, SO > log(const DenseMatrix< MT, SO > &dm)
Computes the natural logarithm for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1498
const DMatForEachExpr< MT, Sin, SO > sin(const DenseMatrix< MT, SO > &dm)
Computes the sine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1557
Generic wrapper for the cbrt() function.
Definition: Cbrt.h:62
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
Header file for basic type definitions.
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatForEachExpr.h:181
SMatForEachExpr< MT, OP, SO > This
Type of this SMatForEachExpr instance.
Definition: SMatForEachExpr.h:154
DifferenceType difference_type
Difference between two iterators.
Definition: SMatForEachExpr.h:197
const DMatForEachExpr< MT, Log10, SO > log10(const DenseMatrix< MT, SO > &dm)
Computes the common logarithm for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1529
Generic wrapper for the sin() function.
Definition: Sin.h:62
Generic wrapper for the conj() function.
Definition: Conj.h:62
Generic wrapper for the invsqrt() function.
Definition: InvSqrt.h:62
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the serial shim.
#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
const DMatForEachExpr< MT, Tanh, SO > tanh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic tangent for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1849
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatForEachExpr.h:360
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatForEachExpr.h:269
const CTransExprTrait_< MT > ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatForEachExpr.h:1195
Header file for the ColumnExprTrait class template.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatForEachExpr.h:401
Header file for the IsSame and IsStrictlySame type traits.
Header file for the ForEachExprTrait class template.
const DMatForEachExpr< MT, Cos, SO > cos(const DenseMatrix< MT, SO > &dm)
Computes the cosine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1672
ReferenceType reference
Reference return type.
Definition: SMatForEachExpr.h:196
const DMatForEachExpr< MT, Atan, SO > atan(const DenseMatrix< MT, SO > &dm)
Computes the inverse tangent for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1818
Generic wrapper for the acosh() function.
Definition: Acosh.h:62
const DMatForEachExpr< MT, Imag, SO > imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatForEachExpr.h:1251
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatForEachExpr.h:238
Header file for the And class template.
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1669
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
const DMatForEachExpr< MT, Sinh, SO > sinh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic sine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1616
Header file for the Computation base class.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member constant is set to true, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to false, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:138
Header file for the RequiresEvaluation type trait.
Header file for the MatForEachExpr base class.
ForEachTrait_< MT, OP > ResultType
Result type for expression template evaluations.
Definition: SMatForEachExpr.h:155
Header file for the IsUniLower type trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1716
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:109
const DMatForEachExpr< MT, Exp, SO > exp(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1467
Constraint on the data type.
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
Header file for the SparseMatrix base class.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatForEachExpr.h:505
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatForEachExpr.h:248
Constraint on the data type.
SMatForEachExpr(const MT &sm, OP op) noexcept
Constructor for the SMatForEachExpr class.
Definition: SMatForEachExpr.h:315
Generic wrapper for the abs() function.
Definition: Abs.h:62
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
ValueType * PointerType
Pointer return type.
Definition: SMatForEachExpr.h:188
typename ForEachTrait< T, OP >::Type ForEachTrait_
Auxiliary alias declaration for the ForEachTrait class template.The ForEachTrait_ alias declaration p...
Definition: ForEachTrait.h:146
const DMatForEachExpr< MT, Acosh, SO > acosh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic cosine for each single element of the dense matrix dm...
Definition: DMatForEachExpr.h:1762
Generic wrapper for the sqrt() function.
Definition: Sqrt.h:62
Header file for the ValueIndexPair class.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
typename CTransExprTrait< T >::Type CTransExprTrait_
Auxiliary alias declaration for the CTransExprTrait class template.The CTransExprTrait_ alias declara...
Definition: CTransExprTrait.h:143
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatForEachExpr.h:280
IteratorCategory iterator_category
The iterator category.
Definition: SMatForEachExpr.h:193
Header file for the If class template.
Generic wrapper for the imag() function.
Definition: Imag.h:59
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatForEachExpr.h:381
const DMatForEachExpr< MT, Abs, SO > abs(const DenseMatrix< MT, SO > &dm)
Applies the abs() function to each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1074
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatForEachExpr.h:291
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
ValueType value_type
Type of the underlying pointers.
Definition: SMatForEachExpr.h:194
#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
Header file for the Columns type trait.
const DMatForEachExpr< MT, OP, SO > forEach(const DenseMatrix< MT, SO > &dm, OP op)
Evaluates the given custom operation on each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1046
Generic wrapper for the log10() function.
Definition: Log10.h:62
Header file for the Not class template.
size_t index() const
Access to the current index of the sparse element.
Definition: SMatForEachExpr.h:258
Header file for all functors.
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SMatForEachExpr.h:450
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
const DMatForEachExpr< MT, InvCbrt, SO > invcbrt(const DenseMatrix< MT, SO > &dm)
Computes the inverse cubic root of each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1375
Element ValueType
Type of the underlying pointers.
Definition: SMatForEachExpr.h:187
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatForEachExpr.h:343
Header file for the IsLower type trait.
Generic wrapper for the asin() function.
Definition: Asin.h:62
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatForEachExpr.h:190
Operation operation() const
Returns a copy of the custom operation.
Definition: SMatForEachExpr.h:471
const DMatForEachExpr< MT, Floor, SO > floor(const DenseMatrix< MT, SO > &dm)
Applies the floor() function to each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1102
const DMatForEachExpr< MT, Erf, SO > erf(const DenseMatrix< MT, SO > &dm)
Computes the error function for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1908
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:60
const DMatForEachExpr< MT, Tan, SO > tan(const DenseMatrix< MT, SO > &dm)
Computes the tangent for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1790
Generic wrapper for the erf() function.
Definition: Erf.h:62
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatForEachExpr.h:328
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatForEachExpr.h:461
Operation op_
The custom unary operation.
Definition: SMatForEachExpr.h:513
Constraints on the storage order of matrix types.
const DMatForEachExpr< MT, Pow< ET >, SO > pow(const DenseMatrix< MT, SO > &dm, ET exp)
Computes the exponential value for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1437
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatForEachExpr.h:228
Header file for the exception macros of the math module.
Expression object for the sparse matrix forEach() function.The SMatForEachExpr class represents the c...
Definition: Forward.h:94
IfTrue_< useAssign, const ResultType, const SMatForEachExpr & > CompositeType
Data type for composite expression templates.
Definition: SMatForEachExpr.h:164
If_< IsExpression< MT >, const MT, const MT & > Operand
Composite data type of the sparse matrix expression.
Definition: SMatForEachExpr.h:167
OppositeType_< MT > OT
Opposite type of the sparse matrix expression.
Definition: SMatForEachExpr.h:114
PointerType pointer
Pointer return type.
Definition: SMatForEachExpr.h:195
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatForEachExpr.h:371
Constraint on the data type.
Evaluation of the underlying numeric element type of a given data type.Via this type trait it is poss...
Definition: UnderlyingNumeric.h:81
Header file for the RowExprTrait class template.
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatForEachExpr.h:156
Header file for all forward declarations for expression class templates.
Generic wrapper for the floor() function.
Definition: Floor.h:62
const DMatForEachExpr< MT, Cosh, SO > cosh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic cosine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1731
const DMatForEachExpr< MT, Sqrt, SO > sqrt(const DenseMatrix< MT, SO > &dm)
Computes the square root of each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1282
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
const DMatForEachExpr< MT, Real, SO > real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatForEachExpr.h:1223
ConstIterator_< RemoveReference_< Operand > > IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatForEachExpr.h:184
const DMatForEachExpr< MT, Atanh, SO > atanh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic tangent for each single element of the dense matrix dm...
Definition: DMatForEachExpr.h:1880
Generic wrapper for the clip() function.
Definition: Clip.h:60
const DMatForEachExpr< MT, Acos, SO > acos(const DenseMatrix< MT, SO > &dm)
Computes the inverse cosine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1703
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatForEachExpr.h:495
OP Operation
Data type of the custom unary operation.
Definition: SMatForEachExpr.h:170
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatForEachExpr.h:391
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2642
Header file for run time assertion macros.
const DMatForEachExpr< MT, InvSqrt, SO > invsqrt(const DenseMatrix< MT, SO > &dm)
Computes the inverse square root of each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1313
Generic wrapper for the pow() function.
Definition: Forward.h:72
const DMatForEachExpr< MT, Cbrt, SO > cbrt(const DenseMatrix< MT, SO > &dm)
Computes the cubic root of each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1344
Generic wrapper for the atanh() function.
Definition: Atanh.h:62
Generic wrapper for the invcbrt() function.
Definition: InvCbrt.h:62
Generic wrapper for the real() function.
Definition: Real.h:59
Generic wrapper for the asinh() function.
Definition: Asinh.h:62
const DMatForEachExpr< MT, Asin, SO > asin(const DenseMatrix< MT, SO > &dm)
Computes the inverse sine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1588
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:160
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:61
Generic wrapper for the tan() function.
Definition: Tan.h:62
Generic wrapper for the log() function.
Definition: Log.h:62
ElementType_< ResultType > ElementType
Resulting element type.
Definition: SMatForEachExpr.h:158
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2646
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatForEachExpr.h:483
Generic wrapper for the erfc() function.
Definition: Erfc.h:62
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatForEachExpr.h:186
Generic wrapper for the cos() function.
Definition: Cos.h:62
#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
Operand sm_
Sparse matrix of the absolute value expression.
Definition: SMatForEachExpr.h:512
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatForEachExpr.h:157
IteratorType it_
Iterator over the elements of the sparse matrix expression.
Definition: SMatForEachExpr.h:298
Header file for the RemoveReference type trait.
ValueType & ReferenceType
Reference return type.
Definition: SMatForEachExpr.h:189
const DMatForEachExpr< MT, Clip< DT >, SO > clip(const DenseMatrix< MT, SO > &dm, const DT &min, const DT &max)
Restricts each single element of the dense matrix dm to the range .
Definition: DMatForEachExpr.h:1407
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
typename T::Iterator Iterator_
Alias declaration for nested Iterator type definitions.The Iterator_ alias declaration provides a con...
Definition: Aliases.h:183
const DMatForEachExpr< MT, Erfc, SO > erfc(const DenseMatrix< MT, SO > &dm)
Computes the complementary error function for each single element of the dense matrix dm...
Definition: DMatForEachExpr.h:1936
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatForEachExpr.h:412
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:950
Header file for the IsComputation type trait class.
Generic wrapper for the acos() function.
Definition: Acos.h:62
ConstIterator(IteratorType it, OP op)
Constructor for the ConstIterator class.
Definition: SMatForEachExpr.h:206
Header file for the for-each trait.
Generic wrapper for the atan() function.
Definition: Atan.h:62
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
const DMatForEachExpr< MT, Asinh, SO > asinh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic sine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1644
Generic wrapper for the sinh() function.
Definition: Sinh.h:62
Header file for the IntegralConstant class template.
Iterator over the elements of the sparse matrix for-each expression.
Definition: SMatForEachExpr.h:176
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
Header file for the IsUpper type trait.
Header file for the CTransExprTrait class template.
Generic wrapper for the cosh() function.
Definition: Cosh.h:62
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatForEachExpr.h:217
ResultType_< MT > RT
Result type of the sparse matrix expression.
Definition: SMatForEachExpr.h:113
Generic wrapper for the tanh() function.
Definition: Tanh.h:62
Header file for the IsHermitian type trait.
Generic wrapper for the exp() function.
Definition: Exp.h:62
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
#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
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:71
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatForEachExpr.h:424
const DMatForEachExpr< MT, Ceil, SO > ceil(const DenseMatrix< MT, SO > &dm)
Applies the ceil() function to each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1130
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.