35#ifndef _BLAZE_MATH_EXPRESSIONS_DMATREDUCEEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_DMATREDUCEEXPR_H_
130 :
public MatReduceExpr< DenseVector< DMatReduceExpr<MT,OP,columnwise>, true >, columnwise >
146 template<
typename VT >
189 ,
op_( std::move(op) )
213 if( index >=
dm_.columns() ) {
216 return (*
this)[index];
225 inline size_t size() const noexcept {
226 return dm_.columns();
256 template<
typename T >
257 inline bool canAlias(
const T* alias )
const noexcept {
258 return (
dm_.isAliased( alias ) );
268 template<
typename T >
269 inline bool isAliased(
const T* alias )
const noexcept {
270 return (
dm_.isAliased( alias ) );
290 return dm_.canSMPAssign() || (
size() > SMP_DMATREDUCE_THRESHOLD );
312 template<
typename VT1 >
319 const size_t M( rhs.dm_.rows() );
329 for(
size_t i=1UL; i<M; ++i ) {
348 template<
typename VT1 >
359 const ResultType tmp(
serial( rhs ) );
378 template<
typename VT1 >
379 friend inline void addAssign( DenseVector<VT1,true>& lhs,
const DMatReduceExpr& rhs )
385 if( rhs.dm_.rows() == 0UL ) {
389 CT tmp(
serial( rhs.dm_ ) );
390 const size_t M( tmp.rows() );
391 for(
size_t i=0UL; i<M; ++i ) {
396 const ResultType tmp(
serial( rhs ) );
397 addAssign( *lhs, tmp );
416 template<
typename VT1 >
417 friend inline void addAssign( SparseVector<VT1,true>& lhs,
const DMatReduceExpr& rhs )
427 const ResultType tmp(
serial( rhs ) );
428 addAssign( *lhs, tmp );
446 template<
typename VT1 >
447 friend inline void subAssign( DenseVector<VT1,true>& lhs,
const DMatReduceExpr& rhs )
453 if( rhs.dm_.rows() == 0UL ) {
457 CT tmp(
serial( rhs.dm_ ) );
458 const size_t M( tmp.rows() );
459 for(
size_t i=0UL; i<M; ++i ) {
464 const ResultType tmp(
serial( rhs ) );
465 subAssign( *lhs, tmp );
484 template<
typename VT1 >
485 friend inline void subAssign( SparseVector<VT1,true>& lhs,
const DMatReduceExpr& rhs )
495 const ResultType tmp(
serial( rhs ) );
496 subAssign( *lhs, tmp );
514 template<
typename VT1 >
515 friend inline void multAssign( DenseVector<VT1,true>& lhs,
const DMatReduceExpr& rhs )
521 if( rhs.dm_.rows() == 0UL ) {
525 CT tmp(
serial( rhs.dm_ ) );
526 const size_t M( tmp.rows() );
527 for(
size_t i=0UL; i<M; ++i ) {
532 const ResultType tmp(
serial( rhs ) );
533 multAssign( *lhs, tmp );
552 template<
typename VT1 >
553 friend inline void multAssign( SparseVector<VT1,true>& lhs,
const DMatReduceExpr& rhs )
563 const ResultType tmp(
serial( rhs ) );
564 multAssign( *lhs, tmp );
582 template<
typename VT1 >
583 friend inline void divAssign( Vector<VT1,true>& lhs,
const DMatReduceExpr& rhs )
593 const ResultType tmp(
serial( rhs ) );
594 divAssign( *lhs, tmp );
613 template<
typename VT1 >
614 friend inline auto smpAssign( Vector<VT1,true>& lhs,
const DMatReduceExpr& rhs )
621 const RT tmp( rhs.dm_ );
642 template<
typename VT1 >
643 friend inline auto smpAddAssign( Vector<VT1,true>& lhs,
const DMatReduceExpr& rhs )
650 const RT tmp( rhs.dm_ );
671 template<
typename VT1 >
672 friend inline auto smpSubAssign( Vector<VT1,true>& lhs,
const DMatReduceExpr& rhs )
679 const RT tmp( rhs.dm_ );
700 template<
typename VT1 >
701 friend inline auto smpMultAssign( Vector<VT1,true>& lhs,
const DMatReduceExpr& rhs )
708 const RT tmp( rhs.dm_ );
729 template<
typename VT1 >
730 friend inline auto smpDivAssign( Vector<VT1,true>& lhs,
const DMatReduceExpr& rhs )
737 const RT tmp( rhs.dm_ );
771 :
public MatReduceExpr< DenseVector< DMatReduceExpr<MT,OP,rowwise>, false >, rowwise >
791 template<
typename VT >
792 static constexpr bool UseAssign_v =
useAssign;
803 template<
typename VT >
804 static constexpr bool UseSMPAssign_v = ( !MT::smpAssignable &&
useAssign );
863 ,
op_ ( std::move(op) )
1081 ,
op_( std::move(op) )
1105 if( index >=
dm_.rows() ) {
1108 return (*
this)[index];
1137 inline size_t size() const noexcept {
1168 template<
typename T >
1169 inline bool canAlias(
const T* alias )
const noexcept {
1170 return (
dm_.isAliased( alias ) );
1180 template<
typename T >
1182 return (
dm_.isAliased( alias ) );
1202 return dm_.canSMPAssign() || (
size() > SMP_DMATREDUCE_THRESHOLD );
1226 template<
typename VT1 >
1254 template<
typename VT1 >
1262 const RT tmp(
serial( rhs.dm_ ) );
1283 template<
typename VT1 >
1284 friend inline auto subAssign( Vector<VT1,false>& lhs,
const DMatReduceExpr& rhs )
1291 const RT tmp(
serial( rhs.dm_ ) );
1312 template<
typename VT1 >
1313 friend inline auto multAssign( Vector<VT1,false>& lhs,
const DMatReduceExpr& rhs )
1320 const RT tmp(
serial( rhs.dm_ ) );
1340 template<
typename VT1 >
1341 friend inline auto divAssign( Vector<VT1,false>& lhs,
const DMatReduceExpr& rhs )
1348 const RT tmp(
serial( rhs.dm_ ) );
1368 template<
typename VT1 >
1369 friend inline auto smpAssign( Vector<VT1,false>& lhs,
const DMatReduceExpr& rhs )
1376 const RT tmp( rhs.dm_ );
1397 template<
typename VT1 >
1398 friend inline auto smpAddAssign( Vector<VT1,false>& lhs,
const DMatReduceExpr& rhs )
1405 const RT tmp( rhs.dm_ );
1426 template<
typename VT1 >
1427 friend inline auto smpSubAssign( Vector<VT1,false>& lhs,
const DMatReduceExpr& rhs )
1434 const RT tmp( rhs.dm_ );
1455 template<
typename VT1 >
1456 friend inline auto smpMultAssign( Vector<VT1,false>& lhs,
const DMatReduceExpr& rhs )
1463 const RT tmp( rhs.dm_ );
1484 template<
typename VT1 >
1485 friend inline auto smpDivAssign( Vector<VT1,false>& lhs,
const DMatReduceExpr& rhs )
1492 const RT tmp( rhs.dm_ );
1521template<
typename MT
1523struct DMatReduceExprHelper
1527 using CT = RemoveReference_t< CompositeType_t<MT> >;
1530 using ET = RemoveCV_t< ElementType_t<CT> >;
1534 static constexpr bool value =
1535 ( CT::simdEnabled &&
1536 If_t< HasSIMDEnabled_v<OP>, GetSIMDEnabled<OP,ET,ET>, HasLoad<OP> >::value );
1564template<
typename MT
1572 const size_t M( (*dm).rows() );
1573 const size_t N( (*dm).columns() );
1575 if( M == 0UL || N == 0UL )
return RT{};
1576 if( M == 1UL && N == 1UL )
return (*dm)(0UL,0UL);
1586 redux0 = tmp(0UL,0UL);
1588 for(
size_t j=1UL; j<N; ++j ) {
1589 redux0 = op( redux0, tmp(0UL,j) );
1595 for( ; (i+2UL) <= M; i+=2UL )
1597 RT redux1( tmp(i ,0UL) );
1598 RT redux2( tmp(i+1UL,0UL) );
1600 for(
size_t j=1UL; j<N; ++j ) {
1601 redux1 = op( redux1, tmp(i ,j) );
1602 redux2 = op( redux2, tmp(i+1UL,j) );
1605 redux1 = op( redux1, redux2 );
1606 redux0 = op( redux0, redux1 );
1611 RT redux1( tmp(i,0UL) );
1613 for(
size_t j=1UL; j<N; ++j ) {
1614 redux1 = op( redux1, tmp(i,j) );
1617 redux0 = op( redux0, redux1 );
1639template<
typename MT
1647 const size_t M( (*dm).rows() );
1648 const size_t N( (*dm).columns() );
1650 if( M == 0UL || N == 0UL )
return ET{};
1674 xmm1 = tmp.load(0UL,0UL);
1675 size_t j( SIMDSIZE );
1677 for( ; j<jpos; j+=SIMDSIZE ) {
1678 xmm1 = op( xmm1, tmp.load(0UL,j) );
1686 array1[0UL] = op( array1[0UL], tmp(0UL,j) );
1689 xmm1 =
loada( array1 );
1695 for( ; (i+4UL) <= M; i+=4UL )
1697 xmm1 = op( xmm1, tmp.load(i,0UL) );
1701 size_t j( SIMDSIZE );
1703 for( ; j<jpos; j+=SIMDSIZE ) {
1704 xmm1 = op( xmm1, tmp.load(i ,j) );
1705 xmm2 = op( xmm2, tmp.load(i+1UL,j) );
1706 xmm3 = op( xmm3, tmp.load(i+2UL,j) );
1707 xmm4 = op( xmm4, tmp.load(i+3UL,j) );
1718 array1[0UL] = op( array1[0UL], tmp(i ,j) );
1719 array2[0UL] = op( array2[0UL], tmp(i+1UL,j) );
1720 array3[0UL] = op( array3[0UL], tmp(i+2UL,j) );
1721 array4[0UL] = op( array4[0UL], tmp(i+3UL,j) );
1724 xmm1 =
loada( array1 );
1725 xmm2 =
loada( array2 );
1726 xmm3 =
loada( array3 );
1727 xmm4 =
loada( array4 );
1730 xmm1 = op( xmm1, xmm2 );
1731 xmm3 = op( xmm3, xmm4 );
1732 xmm1 = op( xmm1, xmm3 );
1737 xmm1 = op( xmm1, tmp.load(i,0UL) );
1739 size_t j( SIMDSIZE );
1741 for( ; j<jpos; j+=SIMDSIZE ) {
1742 xmm1 = op( xmm1, tmp.load(i ,j) );
1743 xmm2 = op( xmm2, tmp.load(i+1UL,j) );
1752 array1[0UL] = op( array1[0UL], tmp(i ,j) );
1753 array2[0UL] = op( array2[0UL], tmp(i+1UL,j) );
1756 xmm1 =
loada( array1 );
1757 xmm2 =
loada( array2 );
1760 xmm1 = op( xmm1, xmm2 );
1767 xmm1 = op( xmm1, tmp.load(i,0UL) );
1768 size_t j( SIMDSIZE );
1770 for( ; j<jpos; j+=SIMDSIZE ) {
1771 xmm1 = op( xmm1, tmp.load(i,j) );
1779 array1[0] = op( array1[0], tmp(i,j) );
1782 xmm1 =
loada( array1 );
1786 redux =
reduce( xmm1, op );
1791 redux = tmp(0UL,0UL);
1792 for(
size_t j=1UL; j<N; ++j ) {
1793 redux = op( redux, tmp(0UL,j) );
1796 for(
size_t i=1UL; i<M; ++i ) {
1797 for(
size_t j=0UL; j<N; ++j ) {
1798 redux = op( redux, tmp(i,j) );
1821template<
typename MT >
1828 const size_t M( (*dm).rows() );
1829 const size_t N( (*dm).columns() );
1831 if( M == 0UL || N == 0UL )
return ET{};
1843 if( !remainder || N >= SIMDSIZE )
1845 const size_t jpos( remainder ?
prevMultiple( N, SIMDSIZE ) : N );
1851 for( ; (i+4UL) <= M; i+=4UL )
1853 xmm1 += tmp.load(i,0UL);
1857 size_t j( SIMDSIZE );
1859 for( ; j<jpos; j+=SIMDSIZE ) {
1860 xmm1 += tmp.load(i ,j);
1861 xmm2 += tmp.load(i+1UL,j);
1862 xmm3 += tmp.load(i+2UL,j);
1863 xmm4 += tmp.load(i+3UL,j);
1865 for( ; remainder && j<N; ++j ) {
1867 redux += tmp(i+1UL,j);
1868 redux += tmp(i+2UL,j);
1869 redux += tmp(i+3UL,j);
1879 xmm1 += tmp.load(i,0UL);
1881 size_t j( SIMDSIZE );
1883 for( ; j<jpos; j+=SIMDSIZE ) {
1884 xmm1 += tmp.load(i ,j);
1885 xmm2 += tmp.load(i+1UL,j);
1887 for( ; remainder && j<N; ++j ) {
1889 redux += tmp(i+1UL,j);
1899 xmm1 += tmp.load(i,0UL);
1900 size_t j( SIMDSIZE );
1902 for( ; j<jpos; j+=SIMDSIZE ) {
1903 xmm1 += tmp.load(i,j);
1905 for( ; remainder && j<N; ++j ) {
1910 redux +=
sum( xmm1 );
1914 for(
size_t i=0UL; i<M; ++i ) {
1915 for(
size_t j=0UL; j<N; ++j ) {
1939template<
typename MT >
1943 return (*dm)(0UL,0UL);
1960template<
typename MT >
1964 return (*dm)(0UL,0UL);
1983template<
typename MT
1987 return dmatreduce(
trans( *dm ), std::move(op) );
2022template<
typename MT
2029 return dmatreduce( *dm, std::move(op) );
2043template< ReductionFlag RF
2046inline const DMatReduceExpr<MT,OP,RF> reduce_backend(
const DenseMatrix<MT,false>& dm, OP op )
2048 using ReturnType =
const DMatReduceExpr<MT,OP,RF>;
2049 return ReturnType( *dm, std::move(op) );
2132 return reduce_backend<RF>( *dm, std::move(op) );
2154template<
typename MT
2198template< ReductionFlag RF
2227template<
typename MT
2271template< ReductionFlag RF
2301template<
typename MT
2342template< ReductionFlag RF
2372template<
typename MT
2413template< ReductionFlag RF
Header file for auxiliary alias declarations.
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.
Definition Aliases.h:110
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.
Definition Aliases.h:550
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition Aliases.h:190
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition Aliases.h:450
Header file for run time assertion macros.
Header file for the blaze::checked and blaze::unchecked instances.
Constraints on the storage order of matrix types.
Constraint on the transpose flag of vector types.
Header file for the EnableIf class template.
Header file for the function trace functionality.
Header file for the HasLoad type trait.
Header file for the HasMember type traits.
Macro for CUDA compatibility.
Header file for the If class template.
Header file for the IsExpression type trait class.
Header file for the IsPadded type trait.
Header file for the IsSIMDEnabled type trait.
Header file for the IsSame and IsStrictlySame type traits.
Deactivation of problematic macros.
Header file for the prevMultiple shim.
Header file for the reduce trait.
Header file for the reduction flags.
constexpr ReductionFlag columnwise
Reduction flag for column-wise reduction operations.
Definition ReductionFlag.h:97
constexpr ReductionFlag rowwise
Reduction flag for row-wise reduction operations.
Definition ReductionFlag.h:77
size_t ReductionFlag
Type of the reduction flags.
Definition ReductionFlag.h:57
Header file for the RemoveCV type trait.
Header file for the RemoveReference type trait.
Constraints on the storage order of matrix types.
Constraint on the transpose flag of vector types.
Header file for all SIMD functionality.
ReduceTrait_t< RT, OP, columnwise > ResultType
Result type for expression template evaluations.
Definition DMatReduceExpr.h:159
const ResultType CompositeType
Data type for composite expression templates.
Definition DMatReduceExpr.h:164
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition DMatReduceExpr.h:269
ResultType_t< MT > RT
Result type of the dense matrix expression.
Definition DMatReduceExpr.h:135
const ElementType ReturnType
Return type for expression template evaluations.
Definition DMatReduceExpr.h:163
ElementType_t< ResultType > ElementType
Resulting element type.
Definition DMatReduceExpr.h:161
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition DMatReduceExpr.h:279
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition DMatReduceExpr.h:289
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition DMatReduceExpr.h:160
Operation op_
The reduction operation.
Definition DMatReduceExpr.h:297
Operand operand() const noexcept
Returns the dense matrix operand.
Definition DMatReduceExpr.h:235
SIMDTrait_t< ElementType > SIMDType
Resulting SIMD element type.
Definition DMatReduceExpr.h:162
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition DMatReduceExpr.h:225
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition DMatReduceExpr.h:199
DMatReduceExpr(const MT &dm, OP op) noexcept
Constructor for the DMatReduceExpr class.
Definition DMatReduceExpr.h:187
CompositeType_t< MT > CT
Composite type of the dense matrix expression.
Definition DMatReduceExpr.h:136
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition DMatReduceExpr.h:175
Operation operation() const
Returns a copy of the reduction operation.
Definition DMatReduceExpr.h:245
Operand dm_
Dense matrix of the reduction expression.
Definition DMatReduceExpr.h:296
MatReduceExpr< DenseVector< This, true >, columnwise > BaseType
Base type of this DMatReduceExpr instance.
Definition DMatReduceExpr.h:157
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition DMatReduceExpr.h:178
OP Operation
Data type of the custom unary operation.
Definition DMatReduceExpr.h:170
DMatReduceExpr< MT, OP, columnwise > This
Type of this DMatReduceExpr instance.
Definition DMatReduceExpr.h:154
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition DMatReduceExpr.h:257
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition DMatReduceExpr.h:212
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite type of the left-hand side dense matrix expression.
Definition DMatReduceExpr.h:167
Iterator over the elements of the dense vector.
Definition DMatReduceExpr.h:836
BLAZE_DEVICE_CALLABLE ConstIterator & operator--()
Pre-decrement operator.
Definition DMatReduceExpr.h:917
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition DMatReduceExpr.h:949
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition DMatReduceExpr.h:993
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition DMatReduceExpr.h:1015
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition DMatReduceExpr.h:982
BLAZE_DEVICE_CALLABLE ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition DMatReduceExpr.h:873
BLAZE_DEVICE_CALLABLE const ConstIterator operator++(int)
Post-increment operator.
Definition DMatReduceExpr.h:907
BLAZE_DEVICE_CALLABLE ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition DMatReduceExpr.h:885
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition DMatReduceExpr.h:938
OP op_
The reduction operation.
Definition DMatReduceExpr.h:1060
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition DMatReduceExpr.h:1027
ConstIterator(Operand dm, size_t index, OP op)
Constructor for the ConstIterator class.
Definition DMatReduceExpr.h:860
ReferenceType reference
Reference return type.
Definition DMatReduceExpr.h:849
ElementType * PointerType
Pointer return type.
Definition DMatReduceExpr.h:841
Operand dm_
Dense matrix of the reduction expression.
Definition DMatReduceExpr.h:1058
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition DMatReduceExpr.h:1051
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition DMatReduceExpr.h:971
size_t index_
Index to the current matrix row.
Definition DMatReduceExpr.h:1059
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition DMatReduceExpr.h:839
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition DMatReduceExpr.h:1039
PointerType pointer
Pointer return type.
Definition DMatReduceExpr.h:848
ElementType & ReferenceType
Reference return type.
Definition DMatReduceExpr.h:842
ValueType value_type
Type of the underlying elements.
Definition DMatReduceExpr.h:847
IteratorCategory iterator_category
The iterator category.
Definition DMatReduceExpr.h:846
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition DMatReduceExpr.h:1004
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition DMatReduceExpr.h:960
ElementType ValueType
Type of the underlying elements.
Definition DMatReduceExpr.h:840
DifferenceType difference_type
Difference between two iterators.
Definition DMatReduceExpr.h:850
ptrdiff_t DifferenceType
Difference between two iterators.
Definition DMatReduceExpr.h:843
BLAZE_DEVICE_CALLABLE const ConstIterator operator--(int)
Post-decrement operator.
Definition DMatReduceExpr.h:928
BLAZE_DEVICE_CALLABLE ConstIterator & operator++()
Pre-increment operator.
Definition DMatReduceExpr.h:896
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the reduction expression.
Definition DMatReduceExpr.h:787
Operand operand() const noexcept
Returns the dense matrix operand.
Definition DMatReduceExpr.h:1147
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite type of the left-hand side dense matrix expression.
Definition DMatReduceExpr.h:826
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition DMatReduceExpr.h:1070
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition DMatReduceExpr.h:1104
ElementType_t< ResultType > ElementType
Resulting element type.
Definition DMatReduceExpr.h:818
ResultType_t< MT > RT
Result type of the dense matrix expression.
Definition DMatReduceExpr.h:776
MatReduceExpr< DenseVector< This, false >, rowwise > BaseType
Base type of this DMatReduceExpr instance.
Definition DMatReduceExpr.h:814
DMatReduceExpr< MT, OP, rowwise > This
Type of this DMatReduceExpr instance.
Definition DMatReduceExpr.h:811
Operation operation() const
Returns a copy of the reduction operation.
Definition DMatReduceExpr.h:1157
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition DMatReduceExpr.h:1191
ReduceTrait_t< RT, OP, rowwise > ResultType
Result type for expression template evaluations.
Definition DMatReduceExpr.h:816
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition DMatReduceExpr.h:1117
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition DMatReduceExpr.h:1067
SIMDTrait_t< ElementType > SIMDType
Resulting SIMD element type.
Definition DMatReduceExpr.h:819
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition DMatReduceExpr.h:1137
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition DMatReduceExpr.h:1091
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition DMatReduceExpr.h:817
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition DMatReduceExpr.h:1169
If_t< useAssign, const ResultType, const DMatReduceExpr & > CompositeType
Data type for composite expression templates.
Definition DMatReduceExpr.h:823
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition DMatReduceExpr.h:1201
const ElementType ReturnType
Return type for expression template evaluations.
Definition DMatReduceExpr.h:820
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition DMatReduceExpr.h:1127
Operation op_
The reduction operation.
Definition DMatReduceExpr.h:1209
OP Operation
Data type of the custom unary operation.
Definition DMatReduceExpr.h:829
Operand dm_
Dense matrix of the reduction expression.
Definition DMatReduceExpr.h:1208
DMatReduceExpr(const MT &dm, OP op) noexcept
Constructor for the DMatReduceExpr class.
Definition DMatReduceExpr.h:1079
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition DMatReduceExpr.h:1181
Base template for row-major dense matrix partial reduction operations.
Definition DMatReduceExpr.h:108
Base class for dense matrices.
Definition DenseMatrix.h:82
Base class for N-dimensional dense vectors.
Definition DenseVector.h:77
SIMD characteristics of data types.
Definition SIMDTrait.h:297
Base class for sparse vectors.
Definition SparseVector.h:72
Base class for N-dimensional vectors.
Definition Vector.h:82
Pointer difference type of the Blaze library.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the Computation base class.
Header file for the DenseMatrix base class.
Header file for the DenseVector base class.
Header file for the MatReduceExpr base class.
Header file for the Add functor.
Header file for the Mult functor.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition Column.h:137
decltype(auto) prod(const DenseMatrix< MT, SO > &dm)
Reduces the given dense matrix by means of multiplication.
Definition DMatReduceExpr.h:2229
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition DMatDMatMapExpr.h:1339
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition DMatDMatMapExpr.h:1375
decltype(auto) reduce(const DenseMatrix< MT, SO > &dm, OP op)
Performs a custom reduction operation on the given dense matrix.
Definition DMatReduceExpr.h:2025
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition DMatTransExpr.h:766
decltype(auto) map(const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs, OP op)
Elementwise evaluation of the given binary operation on each single element of the dense matrices lhs...
Definition DMatDMatMapExpr.h:1144
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition DMatSerialExpr.h:812
decltype(auto) sum(const DenseMatrix< MT, SO > &dm)
Reduces the given dense matrix by means of addition.
Definition DMatReduceExpr.h:2156
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition RowMajorMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition DenseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.
Definition DenseVector.h:61
#define BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE(T)
Constraint on the data type.
Definition RowVector.h:61
typename ReduceTrait< T, OP, RF... >::Type ReduceTrait_t
Auxiliary alias declaration for the ReduceTrait class template.
Definition ReduceTrait.h:150
constexpr bool RequiresEvaluation_v
Auxiliary variable template for the RequiresEvaluation type trait.
Definition RequiresEvaluation.h:91
constexpr bool IsPadded_v
Auxiliary variable template for the IsPadded type trait.
Definition IsPadded.h:134
BLAZE_ALWAYS_INLINE constexpr auto prevMultiple(T1 value, T2 factor) noexcept
Rounds down an integral value to the previous multiple of a given factor.
Definition PrevMultiple.h:68
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition Matrix.h:806
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition Row.h:137
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition Assert.h:101
typename SIMDTrait< T >::Type SIMDTrait_t
Auxiliary alias declaration for the SIMDTrait class template.
Definition SIMDTrait.h:315
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition Storea.h:78
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition Loada.h:79
auto smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition DenseVector.h:221
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
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
auto smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector.
Definition DenseVector.h:192
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
#define BLAZE_STATIC_ASSERT_MSG(expr, msg)
Compile time assertion macro.
Definition StaticAssert.h:123
#define BLAZE_DEVICE_CALLABLE
Conditional macro that sets host and device attributes when compiled with CUDA.
Definition HostDevice.h:94
constexpr bool IsSame_v
Auxiliary variable template for the IsSame type trait.
Definition IsSame.h:159
typename RemoveReference< T >::Type RemoveReference_t
Auxiliary alias declaration for the RemoveReference type trait.
Definition RemoveReference.h:95
typename RemoveCV< T >::Type RemoveCV_t
Auxiliary alias declaration for the RemoveCV type trait.
Definition RemoveCV.h:97
constexpr size_t AlignmentOf_v
Auxiliary variable template for the AlignmentOf type trait.
Definition AlignmentOf.h:239
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:138
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition Exception.h:331
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition FunctionTrace.h:94
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition If.h:108
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:175
constexpr Unchecked unchecked
Global Unchecked instance.
Definition Check.h:146
Header file for the exception macros of the math module.
Header file for all forward declarations for expression class templates.
Header file for the Max functor.
Header file for the Min functor.
Header file for the serial shim.
Generic wrapper for the addition operator.
Definition Add.h:85
Base class for all compute expression templates.
Definition Computation.h:68
Base class for all matrix reduction expression templates.
Definition MatReduceExpr.h:70
Generic wrapper for the max() function.
Definition Max.h:82
Generic wrapper for the min() function.
Definition Min.h:82
Generic wrapper for the multiplication operator.
Definition Mult.h:82
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
Header file for the RequiresEvaluation type trait.
Header file for basic type definitions.