Blaze 3.9
DMatSMatSubExpr.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_EXPRESSIONS_DMATSMATSUBEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_DMATSMATSUBEXPR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <utility>
44#include <blaze/math/Aliases.h>
61#include <blaze/util/Assert.h>
62#include <blaze/util/EnableIf.h>
66#include <blaze/util/mpl/If.h>
67#include <blaze/util/Types.h>
69
70
71namespace blaze {
72
73//=================================================================================================
74//
75// CLASS DMATSMATSUBEXPR
76//
77//=================================================================================================
78
79//*************************************************************************************************
86template< typename MT1 // Type of the left-hand side dense matrix
87 , typename MT2 // Type of the right-hand side sparse matrix
88 , bool SO > // Storage order
90 : public MatMatSubExpr< DenseMatrix< DMatSMatSubExpr<MT1,MT2,SO>, SO > >
91 , private Computation
92{
93 private:
94 //**Type definitions****************************************************************************
99 //**********************************************************************************************
100
101 //**Return type evaluation**********************************************************************
103
108 static constexpr bool returnExpr = ( !IsTemporary_v<RN1> && !IsTemporary_v<RN2> );
109
111 using ExprReturnType = decltype( std::declval<RN1>() - std::declval<RN2>() );
112 //**********************************************************************************************
113
114 //**Parallel evaluation strategy****************************************************************
116
121 template< typename MT >
122 static constexpr bool UseSMPAssign_v = ( !MT1::smpAssignable || !MT2::smpAssignable );
124 //**********************************************************************************************
125
126 public:
127 //**Type definitions****************************************************************************
130
133
138
141
144
146 using LeftOperand = If_t< IsExpression_v<MT1>, const MT1, const MT1& >;
147
149 using RightOperand = If_t< IsExpression_v<MT2>, const MT2, const MT2& >;
150 //**********************************************************************************************
151
152 //**Compilation flags***************************************************************************
154 static constexpr bool simdEnabled = false;
155
157 static constexpr bool smpAssignable = false;
158 //**********************************************************************************************
159
160 //**Constructor*********************************************************************************
166 inline DMatSMatSubExpr( const MT1& lhs, const MT2& rhs ) noexcept
167 : lhs_( lhs ) // Left-hand side dense matrix of the subtraction expression
168 , rhs_( rhs ) // Right-hand side sparse matrix of the subtraction expression
169 {
170 BLAZE_INTERNAL_ASSERT( lhs.rows() == rhs.rows() , "Invalid number of rows" );
171 BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.columns(), "Invalid number of columns" );
172 }
173 //**********************************************************************************************
174
175 //**Access operator*****************************************************************************
182 inline ReturnType operator()( size_t i, size_t j ) const {
183 BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
184 BLAZE_INTERNAL_ASSERT( j < lhs_.columns(), "Invalid column access index" );
185 return lhs_(i,j) - rhs_(i,j);
186 }
187 //**********************************************************************************************
188
189 //**At function*********************************************************************************
197 inline ReturnType at( size_t i, size_t j ) const {
198 if( i >= lhs_.rows() ) {
199 BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
200 }
201 if( j >= lhs_.columns() ) {
202 BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
203 }
204 return (*this)(i,j);
205 }
206 //**********************************************************************************************
207
208 //**Rows function*******************************************************************************
213 inline size_t rows() const noexcept {
214 return lhs_.rows();
215 }
216 //**********************************************************************************************
217
218 //**Columns function****************************************************************************
223 inline size_t columns() const noexcept {
224 return lhs_.columns();
225 }
226 //**********************************************************************************************
227
228 //**Left operand access*************************************************************************
233 inline LeftOperand leftOperand() const noexcept {
234 return lhs_;
235 }
236 //**********************************************************************************************
237
238 //**Right operand access************************************************************************
243 inline RightOperand rightOperand() const noexcept {
244 return rhs_;
245 }
246 //**********************************************************************************************
247
248 //**********************************************************************************************
254 template< typename T >
255 inline bool canAlias( const T* alias ) const noexcept {
256 return ( IsExpression_v<MT1> && lhs_.canAlias( alias ) ) ||
257 ( rhs_.canAlias( alias ) );
258 }
259 //**********************************************************************************************
260
261 //**********************************************************************************************
267 template< typename T >
268 inline bool isAliased( const T* alias ) const noexcept {
269 return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
270 }
271 //**********************************************************************************************
272
273 private:
274 //**Member variables****************************************************************************
277 //**********************************************************************************************
278
279 //**Assignment to dense matrices****************************************************************
291 template< typename MT // Type of the target dense matrix
292 , bool SO2 > // Storage order of the target dense matrix
293 friend inline void assign( DenseMatrix<MT,SO2>& lhs, const DMatSMatSubExpr& rhs )
294 {
296
297 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
298 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
299
300 if( !IsOperation_v<MT1> && isSame( *lhs, rhs.lhs_ ) ) {
301 subAssign( *lhs, rhs.rhs_ );
302 }
303 else {
304 assign ( *lhs, rhs.lhs_ );
305 subAssign( *lhs, rhs.rhs_ );
306 }
307 }
309 //**********************************************************************************************
310
311 //**Assignment to sparse matrices***************************************************************
323 template< typename MT // Type of the target sparse matrix
324 , bool SO2 > // Storage order of the target sparse matrix
325 friend inline void assign( SparseMatrix<MT,SO2>& lhs, const DMatSMatSubExpr& rhs )
326 {
328
330
337
338 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
339 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
340
341 const TmpType tmp( serial( rhs ) );
342 assign( *lhs, tmp );
343 }
345 //**********************************************************************************************
346
347 //**Addition assignment to dense matrices*******************************************************
359 template< typename MT // Type of the target dense matrix
360 , bool SO2 > // Storage order of the target dense matrix
361 friend inline void addAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatSubExpr& rhs )
362 {
364
365 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
366 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
367
368 addAssign( *lhs, rhs.lhs_ );
369 subAssign( *lhs, rhs.rhs_ );
370 }
372 //**********************************************************************************************
373
374 //**Addition assignment to sparse matrices******************************************************
375 // No special implementation for the addition assignment to sparse matrices.
376 //**********************************************************************************************
377
378 //**Subtraction assignment to dense matrices****************************************************
390 template< typename MT // Type of the target dense matrix
391 , bool SO2 > // Storage order of the target dense matrix
392 friend inline void subAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatSubExpr& rhs )
393 {
395
396 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
397 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
398
399 subAssign( *lhs, rhs.lhs_ );
400 addAssign( *lhs, rhs.rhs_ );
401 }
403 //**********************************************************************************************
404
405 //**Subtraction assignment to sparse matrices***************************************************
406 // No special implementation for the subtraction assignment to sparse matrices.
407 //**********************************************************************************************
408
409 //**Schur product assignment to dense matrices**************************************************
421 template< typename MT // Type of the target dense matrix
422 , bool SO2 > // Storage order of the target dense matrix
423 friend inline void schurAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatSubExpr& rhs )
424 {
426
430
431 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
432 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
433
434 const ResultType tmp( serial( rhs ) );
435 schurAssign( *lhs, tmp );
436 }
438 //**********************************************************************************************
439
440 //**Schur product assignment to sparse matrices*************************************************
441 // No special implementation for the Schur product assignment to sparse matrices.
442 //**********************************************************************************************
443
444 //**Multiplication assignment to dense matrices*************************************************
445 // No special implementation for the multiplication assignment to dense matrices.
446 //**********************************************************************************************
447
448 //**Multiplication assignment to sparse matrices************************************************
449 // No special implementation for the multiplication assignment to sparse matrices.
450 //**********************************************************************************************
451
452 //**SMP assignment to dense matrices************************************************************
466 template< typename MT // Type of the target dense matrix
467 , bool SO2 > // Storage order of the target dense matrix
468 friend inline auto smpAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatSubExpr& rhs )
469 -> EnableIf_t< UseSMPAssign_v<MT> >
470 {
472
473 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
474 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
475
476 if( !IsOperation_v<MT1> && isSame( *lhs, rhs.lhs_ ) ) {
477 smpSubAssign( *lhs, rhs.rhs_ );
478 }
479 else {
480 smpAssign ( *lhs, rhs.lhs_ );
481 smpSubAssign( *lhs, rhs.rhs_ );
482 }
483 }
485 //**********************************************************************************************
486
487 //**SMP assignment to sparse matrices***********************************************************
501 template< typename MT // Type of the target sparse matrix
502 , bool SO2 > // Storage order of the target sparse matrix
503 friend inline auto smpAssign( SparseMatrix<MT,SO2>& lhs, const DMatSMatSubExpr& rhs )
504 -> EnableIf_t< UseSMPAssign_v<MT> >
505 {
507
508 using TmpType = If_t< SO == SO2, ResultType, OppositeType >;
509
516
517 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
518 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
519
520 const TmpType tmp( rhs );
521 smpAssign( *lhs, tmp );
522 }
524 //**********************************************************************************************
525
526 //**SMP addition assignment to dense matrices***************************************************
540 template< typename MT // Type of the target dense matrix
541 , bool SO2 > // Storage order of the target dense matrix
542 friend inline auto smpAddAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatSubExpr& rhs )
543 -> EnableIf_t< UseSMPAssign_v<MT> >
544 {
546
547 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
548 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
549
550 smpAddAssign( *lhs, rhs.lhs_ );
551 smpSubAssign( *lhs, rhs.rhs_ );
552 }
554 //**********************************************************************************************
555
556 //**SMP addition assignment to sparse matrices**************************************************
557 // No special implementation for the SMP addition assignment to sparse matrices.
558 //**********************************************************************************************
559
560 //**SMP subtraction assignment to dense matrices************************************************
574 template< typename MT // Type of the target dense matrix
575 , bool SO2 > // Storage order of the target dense matrix
576 friend inline auto smpSubAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatSubExpr& rhs )
577 -> EnableIf_t< UseSMPAssign_v<MT> >
578 {
580
581 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
582 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
583
584 smpSubAssign( *lhs, rhs.lhs_ );
585 smpAddAssign( *lhs, rhs.rhs_ );
586 }
588 //**********************************************************************************************
589
590 //**SMP subtraction assignment to sparse matrices***********************************************
591 // No special implementation for the SMP subtraction assignment to sparse matrices.
592 //**********************************************************************************************
593
594 //**SMP Schur product assignment to dense matrices**********************************************
609 template< typename MT // Type of the target dense matrix
610 , bool SO2 > // Storage order of the target dense matrix
611 friend inline auto smpSchurAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatSubExpr& rhs )
612 -> EnableIf_t< UseSMPAssign_v<MT> >
613 {
615
619
620 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
621 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
622
623 const ResultType tmp( rhs );
624 smpSchurAssign( *lhs, tmp );
625 }
627 //**********************************************************************************************
628
629 //**SMP Schur product assignment to sparse matrices*********************************************
630 // No special implementation for the SMP Schur product assignment to sparse matrices.
631 //**********************************************************************************************
632
633 //**SMP multiplication assignment to dense matrices*********************************************
634 // No special implementation for the SMP multiplication assignment to dense matrices.
635 //**********************************************************************************************
636
637 //**SMP multiplication assignment to sparse matrices********************************************
638 // No special implementation for the SMP multiplication assignment to sparse matrices.
639 //**********************************************************************************************
640
641 //**Compile time checks*************************************************************************
648 //**********************************************************************************************
649};
650//*************************************************************************************************
651
652
653
654
655//=================================================================================================
656//
657// GLOBAL BINARY ARITHMETIC OPERATORS
658//
659//=================================================================================================
660
661//*************************************************************************************************
674template< typename MT1 // Type of the left-hand side dense matrix
675 , typename MT2 // Type of the right-hand side sparse matrix
676 , bool SO // Storage order
677 , DisableIf_t< IsZero_v<MT2> &&
678 IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > >* = nullptr >
679inline const DMatSMatSubExpr<MT1,MT2,SO>
680 dmatsmatsub( const DenseMatrix<MT1,SO>& lhs, const SparseMatrix<MT2,SO>& rhs )
681{
683
684 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == (*rhs).rows() , "Invalid number of rows" );
685 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == (*rhs).columns(), "Invalid number of columns" );
686
687 return DMatSMatSubExpr<MT1,MT2,SO>( *lhs, *rhs );
688}
690//*************************************************************************************************
691
692
693//*************************************************************************************************
706template< typename MT1 // Type of the left-hand side dense matrix
707 , typename MT2 // Type of the right-hand side sparse matrix
708 , bool SO // Storage order
709 , EnableIf_t< IsZero_v<MT2> &&
710 IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > >* = nullptr >
711inline const MT1&
712 dmatsmatsub( const DenseMatrix<MT1,SO>& lhs, const SparseMatrix<MT2,SO>& rhs )
713{
715
716 MAYBE_UNUSED( rhs );
717
718 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == (*rhs).rows() , "Invalid number of rows" );
719 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == (*rhs).columns(), "Invalid number of columns" );
720
721 return (*lhs);
722}
724//*************************************************************************************************
725
726
727//*************************************************************************************************
756template< typename MT1 // Type of the left-hand side dense matrix
757 , typename MT2 // Type of the right-hand side sparse matrix
758 , bool SO > // Storage order
759inline decltype(auto)
760 operator-( const DenseMatrix<MT1,SO>& lhs, const SparseMatrix<MT2,SO>& rhs )
761{
763
764 if( (*lhs).rows() != (*rhs).rows() || (*lhs).columns() != (*rhs).columns() ) {
765 BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
766 }
767
768 return dmatsmatsub( *lhs, *rhs );
769}
770//*************************************************************************************************
771
772
773
774
775//=================================================================================================
776//
777// GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
778//
779//=================================================================================================
780
781//*************************************************************************************************
794template< typename MT1 // Type of the dense matrix of the left-hand side expression
795 , typename MT2 // Type of the sparse matrix of the left-hand side expression
796 , bool SO1 // Storage order of the left-hand side expression
797 , typename MT3 // Type of the right-hand side dense matrix
798 , bool SO2 > // Storage order of the right-hand side dense matrix
799inline decltype(auto)
800 operator+( const DMatSMatSubExpr<MT1,MT2,SO1>& lhs, const DenseMatrix<MT3,SO2>& rhs )
801{
803
804 return ( lhs.leftOperand() + (*rhs) ) - lhs.rightOperand();
805}
807//*************************************************************************************************
808
809
810//*************************************************************************************************
823template< typename MT1 // Type of the dense matrix of the left-hand side expression
824 , typename MT2 // Type of the sparse matrix of the left-hand side expression
825 , bool SO1 // Storage order of the left-hand side expression
826 , typename MT3 // Type of the right-hand side dense matrix
827 , bool SO2 > // Storage order of the right-hand side dense matrix
828inline decltype(auto)
829 operator-( const DMatSMatSubExpr<MT1,MT2,SO1>& lhs, const DenseMatrix<MT3,SO2>& rhs )
830{
832
833 return ( lhs.leftOperand() - (*rhs) ) - lhs.rightOperand();
834}
836//*************************************************************************************************
837
838} // namespace blaze
839
840#endif
Header file for auxiliary alias declarations.
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::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 EnableIf class template.
Header file for the function trace functionality.
Header file for the If class template.
Header file for the IntegralConstant class template.
Header file for the IsExpression type trait class.
Header file for the IsOperation type trait class.
Header file for the IsSame and IsStrictlySame type traits.
Header file for the IsTemporary type trait class.
Header file for the MAYBE_UNUSED function template.
Header file for the subtraction trait.
Expression object for dense matrix-sparse matrix subtractions.
Definition: DMatSMatSubExpr.h:92
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatSMatSubExpr.h:213
ReturnType_t< MT1 > RN1
Return type of the left-hand side dense matrix expression.
Definition: DMatSMatSubExpr.h:97
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatSMatSubExpr.h:223
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatSMatSubExpr.h:268
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatSMatSubExpr.h:197
RightOperand rhs_
Right-hand side sparse matrix of the subtraction expression.
Definition: DMatSMatSubExpr.h:276
If_t< IsExpression_v< MT2 >, const MT2, const MT2 & > RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: DMatSMatSubExpr.h:149
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatSMatSubExpr.h:255
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatSMatSubExpr.h:154
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: DMatSMatSubExpr.h:137
decltype(std::declval< RN1 >() - std::declval< RN2 >()) ExprReturnType
Expression return type for the subscript operator.
Definition: DMatSMatSubExpr.h:111
If_t< IsExpression_v< MT1 >, const MT1, const MT1 & > LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatSMatSubExpr.h:146
SubTrait_t< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DMatSMatSubExpr.h:134
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatSMatSubExpr.h:233
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DMatSMatSubExpr.h:157
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatSMatSubExpr.h:135
const ResultType CompositeType
Data type for composite expression templates.
Definition: DMatSMatSubExpr.h:143
static constexpr bool returnExpr
Compilation switch for the selection of the subscript operator return type.
Definition: DMatSMatSubExpr.h:108
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse matrix operand.
Definition: DMatSMatSubExpr.h:243
ResultType_t< MT2 > RT2
Result type of the right-hand side sparse matrix expression.
Definition: DMatSMatSubExpr.h:96
const If_t< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DMatSMatSubExpr.h:140
DMatSMatSubExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the DMatSMatSubExpr class.
Definition: DMatSMatSubExpr.h:166
ResultType_t< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: DMatSMatSubExpr.h:95
ReturnType_t< MT2 > RN2
Return type of the right-hand side sparse matrix expression.
Definition: DMatSMatSubExpr.h:98
LeftOperand lhs_
Left-hand side dense matrix of the subtraction expression.
Definition: DMatSMatSubExpr.h:275
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatSMatSubExpr.h:182
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatSMatSubExpr.h:136
Base class for dense matrices.
Definition: DenseMatrix.h:82
Base class for sparse matrices.
Definition: SparseMatrix.h:77
Constraint on the data type.
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 MatMatSubExpr base class.
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_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.
Definition: StorageOrder.h:84
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATMATSUBEXPR(T1, T2)
Constraint on the data type.
Definition: MatMatSubExpr.h:103
#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_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: SparseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.
Definition: StorageOrder.h:63
typename SubTrait< T1, T2 >::Type SubTrait_t
Auxiliary alias declaration for the SubTrait class template.
Definition: SubTrait.h:163
bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b) noexcept
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:1424
#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
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
#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 serial shim.
Base class for all compute expression templates.
Definition: Computation.h:68
Base class for all matrix/matrix subtraction expression templates.
Definition: MatMatSubExpr.h:69
Header file for the IsZero type trait.
Header file for basic type definitions.