Blaze 3.9
TSMatSMatMultExpr.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_EXPRESSIONS_TSMATSMATMULTEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_TSMATSMATMULTEXPR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <blaze/math/Aliases.h>
78#include <blaze/util/Assert.h>
79#include <blaze/util/EnableIf.h>
83#include <blaze/util/mpl/If.h>
84#include <blaze/util/Types.h>
85
86
87namespace blaze {
88
89//=================================================================================================
90//
91// CLASS TSMATSMATMULTEXPR
92//
93//=================================================================================================
94
95//*************************************************************************************************
102template< typename MT1 // Type of the left-hand side sparse matrix
103 , typename MT2 > // Type of the right-hand side sparse matrix
105 : public MatMatMultExpr< SparseMatrix< TSMatSMatMultExpr<MT1,MT2>, !IsIdentity_v<MT1> > >
106 , private Computation
107{
108 private:
109 //**Type definitions****************************************************************************
114 //**********************************************************************************************
115
116 //**********************************************************************************************
118 static constexpr bool evaluateLeft = RequiresEvaluation_v<MT1>;
119 //**********************************************************************************************
120
121 //**********************************************************************************************
123 static constexpr bool evaluateRight = RequiresEvaluation_v<MT2>;
124 //**********************************************************************************************
125
126 //**********************************************************************************************
128
134 template< typename T1, typename T2, typename T3 >
135 static constexpr bool CanExploitSymmetry_v =
136 ( ( IsRowMajorMatrix_v<T1> && IsSymmetric_v<T2> ) ||
137 ( IsColumnMajorMatrix_v<T1> && IsSymmetric_v<T3> ) );
139 //**********************************************************************************************
140
141 //**********************************************************************************************
143
147 template< typename T1, typename T2, typename T3 >
148 static constexpr bool IsEvaluationRequired_v =
149 ( ( evaluateLeft || evaluateRight ) && !CanExploitSymmetry_v<T1,T2,T2> );
151 //**********************************************************************************************
152
153 public:
154 //**Type definitions****************************************************************************
157
160
165 using ReturnType = const ElementType;
166 using CompositeType = const ResultType;
167
169 using LeftOperand = If_t< IsExpression_v<MT1>, const MT1, const MT1& >;
170
172 using RightOperand = If_t< IsExpression_v<MT2>, const MT2, const MT2& >;
173 //**********************************************************************************************
174
175 //**Compilation flags***************************************************************************
177 static constexpr bool smpAssignable =
178 ( !evaluateLeft && MT1::smpAssignable && !evaluateRight && MT2::smpAssignable );
179 //**********************************************************************************************
180
181 //**Constructor*********************************************************************************
187 inline TSMatSMatMultExpr( const MT1& lhs, const MT2& rhs ) noexcept
188 : lhs_( lhs ) // Left-hand side sparse matrix of the multiplication expression
189 , rhs_( rhs ) // Right-hand side sparse matrix of the multiplication expression
190 {
191 BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.rows(), "Invalid matrix sizes" );
192 }
193 //**********************************************************************************************
194
195 //**Access operator*****************************************************************************
202 inline ReturnType operator()( size_t i, size_t j ) const {
203 BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
204 BLAZE_INTERNAL_ASSERT( j < rhs_.columns(), "Invalid column access index" );
205
206 if( IsDiagonal_v<MT1> ) {
207 return lhs_(i,i) * rhs_(i,j);
208 }
209 else if( IsDiagonal_v<MT2> ) {
210 return lhs_(i,j) * rhs_(j,j);
211 }
212 else if( IsTriangular_v<MT1> || IsTriangular_v<MT2> ) {
213 const size_t begin( ( IsUpper_v<MT1> )
214 ?( ( IsLower_v<MT2> )
215 ?( max( ( IsStrictlyUpper_v<MT1> ? i+1UL : i )
216 , ( IsStrictlyLower_v<MT2> ? j+1UL : j ) ) )
217 :( IsStrictlyUpper_v<MT1> ? i+1UL : i ) )
218 :( ( IsLower_v<MT2> )
219 ?( IsStrictlyLower_v<MT2> ? j+1UL : j )
220 :( 0UL ) ) );
221 const size_t end( ( IsLower_v<MT1> )
222 ?( ( IsUpper_v<MT2> )
223 ?( min( ( IsStrictlyLower_v<MT1> ? i : i+1UL )
224 , ( IsStrictlyUpper_v<MT2> ? j : j+1UL ) ) )
225 :( IsStrictlyLower_v<MT1> ? i : i+1UL ) )
226 :( ( IsUpper_v<MT2> )
227 ?( IsStrictlyUpper_v<MT2> ? j : j+1UL )
228 :( lhs_.columns() ) ) );
229
230 if( begin >= end ) return ElementType();
231
232 const size_t n( end - begin );
233
234 return subvector( row( lhs_, i, unchecked ), begin, n, unchecked ) *
236 }
237 else {
238 return row( lhs_, i, unchecked ) * column( rhs_, j, unchecked );
239 }
240 }
241 //**********************************************************************************************
242
243 //**At function*********************************************************************************
251 inline ReturnType at( size_t i, size_t j ) const {
252 if( i >= lhs_.rows() ) {
253 BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
254 }
255 if( j >= rhs_.columns() ) {
256 BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
257 }
258 return (*this)(i,j);
259 }
260 //**********************************************************************************************
261
262 //**Rows function*******************************************************************************
267 inline size_t rows() const noexcept {
268 return lhs_.rows();
269 }
270 //**********************************************************************************************
271
272 //**Columns function****************************************************************************
277 inline size_t columns() const noexcept {
278 return rhs_.columns();
279 }
280 //**********************************************************************************************
281
282 //**NonZeros function***************************************************************************
287 constexpr size_t nonZeros() const noexcept {
288 return 0UL;
289 }
290 //**********************************************************************************************
291
292 //**NonZeros function***************************************************************************
298 inline size_t nonZeros( size_t i ) const noexcept {
299 MAYBE_UNUSED( i );
300 return 0UL;
301 }
302 //**********************************************************************************************
303
304 //**Left operand access*************************************************************************
309 inline LeftOperand leftOperand() const noexcept {
310 return lhs_;
311 }
312 //**********************************************************************************************
313
314 //**Right operand access************************************************************************
319 inline RightOperand rightOperand() const noexcept {
320 return rhs_;
321 }
322 //**********************************************************************************************
323
324 //**********************************************************************************************
330 template< typename T >
331 inline bool canAlias( const T* alias ) const noexcept {
332 return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
333 }
334 //**********************************************************************************************
335
336 //**********************************************************************************************
342 template< typename T >
343 inline bool isAliased( const T* alias ) const noexcept {
344 return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
345 }
346 //**********************************************************************************************
347
348 //**********************************************************************************************
353 inline bool canSMPAssign() const noexcept {
354 return ( rows() * columns() >= SMP_TSMATSMATMULT_THRESHOLD );
355 }
356 //**********************************************************************************************
357
358 private:
359 //**Member variables****************************************************************************
362 //**********************************************************************************************
363
364 //**Assignment to dense matrices****************************************************************
377 template< typename MT // Type of the target dense matrix
378 , bool SO > // Storage order of the target dense matrix
379 friend inline auto assign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
381 {
383
384 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
385 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
386
387 CT1 A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse matrix operand
388 CT2 B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
389
390 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
391 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
392 BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
393 BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
394 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).rows() , "Invalid number of rows" );
395 BLAZE_INTERNAL_ASSERT( B.columns() == (*lhs).columns() , "Invalid number of columns" );
396
397 TSMatSMatMultExpr::selectAssignKernel( *lhs, A, B );
398 }
400 //**********************************************************************************************
401
402 //**Default assignment to dense matrices********************************************************
416 template< typename MT3 // Type of the left-hand side target matrix
417 , typename MT4 // Type of the left-hand side matrix operand
418 , typename MT5 > // Type of the right-hand side matrix operand
419 static inline void selectAssignKernel( MT3& C, const MT4& A, const MT5& B )
420 {
421 for( size_t j=0UL; j<A.columns(); ++j ) {
422 const auto lend( A.end(j) );
423 for( auto lelem=A.begin(j); lelem!=lend; ++lelem ) {
424 const auto rend( B.end(j) );
425 for( auto relem=B.begin(j); relem!=rend; ++relem )
426 {
428 isDefault( C(lelem->index(),relem->index()) ) ) {
429 C(lelem->index(),relem->index()) = lelem->value() * relem->value();
430 }
431 else {
432 C(lelem->index(),relem->index()) += lelem->value() * relem->value();
433 }
434 }
435 }
436 }
437 }
439 //**********************************************************************************************
440
441 //**Assignment to row-major sparse matrices*****************************************************
454 template< typename MT > // Type of the target sparse matrix
455 friend inline auto assign( SparseMatrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
456 -> DisableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
457 {
459
461
462 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
463 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
464
466
467 const OppositeType_t<MT1> tmp( serial( rhs.lhs_ ) );
468 assign( *lhs, tmp * rhs.rhs_ );
469 }
471 //**********************************************************************************************
472
473 //**Assignment to column-major sparse matrices**************************************************
486 template< typename MT > // Type of the target sparse matrix
487 friend inline auto assign( SparseMatrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
488 -> DisableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
489 {
491
492 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
493 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
494
496
497 const OppositeType_t<MT2> tmp( serial( rhs.rhs_ ) );
498 assign( *lhs, rhs.lhs_ * tmp );
499 }
501 //**********************************************************************************************
502
503 //**Restructuring assignment to row-major matrices**********************************************
518 template< typename MT > // Type of the target matrix
519 friend inline auto assign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
520 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
521 {
523
525
526 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
527 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
528
529 assign( *lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
530 }
532 //**********************************************************************************************
533
534 //**Restructuring assignment to column-major matrices*******************************************
549 template< typename MT > // Type of the target matrix
550 friend inline auto assign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
551 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
552 {
554
555 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
556 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
557
558 assign( *lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
559 }
561 //**********************************************************************************************
562
563 //**Addition assignment to dense matrices*******************************************************
576 template< typename MT // Type of the target dense matrix
577 , bool SO > // Storage order of the target dense matarix
578 friend inline auto addAssign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
579 -> DisableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
580 {
582
583 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
584 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
585
586 CT1 A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse matrix operand
587 CT2 B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
588
589 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
590 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
591 BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
592 BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
593 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).rows() , "Invalid number of rows" );
594 BLAZE_INTERNAL_ASSERT( B.columns() == (*lhs).columns() , "Invalid number of columns" );
595
596 TSMatSMatMultExpr::selectAddAssignKernel( *lhs, A, B );
597 }
599 //**********************************************************************************************
600
601 //**Default addition assignment to dense matrices***********************************************
615 template< typename MT3 // Type of the left-hand side target matrix
616 , typename MT4 // Type of the left-hand side matrix operand
617 , typename MT5 > // Type of the right-hand side matrix operand
618 static inline void selectAddAssignKernel( MT3& C, const MT4& A, const MT5& B )
619 {
620 for( size_t j=0UL; j<A.columns(); ++j ) {
621 const auto lend( A.end(j) );
622 for( auto lelem=A.begin(j); lelem!=lend; ++lelem ) {
623 const auto rend( B.end(j) );
624 for( auto relem=B.begin(j); relem!=rend; ++relem ) {
625 C(lelem->index(),relem->index()) += lelem->value() * relem->value();
626 }
627 }
628 }
629 }
631 //**********************************************************************************************
632
633 //**Restructuring addition assignment to row-major matrices*************************************
648 template< typename MT > // Type of the target matrix
649 friend inline auto addAssign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
650 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
651 {
653
655
656 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
657 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
658
659 addAssign( *lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
660 }
662 //**********************************************************************************************
663
664 //**Restructuring addition assignment to column-major matrices**********************************
679 template< typename MT > // Type of the target matrix
680 friend inline auto addAssign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
681 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
682 {
684
685 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
686 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
687
688 addAssign( *lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
689 }
691 //**********************************************************************************************
692
693 //**Addition assignment to sparse matrices******************************************************
694 // No special implementation for the addition assignment to sparse matrices.
695 //**********************************************************************************************
696
697 //**Subtraction assignment to dense matrices****************************************************
710 template< typename MT // Type of the target dense matrix
711 , bool SO > // Storage order of the target dense matrix
712 friend inline void subAssign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
713 {
715
716 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
717 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
718
719 CT1 A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse matrix operand
720 CT2 B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
721
722 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
723 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
724 BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
725 BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
726 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).rows() , "Invalid number of rows" );
727 BLAZE_INTERNAL_ASSERT( B.columns() == (*lhs).columns() , "Invalid number of columns" );
728
729 TSMatSMatMultExpr::selectSubAssignKernel( *lhs, A, B );
730 }
732 //**********************************************************************************************
733
734 //**Default subtraction assignment to dense matrices********************************************
748 template< typename MT3 // Type of the left-hand side target matrix
749 , typename MT4 // Type of the left-hand side matrix operand
750 , typename MT5 > // Type of the right-hand side matrix operand
751 static inline void selectSubAssignKernel( MT3& C, const MT4& A, const MT5& B )
752 {
753 for( size_t j=0UL; j<A.columns(); ++j ) {
754 const auto lend( A.end(j) );
755 for( auto lelem=A.begin(j); lelem!=lend; ++lelem ) {
756 const auto rend( B.end(j) );
757 for( auto relem=B.begin(j); relem!=rend; ++relem ) {
758 C(lelem->index(),relem->index()) -= lelem->value() * relem->value();
759 }
760 }
761 }
762 }
764 //**********************************************************************************************
765
766 //**Restructuring subtraction assignment to row-major matrices**********************************
781 template< typename MT > // Type of the target matrix
782 friend inline auto subAssign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
783 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
784 {
786
788
789 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
790 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
791
792 subAssign( *lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
793 }
795 //**********************************************************************************************
796
797 //**Restructuring subtraction assignment to column-major matrices*******************************
812 template< typename MT > // Type of the target matrix
813 friend inline auto subAssign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
814 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
815 {
817
818 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
819 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
820
821 subAssign( *lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
822 }
824 //**********************************************************************************************
825
826 //**Subtraction assignment to sparse matrices***************************************************
827 // No special implementation for the subtraction assignment to sparse matrices.
828 //**********************************************************************************************
829
830 //**Schur product assignment to dense matrices**************************************************
843 template< typename MT // Type of the target dense matrix
844 , bool SO > // Storage order of the target dense matrix
845 friend inline void schurAssign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
846 {
848
851
852 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
853 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
854
855 const ResultType tmp( serial( rhs ) );
856 schurAssign( *lhs, tmp );
857 }
859 //**********************************************************************************************
860
861 //**Schur product assignment to sparse matrices*************************************************
862 // No special implementation for the Schur product assignment to sparse matrices.
863 //**********************************************************************************************
864
865 //**Multiplication assignment to dense matrices*************************************************
866 // No special implementation for the multiplication assignment to dense matrices.
867 //**********************************************************************************************
868
869 //**Multiplication assignment to sparse matrices************************************************
870 // No special implementation for the multiplication assignment to sparse matrices.
871 //**********************************************************************************************
872
873 //**SMP assignment to matrices******************************************************************
889 template< typename MT // Type of the target matrix
890 , bool SO > // Storage order of the target matrix
891 friend inline auto smpAssign( Matrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
892 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
893 {
895
896 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
897 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
898
899 CT1 A( rhs.lhs_ ); // Evaluation of the left-hand side sparse matrix operand
900 CT2 B( rhs.rhs_ ); // Evaluation of the right-hand side sparse matrix operand
901
902 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
903 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
904 BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
905 BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
906 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).rows() , "Invalid number of rows" );
907 BLAZE_INTERNAL_ASSERT( B.columns() == (*lhs).columns() , "Invalid number of columns" );
908
909 smpAssign( *lhs, A * B );
910 }
912 //**********************************************************************************************
913
914 //**Restructuring SMP assignment to row-major matrices******************************************
929 template< typename MT > // Type of the target matrix
930 friend inline auto smpAssign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
931 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
932 {
934
936
937 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
938 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
939
940 smpAssign( *lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
941 }
943 //**********************************************************************************************
944
945 //**Restructuring SMP assignment to column-major matrices***************************************
960 template< typename MT > // Type of the target matrix
961 friend inline auto smpAssign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
962 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
963 {
965
966 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
967 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
968
969 smpAssign( *lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
970 }
972 //**********************************************************************************************
973
974 //**SMP addition assignment to dense matrices***************************************************
990 template< typename MT // Type of the target dense matrix
991 , bool SO > // Storage order of the target dense matarix
992 friend inline auto smpAddAssign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
993 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
994 {
996
997 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
998 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
999
1000 CT1 A( rhs.lhs_ ); // Evaluation of the left-hand side sparse matrix operand
1001 CT2 B( rhs.rhs_ ); // Evaluation of the right-hand side sparse matrix operand
1002
1003 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
1004 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
1005 BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1006 BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1007 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).rows() , "Invalid number of rows" );
1008 BLAZE_INTERNAL_ASSERT( B.columns() == (*lhs).columns() , "Invalid number of columns" );
1009
1010 smpAddAssign( *lhs, A * B );
1011 }
1013 //**********************************************************************************************
1014
1015 //**Restructuring SMP addition assignment to row-major matrices*********************************
1030 template< typename MT > // Type of the target matrix
1031 friend inline auto smpAddAssign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
1032 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
1033 {
1035
1037
1038 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
1039 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
1040
1041 smpAddAssign( *lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
1042 }
1044 //**********************************************************************************************
1045
1046 //**Restructuring SMP addition assignment to column-major matrices******************************
1061 template< typename MT > // Type of the target matrix
1062 friend inline auto smpAddAssign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
1063 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
1064 {
1066
1067 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
1068 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
1069
1070 smpAddAssign( *lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
1071 }
1073 //**********************************************************************************************
1074
1075 //**SMP addition assignment to sparse matrices**************************************************
1076 // No special implementation for the SMP addition assignment to sparse matrices.
1077 //**********************************************************************************************
1078
1079 //**SMP subtraction assignment to dense matrices************************************************
1095 template< typename MT // Type of the target dense matrix
1096 , bool SO > // Storage order of the target dense matrix
1097 friend inline auto smpSubAssign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
1098 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1099 {
1101
1102 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
1103 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
1104
1105 CT1 A( rhs.lhs_ ); // Evaluation of the left-hand side sparse matrix operand
1106 CT2 B( rhs.rhs_ ); // Evaluation of the right-hand side sparse matrix operand
1107
1108 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
1109 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
1110 BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1111 BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1112 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).rows() , "Invalid number of rows" );
1113 BLAZE_INTERNAL_ASSERT( B.columns() == (*lhs).columns() , "Invalid number of columns" );
1114
1115 smpSubAssign( *lhs, A * B );
1116 }
1118 //**********************************************************************************************
1119
1120 //**Restructuring SMP subtraction assignment to row-major matrices******************************
1135 template< typename MT > // Type of the target matrix
1136 friend inline auto smpSubAssign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
1137 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
1138 {
1140
1142
1143 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
1144 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
1145
1146 smpSubAssign( *lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
1147 }
1149 //**********************************************************************************************
1150
1151 //**Restructuring SMP subtraction assignment to column-major matrices***************************
1166 template< typename MT > // Type of the target matrix
1167 friend inline auto smpSubAssign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
1168 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
1169 {
1171
1172 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
1173 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
1174
1175 smpSubAssign( *lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
1176 }
1178 //**********************************************************************************************
1179
1180 //**SMP subtraction assignment to sparse matrices***********************************************
1181 // No special implementation for the SMP subtraction assignment to sparse matrices.
1182 //**********************************************************************************************
1183
1184 //**SMP Schur product assignment to dense matrices**********************************************
1197 template< typename MT // Type of the target dense matrix
1198 , bool SO > // Storage order of the target dense matrix
1199 friend inline void smpSchurAssign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
1200 {
1202
1205
1206 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
1207 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
1208
1209 const ResultType tmp( rhs );
1210 smpSchurAssign( *lhs, tmp );
1211 }
1213 //**********************************************************************************************
1214
1215 //**SMP Schur product assignment to sparse matrices*********************************************
1216 // No special implementation for the SMP Schur product assignment to sparse matrices.
1217 //**********************************************************************************************
1218
1219 //**SMP multiplication assignment to dense matrices*********************************************
1220 // No special implementation for the SMP multiplication assignment to dense matrices.
1221 //**********************************************************************************************
1222
1223 //**SMP multiplication assignment to sparse matrices********************************************
1224 // No special implementation for the SMP multiplication assignment to sparse matrices.
1225 //**********************************************************************************************
1226
1227 //**Compile time checks*************************************************************************
1237 //**********************************************************************************************
1238};
1239//*************************************************************************************************
1240
1241
1242
1243
1244//=================================================================================================
1245//
1246// GLOBAL BINARY ARITHMETIC OPERATORS
1247//
1248//=================================================================================================
1249
1250//*************************************************************************************************
1263template< typename MT1 // Type of the left-hand side sparse matrix
1264 , typename MT2 // Type of the right-hand side sparse matrix
1265 , DisableIf_t< ( ( IsIdentity_v<MT1> || IsIdentity_v<MT2> ) &&
1266 IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > ) ||
1267 ( IsIdentity_v<MT1> && IsIdentity_v<MT2> ) ||
1268 ( IsZero_v<MT1> || IsZero_v<MT2> ) >* = nullptr >
1269inline const TSMatSMatMultExpr<MT1,MT2>
1270 tsmatsmatmult( const SparseMatrix<MT1,true>& lhs, const SparseMatrix<MT2,false>& rhs )
1271{
1273
1274 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == (*rhs).rows(), "Invalid matrix sizes" );
1275
1276 return TSMatSMatMultExpr<MT1,MT2>( *lhs, *rhs );
1277}
1279//*************************************************************************************************
1280
1281
1282//*************************************************************************************************
1296template< typename MT1 // Type of the left-hand side sparse matrix
1297 , typename MT2 // Type of the right-hand side sparse matrix
1298 , EnableIf_t< !IsIdentity_v<MT1> && IsIdentity_v<MT2> &&
1299 IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > >* = nullptr >
1300inline const MT1&
1301 tsmatsmatmult( const SparseMatrix<MT1,true>& lhs, const SparseMatrix<MT2,false>& rhs )
1302{
1304
1305 MAYBE_UNUSED( rhs );
1306
1307 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == (*rhs).rows(), "Invalid matrix sizes" );
1308
1309 return (*lhs);
1310}
1312//*************************************************************************************************
1313
1314
1315//*************************************************************************************************
1329template< typename MT1 // Type of the left-hand side sparse matrix
1330 , typename MT2 // Type of the right-hand side sparse matrix
1331 , EnableIf_t< IsIdentity_v<MT1> && !IsIdentity_v<MT2> &&
1332 IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > >* = nullptr >
1333inline const MT2&
1334 tsmatsmatmult( const SparseMatrix<MT1,true>& lhs, const SparseMatrix<MT2,false>& rhs )
1335{
1337
1338 MAYBE_UNUSED( lhs );
1339
1340 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == (*rhs).rows(), "Invalid matrix sizes" );
1341
1342 return (*rhs);
1343}
1345//*************************************************************************************************
1346
1347
1348//*************************************************************************************************
1361template< typename MT1 // Type of the left-hand side sparse matrix
1362 , typename MT2 // Type of the right-hand side sparse matrix
1363 , EnableIf_t< IsIdentity_v<MT1> && IsIdentity_v<MT2> >* = nullptr >
1364inline decltype(auto)
1365 tsmatsmatmult( const SparseMatrix<MT1,true>& lhs, const SparseMatrix<MT2,false>& rhs )
1366{
1368
1369 MAYBE_UNUSED( rhs );
1370
1371 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == (*rhs).rows(), "Invalid matrix sizes" );
1372
1373 using ReturnType = const MultTrait_t< ResultType_t<MT1>, ResultType_t<MT2> >;
1374
1377
1378 return ReturnType( (*lhs).rows() );
1379}
1381//*************************************************************************************************
1382
1383
1384//*************************************************************************************************
1398template< typename MT1 // Type of the left-hand side sparse matrix
1399 , typename MT2 // Type of the right-hand side sparse matrix
1400 , EnableIf_t< IsZero_v<MT1> || IsZero_v<MT2> >* = nullptr >
1401inline decltype(auto)
1402 tsmatsmatmult( const SparseMatrix<MT1,true>& lhs, const SparseMatrix<MT2,false>& rhs )
1403{
1405
1406 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == (*rhs).rows(), "Invalid matrix sizes" );
1407
1408 using ReturnType = const MultTrait_t< ResultType_t<MT1>, ResultType_t<MT2> >;
1409
1410 BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER( ReturnType, IsZero_v<MT1> );
1412
1413 return ReturnType( (*lhs).rows(), (*rhs).columns() );
1414}
1416//*************************************************************************************************
1417
1418
1419//*************************************************************************************************
1449template< typename MT1 // Type of the left-hand side sparse matrix
1450 , typename MT2 > // Type of the right-hand side sparse matrix
1451inline decltype(auto)
1452 operator*( const SparseMatrix<MT1,true>& lhs, const SparseMatrix<MT2,false>& rhs )
1453{
1455
1456 if( (*lhs).columns() != (*rhs).rows() ) {
1457 BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
1458 }
1459
1460 return tsmatsmatmult( *lhs, *rhs );
1461}
1462//*************************************************************************************************
1463
1464} // namespace blaze
1465
1466#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::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::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.
Definition: Aliases.h:550
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.
Header file for the EnableIf class template.
Header file for the function trace functionality.
Constraint on the data type.
Header file for the If class template.
Header file for the IntegralConstant class template.
Header file for the IsColumnMajorMatrix type trait.
Header file for the isDefault shim.
Header file for the IsDiagonal type trait.
Header file for the IsExpression type trait class.
Header file for the IsIdentity type trait.
Header file for the IsLower type trait.
Header file for the IsResizable type trait.
Header file for the IsRowMajorMatrix type trait.
Header file for the IsStrictlyLower type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Header file for the IsTriangular type trait.
Header file for the IsUpper type trait.
Header file for the MAYBE_UNUSED function template.
Header file for the multiplication trait.
Constraints on the storage order of matrix types.
Constraint on the data type.
Constraint on the data type.
Base class for dense matrices.
Definition: DenseMatrix.h:82
Base class for sparse matrices.
Definition: SparseMatrix.h:77
Expression object for transpose sparse matrix-sparse matrix multiplications.
Definition: TSMatSMatMultExpr.h:107
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: TSMatSMatMultExpr.h:251
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TSMatSMatMultExpr.h:165
ResultType_t< MT1 > RT1
Result type of the left-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:110
size_t nonZeros(size_t i) const noexcept
Returns the number of non-zero elements in the specified row.
Definition: TSMatSMatMultExpr.h:298
ResultType_t< MT2 > RT2
Result type of the right-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:111
LeftOperand lhs_
Left-hand side sparse matrix of the multiplication expression.
Definition: TSMatSMatMultExpr.h:360
LeftOperand leftOperand() const noexcept
Returns the left-hand side transpose sparse matrix operand.
Definition: TSMatSMatMultExpr.h:309
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: TSMatSMatMultExpr.h:163
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse matrix operand.
Definition: TSMatSMatMultExpr.h:319
constexpr size_t nonZeros() const noexcept
Returns the number of non-zero elements in the sparse matrix.
Definition: TSMatSMatMultExpr.h:287
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: TSMatSMatMultExpr.h:164
CompositeType_t< MT1 > CT1
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:112
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: TSMatSMatMultExpr.h:202
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: TSMatSMatMultExpr.h:353
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: TSMatSMatMultExpr.h:331
TSMatSMatMultExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the TSMatSMatMultExpr class.
Definition: TSMatSMatMultExpr.h:187
static constexpr bool evaluateLeft
Compilation switch for the composite type of the left-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:118
If_t< IsExpression_v< MT2 >, const MT2, const MT2 & > RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:172
CompositeType_t< MT2 > CT2
Composite type of the right-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:113
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: TSMatSMatMultExpr.h:177
MultTrait_t< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: TSMatSMatMultExpr.h:161
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: TSMatSMatMultExpr.h:343
RightOperand rhs_
Right-hand side sparse matrix of the multiplication expression.
Definition: TSMatSMatMultExpr.h:361
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: TSMatSMatMultExpr.h:267
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: TSMatSMatMultExpr.h:277
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TSMatSMatMultExpr.h:162
If_t< IsExpression_v< MT1 >, const MT1, const MT1 & > LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:169
static constexpr bool evaluateRight
Compilation switch for the composite type of the right-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:123
const ResultType CompositeType
Data type for composite expression templates.
Definition: TSMatSMatMultExpr.h:166
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 MatMatMultExpr base class.
Header file for the SparseMatrix base class.
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) 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) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:812
bool isDefault(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the given diagonal matrix is in default state.
Definition: DiagonalMatrix.h:169
#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_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition: RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATMATMULTEXPR(T1, T2)
Constraint on the data type.
Definition: MatMatMultExpr.h:103
#define BLAZE_CONSTRAINT_MUST_NOT_BE_ZERO_TYPE(T)
Constraint on the data type.
Definition: Zero.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: SparseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_BE_IDENTITY_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Identity.h:60
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: ColumnMajorMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_BE_ZERO_TYPE(T)
Constraint on the data type.
Definition: Zero.h:61
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.
Definition: StorageOrder.h:63
typename MultTrait< T1, T2 >::Type MultTrait_t
Auxiliary alias declaration for the MultTrait class template.
Definition: MultTrait.h:165
constexpr bool IsResizable_v
Auxiliary variable template for the IsResizable type trait.
Definition: IsResizable.h:136
MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:584
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:518
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
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
decltype(auto) subvector(Vector< VT, TF > &, RSAs...)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:158
constexpr bool IsSame_v
Auxiliary variable template for the IsSame type trait.
Definition: IsSame.h:159
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition: If.h:108
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition: Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:175
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition: FunctionTrace.h:94
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 serial shim.
Base class for all compute expression templates.
Definition: Computation.h:68
Base class for all matrix/matrix multiplication expression templates.
Definition: MatMatMultExpr.h:71
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
Header file for the IsZero type trait.
Header file for the RequiresEvaluation type trait.
Header file for basic type definitions.
Header file for the generic max algorithm.
Header file for the generic min algorithm.