DMatTransExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATTRANSEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATTRANSEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <blaze/math/Aliases.h>
48 #include <blaze/math/Exception.h>
72 #include <blaze/system/Inline.h>
73 #include <blaze/util/Assert.h>
74 #include <blaze/util/EnableIf.h>
77 #include <blaze/util/InvalidType.h>
78 #include <blaze/util/mpl/If.h>
79 #include <blaze/util/Types.h>
81 
82 
83 namespace blaze {
84 
85 //=================================================================================================
86 //
87 // CLASS DMATTRANSEXPR
88 //
89 //=================================================================================================
90 
91 //*************************************************************************************************
98 template< typename MT // Type of the dense matrix
99  , bool SO > // Storage order
101  : public MatTransExpr< DenseMatrix< DMatTransExpr<MT,SO>, SO > >
102  , private If< IsComputation<MT>, Computation, Transformation >::Type
103 {
104  private:
105  //**Type definitions****************************************************************************
106  using RT = ResultType_<MT>;
108  //**********************************************************************************************
109 
110  //**Serial evaluation strategy******************************************************************
112 
118  enum : bool { useAssign = RequiresEvaluation<MT>::value };
119 
121  template< typename MT2 >
123  struct UseAssign {
124  enum : bool { value = useAssign };
125  };
127  //**********************************************************************************************
128 
129  //**Parallel evaluation strategy****************************************************************
131 
136  template< typename MT2 >
137  struct UseSMPAssign {
138  enum : bool { value = MT2::smpAssignable && useAssign };
139  };
141  //**********************************************************************************************
142 
143  //**********************************************************************************************
145 
149  template< typename MT2 >
150  struct GetConstIterator {
152  struct Success { using Type = typename MT2::ConstIterator; };
153  struct Failure { using Type = INVALID_TYPE; };
154  using Type = typename If_< HasConstIterator<MT2>, Success, Failure >::Type;
155  };
157  //**********************************************************************************************
158 
159  public:
160  //**Type definitions****************************************************************************
167 
170 
172  using ConstIterator = typename GetConstIterator<MT>::Type;
173 
175  using Operand = If_< IsExpression<MT>, const MT, const MT& >;
176  //**********************************************************************************************
177 
178  //**Compilation flags***************************************************************************
180  enum : bool { simdEnabled = MT::simdEnabled };
181 
183  enum : bool { smpAssignable = MT::smpAssignable };
184  //**********************************************************************************************
185 
186  //**SIMD properties*****************************************************************************
188  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
189  //**********************************************************************************************
190 
191  //**Constructor*********************************************************************************
196  explicit inline DMatTransExpr( const MT& dm ) noexcept
197  : dm_( dm ) // Dense matrix of the transposition expression
198  {}
199  //**********************************************************************************************
200 
201  //**Access operator*****************************************************************************
208  inline ReturnType operator()( size_t i, size_t j ) const {
209  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
210  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
211  return dm_(j,i);
212  }
213  //**********************************************************************************************
214 
215  //**At function*********************************************************************************
223  inline ReturnType at( size_t i, size_t j ) const {
224  if( i >= dm_.columns() ) {
225  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
226  }
227  if( j >= dm_.rows() ) {
228  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
229  }
230  return (*this)(i,j);
231  }
232  //**********************************************************************************************
233 
234  //**Load function*******************************************************************************
241  BLAZE_ALWAYS_INLINE auto load( size_t i, size_t j ) const noexcept {
242  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
243  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
244  BLAZE_INTERNAL_ASSERT( !SO || ( i % SIMDSIZE == 0UL ), "Invalid row access index" );
245  BLAZE_INTERNAL_ASSERT( SO || ( j % SIMDSIZE == 0UL ), "Invalid column access index" );
246  return dm_.load(j,i);
247  }
248  //**********************************************************************************************
249 
250  //**Low-level data access***********************************************************************
255  inline const ElementType* data() const noexcept {
256  return dm_.data();
257  }
258  //**********************************************************************************************
259 
260  //**Begin function******************************************************************************
266  inline ConstIterator begin( size_t i ) const {
267  return ConstIterator( dm_.begin(i) );
268  }
269  //**********************************************************************************************
270 
271  //**End function********************************************************************************
277  inline ConstIterator end( size_t i ) const {
278  return ConstIterator( dm_.end(i) );
279  }
280  //**********************************************************************************************
281 
282  //**Rows function*******************************************************************************
287  inline size_t rows() const noexcept {
288  return dm_.columns();
289  }
290  //**********************************************************************************************
291 
292  //**Columns function****************************************************************************
297  inline size_t columns() const noexcept {
298  return dm_.rows();
299  }
300  //**********************************************************************************************
301 
302  //**Spacing function****************************************************************************
307  inline size_t spacing() const noexcept {
308  return dm_.spacing();
309  }
310  //**********************************************************************************************
311 
312  //**NonZeros function***************************************************************************
317  inline size_t nonZeros() const {
318  return dm_.nonZeros();
319  }
320  //**********************************************************************************************
321 
322  //**NonZeros function***************************************************************************
328  inline size_t nonZeros( size_t i ) const {
329  return dm_.nonZeros( i );
330  }
331  //**********************************************************************************************
332 
333  //**Operand access******************************************************************************
338  inline Operand operand() const noexcept {
339  return dm_;
340  }
341  //**********************************************************************************************
342 
343  //**********************************************************************************************
349  template< typename T >
350  inline bool canAlias( const T* alias ) const noexcept {
351  return dm_.isAliased( alias );
352  }
353  //**********************************************************************************************
354 
355  //**********************************************************************************************
361  template< typename T >
362  inline bool isAliased( const T* alias ) const noexcept {
363  return dm_.isAliased( alias );
364  }
365  //**********************************************************************************************
366 
367  //**********************************************************************************************
372  inline bool isAligned() const noexcept {
373  return dm_.isAligned();
374  }
375  //**********************************************************************************************
376 
377  //**********************************************************************************************
382  inline bool canSMPAssign() const noexcept {
383  return dm_.canSMPAssign();
384  }
385  //**********************************************************************************************
386 
387  private:
388  //**Member variables****************************************************************************
390  //**********************************************************************************************
391 
392  //**Assignment to dense matrices****************************************************************
406  template< typename MT2 // Type of the target dense matrix
407  , bool SO2 > // Storage order of the target dense matrix
408  friend inline EnableIf_< UseAssign<MT2> >
409  assign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
410  {
412 
413  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
414  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
415 
416  DMatTransposer<MT2,!SO2> tmp( ~lhs );
417  assign( tmp, rhs.dm_ );
418  }
420  //**********************************************************************************************
421 
422  //**Assignment to sparse matrices***************************************************************
436  template< typename MT2 // Type of the target sparse matrix
437  , bool SO2 > // Storage order of the target sparse matrix
438  friend inline EnableIf_< UseAssign<MT2> >
439  assign( SparseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
440  {
442 
444 
451 
452  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
453  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
454 
455  const TmpType tmp( serial( rhs ) );
456  assign( ~lhs, tmp );
457  }
459  //**********************************************************************************************
460 
461  //**Addition assignment to dense matrices*******************************************************
475  template< typename MT2 // Type of the target dense matrix
476  , bool SO2 > // Storage order of the target dense matrix
477  friend inline EnableIf_< UseAssign<MT2> >
478  addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
479  {
481 
482  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
483  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
484 
485  DMatTransposer<MT2,!SO2> tmp( ~lhs );
486  addAssign( tmp, rhs.dm_ );
487  }
489  //**********************************************************************************************
490 
491  //**Addition assignment to sparse matrices******************************************************
492  // No special implementation for the addition assignment to sparse matrices.
493  //**********************************************************************************************
494 
495  //**Subtraction assignment to dense matrices****************************************************
509  template< typename MT2 // Type of the target dense matrix
510  , bool SO2 > // Storage order of the target dense matrix
511  friend inline EnableIf_< UseAssign<MT2> >
512  subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
513  {
515 
516  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
517  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
518 
519  DMatTransposer<MT2,!SO2> tmp( ~lhs );
520  subAssign( tmp, rhs.dm_ );
521  }
523  //**********************************************************************************************
524 
525  //**Subtraction assignment to sparse matrices***************************************************
526  // No special implementation for the subtraction assignment to sparse matrices.
527  //**********************************************************************************************
528 
529  //**Schur product assignment to dense matrices**************************************************
543  template< typename MT2 // Type of the target dense matrix
544  , bool SO2 > // Storage order of the target dense matrix
545  friend inline EnableIf_< UseAssign<MT2> >
546  schurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
547  {
549 
550  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
551  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
552 
553  DMatTransposer<MT2,!SO2> tmp( ~lhs );
554  schurAssign( tmp, rhs.dm_ );
555  }
557  //**********************************************************************************************
558 
559  //**Schur product assignment to sparse matrices*************************************************
560  // No special implementation for the Schur product assignment to sparse matrices.
561  //**********************************************************************************************
562 
563  //**Multiplication assignment to dense matrices*************************************************
564  // No special implementation for the multiplication assignment to dense matrices.
565  //**********************************************************************************************
566 
567  //**Multiplication assignment to sparse matrices************************************************
568  // No special implementation for the multiplication assignment to sparse matrices.
569  //**********************************************************************************************
570 
571  //**SMP assignment to dense matrices************************************************************
585  template< typename MT2 // Type of the target dense matrix
586  , bool SO2 > // Storage order of the target dense matrix
587  friend inline EnableIf_< UseSMPAssign<MT2> >
588  smpAssign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
589  {
591 
592  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
593  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
594 
595  DMatTransposer<MT2,!SO2> tmp( ~lhs );
596  smpAssign( tmp, rhs.dm_ );
597  }
599  //**********************************************************************************************
600 
601  //**SMP assignment to sparse matrices***********************************************************
615  template< typename MT2 // Type of the target sparse matrix
616  , bool SO2 > // Storage order of the target sparse matrix
617  friend inline EnableIf_< UseSMPAssign<MT2> >
618  smpAssign( SparseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
619  {
621 
623 
630 
631  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
632  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
633 
634  const TmpType tmp( rhs );
635  smpAssign( ~lhs, tmp );
636  }
638  //**********************************************************************************************
639 
640  //**SMP addition assignment to dense matrices***************************************************
654  template< typename MT2 // Type of the target dense matrix
655  , bool SO2 > // Storage order of the target dense matrix
656  friend inline EnableIf_< UseSMPAssign<MT2> >
658  {
660 
661  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
662  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
663 
664  DMatTransposer<MT2,!SO2> tmp( ~lhs );
665  smpAddAssign( tmp, rhs.dm_ );
666  }
668  //**********************************************************************************************
669 
670  //**SMP addition assignment to sparse matrices**************************************************
671  // No special implementation for the SMP addition assignment to sparse matrices.
672  //**********************************************************************************************
673 
674  //**SMP subtraction assignment to dense matrices************************************************
688  template< typename MT2 // Type of the target dense matrix
689  , bool SO2 > // Storage order of the target dense matrix
690  friend inline EnableIf_< UseSMPAssign<MT2> >
692  {
694 
695  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
696  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
697 
698  DMatTransposer<MT2,!SO2> tmp( ~lhs );
699  smpSubAssign( tmp, rhs.dm_ );
700  }
702  //**********************************************************************************************
703 
704  //**SMP subtraction assignment to sparse matrices***********************************************
705  // No special implementation for the SMP subtraction assignment to sparse matrices.
706  //**********************************************************************************************
707 
708  //**SMP Schur product assignment to dense matrices**********************************************
723  template< typename MT2 // Type of the target dense matrix
724  , bool SO2 > // Storage order of the target dense matrix
725  friend inline EnableIf_< UseSMPAssign<MT2> >
727  {
729 
730  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
731  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
732 
733  DMatTransposer<MT2,!SO2> tmp( ~lhs );
734  smpSchurAssign( tmp, rhs.dm_ );
735  }
737  //**********************************************************************************************
738 
739  //**SMP Schur product assignment to sparse matrices*********************************************
740  // No special implementation for the SMP Schur product assignment to sparse matrices.
741  //**********************************************************************************************
742 
743  //**SMP multiplication assignment to dense matrices*********************************************
744  // No special implementation for the SMP multiplication assignment to dense matrices.
745  //**********************************************************************************************
746 
747  //**SMP multiplication assignment to sparse matrices********************************************
748  // No special implementation for the SMP multiplication assignment to sparse matrices.
749  //**********************************************************************************************
750 
751  //**Compile time checks*************************************************************************
756  //**********************************************************************************************
757 };
758 //*************************************************************************************************
759 
760 
761 
762 
763 //=================================================================================================
764 //
765 // GLOBAL OPERATORS
766 //
767 //=================================================================================================
768 
769 //*************************************************************************************************
788 template< typename MT // Type of the dense matrix
789  , bool SO > // Storage order
790 inline decltype(auto) trans( const DenseMatrix<MT,SO>& dm )
791 {
793 
794  using ReturnType = const DMatTransExpr<MT,!SO>;
795  return ReturnType( ~dm );
796 }
797 //*************************************************************************************************
798 
799 
800 
801 
802 //=================================================================================================
803 //
804 // GLOBAL RESTRUCTURING FUNCTIONS
805 //
806 //=================================================================================================
807 
808 //*************************************************************************************************
828 template< typename MT // Type of the dense matrix
829  , bool SO > // Storage order
830 inline decltype(auto) trans( const DMatTransExpr<MT,SO>& dm )
831 {
833 
834  return dm.operand();
835 }
837 //*************************************************************************************************
838 
839 
840 //*************************************************************************************************
852 template< typename MT // Type of the left-hand side dense matrix
853  , typename ST // Type of the right-hand side scalar value
854  , bool SO > // Storage order
855 inline decltype(auto) trans( const DMatScalarMultExpr<MT,ST,SO>& dm )
856 {
858 
859  return trans( dm.leftOperand() ) * dm.rightOperand();
860 }
862 //*************************************************************************************************
863 
864 
865 
866 
867 //=================================================================================================
868 //
869 // ROWS SPECIALIZATIONS
870 //
871 //=================================================================================================
872 
873 //*************************************************************************************************
875 template< typename MT, bool SO >
876 struct Rows< DMatTransExpr<MT,SO> >
877  : public Columns<MT>
878 {};
880 //*************************************************************************************************
881 
882 
883 
884 
885 //=================================================================================================
886 //
887 // COLUMNS SPECIALIZATIONS
888 //
889 //=================================================================================================
890 
891 //*************************************************************************************************
893 template< typename MT, bool SO >
894 struct Columns< DMatTransExpr<MT,SO> >
895  : public Rows<MT>
896 {};
898 //*************************************************************************************************
899 
900 
901 
902 
903 //=================================================================================================
904 //
905 // ISALIGNED SPECIALIZATIONS
906 //
907 //=================================================================================================
908 
909 //*************************************************************************************************
911 template< typename MT, bool SO >
912 struct IsAligned< DMatTransExpr<MT,SO> >
913  : public BoolConstant< IsAligned<MT>::value >
914 {};
916 //*************************************************************************************************
917 
918 
919 
920 
921 //=================================================================================================
922 //
923 // ISPADDED SPECIALIZATIONS
924 //
925 //=================================================================================================
926 
927 //*************************************************************************************************
929 template< typename MT, bool SO >
930 struct IsPadded< DMatTransExpr<MT,SO> >
931  : public BoolConstant< IsPadded<MT>::value >
932 {};
934 //*************************************************************************************************
935 
936 
937 
938 
939 //=================================================================================================
940 //
941 // ISSYMMETRIC SPECIALIZATIONS
942 //
943 //=================================================================================================
944 
945 //*************************************************************************************************
947 template< typename MT, bool SO >
948 struct IsSymmetric< DMatTransExpr<MT,SO> >
949  : public BoolConstant< IsSymmetric<MT>::value >
950 {};
952 //*************************************************************************************************
953 
954 
955 
956 
957 //=================================================================================================
958 //
959 // ISHERMITIAN SPECIALIZATIONS
960 //
961 //=================================================================================================
962 
963 //*************************************************************************************************
965 template< typename MT, bool SO >
966 struct IsHermitian< DMatTransExpr<MT,SO> >
967  : public BoolConstant< IsHermitian<MT>::value >
968 {};
970 //*************************************************************************************************
971 
972 
973 
974 
975 //=================================================================================================
976 //
977 // ISLOWER SPECIALIZATIONS
978 //
979 //=================================================================================================
980 
981 //*************************************************************************************************
983 template< typename MT, bool SO >
984 struct IsLower< DMatTransExpr<MT,SO> >
985  : public BoolConstant< IsUpper<MT>::value >
986 {};
988 //*************************************************************************************************
989 
990 
991 
992 
993 //=================================================================================================
994 //
995 // ISUNILOWER SPECIALIZATIONS
996 //
997 //=================================================================================================
998 
999 //*************************************************************************************************
1001 template< typename MT, bool SO >
1002 struct IsUniLower< DMatTransExpr<MT,SO> >
1003  : public BoolConstant< IsUniUpper<MT>::value >
1004 {};
1006 //*************************************************************************************************
1007 
1008 
1009 
1010 
1011 //=================================================================================================
1012 //
1013 // ISSTRICTLYLOWER SPECIALIZATIONS
1014 //
1015 //=================================================================================================
1016 
1017 //*************************************************************************************************
1019 template< typename MT, bool SO >
1020 struct IsStrictlyLower< DMatTransExpr<MT,SO> >
1021  : public BoolConstant< IsStrictlyUpper<MT>::value >
1022 {};
1024 //*************************************************************************************************
1025 
1026 
1027 
1028 
1029 //=================================================================================================
1030 //
1031 // ISUPPER SPECIALIZATIONS
1032 //
1033 //=================================================================================================
1034 
1035 //*************************************************************************************************
1037 template< typename MT, bool SO >
1038 struct IsUpper< DMatTransExpr<MT,SO> >
1039  : public BoolConstant< IsLower<MT>::value >
1040 {};
1042 //*************************************************************************************************
1043 
1044 
1045 
1046 
1047 //=================================================================================================
1048 //
1049 // ISUNIUPPER SPECIALIZATIONS
1050 //
1051 //=================================================================================================
1052 
1053 //*************************************************************************************************
1055 template< typename MT, bool SO >
1056 struct IsUniUpper< DMatTransExpr<MT,SO> >
1057  : public BoolConstant< IsUniLower<MT>::value >
1058 {};
1060 //*************************************************************************************************
1061 
1062 
1063 
1064 
1065 //=================================================================================================
1066 //
1067 // ISSTRICTLYUPPER SPECIALIZATIONS
1068 //
1069 //=================================================================================================
1070 
1071 //*************************************************************************************************
1073 template< typename MT, bool SO >
1074 struct IsStrictlyUpper< DMatTransExpr<MT,SO> >
1075  : public BoolConstant< IsStrictlyLower<MT>::value >
1076 {};
1078 //*************************************************************************************************
1079 
1080 } // namespace blaze
1081 
1082 #endif
Header file for auxiliary alias declarations.
typename GetConstIterator< MT >::Type ConstIterator
Iterator over the elements of the dense matrix.
Definition: DMatTransExpr.h:172
size_t spacing() const noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DMatTransExpr.h:307
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
EnableIf_< IsDenseMatrix< MT1 > > smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:196
Compile time type selection.The If alias declaration selects one of the two given types T2 and T3 dep...
Definition: If.h:132
Header file for basic type definitions.
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatTransExpr.h:372
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:164
Header file for the serial shim.
Expression object for dense matrix transpositions.The DMatTransExpr class represents the compile time...
Definition: DMatTransExpr.h:100
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:63
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Header file for the MatTransExpr base class.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatTransExpr.h:382
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
const ElementType * data() const noexcept
Low-level data access to the matrix elements.
Definition: DMatTransExpr.h:255
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
#define BLAZE_CREATE_HAS_TYPE_MEMBER_TYPE_TRAIT(TYPE_TRAIT_NAME, MEMBER_NAME)
Macro for the creation of a type trait for compile time checks for member types.This macro creates th...
Definition: HasMember.h:182
Header file for the Computation base class.
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
Operand operand() const noexcept
Returns the dense matrix operand.
Definition: DMatTransExpr.h:338
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatTransExpr.h:297
Header file for the RequiresEvaluation type trait.
Operand dm_
Dense matrix of the transposition expression.
Definition: DMatTransExpr.h:389
Header file for the SIMD trait.
Header file for the IsUniLower type trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:133
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatTransExpr.h:241
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:78
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
TransposeType_< MT > ResultType
Result type for expression template evaluations.
Definition: DMatTransExpr.h:162
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
Constraint on the data type.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
ReturnType_< MT > ReturnType
Return type for expression template evaluations.
Definition: DMatTransExpr.h:166
IfTrue_< useAssign, const ResultType, const DMatTransExpr &> CompositeType
Data type for composite expression templates.
Definition: DMatTransExpr.h:169
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the If class template.
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatTransExpr.h:277
Header file for the Transformation base class.
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:102
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatTransExpr.h:287
Expression object for dense matrix-scalar multiplications.The DMatScalarMultExpr class represents the...
Definition: DMatScalarMultExpr.h:110
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
Header file for the Columns type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3087
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Expression object for the transposition of a dense matrix.The DMatTransposer class is a wrapper objec...
Definition: DMatTransposer.h:81
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: DMatScalarMultExpr.h:567
Constraints on the storage order of matrix types.
Compile time check for symmetric matrices.This type trait tests whether or not the given template par...
Definition: IsSymmetric.h:85
Header file for the exception macros of the math module.
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Constraint on the data type.
Header file for all forward declarations for expression class templates.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatTransExpr.h:350
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Header file for the IsPadded type trait.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatTransExpr.h:362
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatTransExpr.h:163
ResultType_< MT > RT
Result type of the dense matrix expression.
Definition: DMatTransExpr.h:106
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatTransExpr.h:208
Header file for the dense matrix transposer.
DMatTransExpr(const MT &dm) noexcept
Constructor for the DMatTransExpr class.
Definition: DMatTransExpr.h:196
Header file for run time assertion macros.
Utility type for generic codes.
size_t nonZeros() const
Returns the number of non-zero elements in the dense matrix.
Definition: DMatTransExpr.h:317
If_< IsExpression< MT >, const MT, const MT &> Operand
Composite data type of the dense matrix expression.
Definition: DMatTransExpr.h:175
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatTransExpr.h:266
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
CompositeType_< MT > CT
Composite type of the dense matrix expression.
Definition: DMatTransExpr.h:107
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:819
Base class for all matrix transposition expression templates.The MatTransExpr class serves as a tag f...
Definition: MatTransExpr.h:66
Header file for the HasMember type traits.
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:263
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.In case either of the two given data types T1 or T2 is not a matrix type ...
Definition: StorageOrder.h:84
ElementType_< MT > ElementType
Resulting element type.
Definition: DMatTransExpr.h:165
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3082
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:790
Header file for the IsComputation type trait class.
Header file for the IntegralConstant class template.
Compile time evaluation of the number of columns of a matrix.The Columns type trait evaluates the num...
Definition: Columns.h:75
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:75
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
Header file for the IsUpper type trait.
ResultType_< MT > TransposeType
Transpose type for expression template evaluations.
Definition: DMatTransExpr.h:164
Header file for the IsHermitian type trait.
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row/column.
Definition: DMatTransExpr.h:328
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatScalarMultExpr.h:557
System settings for the inline keywords.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatTransExpr.h:223