35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATFOREACHEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_SMATFOREACHEXPR_H_ 105 template<
typename MT
108 class SMatForEachExpr :
public SparseMatrix< SMatForEachExpr<MT,OP,SO>, SO >
109 ,
private MatForEachExpr
110 ,
private Computation
130 template<
typename MT2 >
133 enum :
bool { value = useAssign };
146 template<
typename MT2 >
147 struct UseSMPAssign {
148 enum :
bool { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
162 typedef decltype( std::declval<OP>()( std::declval<RN>() ) )
ReturnType;
230 return Element(
op_( it_->value() ), it_->index() );
250 return op_( it_->value() );
271 return it_ == rhs.
it_;
282 return it_ != rhs.
it_;
292 inline DifferenceType
operator-(
const ConstIterator& rhs )
const {
293 return it_ - rhs.
it_;
307 enum :
bool { smpAssignable = MT::smpAssignable };
345 if( i >=
sm_.rows() ) {
348 if( j >=
sm_.columns() ) {
382 inline size_t rows() const noexcept {
393 return sm_.columns();
403 return sm_.nonZeros();
414 return sm_.nonZeros(i);
483 template<
typename T >
484 inline bool canAlias(
const T* alias )
const noexcept {
485 return sm_.canAlias( alias );
495 template<
typename T >
496 inline bool isAliased(
const T* alias )
const noexcept {
497 return sm_.isAliased( alias );
507 return sm_.canSMPAssign();
531 template<
typename MT2
545 const RT tmp(
serial( rhs.sm_ ) );
546 assign( ~lhs,
forEach( tmp, rhs.op_ ) );
566 template<
typename MT2 >
578 assign( ~lhs, rhs.sm_ );
580 const size_t m( rhs.rows() );
582 for(
size_t i=0UL; i<m; ++i ) {
583 const Iterator
end( (~lhs).
end(i) );
584 for( Iterator element=(~lhs).
begin(i); element!=
end; ++element ) {
585 element->value() = rhs.op_( element->value() );
607 template<
typename MT2 >
619 assign( ~lhs, rhs.sm_ );
621 const size_t n( rhs.columns() );
623 for(
size_t j=0UL; j<n; ++j ) {
624 const Iterator
end( (~lhs).
end(j) );
625 for( Iterator element=(~lhs).
begin(j); element!=
end; ++element ) {
626 element->value() = rhs.op_( element->value() );
647 template<
typename MT2
662 const RT tmp(
serial( rhs.sm_ ) );
663 (~lhs).reserve( tmp.nonZeros() );
664 assign( ~lhs,
forEach( tmp, rhs.op_ ) );
683 template<
typename MT2
697 const RT tmp(
serial( rhs.sm_ ) );
698 addAssign( ~lhs,
forEach( tmp, rhs.op_ ) );
721 template<
typename MT2
735 const RT tmp(
serial( rhs.sm_ ) );
736 subAssign( ~lhs,
forEach( tmp, rhs.op_ ) );
767 template<
typename MT2
781 const RT tmp( rhs.sm_ );
805 template<
typename MT2
819 const RT tmp( rhs.sm_ );
843 template<
typename MT2
857 const RT tmp( rhs.sm_ );
911 template<
typename MT
940 template<
typename MT
968 template<
typename MT
996 template<
typename MT
1024 template<
typename MT
1052 template<
typename MT
1080 template<
typename MT
1117 template<
typename MT
1145 template<
typename MT
1173 template<
typename MT
1204 template<
typename MT
1235 template<
typename MT
1266 template<
typename MT
1297 template<
typename MT
1327 template<
typename MT
1335 return SMatForEachExpr<MT,Clamp<DT>,SO>( ~sm,
Clamp<DT>(
min,
max ) );
1358 template<
typename MT
1389 template<
typename MT
1417 template<
typename MT
1445 template<
typename MT
1476 template<
typename MT
1507 template<
typename MT
1538 template<
typename MT
1566 template<
typename MT
1597 template<
typename MT
1625 template<
typename MT
1653 template<
typename MT
1681 template<
typename MT
1712 template<
typename MT
1740 template<
typename MT
1771 template<
typename MT
1799 template<
typename MT
1827 template<
typename MT
1858 template<
typename MT
1889 template<
typename MT
1917 template<
typename MT
1946 template<
typename MT
1976 template<
typename MT
1999 template<
typename MT
2022 template<
typename MT
2045 template<
typename MT
2068 template<
typename MT
2098 template<
typename MT
2104 return sm.operand();
2128 template<
typename MT
2151 template<
typename MT
2174 template<
typename MT
2196 template<
typename MT,
typename OP,
bool SO >
2197 struct Rows< SMatForEachExpr<MT,OP,SO> > :
public Rows<MT>
2213 template<
typename MT,
typename OP,
bool SO >
2230 template<
typename MT,
bool SO >
2235 template<
typename MT,
bool SO >
2236 struct IsSymmetric< SMatForEachExpr<MT,Floor,SO> >
2240 template<
typename MT,
bool SO >
2245 template<
typename MT,
bool SO >
2246 struct IsSymmetric< SMatForEachExpr<MT,Trunc,SO> >
2250 template<
typename MT,
bool SO >
2251 struct IsSymmetric< SMatForEachExpr<MT,Round,SO> >
2255 template<
typename MT,
bool SO >
2260 template<
typename MT,
bool SO >
2265 template<
typename MT,
bool SO >
2270 template<
typename MT,
bool SO >
2275 template<
typename MT,
bool SO >
2276 struct IsSymmetric< SMatForEachExpr<MT,InvSqrt,SO> >
2280 template<
typename MT,
bool SO >
2285 template<
typename MT,
bool SO >
2286 struct IsSymmetric< SMatForEachExpr<MT,InvCbrt,SO> >
2290 template<
typename MT,
typename ET,
bool SO >
2291 struct IsSymmetric< SMatForEachExpr<MT,Pow<ET>,SO> >
2295 template<
typename MT,
bool SO >
2300 template<
typename MT,
bool SO >
2305 template<
typename MT,
bool SO >
2306 struct IsSymmetric< SMatForEachExpr<MT,Exp10,SO> >
2310 template<
typename MT,
bool SO >
2315 template<
typename MT,
bool SO >
2320 template<
typename MT,
bool SO >
2321 struct IsSymmetric< SMatForEachExpr<MT,Log10,SO> >
2325 template<
typename MT,
bool SO >
2330 template<
typename MT,
bool SO >
2335 template<
typename MT,
bool SO >
2340 template<
typename MT,
bool SO >
2341 struct IsSymmetric< SMatForEachExpr<MT,Asinh,SO> >
2345 template<
typename MT,
bool SO >
2350 template<
typename MT,
bool SO >
2355 template<
typename MT,
bool SO >
2360 template<
typename MT,
bool SO >
2361 struct IsSymmetric< SMatForEachExpr<MT,Acosh,SO> >
2365 template<
typename MT,
bool SO >
2370 template<
typename MT,
bool SO >
2375 template<
typename MT,
bool SO >
2380 template<
typename MT,
bool SO >
2381 struct IsSymmetric< SMatForEachExpr<MT,Atanh,SO> >
2385 template<
typename MT,
bool SO >
2390 template<
typename MT,
bool SO >
2408 template<
typename MT,
bool SO >
2413 template<
typename MT,
bool SO >
2414 struct IsHermitian< SMatForEachExpr<MT,Floor,SO> >
2418 template<
typename MT,
bool SO >
2423 template<
typename MT,
bool SO >
2424 struct IsHermitian< SMatForEachExpr<MT,Trunc,SO> >
2428 template<
typename MT,
bool SO >
2429 struct IsHermitian< SMatForEachExpr<MT,Round,SO> >
2433 template<
typename MT,
bool SO >
2438 template<
typename MT,
bool SO >
2443 template<
typename MT,
bool SO >
2445 :
public BoolConstant< IsBuiltin< ElementType_<MT> >::value >
2448 template<
typename MT,
bool SO >
2453 template<
typename MT,
bool SO >
2454 struct IsHermitian< SMatForEachExpr<MT,InvSqrt,SO> >
2458 template<
typename MT,
bool SO >
2463 template<
typename MT,
bool SO >
2464 struct IsHermitian< SMatForEachExpr<MT,InvCbrt,SO> >
2468 template<
typename MT,
typename ET,
bool SO >
2469 struct IsHermitian< SMatForEachExpr<MT,Pow<ET>,SO> >
2473 template<
typename MT,
bool SO >
2478 template<
typename MT,
bool SO >
2483 template<
typename MT,
bool SO >
2484 struct IsHermitian< SMatForEachExpr<MT,Exp10,SO> >
2488 template<
typename MT,
bool SO >
2493 template<
typename MT,
bool SO >
2498 template<
typename MT,
bool SO >
2499 struct IsHermitian< SMatForEachExpr<MT,Log10,SO> >
2503 template<
typename MT,
bool SO >
2508 template<
typename MT,
bool SO >
2513 template<
typename MT,
bool SO >
2518 template<
typename MT,
bool SO >
2519 struct IsHermitian< SMatForEachExpr<MT,Asinh,SO> >
2523 template<
typename MT,
bool SO >
2528 template<
typename MT,
bool SO >
2533 template<
typename MT,
bool SO >
2538 template<
typename MT,
bool SO >
2539 struct IsHermitian< SMatForEachExpr<MT,Acosh,SO> >
2543 template<
typename MT,
bool SO >
2548 template<
typename MT,
bool SO >
2553 template<
typename MT,
bool SO >
2558 template<
typename MT,
bool SO >
2559 struct IsHermitian< SMatForEachExpr<MT,Atanh,SO> >
2563 template<
typename MT,
bool SO >
2568 template<
typename MT,
bool SO >
2586 template<
typename MT,
typename OP,
bool SO >
2587 struct IsLower< SMatForEachExpr<MT,OP,SO> >
2604 template<
typename MT,
bool SO >
2605 struct IsUniLower< SMatForEachExpr<MT,Abs,SO> >
2609 template<
typename MT,
bool SO >
2610 struct IsUniLower< SMatForEachExpr<MT,Floor,SO> >
2614 template<
typename MT,
bool SO >
2615 struct IsUniLower< SMatForEachExpr<MT,Ceil,SO> >
2619 template<
typename MT,
bool SO >
2620 struct IsUniLower< SMatForEachExpr<MT,Trunc,SO> >
2624 template<
typename MT,
bool SO >
2625 struct IsUniLower< SMatForEachExpr<MT,Round,SO> >
2629 template<
typename MT,
typename ET,
bool SO >
2630 struct IsUniLower< SMatForEachExpr<MT,Pow<ET>,SO> >
2647 template<
typename MT,
typename OP,
bool SO >
2665 template<
typename MT,
typename OP,
bool SO >
2666 struct IsUpper< SMatForEachExpr<MT,OP,SO> >
2683 template<
typename MT,
bool SO >
2684 struct IsUniUpper< SMatForEachExpr<MT,Abs,SO> >
2688 template<
typename MT,
bool SO >
2689 struct IsUniUpper< SMatForEachExpr<MT,Floor,SO> >
2693 template<
typename MT,
bool SO >
2694 struct IsUniUpper< SMatForEachExpr<MT,Ceil,SO> >
2698 template<
typename MT,
bool SO >
2699 struct IsUniUpper< SMatForEachExpr<MT,Trunc,SO> >
2703 template<
typename MT,
bool SO >
2704 struct IsUniUpper< SMatForEachExpr<MT,Round,SO> >
2708 template<
typename MT,
typename ET,
bool SO >
2709 struct IsUniUpper< SMatForEachExpr<MT,Pow<ET>,SO> >
2726 template<
typename MT,
typename OP,
bool SO >
2744 template<
typename MT >
2760 template<
typename MT >
2776 template<
typename MT >
2792 template<
typename MT >
2808 template<
typename MT >
2824 template<
typename MT >
2840 template<
typename MT >
2856 template<
typename MT >
2872 template<
typename MT >
2888 template<
typename MT >
2904 template<
typename MT >
2920 template<
typename MT >
2936 template<
typename MT >
2952 template<
typename MT >
2968 template<
typename MT >
2984 template<
typename MT >
3000 template<
typename MT,
typename OP,
bool SO,
bool AF >
3014 template<
typename MT,
typename OP,
bool SO >
3028 template<
typename MT,
typename OP,
bool SO >
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatForEachExpr.h:239
Generic wrapper for the trunc() function.
Definition: Trunc.h:62
Pointer difference type of the Blaze library.
ReturnType_< MT > RN
Return type of the sparse matrix expression.
Definition: SMatForEachExpr.h:116
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatForEachExpr.h:496
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:1214
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:300
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:1610
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:1700
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:182
SMatForEachExpr< MT, OP, SO > This
Type of this SMatForEachExpr instance.
Definition: SMatForEachExpr.h:155
DifferenceType difference_type
Difference between two iterators.
Definition: SMatForEachExpr.h:198
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:1672
Generic wrapper for the sin() function.
Definition: Sin.h:62
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatForEachExpr.h:361
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.
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatForEachExpr.h:292
#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:1992
const CTransExprTrait_< MT > ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatForEachExpr.h:1251
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Header file for the ColumnExprTrait class template.
size_t index() const
Access to the current index of the sparse element.
Definition: SMatForEachExpr.h:259
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:1815
Generic wrapper for the clamp() function.
Definition: Clamp.h:60
ReferenceType reference
Reference return type.
Definition: SMatForEachExpr.h:197
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:1961
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:1307
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:1755
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatForEachExpr.h:402
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
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:1759
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
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
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:156
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatForEachExpr.h:281
const DMatForEachExpr< MT, Exp10, SO > exp10(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1579
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:1802
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:71
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:119
const DMatForEachExpr< MT, Exp, SO > exp(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1523
Constraint on the data type.
const DMatForEachExpr< MT, Trunc, SO > trunc(const DenseMatrix< MT, SO > &dm)
Applies the trunc() function to each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1158
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.
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatForEachExpr.h:425
Constraint on the data type.
SMatForEachExpr(const MT &sm, OP op) noexcept
Constructor for the SMatForEachExpr class.
Definition: SMatForEachExpr.h:316
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:189
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
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:1905
Generic wrapper for the sqrt() function.
Definition: Sqrt.h:62
Header file for the ValueIndexPair class.
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatForEachExpr.h:462
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SMatForEachExpr.h:451
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
IteratorCategory iterator_category
The iterator category.
Definition: SMatForEachExpr.h:194
Header file for the If class template.
Generic wrapper for the imag() function.
Definition: Imag.h:59
Generic wrapper for the exp10() function.
Definition: Exp10.h:62
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:83
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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2939
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:195
Evaluation of the expression type of a sparse matrix for-each operation.Via this type trait it is pos...
Definition: TSMatForEachExprTrait.h:75
#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.
Header file for all functors.
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:1431
Element ValueType
Type of the underlying pointers.
Definition: SMatForEachExpr.h:188
Evaluation of the expression type type of a submatrix operation.Via this type trait it is possible to...
Definition: SubmatrixExprTrait.h:80
Header file for the IsLower type trait.
Generic wrapper for the exp2() function.
Definition: Exp2.h:62
Generic wrapper for the asin() function.
Definition: Asin.h:62
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatForEachExpr.h:191
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:2051
#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:1933
Generic wrapper for the erf() function.
Definition: Erf.h:62
Operation op_
The custom unary operation.
Definition: SMatForEachExpr.h:514
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatForEachExpr.h:413
const DMatForEachExpr< MT, Round, SO > round(const DenseMatrix< MT, SO > &dm)
Applies the round() function to each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1186
Constraints on the storage order of matrix types.
Compile time check for symmetric matrices.This type trait tests whether or not the given template par...
Definition: IsSymmetric.h:85
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:1493
Header file for the exception macros of the math module.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatForEachExpr.h:484
Expression object for the sparse matrix forEach() function.The SMatForEachExpr class represents the c...
Definition: Forward.h:104
IfTrue_< useAssign, const ResultType, const SMatForEachExpr &> CompositeType
Data type for composite expression templates.
Definition: SMatForEachExpr.h:165
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
If_< IsExpression< MT >, const MT, const MT &> Operand
Composite data type of the sparse matrix expression.
Definition: SMatForEachExpr.h:168
OppositeType_< MT > OT
Opposite type of the sparse matrix expression.
Definition: SMatForEachExpr.h:115
Evaluation of the expression type type of a row operation.Via this type trait it is possible to evalu...
Definition: RowExprTrait.h:79
PointerType pointer
Pointer return type.
Definition: SMatForEachExpr.h:196
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:157
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:1874
const DMatForEachExpr< MT, Exp2, SO > exp2(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1551
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:1338
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:1279
ConstIterator_< RemoveReference_< Operand > > IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatForEachExpr.h:185
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:2023
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
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:1846
OP Operation
Data type of the custom unary operation.
Definition: SMatForEachExpr.h:171
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatForEachExpr.h:270
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2934
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatForEachExpr.h:392
Header file for run time assertion macros.
Compile time check for column-major matrix types.This type trait tests whether or not the given templ...
Definition: IsColumnMajorMatrix.h:83
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:1369
Generic wrapper for the pow() function.
Definition: Forward.h:80
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:1400
Operation operation() const
Returns a copy of the custom operation.
Definition: SMatForEachExpr.h:472
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:1731
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:159
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:93
Compile time type negation.The Not class template negates the given compile time condition. In case the given condition would evaluate to true, the nested member enumeration is set to false and vice versa:
Definition: Not.h:70
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2938
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatForEachExpr.h:329
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
const DMatForEachExpr< MT, Clamp< DT >, SO > 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: DMatForEachExpr.h:1463
Generic wrapper for the erfc() function.
Definition: Erfc.h:62
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatForEachExpr.h:187
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:438
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:513
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatForEachExpr.h:158
IteratorType it_
Iterator over the elements of the sparse matrix expression.
Definition: SMatForEachExpr.h:299
Header file for the RemoveReference type trait.
ValueType & ReferenceType
Reference return type.
Definition: SMatForEachExpr.h:190
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:2079
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:73
const DMatForEachExpr< MT, Log2, SO > log2(const DenseMatrix< MT, SO > &dm)
Computes the binary logarithm for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1641
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatForEachExpr.h:372
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:733
Header file for the IsComputation type trait class.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatForEachExpr.h:344
Header file for the IsBuiltin type trait.
Generic wrapper for the acos() function.
Definition: Acos.h:62
ConstIterator(IteratorType it, OP op)
Constructor for the ConstIterator class.
Definition: SMatForEachExpr.h:207
Header file for the for-each trait.
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatForEachExpr.h:382
Generic wrapper for the atan() function.
Definition: Atan.h:62
Generic wrapper for the round() function.
Definition: Round.h:62
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:1787
Expression object for sparse matrix transpositions.The SMatTransExpr class represents the compile tim...
Definition: Forward.h:114
Generic wrapper for the sinh() function.
Definition: Sinh.h:62
Header file for the IntegralConstant class template.
Compile time evaluation of the number of columns of a matrix.The Columns type trait evaluates the num...
Definition: Columns.h:76
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:76
Generic wrapper for the log2() function.
Definition: Log2.h:62
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatForEachExpr.h:249
Iterator over the elements of the sparse matrix for-each expression.
Definition: SMatForEachExpr.h:177
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
typename ForEachExprTrait< T, OP >::Type ForEachExprTrait_
Auxiliary alias declaration for the ForEachExprTrait class template.The ForEachExprTrait_ alias decla...
Definition: ForEachExprTrait.h:144
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatForEachExpr.h:218
ResultType_< MT > RT
Result type of the sparse matrix expression.
Definition: SMatForEachExpr.h:114
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
Evaluation of the expression type type of a column operation.Via this type trait it is possible to ev...
Definition: ColumnExprTrait.h:78
#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
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatForEachExpr.h:506
typename T::Operand Operand_
Alias declaration for nested Operand type definitions.The Operand_ alias declaration provides a conve...
Definition: Aliases.h:223
#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
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatForEachExpr.h:229
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:71
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.
Evaluation of the expression type of a sparse matrix for-each operation.Via this type trait it is pos...
Definition: SMatForEachExprTrait.h:75
Header file for the function trace functionality.