Blaze 3.9
DMatDeclSymExpr.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_EXPRESSIONS_DMATDECLSYMEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_DMATDECLSYMEXPR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <iterator>
44#include <blaze/math/Aliases.h>
65#include <blaze/util/Assert.h>
66#include <blaze/util/EnableIf.h>
70#include <blaze/util/mpl/If.h>
71#include <blaze/util/Types.h>
73
74
75namespace blaze {
76
77//=================================================================================================
78//
79// CLASS DMATDECLSYMEXPR
80//
81//=================================================================================================
82
83//*************************************************************************************************
90template< typename MT // Type of the dense matrix
91 , bool SO > // Storage order
93 : public DeclSymExpr< DenseMatrix< DMatDeclSymExpr<MT,SO>, SO > >
94 , public Declaration<MT>
95{
96 private:
97 //**Type definitions****************************************************************************
99
101 BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT( GetConstIterator, ConstIterator, INVALID_TYPE );
102 //**********************************************************************************************
103
104 //**Serial evaluation strategy******************************************************************
106
112 static constexpr bool useAssign = RequiresEvaluation_v<MT>;
113
116 template< typename MT2 >
117 static constexpr bool UseAssign_v = useAssign;
119 //**********************************************************************************************
120
121 //**Parallel evaluation strategy****************************************************************
123
129 template< typename MT2 >
130 static constexpr bool UseSMPAssign_v = ( MT2::smpAssignable && useAssign );
132 //**********************************************************************************************
133
134 public:
135 //**Type definitions****************************************************************************
138
141
147
150
152 using ConstIterator = GetConstIterator_t<MT>;
153
155 using Operand = If_t< IsExpression_v<MT>, const MT, const MT& >;
156 //**********************************************************************************************
157
158 //**Compilation flags***************************************************************************
160 static constexpr bool simdEnabled = MT::simdEnabled;
161
163 static constexpr bool smpAssignable = MT::smpAssignable;
164 //**********************************************************************************************
165
166 //**SIMD properties*****************************************************************************
168 static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
169 //**********************************************************************************************
170
171 //**Constructor*********************************************************************************
176 explicit inline DMatDeclSymExpr( const MT& dm ) noexcept
177 : dm_( dm ) // Dense matrix of the declsym expression
178 {
179 BLAZE_INTERNAL_ASSERT( isSquare( *dm ), "Non-square matrix detected" );
180 }
181 //**********************************************************************************************
182
183 //**Access operator*****************************************************************************
190 inline ReturnType operator()( size_t i, size_t j ) const {
191 BLAZE_INTERNAL_ASSERT( i < dm_.rows() , "Invalid row access index" );
192 BLAZE_INTERNAL_ASSERT( j < dm_.columns(), "Invalid column access index" );
193 return dm_(i,j);
194 }
195 //**********************************************************************************************
196
197 //**At function*********************************************************************************
205 inline ReturnType at( size_t i, size_t j ) const {
206 if( i >= dm_.rows() ) {
207 BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
208 }
209 if( j >= dm_.columns() ) {
210 BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
211 }
212 return (*this)(i,j);
213 }
214 //**********************************************************************************************
215
216 //**Load function*******************************************************************************
223 BLAZE_ALWAYS_INLINE auto load( size_t i, size_t j ) const noexcept {
224 BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
225 BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
226 BLAZE_INTERNAL_ASSERT( !SO || ( i % SIMDSIZE == 0UL ), "Invalid row access index" );
227 BLAZE_INTERNAL_ASSERT( SO || ( j % SIMDSIZE == 0UL ), "Invalid column access index" );
228 return dm_.load(i,j);
229 }
230 //**********************************************************************************************
231
232 //**Low-level data access***********************************************************************
237 inline const ElementType* data() const noexcept {
238 return dm_.data();
239 }
240 //**********************************************************************************************
241
242 //**Begin function******************************************************************************
248 inline ConstIterator begin( size_t i ) const {
249 return ConstIterator( dm_.begin(i) );
250 }
251 //**********************************************************************************************
252
253 //**End function********************************************************************************
259 inline ConstIterator end( size_t i ) const {
260 return ConstIterator( dm_.end(i) );
261 }
262 //**********************************************************************************************
263
264 //**Rows function*******************************************************************************
269 inline size_t rows() const noexcept {
270 return dm_.rows();
271 }
272 //**********************************************************************************************
273
274 //**Columns function****************************************************************************
279 inline size_t columns() const noexcept {
280 return dm_.columns();
281 }
282 //**********************************************************************************************
283
284 //**Operand access******************************************************************************
289 inline Operand operand() const noexcept {
290 return dm_;
291 }
292 //**********************************************************************************************
293
294 //**********************************************************************************************
300 template< typename T >
301 inline bool canAlias( const T* alias ) const noexcept {
302 return dm_.canAlias( alias );
303 }
304 //**********************************************************************************************
305
306 //**********************************************************************************************
312 template< typename T >
313 inline bool isAliased( const T* alias ) const noexcept {
314 return dm_.isAliased( alias );
315 }
316 //**********************************************************************************************
317
318 //**********************************************************************************************
323 inline bool isAligned() const noexcept {
324 return dm_.isAligned();
325 }
326 //**********************************************************************************************
327
328 //**********************************************************************************************
333 inline bool canSMPAssign() const noexcept {
334 return dm_.canSMPAssign();
335 }
336 //**********************************************************************************************
337
338 private:
339 //**Member variables****************************************************************************
341 //**********************************************************************************************
342
343 //**Assignment to dense matrices****************************************************************
355 template< typename MT2 // Type of the target dense matrix
356 , bool SO2 > // Storage order of the target dense matrix
357 friend inline auto assign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
359 {
361
362 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
363 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
364
365 assign( *lhs, rhs.dm_ );
366 }
368 //**********************************************************************************************
369
370 //**Assignment to sparse matrices***************************************************************
382 template< typename MT2 // Type of the target sparse matrix
383 , bool SO2 > // Storage order of the target dense matrix
384 friend inline auto assign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
386 {
388
389 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
390 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
391
392 assign( *lhs, rhs.dm_ );
393 }
395 //**********************************************************************************************
396
397 //**Addition assignment to dense matrices*******************************************************
409 template< typename MT2 // Type of the target dense matrix
410 , bool SO2 > // Storage order of the target dense matrix
411 friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
412 -> EnableIf_t< UseAssign_v<MT2> >
413 {
415
416 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
417 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
418
419 addAssign( *lhs, rhs.dm_ );
420 }
422 //**********************************************************************************************
423
424 //**Addition assignment to sparse matrices******************************************************
436 template< typename MT2 // Type of the target sparse matrix
437 , bool SO2 > // Storage order of the target dense matrix
438 friend inline auto addAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
439 -> EnableIf_t< UseAssign_v<MT2> >
440 {
442
443 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
444 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
445
446 addAssign( *lhs, rhs.dm_ );
447 }
449 //**********************************************************************************************
450
451 //**Subtraction assignment to dense matrices****************************************************
463 template< typename MT2 // Type of the target dense matrix
464 , bool SO2 > // Storage order of the target dense matrix
465 friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
466 -> EnableIf_t< UseAssign_v<MT2> >
467 {
469
470 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
471 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
472
473 subAssign( *lhs, rhs.dm_ );
474 }
476 //**********************************************************************************************
477
478 //**Subtraction assignment to sparse matrices***************************************************
490 template< typename MT2 // Type of the target sparse matrix
491 , bool SO2 > // Storage order of the target dense matrix
492 friend inline auto subAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
493 -> EnableIf_t< UseAssign_v<MT2> >
494 {
496
497 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
498 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
499
500 subAssign( *lhs, rhs.dm_ );
501 }
503 //**********************************************************************************************
504
505 //**Schur product assignment to dense matrices**************************************************
517 template< typename MT2 // Type of the target dense matrix
518 , bool SO2 > // Storage order of the target dense matrix
519 friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
520 -> EnableIf_t< UseAssign_v<MT2> >
521 {
523
524 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
525 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
526
527 schurAssign( *lhs, rhs.dm_ );
528 }
530 //**********************************************************************************************
531
532 //**Schur product assignment to sparse matrices*************************************************
544 template< typename MT2 // Type of the target sparse matrix
545 , bool SO2 > // Storage order of the target dense matrix
546 friend inline auto schurAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
547 -> EnableIf_t< UseAssign_v<MT2> >
548 {
550
551 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
552 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
553
554 schurAssign( *lhs, rhs.dm_ );
555 }
557 //**********************************************************************************************
558
559 //**Multiplication assignment to dense matrices*************************************************
571 template< typename MT2 // Type of the target dense matrix
572 , bool SO2 > // Storage order of the target dense matrix
573 friend inline auto multAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
574 -> EnableIf_t< UseAssign_v<MT2> >
575 {
577
578 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
579 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
580
581 multAssign( *lhs, rhs.dm_ );
582 }
584 //**********************************************************************************************
585
586 //**Multiplication assignment to sparse matrices************************************************
598 template< typename MT2 // Type of the target sparse matrix
599 , bool SO2 > // Storage order of the target dense matrix
600 friend inline auto multAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
601 -> EnableIf_t< UseAssign_v<MT2> >
602 {
604
605 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
606 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
607
608 multAssign( *lhs, rhs.dm_ );
609 }
611 //**********************************************************************************************
612
613 //**SMP assignment to dense matrices************************************************************
625 template< typename MT2 // Type of the target dense matrix
626 , bool SO2 > // Storage order of the target dense matrix
627 friend inline auto smpAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
628 -> EnableIf_t< UseSMPAssign_v<MT2> >
629 {
631
632 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
633 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
634
635 smpAssign( *lhs, rhs.dm_ );
636 }
638 //**********************************************************************************************
639
640 //**SMP assignment to sparse matrices***********************************************************
652 template< typename MT2 // Type of the target sparse matrix
653 , bool SO2 > // Storage order of the target dense matrix
654 friend inline auto smpAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
655 -> EnableIf_t< UseSMPAssign_v<MT2> >
656 {
658
659 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
660 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
661
662 smpAssign( *lhs, rhs.dm_ );
663 }
665 //**********************************************************************************************
666
667 //**SMP addition assignment to dense matrices***************************************************
679 template< typename MT2 // Type of the target dense matrix
680 , bool SO2 > // Storage order of the target dense matrix
681 friend inline auto smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
682 -> EnableIf_t< UseSMPAssign_v<MT2> >
683 {
685
686 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
687 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
688
689 smpAddAssign( *lhs, rhs.dm_ );
690 }
692 //**********************************************************************************************
693
694 //**SMP addition assignment to sparse matrices**************************************************
706 template< typename MT2 // Type of the target sparse matrix
707 , bool SO2 > // Storage order of the target dense matrix
708 friend inline auto smpAddAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
709 -> EnableIf_t< UseSMPAssign_v<MT2> >
710 {
712
713 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
714 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
715
716 smpAddAssign( *lhs, rhs.dm_ );
717 }
719 //**********************************************************************************************
720
721 //**SMP subtraction assignment to dense matrices************************************************
733 template< typename MT2 // Type of the target dense matrix
734 , bool SO2 > // Storage order of the target dense matrix
735 friend inline auto smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
736 -> EnableIf_t< UseSMPAssign_v<MT2> >
737 {
739
740 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
741 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
742
743 smpSubAssign( *lhs, rhs.dm_ );
744 }
746 //**********************************************************************************************
747
748 //**SMP subtraction assignment to sparse matrices***********************************************
760 template< typename MT2 // Type of the target sparse matrix
761 , bool SO2 > // Storage order of the target dense matrix
762 friend inline auto smpSubAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
763 -> EnableIf_t< UseSMPAssign_v<MT2> >
764 {
766
767 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
768 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
769
770 smpSubAssign( *lhs, rhs.dm_ );
771 }
773 //**********************************************************************************************
774
775 //**SMP Schur product assignment to dense matrices**********************************************
787 template< typename MT2 // Type of the target dense matrix
788 , bool SO2 > // Storage order of the target dense matrix
789 friend inline auto smpSchurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
790 -> EnableIf_t< UseSMPAssign_v<MT2> >
791 {
793
794 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
795 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
796
797 smpSchurAssign( *lhs, rhs.dm_ );
798 }
800 //**********************************************************************************************
801
802 //**SMP Schur product assignment to sparse matrices*********************************************
814 template< typename MT2 // Type of the target sparse matrix
815 , bool SO2 > // Storage order of the target dense matrix
816 friend inline auto smpSchurAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
817 -> EnableIf_t< UseSMPAssign_v<MT2> >
818 {
820
821 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
822 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
823
824 smpSchurAssign( *lhs, rhs.dm_ );
825 }
827 //**********************************************************************************************
828
829 //**SMP multiplication assignment to dense matrices*********************************************
842 template< typename MT2 // Type of the target dense matrix
843 , bool SO2 > // Storage order of the target dense matrix
844 friend inline auto smpMultAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
845 -> EnableIf_t< UseSMPAssign_v<MT2> >
846 {
848
849 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
850 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
851
852 smpMultAssign( *lhs, rhs.dm_ );
853 }
855 //**********************************************************************************************
856
857 //**SMP multiplication assignment to sparse matrices********************************************
870 template< typename MT2 // Type of the target sparse matrix
871 , bool SO2 > // Storage order of the target dense matrix
872 friend inline auto smpMultAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclSymExpr& rhs )
873 -> EnableIf_t< UseSMPAssign_v<MT2> >
874 {
876
877 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
878 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
879
880 smpMultAssign( *lhs, rhs.dm_ );
881 }
883 //**********************************************************************************************
884
885 //**Compile time checks*************************************************************************
893 //**********************************************************************************************
894};
895//*************************************************************************************************
896
897
898
899
900//=================================================================================================
901//
902// GLOBAL FUNCTIONS
903//
904//=================================================================================================
905
906//*************************************************************************************************
917template< typename MT // Type of the dense matrix
918 , bool SO // Storage order
919 , DisableIf_t< IsSymmetric_v<MT> || IsUniTriangular_v<MT> >* = nullptr >
920inline const DMatDeclSymExpr<MT,SO> declsym_backend( const DenseMatrix<MT,SO>& dm )
921{
923
924 BLAZE_INTERNAL_ASSERT( isSquare( *dm ), "Non-square matrix detected" );
925
926 return DMatDeclSymExpr<MT,SO>( *dm );
927}
929//*************************************************************************************************
930
931
932//*************************************************************************************************
943template< typename MT // Type of the dense matrix
944 , bool SO // Storage order
945 , EnableIf_t< !IsSymmetric_v<MT> && IsUniTriangular_v<MT> >* = nullptr >
946inline const IdentityMatrix<ElementType_t<MT>,SO> declsym_backend( const DenseMatrix<MT,SO>& dm )
947{
949
950 BLAZE_INTERNAL_ASSERT( isSquare( *dm ), "Non-square matrix detected" );
951
952 return IdentityMatrix<ElementType_t<MT>,SO>( (*dm).rows() );
953}
955//*************************************************************************************************
956
957
958//*************************************************************************************************
969template< typename MT // Type of the dense matrix
970 , bool SO // Storage order
971 , EnableIf_t< IsSymmetric_v<MT> >* = nullptr >
972inline const MT& declsym_backend( const DenseMatrix<MT,SO>& dm )
973{
975
976 BLAZE_INTERNAL_ASSERT( isSquare( *dm ), "Non-square matrix detected" );
977
978 return *dm;
979}
981//*************************************************************************************************
982
983
984//*************************************************************************************************
1003template< typename MT // Type of the dense matrix
1004 , bool SO > // Storage order
1005inline decltype(auto) declsym( const DenseMatrix<MT,SO>& dm )
1006{
1008
1009 if( !isSquare( *dm ) ) {
1010 BLAZE_THROW_INVALID_ARGUMENT( "Invalid symmetric matrix specification" );
1011 }
1012
1013 return declsym_backend( *dm );
1014}
1015//*************************************************************************************************
1016
1017
1018
1019
1020//=================================================================================================
1021//
1022// HASCONSTDATAACCESS SPECIALIZATIONS
1023//
1024//=================================================================================================
1025
1026//*************************************************************************************************
1028template< typename MT, bool SO >
1029struct HasConstDataAccess< DMatDeclSymExpr<MT,SO> >
1030 : public HasConstDataAccess<MT>
1031{};
1033//*************************************************************************************************
1034
1035
1036
1037
1038//=================================================================================================
1039//
1040// ISALIGNED SPECIALIZATIONS
1041//
1042//=================================================================================================
1043
1044//*************************************************************************************************
1046template< typename MT, bool SO >
1047struct IsAligned< DMatDeclSymExpr<MT,SO> >
1048 : public IsAligned<MT>
1049{};
1051//*************************************************************************************************
1052
1053
1054
1055
1056//=================================================================================================
1057//
1058// ISSYMMETRIC SPECIALIZATIONS
1059//
1060//=================================================================================================
1061
1062//*************************************************************************************************
1064template< typename MT, bool SO >
1065struct IsSymmetric< DMatDeclSymExpr<MT,SO> >
1066 : public TrueType
1067{};
1069//*************************************************************************************************
1070
1071} // namespace blaze
1072
1073#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 declsym trait.
Header file for the EnableIf class template.
Header file for the function trace functionality.
Header file for the GetMemberType type trait.
Header file for the HasConstDataAccess type trait.
Header file for the If class template.
Header file for the IntegralConstant class template.
Utility type for generic codes.
Header file for the IsAligned type trait.
Header file for the IsExpression type trait class.
Header file for the IsSymmetric type trait.
Header file for the IsUniTriangular type trait.
Header file for the SIMD trait.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of the base template of the SymmetricMatrix.
Expression object for the explicit symmetry declaration of dense matrices.
Definition: DMatDeclSymExpr.h:95
GetConstIterator_t< MT > ConstIterator
Iterator over the elements of the dense matrix.
Definition: DMatDeclSymExpr.h:152
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatDeclSymExpr.h:190
const ElementType * data() const noexcept
Low-level data access to the matrix elements.
Definition: DMatDeclSymExpr.h:237
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite data type of the dense matrix expression.
Definition: DMatDeclSymExpr.h:155
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatDeclSymExpr.h:143
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatDeclSymExpr.h:313
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DMatDeclSymExpr.h:168
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatDeclSymExpr.h:323
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatDeclSymExpr.h:144
DMatDeclSymExpr(const MT &dm) noexcept
Constructor for the DMatDeclSymExpr class.
Definition: DMatDeclSymExpr.h:176
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DMatDeclSymExpr.h:163
ElementType_t< MT > ElementType
Resulting element type.
Definition: DMatDeclSymExpr.h:145
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatDeclSymExpr.h:160
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatDeclSymExpr.h:301
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the symmetry declaration expression.
Definition: DMatDeclSymExpr.h:112
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatDeclSymExpr.h:248
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatDeclSymExpr.h:223
If_t< RequiresEvaluation_v< MT >, const ResultType, const DMatDeclSymExpr & > CompositeType
Data type for composite expression templates.
Definition: DMatDeclSymExpr.h:149
ResultType_t< MT > RT
Result type of the dense matrix expression.
Definition: DMatDeclSymExpr.h:98
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: DMatDeclSymExpr.h:146
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatDeclSymExpr.h:279
BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT(GetConstIterator, ConstIterator, INVALID_TYPE)
Definition of the GetConstIterator type trait.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatDeclSymExpr.h:333
Operand dm_
Dense matrix of the declsym expression.
Definition: DMatDeclSymExpr.h:340
Operand operand() const noexcept
Returns the dense matrix operand.
Definition: DMatDeclSymExpr.h:289
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatDeclSymExpr.h:205
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatDeclSymExpr.h:259
DeclSymTrait_t< RT > ResultType
Result type for expression template evaluations.
Definition: DMatDeclSymExpr.h:142
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatDeclSymExpr.h:269
Base class for dense matrices.
Definition: DenseMatrix.h:82
SIMD characteristics of data types.
Definition: SIMDTrait.h:297
Base class for sparse matrices.
Definition: SparseMatrix.h:77
Constraint on the data type.
Constraint on the data type.
Header file for the DeclSymExpr base class.
Header file for the Declaration base class.
Header file for the DenseMatrix base class.
decltype(auto) declsym(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as symmetric.
Definition: DMatDeclSymExpr.h:1005
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_MATMATMULTEXPR_TYPE(T)
Constraint on the data type.
Definition: MatMatMultExpr.h:83
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: DenseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: UniTriangular.h:81
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.
Definition: StorageOrder.h:63
typename DeclSymTrait< MT >::Type DeclSymTrait_t
Auxiliary alias declaration for the DeclSymTrait type trait.
Definition: DeclSymTrait.h:144
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:1383
#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 smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector.
Definition: DenseVector.h:192
auto 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
BoolConstant< true > TrueType
Type traits base class.
Definition: IntegralConstant.h:132
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
#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 all forward declarations for sparse vectors and matrices.
Base class for all declsym expression templates.
Definition: DeclSymExpr.h:68
Base class for all declaration expression templates.
Definition: Declaration.h:76
Header file for the RequiresEvaluation type trait.
Header file for basic type definitions.