Blaze 3.9
DVecDVecOuterExpr.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_EXPRESSIONS_DVECDVECOUTEREXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_DVECDVECOUTEREXPR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <iterator>
44#include <utility>
45#include <blaze/math/Aliases.h>
66#include <blaze/math/SIMD.h>
79#include <blaze/system/Inline.h>
83#include <blaze/util/Assert.h>
84#include <blaze/util/EnableIf.h>
87#include <blaze/util/mpl/If.h>
88#include <blaze/util/Types.h>
90
91
92namespace blaze {
93
94//=================================================================================================
95//
96// CLASS DVECDVECMAPEXPR
97//
98//=================================================================================================
99
100//*************************************************************************************************
108template< typename VT1 // Type of the left-hand side dense vector
109 , typename VT2 // Type of the right-hand side dense vector
110 , typename OP > // Type of the custom operation
112 : public VecTVecMapExpr< DenseMatrix< DVecDVecOuterExpr<VT1,VT2,OP>, false > >
113 , private Computation
114{
115 private:
116 //**Type definitions****************************************************************************
125 //**********************************************************************************************
126
127 //**********************************************************************************************
129 static constexpr bool evaluateLeft = ( IsComputation_v<VT1> || RequiresEvaluation_v<VT1> );
130 //**********************************************************************************************
131
132 //**********************************************************************************************
134 static constexpr bool evaluateRight = ( IsComputation_v<VT2> || RequiresEvaluation_v<VT2> );
135 //**********************************************************************************************
136
137 //**Serial evaluation strategy******************************************************************
139
144 static constexpr bool useAssign = ( evaluateLeft || evaluateRight );
145 //**********************************************************************************************
146
147 //**Parallel evaluation strategy****************************************************************
149
153 template< typename VT >
154 static constexpr bool UseSMPAssign_v = evaluateRight;
156 //**********************************************************************************************
157
158 //**********************************************************************************************
160
163 template< typename T1, typename T2, typename T3 >
164 static constexpr bool UseVectorizedKernel_v =
165 ( useOptimizedKernels &&
166 T1::simdEnabled && T2::simdEnabled && T3::simdEnabled &&
167 IsSIMDCombinable_v< ElementType_t<T1>
169 , ElementType_t<T3> > &&
170 If_t< HasSIMDEnabled_v<OP>, GetSIMDEnabled<OP,ET1,ET2>, HasLoad<OP> >::value );
172 //**********************************************************************************************
173
174 //**********************************************************************************************
176
179 template< typename T1, typename T2, typename T3 >
180 static constexpr bool UseDefaultKernel_v = !UseVectorizedKernel_v<T1,T2,T3>;
182 //**********************************************************************************************
183
184 public:
185 //**Type definitions****************************************************************************
188
191
196
198 using ReturnType = decltype( std::declval<OP>()( std::declval<RN1>(), std::declval<RN2>() ) );
199
202
204 using LeftOperand = If_t< IsExpression_v<VT1>, const VT1, const VT1& >;
205
207 using RightOperand = If_t< IsExpression_v<VT2>, const VT2, const VT2& >;
208
210 using Operation = OP;
211
214
217 //**********************************************************************************************
218
219 //**ConstIterator class definition**************************************************************
223 {
224 public:
225 //**Type definitions*************************************************************************
226 using IteratorCategory = std::random_access_iterator_tag;
230 using DifferenceType = ptrdiff_t;
231
232 // STL iterator requirements
238
241
244 //*******************************************************************************************
245
246 //**Constructor******************************************************************************
254 : left_ ( left ) // Iterator to the current left-hand side element
255 , right_( right ) // Iterator to the current right-hand side element
256 , op_ ( std::move(op) ) // The custom binary operation
257 {}
258 //*******************************************************************************************
259
260 //**Addition assignment operator*************************************************************
267 right_ += inc;
268 return *this;
269 }
270 //*******************************************************************************************
271
272 //**Subtraction assignment operator**********************************************************
279 right_ -= dec;
280 return *this;
281 }
282 //*******************************************************************************************
283
284 //**Prefix increment operator****************************************************************
290 ++right_;
291 return *this;
292 }
293 //*******************************************************************************************
294
295 //**Postfix increment operator***************************************************************
301 return ConstIterator( left_, right_++, op_ );
302 }
303 //*******************************************************************************************
304
305 //**Prefix decrement operator****************************************************************
311 --right_;
312 return *this;
313 }
314 //*******************************************************************************************
315
316 //**Postfix decrement operator***************************************************************
322 return ConstIterator( left_, right_--, op_ );
323 }
324 //*******************************************************************************************
325
326 //**Element access operator******************************************************************
331 inline ReturnType operator*() const {
332 return op_( *left_, *right_ );
333 }
334 //*******************************************************************************************
335
336 //**Load function****************************************************************************
341 inline auto load() const noexcept {
342 return op_.load( set( *left_ ), right_.load() );
343 }
344 //*******************************************************************************************
345
346 //**Equality operator************************************************************************
352 inline bool operator==( const ConstIterator& rhs ) const {
353 return right_ == rhs.right_;
354 }
355 //*******************************************************************************************
356
357 //**Inequality operator**********************************************************************
363 inline bool operator!=( const ConstIterator& rhs ) const {
364 return right_ != rhs.right_;
365 }
366 //*******************************************************************************************
367
368 //**Less-than operator***********************************************************************
374 inline bool operator<( const ConstIterator& rhs ) const {
375 return right_ < rhs.right_;
376 }
377 //*******************************************************************************************
378
379 //**Greater-than operator********************************************************************
385 inline bool operator>( const ConstIterator& rhs ) const {
386 return right_ > rhs.right_;
387 }
388 //*******************************************************************************************
389
390 //**Less-or-equal-than operator**************************************************************
396 inline bool operator<=( const ConstIterator& rhs ) const {
397 return right_ <= rhs.right_;
398 }
399 //*******************************************************************************************
400
401 //**Greater-or-equal-than operator***********************************************************
407 inline bool operator>=( const ConstIterator& rhs ) const {
408 return right_ >= rhs.right_;
409 }
410 //*******************************************************************************************
411
412 //**Subtraction operator*********************************************************************
418 inline DifferenceType operator-( const ConstIterator& rhs ) const {
419 return right_ - rhs.right_;
420 }
421 //*******************************************************************************************
422
423 //**Addition operator************************************************************************
430 friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
431 return ConstIterator( it.left_ + inc, it.right_ + inc, it.op_ );
432 }
433 //*******************************************************************************************
434
435 //**Addition operator************************************************************************
442 friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
443 return ConstIterator( it.left_, it.right_ + inc, it.op_ );
444 }
445 //*******************************************************************************************
446
447 //**Subtraction operator*********************************************************************
454 friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
455 return ConstIterator( it.left_, it.right_ - dec, it.op_ );
456 }
457 //*******************************************************************************************
458
459 private:
460 //**Member variables*************************************************************************
463 OP op_;
464 //*******************************************************************************************
465 };
466 //**********************************************************************************************
467
468 //**Compilation flags***************************************************************************
470 static constexpr bool simdEnabled =
471 ( VT1::simdEnabled && VT2::simdEnabled &&
472 If_t< HasSIMDEnabled_v<OP>, GetSIMDEnabled<OP,ET1,ET2>, HasLoad<OP> >::value );
473
475 static constexpr bool smpAssignable = ( VT1::smpAssignable && VT2::smpAssignable );
476 //**********************************************************************************************
477
478 //**SIMD properties*****************************************************************************
480 static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
481 //**********************************************************************************************
482
483 //**Constructor*********************************************************************************
490 inline DVecDVecOuterExpr( const VT1& lhs, const VT2& rhs, OP op ) noexcept
491 : lhs_( lhs ) // Left-hand side dense vector of the map expression
492 , rhs_( rhs ) // Right-hand side dense vector of the map expression
493 , op_ ( std::move(op) ) // The custom binary operation
494 {}
495 //**********************************************************************************************
496
497 //**Access operator*****************************************************************************
504 inline ReturnType operator()( size_t i, size_t j ) const {
505 BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
506 BLAZE_INTERNAL_ASSERT( j < rhs_.size(), "Invalid column access index" );
507
508 return op_( lhs_[i], rhs_[j] );
509 }
510 //**********************************************************************************************
511
512 //**At function*********************************************************************************
520 inline ReturnType at( size_t i, size_t j ) const {
521 if( i >= lhs_.size() ) {
522 BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
523 }
524 if( j >= rhs_.size() ) {
525 BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
526 }
527 return (*this)(i,j);
528 }
529 //**********************************************************************************************
530
531 //**Load function*******************************************************************************
538 BLAZE_ALWAYS_INLINE auto load( size_t i, size_t j ) const noexcept {
539 BLAZE_INTERNAL_ASSERT( i < lhs_.size() , "Invalid row access index" );
540 BLAZE_INTERNAL_ASSERT( j < rhs_.size() , "Invalid column access index" );
541 BLAZE_INTERNAL_ASSERT( j % SIMDSIZE == 0UL, "Invalid column access index" );
542 return op_.load( set( lhs_[i] ), rhs_.load( j ) );
543 }
544 //**********************************************************************************************
545
546 //**Begin function******************************************************************************
552 inline ConstIterator begin( size_t i ) const {
553 BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
554 return ConstIterator( lhs_.begin()+i, rhs_.begin(), op_ );
555 }
556 //**********************************************************************************************
557
558 //**End function********************************************************************************
564 inline ConstIterator end( size_t i ) const {
565 BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
566 return ConstIterator( lhs_.begin()+i, rhs_.end(), op_ );
567 }
568 //**********************************************************************************************
569
570 //**Rows function*******************************************************************************
575 inline size_t rows() const noexcept {
576 return lhs_.size();
577 }
578 //**********************************************************************************************
579
580 //**Columns function****************************************************************************
585 inline size_t columns() const noexcept {
586 return rhs_.size();
587 }
588 //**********************************************************************************************
589
590 //**Left operand access*************************************************************************
595 inline LeftOperand leftOperand() const noexcept {
596 return lhs_;
597 }
598 //**********************************************************************************************
599
600 //**Right operand access************************************************************************
605 inline RightOperand rightOperand() const noexcept {
606 return rhs_;
607 }
608 //**********************************************************************************************
609
610 //**Operation access****************************************************************************
615 inline Operation operation() const {
616 return op_;
617 }
618 //**********************************************************************************************
619
620 //**********************************************************************************************
626 template< typename T >
627 inline bool canAlias( const T* alias ) const noexcept {
628 return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
629 }
630 //**********************************************************************************************
631
632 //**********************************************************************************************
638 template< typename T >
639 inline bool isAliased( const T* alias ) const noexcept {
640 return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
641 }
642 //**********************************************************************************************
643
644 //**********************************************************************************************
649 inline bool isAligned() const noexcept {
650 return lhs_.isAligned() && rhs_.isAligned();
651 }
652 //**********************************************************************************************
653
654 //**********************************************************************************************
659 inline bool canSMPAssign() const noexcept {
660 return ( rows() * columns() >= SMP_DVECDVECOUTER_THRESHOLD );
661 }
662 //**********************************************************************************************
663
664 private:
665 //**Member variables****************************************************************************
669 //**********************************************************************************************
670
671 //**Assignment to dense matrices****************************************************************
686 template< typename MT > // Type of the target dense matrix
687 friend inline auto assign( DenseMatrix<MT,false>& lhs, const DVecDVecOuterExpr& rhs )
688 {
690
691 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
692 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
693
694 LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
695 RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
696
697 BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
698 BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
699 BLAZE_INTERNAL_ASSERT( x.size() == (*lhs).rows() , "Invalid vector size" );
700 BLAZE_INTERNAL_ASSERT( y.size() == (*lhs).columns(), "Invalid vector size" );
701
702 DVecDVecOuterExpr::selectAssignKernel( *lhs, x, y, rhs.op_ );
703 }
705 //**********************************************************************************************
706
707 //**Default assignment to row-major dense matrices**********************************************
722 template< typename MT // Type of the left-hand side target matrix
723 , typename VT3 // Type of the left-hand side vector operand
724 , typename VT4 > // Type of the right-hand side vector operand
725 static inline auto selectAssignKernel( MT& A, const VT3& x, const VT4& y, OP op )
726 -> EnableIf_t< IsRowMajorMatrix_v<MT> && UseDefaultKernel_v<MT,VT3,VT4> >
727 {
728 const size_t M( A.rows() );
729 const size_t N( A.columns() );
730
731 const size_t jpos( prevMultiple( N, 2UL ) );
732 BLAZE_INTERNAL_ASSERT( jpos <= N, "Invalid end calculation" );
733
734 for( size_t i=0UL; i<M; ++i ) {
735 for( size_t j=0UL; j<jpos; j+=2UL ) {
736 A(i,j ) = op( x[i], y[j ] );
737 A(i,j+1UL) = op( x[i], y[j+1] );
738 }
739 if( jpos < N ) {
740 A(i,jpos) = op( x[i], y[jpos] );
741 }
742 }
743 }
745 //**********************************************************************************************
746
747 //**Vectorized assignment to row-major dense matrices*******************************************
762 template< typename MT // Type of the left-hand side target matrix
763 , typename VT3 // Type of the left-hand side vector operand
764 , typename VT4 > // Type of the right-hand side vector operand
765 static inline auto selectAssignKernel( MT& A, const VT3& x, const VT4& y, OP op )
766 -> EnableIf_t< IsRowMajorMatrix_v<MT> && UseVectorizedKernel_v<MT,VT3,VT4> >
767 {
768 constexpr bool remainder( !IsSame_v<OP,Mult> || !IsPadded_v<MT> || !IsPadded_v<VT4> );
769
770 const size_t M( A.rows() );
771 const size_t N( A.columns() );
772
773 const size_t jpos( remainder ? prevMultiple( N, SIMDSIZE ) : N );
774 BLAZE_INTERNAL_ASSERT( jpos <= N, "Invalid end calculation" );
775
776 auto xbegin( x.begin() );
777
778 for( size_t i=0UL; i<M; ++i )
779 {
780 const auto x1( set( *xbegin ) );
781
782 size_t j( 0UL );
783 auto abegin( A.begin(i) );
784 auto ybegin( y.begin() );
785
786 for( ; j<jpos; j+=SIMDSIZE, abegin+=SIMDSIZE, ybegin+=SIMDSIZE ) {
787 abegin.store( op.load( x1, ybegin.load() ) );
788 }
789 for( ; remainder && j<N; ++j, ++abegin, ++ybegin ) {
790 *abegin = op( *xbegin, *ybegin );
791 }
792
793 ++xbegin;
794 }
795 }
797 //**********************************************************************************************
798
799 //**Assignment to column-major dense matrices***************************************************
812 template< typename MT > // Type of the target dense matrix
813 friend inline void assign( DenseMatrix<MT,true>& lhs, const DVecDVecOuterExpr& rhs )
814 {
816
818
819 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
820 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
821
822 LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
823 RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
824
825 BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
826 BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
827 BLAZE_INTERNAL_ASSERT( x.size() == (*lhs).rows() , "Invalid vector size" );
828 BLAZE_INTERNAL_ASSERT( y.size() == (*lhs).columns(), "Invalid vector size" );
829
830 DVecDVecOuterExpr::selectAssignKernel( *lhs, x, y, rhs.op_ );
831 }
833 //**********************************************************************************************
834
835 //**Default assignment to column-major dense matrices*******************************************
850 template< typename MT // Type of the left-hand side target matrix
851 , typename VT3 // Type of the left-hand side vector operand
852 , typename VT4 > // Type of the right-hand side vector operand
853 static inline auto selectAssignKernel( MT& A, const VT3& x, const VT4& y, OP op )
854 -> EnableIf_t< IsColumnMajorMatrix_v<MT> && UseDefaultKernel_v<MT,VT3,VT4> >
855 {
856 const size_t M( A.rows() );
857 const size_t N( A.columns() );
858
859 const size_t ipos( prevMultiple( M, 2UL ) );
860 BLAZE_INTERNAL_ASSERT( ipos <= M, "Invalid end calculation" );
861
862 for( size_t j=0UL; j<N; ++j ) {
863 for( size_t i=0UL; i<ipos; i+=2UL ) {
864 A(i ,j) = op( x[i ], y[j] );
865 A(i+1UL,j) = op( x[i+1], y[j] );
866 }
867 if( ipos < M ) {
868 A(ipos,j) = op( x[ipos], y[j] );
869 }
870 }
871 }
873 //**********************************************************************************************
874
875 //**Vectorized assignment to column-major dense matrices****************************************
890 template< typename MT // Type of the left-hand side target matrix
891 , typename VT3 // Type of the left-hand side vector operand
892 , typename VT4 > // Type of the right-hand side vector operand
893 static inline auto selectAssignKernel( MT& A, const VT3& x, const VT4& y, OP op )
894 -> EnableIf_t< IsColumnMajorMatrix_v<MT> && UseVectorizedKernel_v<MT,VT3,VT4> >
895 {
896 constexpr bool remainder( !IsSame_v<OP,Mult> || !IsPadded_v<MT> || !IsPadded_v<VT3> );
897
898 const size_t M( A.rows() );
899 const size_t N( A.columns() );
900
901 const size_t ipos( remainder ? prevMultiple( M, SIMDSIZE ) : M );
902 BLAZE_INTERNAL_ASSERT( ipos <= M, "Invalid end calculation" );
903
904 auto ybegin( y.begin() );
905
906 for( size_t j=0UL; j<N; ++j )
907 {
908 const auto y1( set( *ybegin ) );
909
910 size_t i( 0UL );
911 auto abegin( A.begin(j) );
912 auto xbegin( x.begin() );
913
914 for( ; i<ipos; i+=SIMDSIZE, abegin+=SIMDSIZE, xbegin+=SIMDSIZE ) {
915 abegin.store( op.load( xbegin.load(), y1 ) );
916 }
917 for( ; remainder && i<M; ++i, ++abegin, ++xbegin ) {
918 *abegin = op( *xbegin, *ybegin );
919 }
920
921 ++ybegin;
922 }
923 }
925 //**********************************************************************************************
926
927 //**Assignment to sparse matrices***************************************************************
939 template< typename MT // Type of the target sparse matrix
940 , bool SO > // Storage order of the target sparse matrix
941 friend inline void assign( SparseMatrix<MT,SO>& lhs, const DVecDVecOuterExpr& rhs )
942 {
944
945 using TmpType = If_t< SO, OppositeType, ResultType >;
946
953
954 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
955 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
956
957 const TmpType tmp( serial( rhs ) );
958 assign( *lhs, tmp );
959 }
961 //**********************************************************************************************
962
963 //**Addition assignment to row-major dense matrices*********************************************
978 template< typename MT > // Type of the target dense matrix
979 friend inline auto addAssign( DenseMatrix<MT,false>& lhs, const DVecDVecOuterExpr& rhs )
980 {
982
983 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
984 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
985
986 LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
987 RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
988
989 BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
990 BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
991 BLAZE_INTERNAL_ASSERT( x.size() == (*lhs).rows() , "Invalid vector size" );
992 BLAZE_INTERNAL_ASSERT( y.size() == (*lhs).columns(), "Invalid vector size" );
993
994 DVecDVecOuterExpr::selectAddAssignKernel( *lhs, x, y, rhs.op_ );
995 }
997 //**********************************************************************************************
998
999 //**Default addition assignment to row-major dense matrices*************************************
1014 template< typename MT // Type of the left-hand side target matrix
1015 , typename VT3 // Type of the left-hand side vector operand
1016 , typename VT4 > // Type of the right-hand side vector operand
1017 static inline auto selectAddAssignKernel( MT& A, const VT3& x, const VT4& y, OP op )
1018 -> EnableIf_t< IsRowMajorMatrix_v<MT> && UseDefaultKernel_v<MT,VT3,VT4> >
1019 {
1020 const size_t M( A.rows() );
1021 const size_t N( A.columns() );
1022
1023 const size_t jpos( prevMultiple( N, 2UL ) );
1024 BLAZE_INTERNAL_ASSERT( jpos <= N, "Invalid end calculation" );
1025
1026 for( size_t i=0UL; i<M; ++i ) {
1027 for( size_t j=0UL; j<jpos; j+=2UL ) {
1028 A(i,j ) += op( x[i], y[j ] );
1029 A(i,j+1UL) += op( x[i], y[j+1UL] );
1030 }
1031 if( jpos < N ) {
1032 A(i,jpos) += op( x[i], y[jpos] );
1033 }
1034 }
1035 }
1037 //**********************************************************************************************
1038
1039 //**Vectorized addition assignment to row-major dense matrices**********************************
1054 template< typename MT // Type of the left-hand side target matrix
1055 , typename VT3 // Type of the left-hand side vector operand
1056 , typename VT4 > // Type of the right-hand side vector operand
1057 static inline auto selectAddAssignKernel( MT& A, const VT3& x, const VT4& y, OP op )
1058 -> EnableIf_t< IsRowMajorMatrix_v<MT> && UseVectorizedKernel_v<MT,VT3,VT4> >
1059 {
1060 constexpr bool remainder( !IsSame_v<OP,Mult> || !IsPadded_v<MT> || !IsPadded_v<VT4> );
1061
1062 const size_t M( A.rows() );
1063 const size_t N( A.columns() );
1064
1065 const size_t jpos( remainder ? prevMultiple( N, SIMDSIZE ) : N );
1066 BLAZE_INTERNAL_ASSERT( jpos <= N, "Invalid end calculation" );
1067
1068 auto xbegin( x.begin() );
1069
1070 for( size_t i=0UL; i<M; ++i )
1071 {
1072 const auto x1( set( *xbegin ) );
1073
1074 size_t j( 0UL );
1075 auto abegin( A.begin(i) );
1076 auto ybegin( y.begin() );
1077
1078 for( ; j<jpos; j+=SIMDSIZE, abegin+=SIMDSIZE, ybegin+=SIMDSIZE ) {
1079 abegin.store( abegin.load() + op.load( x1, ybegin.load() ) );
1080 }
1081 for( ; remainder && j<N; ++j, ++abegin, ++ybegin ) {
1082 *abegin += op( *xbegin, *ybegin );
1083 }
1084
1085 ++xbegin;
1086 }
1087 }
1089 //**********************************************************************************************
1090
1091 //**Addition assignment to column-major dense matrices******************************************
1104 template< typename MT > // Type of the target dense matrix
1105 friend inline void addAssign( DenseMatrix<MT,true>& lhs, const DVecDVecOuterExpr& rhs )
1106 {
1108
1110
1111 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
1112 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
1113
1114 LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1115 RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
1116
1117 BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1118 BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1119 BLAZE_INTERNAL_ASSERT( x.size() == (*lhs).rows() , "Invalid vector size" );
1120 BLAZE_INTERNAL_ASSERT( y.size() == (*lhs).columns(), "Invalid vector size" );
1121
1122 DVecDVecOuterExpr::selectAddAssignKernel( *lhs, x, y, rhs.op_ );
1123 }
1125 //**********************************************************************************************
1126
1127 //**Default addition assignment to column dense matrices****************************************
1142 template< typename MT // Type of the left-hand side target matrix
1143 , typename VT3 // Type of the left-hand side vector operand
1144 , typename VT4 > // Type of the right-hand side vector operand
1145 static inline auto selectAddAssignKernel( MT& A, const VT3& x, const VT4& y, OP op )
1146 -> EnableIf_t< IsColumnMajorMatrix_v<MT> && UseDefaultKernel_v<MT,VT3,VT4> >
1147 {
1148 const size_t M( A.rows() );
1149 const size_t N( A.columns() );
1150
1151 const size_t ipos( prevMultiple( M, 2UL ) );
1152 BLAZE_INTERNAL_ASSERT( ipos <= M, "Invalid end calculation" );
1153
1154 for( size_t j=0UL; j<N; ++j ) {
1155 for( size_t i=0UL; i<ipos; i+=2UL ) {
1156 A(i ,j) += op( x[i ], y[j] );
1157 A(i+1UL,j) += op( x[i+1UL], y[j] );
1158 }
1159 if( ipos < M ) {
1160 A(ipos,j) += op( x[ipos], y[j] );
1161 }
1162 }
1163 }
1165 //**********************************************************************************************
1166
1167 //**Vectorized addition assignment to column-major dense matrices*******************************
1182 template< typename MT // Type of the left-hand side target matrix
1183 , typename VT3 // Type of the left-hand side vector operand
1184 , typename VT4 > // Type of the right-hand side vector operand
1185 static inline auto selectAddAssignKernel( MT& A, const VT3& x, const VT4& y, OP op )
1186 -> EnableIf_t< IsColumnMajorMatrix_v<MT> && UseVectorizedKernel_v<MT,VT3,VT4> >
1187 {
1188 constexpr bool remainder( !IsSame_v<OP,Mult> || !IsPadded_v<MT> || !IsPadded_v<VT3> );
1189
1190 const size_t M( A.rows() );
1191 const size_t N( A.columns() );
1192
1193 const size_t ipos( remainder ? prevMultiple( M, SIMDSIZE ) : M );
1194 BLAZE_INTERNAL_ASSERT( ipos <= M, "Invalid end calculation" );
1195
1196 auto ybegin( y.begin() );
1197
1198 for( size_t j=0UL; j<N; ++j )
1199 {
1200 const auto y1( set( *ybegin ) );
1201
1202 size_t i( 0UL );
1203 auto abegin( A.begin(j) );
1204 auto xbegin( x.begin() );
1205
1206 for( ; i<ipos; i+=SIMDSIZE, abegin+=SIMDSIZE, xbegin+=SIMDSIZE ) {
1207 abegin.store( abegin.load() + op.load( xbegin.load(), y1 ) );
1208 }
1209 for( ; remainder && i<M; ++i, ++abegin, ++xbegin ) {
1210 *abegin += op( *xbegin, *ybegin );
1211 }
1212
1213 ++ybegin;
1214 }
1215 }
1217 //**********************************************************************************************
1218
1219 //**Addition assignment to sparse matrices******************************************************
1220 // No special implementation for the addition assignment to sparse matrices.
1221 //**********************************************************************************************
1222
1223 //**Subtraction assignment to row-major dense matrices******************************************
1238 template< typename MT > // Type of the target dense matrix
1239 friend inline auto subAssign( DenseMatrix<MT,false>& lhs, const DVecDVecOuterExpr& rhs )
1240 {
1242
1243 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
1244 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
1245
1246 LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1247 RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
1248
1249 BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1250 BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1251 BLAZE_INTERNAL_ASSERT( x.size() == (*lhs).rows() , "Invalid vector size" );
1252 BLAZE_INTERNAL_ASSERT( y.size() == (*lhs).columns(), "Invalid vector size" );
1253
1254 DVecDVecOuterExpr::selectSubAssignKernel( *lhs, x, y, rhs.op_ );
1255 }
1257 //**********************************************************************************************
1258
1259 //**Default subtraction assignment to row-major dense matrices**********************************
1274 template< typename MT // Type of the left-hand side target matrix
1275 , typename VT3 // Type of the left-hand side vector operand
1276 , typename VT4 > // Type of the right-hand side vector operand
1277 static inline auto selectSubAssignKernel( MT& A, const VT3& x, const VT4& y, OP op )
1278 -> EnableIf_t< IsRowMajorMatrix_v<MT> && UseDefaultKernel_v<MT,VT3,VT4> >
1279 {
1280 const size_t M( A.rows() );
1281 const size_t N( A.columns() );
1282
1283 const size_t jpos( prevMultiple( N, 2UL ) );
1284 BLAZE_INTERNAL_ASSERT( jpos <= N, "Invalid end calculation" );
1285
1286 for( size_t i=0UL; i<M; ++i ) {
1287 for( size_t j=0UL; j<jpos; j+=2UL ) {
1288 A(i,j ) -= op( x[i], y[j ] );
1289 A(i,j+1UL) -= op( x[i], y[j+1UL] );
1290 }
1291 if( jpos < N ) {
1292 A(i,jpos) -= op( x[i], y[jpos] );
1293 }
1294 }
1295 }
1297 //**********************************************************************************************
1298
1299 //**Vectorized subtraction assignment to row-major dense matrices*******************************
1314 template< typename MT // Type of the left-hand side target matrix
1315 , typename VT3 // Type of the left-hand side vector operand
1316 , typename VT4 > // Type of the right-hand side vector operand
1317 static inline auto selectSubAssignKernel( MT& A, const VT3& x, const VT4& y, OP op )
1318 -> EnableIf_t< IsRowMajorMatrix_v<MT> && UseVectorizedKernel_v<MT,VT3,VT4> >
1319 {
1320 constexpr bool remainder( !IsSame_v<OP,Mult> || !IsPadded_v<MT> || !IsPadded_v<VT4> );
1321
1322 const size_t M( A.rows() );
1323 const size_t N( A.columns() );
1324
1325 const size_t jpos( remainder ? prevMultiple( N, SIMDSIZE ) : N );
1326 BLAZE_INTERNAL_ASSERT( jpos <= N, "Invalid end calculation" );
1327
1328 auto xbegin( x.begin() );
1329
1330 for( size_t i=0UL; i<M; ++i )
1331 {
1332 const auto x1( set( *xbegin ) );
1333
1334 size_t j( 0UL );
1335 auto abegin( A.begin(i) );
1336 auto ybegin( y.begin() );
1337
1338 for( ; j<jpos; j+=SIMDSIZE, abegin+=SIMDSIZE, ybegin+=SIMDSIZE ) {
1339 abegin.store( abegin.load() - op.load( x1, ybegin.load() ) );
1340 }
1341 for( ; remainder && j<N; ++j, ++abegin, ++ybegin ) {
1342 *abegin -= op( *xbegin, *ybegin );
1343 }
1344
1345 ++xbegin;
1346 }
1347 }
1349 //**********************************************************************************************
1350
1351 //**Subtraction assignment to column-major dense matrices***************************************
1364 template< typename MT > // Type of the target dense matrix
1365 friend inline void subAssign( DenseMatrix<MT,true>& lhs, const DVecDVecOuterExpr& rhs )
1366 {
1368
1370
1371 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
1372 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
1373
1374 LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1375 RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
1376
1377 BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1378 BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1379 BLAZE_INTERNAL_ASSERT( x.size() == (*lhs).rows() , "Invalid vector size" );
1380 BLAZE_INTERNAL_ASSERT( y.size() == (*lhs).columns(), "Invalid vector size" );
1381
1382 DVecDVecOuterExpr::selectSubAssignKernel( *lhs, x, y, rhs.op_ );
1383 }
1385 //**********************************************************************************************
1386
1387 //**Default subtraction assignment to column dense matrices*************************************
1402 template< typename MT // Type of the left-hand side target matrix
1403 , typename VT3 // Type of the left-hand side vector operand
1404 , typename VT4 > // Type of the right-hand side vector operand
1405 static inline auto selectSubAssignKernel( MT& A, const VT3& x, const VT4& y, OP op )
1406 -> EnableIf_t< IsColumnMajorMatrix_v<MT> && UseDefaultKernel_v<MT,VT3,VT4> >
1407 {
1408 const size_t M( A.rows() );
1409 const size_t N( A.columns() );
1410
1411 const size_t ipos( prevMultiple( M, 2UL ) );
1412 BLAZE_INTERNAL_ASSERT( ipos <= M, "Invalid end calculation" );
1413
1414 for( size_t j=0UL; j<N; ++j ) {
1415 for( size_t i=0UL; i<ipos; i+=2UL ) {
1416 A(i ,j) -= op( x[i ], y[j] );
1417 A(i+1UL,j) -= op( x[i+1UL], y[j] );
1418 }
1419 if( ipos < M ) {
1420 A(ipos,j) -= op( x[ipos], y[j] );
1421 }
1422 }
1423 }
1425 //**********************************************************************************************
1426
1427 //**Vectorized subtraction assignment to column-major dense matrices****************************
1442 template< typename MT // Type of the left-hand side target matrix
1443 , typename VT3 // Type of the left-hand side vector operand
1444 , typename VT4 > // Type of the right-hand side vector operand
1445 static inline auto selectSubAssignKernel( MT& A, const VT3& x, const VT4& y, OP op )
1446 -> EnableIf_t< IsColumnMajorMatrix_v<MT> && UseVectorizedKernel_v<MT,VT3,VT4> >
1447 {
1448 constexpr bool remainder( !IsSame_v<OP,Mult> || !IsPadded_v<MT> || !IsPadded_v<VT3> );
1449
1450 const size_t M( A.rows() );
1451 const size_t N( A.columns() );
1452
1453 const size_t ipos( remainder ? prevMultiple( M, SIMDSIZE ) : M );
1454 BLAZE_INTERNAL_ASSERT( ipos <= M, "Invalid end calculation" );
1455
1456 auto ybegin( y.begin() );
1457
1458 for( size_t j=0UL; j<N; ++j )
1459 {
1460 const auto y1( set( *ybegin ) );
1461
1462 size_t i( 0UL );
1463 auto abegin( A.begin(j) );
1464 auto xbegin( x.begin() );
1465
1466 for( ; i<ipos; i+=SIMDSIZE, abegin+=SIMDSIZE, xbegin+=SIMDSIZE ) {
1467 abegin.store( abegin.load() - op.load( xbegin.load(), y1 ) );
1468 }
1469 for( ; remainder && i<M; ++i, ++abegin, ++xbegin ) {
1470 *abegin -= op( *xbegin, *ybegin );
1471 }
1472
1473 ++ybegin;
1474 }
1475 }
1477 //**********************************************************************************************
1478
1479 //**Subtraction assignment to sparse matrices***************************************************
1480 // No special implementation for the subtraction assignment to sparse matrices.
1481 //**********************************************************************************************
1482
1483 //**Schur product assignment to row-major dense matrices****************************************
1498 template< typename MT > // Type of the target dense matrix
1499 friend inline auto schurAssign( DenseMatrix<MT,false>& lhs, const DVecDVecOuterExpr& rhs )
1500 {
1502
1503 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
1504 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
1505
1506 LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1507 RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
1508
1509 BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1510 BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1511 BLAZE_INTERNAL_ASSERT( x.size() == (*lhs).rows() , "Invalid vector size" );
1512 BLAZE_INTERNAL_ASSERT( y.size() == (*lhs).columns(), "Invalid vector size" );
1513
1514 DVecDVecOuterExpr::selectSchurAssignKernel( *lhs, x, y, rhs.op_ );
1515 }
1517 //**********************************************************************************************
1518
1519 //**Default Schur product assignment to row-major dense matrices********************************
1534 template< typename MT // Type of the left-hand side target matrix
1535 , typename VT3 // Type of the left-hand side vector operand
1536 , typename VT4 > // Type of the right-hand side vector operand
1537 static inline auto selectSchurAssignKernel( MT& A, const VT3& x, const VT4& y, OP op )
1538 -> EnableIf_t< IsRowMajorMatrix_v<MT> && UseDefaultKernel_v<MT,VT3,VT4> >
1539 {
1540 const size_t M( A.rows() );
1541 const size_t N( A.columns() );
1542
1543 const size_t jpos( prevMultiple( N, 2UL ) );
1544 BLAZE_INTERNAL_ASSERT( jpos <= N, "Invalid end calculation" );
1545
1546 for( size_t i=0UL; i<M; ++i ) {
1547 for( size_t j=0UL; j<jpos; j+=2UL ) {
1548 A(i,j ) *= op( x[i], y[j ] );
1549 A(i,j+1UL) *= op( x[i], y[j+1UL] );
1550 }
1551 if( jpos < N ) {
1552 A(i,jpos) *= op( x[i], y[jpos] );
1553 }
1554 }
1555 }
1557 //**********************************************************************************************
1558
1559 //**Vectorized Schur product assignment to row-major dense matrices*****************************
1574 template< typename MT // Type of the left-hand side target matrix
1575 , typename VT3 // Type of the left-hand side vector operand
1576 , typename VT4 > // Type of the right-hand side vector operand
1577 static inline auto selectSchurAssignKernel( MT& A, const VT3& x, const VT4& y, OP op )
1578 -> EnableIf_t< IsRowMajorMatrix_v<MT> && UseVectorizedKernel_v<MT,VT3,VT4> >
1579 {
1580 constexpr bool remainder( !IsSame_v<OP,Mult> || !IsPadded_v<MT> || !IsPadded_v<VT4> );
1581
1582 const size_t M( A.rows() );
1583 const size_t N( A.columns() );
1584
1585 const size_t jpos( remainder ? prevMultiple( N, SIMDSIZE ) : N );
1586 BLAZE_INTERNAL_ASSERT( jpos <= N, "Invalid end calculation" );
1587
1588 auto xbegin( x.begin() );
1589
1590 for( size_t i=0UL; i<M; ++i )
1591 {
1592 const auto x1( set( *xbegin ) );
1593
1594 size_t j( 0UL );
1595 auto abegin( A.begin(i) );
1596 auto ybegin( y.begin() );
1597
1598 for( ; j<jpos; j+=SIMDSIZE, abegin+=SIMDSIZE, ybegin+=SIMDSIZE ) {
1599 abegin.store( abegin.load() * op.load( x1, ybegin.load() ) );
1600 }
1601 for( ; remainder && j<N; ++j, ++abegin, ++ybegin ) {
1602 *abegin *= op( *xbegin, *ybegin );
1603 }
1604
1605 ++xbegin;
1606 }
1607 }
1609 //**********************************************************************************************
1610
1611 //**Schur product assignment to column-major dense matrices*************************************
1624 template< typename MT > // Type of the target dense matrix
1625 friend inline void schurAssign( DenseMatrix<MT,true>& lhs, const DVecDVecOuterExpr& rhs )
1626 {
1628
1630
1631 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
1632 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
1633
1634 LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1635 RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
1636
1637 BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1638 BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1639 BLAZE_INTERNAL_ASSERT( x.size() == (*lhs).rows() , "Invalid vector size" );
1640 BLAZE_INTERNAL_ASSERT( y.size() == (*lhs).columns(), "Invalid vector size" );
1641
1642 DVecDVecOuterExpr::selectSchurAssignKernel( *lhs, x, y, rhs.op_ );
1643 }
1645 //**********************************************************************************************
1646
1647 //**Default Schur product assignment to column dense matrices***********************************
1662 template< typename MT // Type of the left-hand side target matrix
1663 , typename VT3 // Type of the left-hand side vector operand
1664 , typename VT4 > // Type of the right-hand side vector operand
1665 static inline auto selectSchurAssignKernel( MT& A, const VT3& x, const VT4& y, OP op )
1666 -> EnableIf_t< IsColumnMajorMatrix_v<MT> && UseDefaultKernel_v<MT,VT3,VT4> >
1667 {
1668 const size_t M( A.rows() );
1669 const size_t N( A.columns() );
1670
1671 const size_t ipos( prevMultiple( M, 2UL ) );
1672 BLAZE_INTERNAL_ASSERT( ipos <= M, "Invalid end calculation" );
1673
1674 for( size_t j=0UL; j<N; ++j ) {
1675 for( size_t i=0UL; i<ipos; i+=2UL ) {
1676 A(i ,j) *= op( x[i ], y[j] );
1677 A(i+1UL,j) *= op( x[i+1UL], y[j] );
1678 }
1679 if( ipos < M ) {
1680 A(ipos,j) *= op( x[ipos], y[j] );
1681 }
1682 }
1683 }
1685 //**********************************************************************************************
1686
1687 //**Vectorized Schur product assignment to column-major dense matrices**************************
1702 template< typename MT // Type of the left-hand side target matrix
1703 , typename VT3 // Type of the left-hand side vector operand
1704 , typename VT4 > // Type of the right-hand side vector operand
1705 static inline auto selectSchurAssignKernel( MT& A, const VT3& x, const VT4& y, OP op )
1706 -> EnableIf_t< IsColumnMajorMatrix_v<MT> && UseVectorizedKernel_v<MT,VT3,VT4> >
1707 {
1708 constexpr bool remainder( !IsSame_v<OP,Mult> || !IsPadded_v<MT> || !IsPadded_v<VT3> );
1709
1710 const size_t M( A.rows() );
1711 const size_t N( A.columns() );
1712
1713 const size_t ipos( remainder ? prevMultiple( M, SIMDSIZE ) : M );
1714 BLAZE_INTERNAL_ASSERT( ipos <= M, "Invalid end calculation" );
1715
1716 auto ybegin( y.begin() );
1717
1718 for( size_t j=0UL; j<N; ++j )
1719 {
1720 const auto y1( set( *ybegin ) );
1721
1722 size_t i( 0UL );
1723 auto abegin( A.begin(j) );
1724 auto xbegin( x.begin() );
1725
1726 for( ; i<ipos; i+=SIMDSIZE, abegin+=SIMDSIZE, xbegin+=SIMDSIZE ) {
1727 abegin.store( abegin.load() * op.load( xbegin.load(), y1 ) );
1728 }
1729 for( ; remainder && i<M; ++i, ++abegin, ++xbegin ) {
1730 *abegin *= op( *xbegin, *ybegin );
1731 }
1732
1733 ++ybegin;
1734 }
1735 }
1737 //**********************************************************************************************
1738
1739 //**Schur product assignment to sparse matrices*************************************************
1740 // No special implementation for the Schur product assignment to sparse matrices.
1741 //**********************************************************************************************
1742
1743 //**Multiplication assignment to dense matrices*************************************************
1744 // No special implementation for the multiplication assignment to dense matrices.
1745 //**********************************************************************************************
1746
1747 //**Multiplication assignment to sparse matrices************************************************
1748 // No special implementation for the multiplication assignment to sparse matrices.
1749 //**********************************************************************************************
1750
1751 //**SMP assignment to dense matrices************************************************************
1765 template< typename MT // Type of the target dense matrix
1766 , bool SO > // Storage order of the target dense matrix
1767 friend inline auto smpAssign( DenseMatrix<MT,SO>& lhs, const DVecDVecOuterExpr& rhs )
1768 -> EnableIf_t< UseSMPAssign_v<MT> >
1769 {
1771
1772 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
1773 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
1774
1775 LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
1776 RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
1777
1778 BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1779 BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1780 BLAZE_INTERNAL_ASSERT( x.size() == (*lhs).rows() , "Invalid vector size" );
1781 BLAZE_INTERNAL_ASSERT( y.size() == (*lhs).columns(), "Invalid vector size" );
1782
1783 smpAssign( *lhs, map( x, y, rhs.op_ ) );
1784 }
1786 //**********************************************************************************************
1787
1788 //**SMP assignment to sparse matrices***********************************************************
1802 template< typename MT // Type of the target sparse matrix
1803 , bool SO > // Storage order of the target sparse matrix
1804 friend inline auto smpAssign( SparseMatrix<MT,SO>& lhs, const DVecDVecOuterExpr& rhs )
1805 -> EnableIf_t< UseSMPAssign_v<MT> >
1806 {
1808
1809 using TmpType = If_t< SO, OppositeType, ResultType >;
1810
1817
1818 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
1819 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
1820
1821 const TmpType tmp( rhs );
1822 smpAssign( *lhs, tmp );
1823 }
1825 //**********************************************************************************************
1826
1827 //**SMP addition assignment to dense matrices***************************************************
1842 template< typename MT > // Type of the target dense matrix
1843 friend inline auto smpAddAssign( DenseMatrix<MT,false>& lhs, const DVecDVecOuterExpr& rhs )
1844 -> EnableIf_t< UseSMPAssign_v<MT> >
1845 {
1847
1848 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
1849 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
1850
1851 LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
1852 RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
1853
1854 BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1855 BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1856 BLAZE_INTERNAL_ASSERT( x.size() == (*lhs).rows() , "Invalid vector size" );
1857 BLAZE_INTERNAL_ASSERT( y.size() == (*lhs).columns(), "Invalid vector size" );
1858
1859 smpAddAssign( *lhs, map( x, y, rhs.op_ ) );
1860 }
1862 //**********************************************************************************************
1863
1864 //**SMP addition assignment to sparse matrices**************************************************
1865 // No special implementation for the SMP addition assignment to sparse matrices.
1866 //**********************************************************************************************
1867
1868 //**SMP subtraction assignment to dense matrices************************************************
1883 template< typename MT > // Type of the target dense matrix
1884 friend inline auto smpSubAssign( DenseMatrix<MT,false>& lhs, const DVecDVecOuterExpr& rhs )
1885 -> EnableIf_t< UseSMPAssign_v<MT> >
1886 {
1888
1889 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
1890 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
1891
1892 LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
1893 RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
1894
1895 BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1896 BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1897 BLAZE_INTERNAL_ASSERT( x.size() == (*lhs).rows() , "Invalid vector size" );
1898 BLAZE_INTERNAL_ASSERT( y.size() == (*lhs).columns(), "Invalid vector size" );
1899
1900 smpSubAssign( *lhs, map( x, y, rhs.op_ ) );
1901 }
1903 //**********************************************************************************************
1904
1905 //**SMP subtraction assignment to sparse matrices***********************************************
1906 // No special implementation for the SMP subtraction assignment to sparse matrices.
1907 //**********************************************************************************************
1908
1909 //**SMP Schur product assignment to dense matrices**********************************************
1924 template< typename MT > // Type of the target dense matrix
1925 friend inline auto smpSchurAssign( DenseMatrix<MT,false>& lhs, const DVecDVecOuterExpr& rhs )
1926 -> EnableIf_t< UseSMPAssign_v<MT> >
1927 {
1929
1930 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
1931 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
1932
1933 LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
1934 RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
1935
1936 BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1937 BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1938 BLAZE_INTERNAL_ASSERT( x.size() == (*lhs).rows() , "Invalid vector size" );
1939 BLAZE_INTERNAL_ASSERT( y.size() == (*lhs).columns(), "Invalid vector size" );
1940
1941 smpSchurAssign( *lhs, map( x, y, rhs.op_ ) );
1942 }
1944 //**********************************************************************************************
1945
1946 //**SMP Schur product assignment to sparse matrices*********************************************
1947 // No special implementation for the SMP Schur product assignment to sparse matrices.
1948 //**********************************************************************************************
1949
1950 //**SMP multiplication assignment to dense matrices*********************************************
1951 // No special implementation for the SMP multiplication assignment to dense matrices.
1952 //**********************************************************************************************
1953
1954 //**SMP multiplication assignment to sparse matrices********************************************
1955 // No special implementation for the SMP multiplication assignment to sparse matrices.
1956 //**********************************************************************************************
1957
1958 //**Compile time checks*************************************************************************
1965 //**********************************************************************************************
1966};
1967//*************************************************************************************************
1968
1969
1970
1971
1972//=================================================================================================
1973//
1974// GLOBAL FUNCTIONS
1975//
1976//=================================================================================================
1977
1978//*************************************************************************************************
2003template< typename VT1 // Type of the left-hand side dense vector
2004 , typename VT2 // Type of the right-hand side dense vector
2005 , typename OP > // Type of the custom operation
2006inline decltype(auto)
2007 map( const DenseVector<VT1,false>& lhs, const DenseVector<VT2,true>& rhs, OP op )
2008{
2010
2011 using ReturnType = const DVecDVecOuterExpr<VT1,VT2,OP>;
2012 return ReturnType( *lhs, *rhs, std::move(op) );
2013}
2014//*************************************************************************************************
2015
2016
2017
2018
2019//=================================================================================================
2020//
2021// GLOBAL BINARY ARITHMETIC OPERATORS
2022//
2023//=================================================================================================
2024
2025//*************************************************************************************************
2045template< typename VT1 // Type of the left-hand side dense vector
2046 , typename VT2 > // Type of the right-hand side dense vector
2047inline decltype(auto)
2048 operator+( const DenseVector<VT1,false>& lhs, const DenseVector<VT2,true>& rhs )
2049{
2051
2052 return map( *lhs, *rhs, Add() );
2053}
2054//*************************************************************************************************
2055
2056
2057//*************************************************************************************************
2078template< typename VT1 // Type of the left-hand side dense vector
2079 , typename VT2 > // Type of the right-hand side dense vector
2080inline decltype(auto)
2081 operator-( const DenseVector<VT1,false>& lhs, const DenseVector<VT2,true>& rhs )
2082{
2084
2085 return map( *lhs, *rhs, Sub() );
2086}
2087//*************************************************************************************************
2088
2089
2090//*************************************************************************************************
2115template< typename VT1 // Type of the left-hand side dense vector
2116 , typename VT2 > // Type of the right-hand side dense vector
2117inline decltype(auto)
2118 operator*( const DenseVector<VT1,false>& lhs, const DenseVector<VT2,true>& rhs )
2119{
2121
2122 return map( *lhs, *rhs, Mult() );
2123}
2124//*************************************************************************************************
2125
2126
2127//*************************************************************************************************
2152template< typename VT1 // Type of the left-hand side dense vector
2153 , typename VT2 > // Type of the right-hand side dense vector
2154inline decltype(auto)
2155 operator/( const DenseVector<VT1,false>& lhs, const DenseVector<VT2,true>& rhs )
2156{
2158
2159 return map( *lhs, *rhs, Div() );
2160}
2161//*************************************************************************************************
2162
2163
2164
2165
2166//=================================================================================================
2167//
2168// SIZE SPECIALIZATIONS
2169//
2170//=================================================================================================
2171
2172//*************************************************************************************************
2174template< typename VT1, typename VT2, typename OP >
2175struct Size< DVecDVecOuterExpr<VT1,VT2,OP>, 0UL >
2176 : public Size<VT1,0UL>
2177{};
2178
2179template< typename VT1, typename VT2, typename OP >
2180struct Size< DVecDVecOuterExpr<VT1,VT2,OP>, 1UL >
2181 : public Size<VT2,0UL>
2182{};
2184//*************************************************************************************************
2185
2186
2187
2188
2189//=================================================================================================
2190//
2191// ISALIGNED SPECIALIZATIONS
2192//
2193//=================================================================================================
2194
2195//*************************************************************************************************
2197template< typename VT1, typename VT2, typename OP >
2198struct IsAligned< DVecDVecOuterExpr<VT1,VT2,OP> >
2199 : public BoolConstant< IsAligned_v<VT1> && IsAligned_v<VT2> >
2200{};
2202//*************************************************************************************************
2203
2204
2205
2206
2207//=================================================================================================
2208//
2209// ISPADDED SPECIALIZATIONS
2210//
2211//=================================================================================================
2212
2213//*************************************************************************************************
2215template< typename VT1, typename VT2 >
2216struct IsPadded< DVecDVecOuterExpr<VT1,VT2,Mult> >
2217 : public IsPadded<VT2>
2218{};
2220//*************************************************************************************************
2221
2222} // namespace blaze
2223
2224#endif
Header file for auxiliary alias declarations.
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.
Definition: Aliases.h:110
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.
Definition: Aliases.h:470
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition: Aliases.h:450
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition: Aliases.h:190
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.
Definition: Aliases.h:310
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.
Definition: Aliases.h:130
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.
Definition: Aliases.h:550
Header file for run time assertion macros.
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.
Macro for CUDA compatibility.
Header file for the If class template.
Header file for the IntegralConstant class template.
Header file for the IsAligned type trait.
Header file for the IsColumnMajorMatrix type trait.
Header file for the IsComputation type trait class.
Header file for the IsExpression type trait class.
Header file for the IsPadded type trait.
Header file for the IsRowMajorMatrix type trait.
Header file for the IsSIMDCombinable type trait.
Header file for the IsSame and IsStrictlySame type traits.
Deactivation of problematic macros.
Header file for the map trait.
Header file for the prevMultiple shim.
Constraints on the storage order of matrix types.
Constraint on the transpose flag of vector types.
Header file for all SIMD functionality.
Constraint on the data type.
Iterator over the elements of the dense vector outer map expression.
Definition: DVecDVecOuterExpr.h:223
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecOuterExpr.h:352
IteratorCategory iterator_category
The iterator category.
Definition: DVecDVecOuterExpr.h:233
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecOuterExpr.h:385
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecOuterExpr.h:234
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecDVecOuterExpr.h:230
BLAZE_DEVICE_CALLABLE const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecDVecOuterExpr.h:300
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecOuterExpr.h:227
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecOuterExpr.h:363
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecOuterExpr.h:407
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecOuterExpr.h:374
BLAZE_DEVICE_CALLABLE ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecOuterExpr.h:289
ConstIterator(LeftIteratorType left, RightIteratorType right, OP op)
Constructor for the ConstIterator class.
Definition: DVecDVecOuterExpr.h:253
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecOuterExpr.h:226
BLAZE_DEVICE_CALLABLE const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecOuterExpr.h:321
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecOuterExpr.h:396
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecOuterExpr.h:430
OP op_
The custom binary operation.
Definition: DVecDVecOuterExpr.h:463
DifferenceType difference_type
Difference between two iterators.
Definition: DVecDVecOuterExpr.h:237
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecDVecOuterExpr.h:454
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecDVecOuterExpr.h:462
PointerType pointer
Pointer return type.
Definition: DVecDVecOuterExpr.h:235
BLAZE_DEVICE_CALLABLE ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecOuterExpr.h:310
ConstIterator_t< VT2 > RightIteratorType
ConstIterator type of the right-hand side dense vector expression.
Definition: DVecDVecOuterExpr.h:243
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecDVecOuterExpr.h:442
ElementType * PointerType
Pointer return type.
Definition: DVecDVecOuterExpr.h:228
ElementType & ReferenceType
Reference return type.
Definition: DVecDVecOuterExpr.h:229
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecDVecOuterExpr.h:341
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecDVecOuterExpr.h:461
BLAZE_DEVICE_CALLABLE ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecDVecOuterExpr.h:278
ReferenceType reference
Reference return type.
Definition: DVecDVecOuterExpr.h:236
BLAZE_DEVICE_CALLABLE ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecDVecOuterExpr.h:266
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecDVecOuterExpr.h:418
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecDVecOuterExpr.h:331
ConstIterator_t< VT1 > LeftIteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecDVecOuterExpr.h:240
Expression object for the dense vector-dense vector outer map() function.
Definition: DVecDVecOuterExpr.h:114
If_t< RequiresEvaluation_v< VT1 >, const RT1, CT1 > LT
Type for the assignment of the left-hand side dense vector operand.
Definition: DVecDVecOuterExpr.h:213
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DVecDVecOuterExpr.h:575
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecOuterExpr.h:627
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecDVecOuterExpr.h:639
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DVecDVecOuterExpr.h:564
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DVecDVecOuterExpr.h:538
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DVecDVecOuterExpr.h:520
static constexpr bool evaluateRight
Compilation switch for the composite type of the right-hand side dense vector expression.
Definition: DVecDVecOuterExpr.h:134
OP Operation
Data type of the custom binary operation.
Definition: DVecDVecOuterExpr.h:210
If_t< IsExpression_v< VT1 >, const VT1, const VT1 & > LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecOuterExpr.h:204
ResultType_t< VT2 > RT2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecOuterExpr.h:118
RightOperand rhs_
Right-hand side dense vector of the map expression.
Definition: DVecDVecOuterExpr.h:667
ElementType_t< VT1 > ET1
Element type of the left-hand side dense vector expression.
Definition: DVecDVecOuterExpr.h:119
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the map expression.
Definition: DVecDVecOuterExpr.h:144
Operation op_
The custom binary operation.
Definition: DVecDVecOuterExpr.h:668
If_t< IsExpression_v< VT2 >, const VT2, const VT2 & > RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecOuterExpr.h:207
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecOuterExpr.h:659
ReturnType_t< VT1 > RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecOuterExpr.h:121
ElementType_t< VT2 > ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecOuterExpr.h:120
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DVecDVecOuterExpr.h:480
Operation operation() const
Returns a copy of the custom operation.
Definition: DVecDVecOuterExpr.h:615
ReturnType_t< VT2 > RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecOuterExpr.h:122
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DVecDVecOuterExpr.h:504
MapTrait_t< RT1, RT2, OP > ResultType
Result type for expression template evaluations.
Definition: DVecDVecOuterExpr.h:192
DVecDVecOuterExpr(const VT1 &lhs, const VT2 &rhs, OP op) noexcept
Constructor for the DVecDVecOuterExpr class.
Definition: DVecDVecOuterExpr.h:490
CompositeType_t< VT1 > CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecOuterExpr.h:123
If_t< useAssign, const ResultType, const DVecDVecOuterExpr & > CompositeType
Data type for composite expression templates.
Definition: DVecDVecOuterExpr.h:201
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DVecDVecOuterExpr.h:585
RightOperand rightOperand() const noexcept
Returns the right-hand side dense vector operand.
Definition: DVecDVecOuterExpr.h:605
ResultType_t< VT1 > RT1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecOuterExpr.h:117
decltype(std::declval< OP >()(std::declval< RN1 >(), std::declval< RN2 >())) ReturnType
Return type for expression template evaluations.
Definition: DVecDVecOuterExpr.h:198
If_t< RequiresEvaluation_v< VT2 >, const RT2, CT2 > RT
Type for the assignment of the right-hand side dense vector operand.
Definition: DVecDVecOuterExpr.h:216
LeftOperand lhs_
Left-hand side dense vector of the map expression.
Definition: DVecDVecOuterExpr.h:666
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DVecDVecOuterExpr.h:552
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: DVecDVecOuterExpr.h:195
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecOuterExpr.h:194
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecDVecOuterExpr.h:649
static constexpr bool evaluateLeft
Compilation switch for the composite type of the left-hand side dense vector expression.
Definition: DVecDVecOuterExpr.h:129
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DVecDVecOuterExpr.h:470
CompositeType_t< VT2 > CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecOuterExpr.h:124
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DVecDVecOuterExpr.h:193
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecDVecOuterExpr.h:595
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DVecDVecOuterExpr.h:475
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
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 VecTVecMapExpr base class.
Header file for the Add functor.
Header file for the Div functor.
Header file for the Mult functor.
Header file for the Sub functor.
decltype(auto) map(const DenseVector< VT1, false > &lhs, const DenseVector< VT2, true > &rhs, OP op)
Pairwise (outer) evaluation of the given binary operation on the elements of the dense vectors lhs an...
Definition: DVecDVecOuterExpr.h:2007
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:812
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: RowMajorMatrix.h:61
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.
Definition: StorageOrder.h:84
#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_COLUMN_VECTOR_TYPE(T)
Constraint on the data type.
Definition: ColumnVector.h:61
#define BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE(T)
Constraint on the data type.
Definition: RowVector.h:61
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: ColumnMajorMatrix.h:61
typename MapTrait< Args... >::Type MapTrait_t
Auxiliary alias declaration for the MapTrait class template.
Definition: MapTrait.h:131
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
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:75
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 smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:194
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_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#define BLAZE_DEVICE_CALLABLE
Conditional macro that sets host and device attributes when compiled with CUDA.
Definition: HostDevice.h:94
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition: If.h:108
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition: IntegralConstant.h:110
#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
Header file for the exception macros of the math module.
Constraints on the storage order of matrix types.
Header file for all forward declarations for expression class templates.
Header file for the Size type trait.
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
Generic wrapper for the division operator.
Definition: Div.h:81
Generic wrapper for the multiplication operator.
Definition: Mult.h:82
Generic wrapper for the subtraction operator.
Definition: Sub.h:85
Base class for all outer map expression templates.
Definition: VecTVecMapExpr.h:68
System settings for the inline keywords.
System settings for performance optimizations.
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.