DMatTransposer.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATTRANSPOSER_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATTRANSPOSER_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
48 #include <blaze/math/Exception.h>
55 #include <blaze/system/Blocking.h>
56 #include <blaze/system/Inline.h>
57 #include <blaze/util/Assert.h>
58 #include <blaze/util/EnableIf.h>
60 #include <blaze/util/Types.h>
62 
63 
64 namespace blaze {
65 
66 //=================================================================================================
67 //
68 // CLASS DMATTRANSPOSER
69 //
70 //=================================================================================================
71 
72 //*************************************************************************************************
78 template< typename MT // Type of the dense matrix
79  , bool SO > // Storage order
80 class DMatTransposer : public DenseMatrix< DMatTransposer<MT,SO>, SO >
81 {
82  public:
83  //**Type definitions****************************************************************************
91  typedef const This& CompositeType;
98  //**********************************************************************************************
99 
100  //**Compilation flags***************************************************************************
102 
105  enum : bool { simdEnabled = MT::simdEnabled };
106 
108 
111  enum : bool { smpAssignable = MT::smpAssignable };
112  //**********************************************************************************************
113 
114  //**Constructor*********************************************************************************
119  explicit inline DMatTransposer( MT& dm ) noexcept
120  : dm_( dm ) // The dense matrix operand
121  {}
122  //**********************************************************************************************
123 
124  //**Access operator*****************************************************************************
131  inline Reference operator()( size_t i, size_t j ) {
132  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
133  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
134  return dm_(j,i);
135  }
136  //**********************************************************************************************
137 
138  //**Access operator*****************************************************************************
145  inline ConstReference operator()( size_t i, size_t j ) const {
146  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
147  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
148  return dm_(j,i);
149  }
150  //**********************************************************************************************
151 
152  //**At function*********************************************************************************
160  inline Reference at( size_t i, size_t j ) {
161  if( i >= dm_.columns() ) {
162  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
163  }
164  if( j >= dm_.rows() ) {
165  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
166  }
167  return (*this)(i,j);
168  }
169  //**********************************************************************************************
170 
171  //**At function*********************************************************************************
179  inline ConstReference at( size_t i, size_t j ) const {
180  if( i >= dm_.columns() ) {
181  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
182  }
183  if( j >= dm_.rows() ) {
184  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
185  }
186  return (*this)(i,j);
187  }
188  //**********************************************************************************************
189 
190  //**Low-level data access***********************************************************************
195  inline Pointer data() noexcept {
196  return dm_.data();
197  }
198  //**********************************************************************************************
199 
200  //**Low-level data access***********************************************************************
205  inline ConstPointer data() const noexcept {
206  return dm_.data();
207  }
208  //**********************************************************************************************
209 
210  //**Begin function******************************************************************************
221  inline Iterator begin( size_t i ) {
222  return dm_.begin( i );
223  }
224  //**********************************************************************************************
225 
226  //**Begin function******************************************************************************
237  inline ConstIterator begin( size_t i ) const {
238  return dm_.cbegin( i );
239  }
240  //**********************************************************************************************
241 
242  //**Cbegin function*****************************************************************************
253  inline ConstIterator cbegin( size_t i ) const {
254  return dm_.cbegin( i );
255  }
256  //**********************************************************************************************
257 
258  //**End function********************************************************************************
269  inline Iterator end( size_t i ) {
270  return dm_.end( i );
271  }
272  //**********************************************************************************************
273 
274  //**End function********************************************************************************
285  inline ConstIterator end( size_t i ) const {
286  return dm_.cend( i );
287  }
288  //**********************************************************************************************
289 
290  //**Cend function*******************************************************************************
301  inline ConstIterator cend( size_t i ) const {
302  return dm_.cend( i );
303  }
304  //**********************************************************************************************
305 
306  //**Multiplication assignment operator**********************************************************
313  template< typename Other > // Data type of the right-hand side scalar
315  {
316  (~dm_) *= rhs;
317  return *this;
318  }
319  //**********************************************************************************************
320 
321  //**Division assignment operator****************************************************************
330  template< typename Other > // Data type of the right-hand side scalar
332  {
333  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
334 
335  (~dm_) /= rhs;
336  return *this;
337  }
338  //**********************************************************************************************
339 
340  //**Rows function*******************************************************************************
345  inline size_t rows() const noexcept {
346  return dm_.columns();
347  }
348  //**********************************************************************************************
349 
350  //**Columns function****************************************************************************
355  inline size_t columns() const noexcept {
356  return dm_.rows();
357  }
358  //**********************************************************************************************
359 
360  //**Spacing function****************************************************************************
365  inline size_t spacing() const noexcept {
366  return dm_.spacing();
367  }
368  //**********************************************************************************************
369 
370  //**Reset function******************************************************************************
375  inline void reset() {
376  return dm_.reset();
377  }
378  //**********************************************************************************************
379 
380  //**IsIntact function***************************************************************************
385  inline bool isIntact() const noexcept {
386  using blaze::isIntact;
387  return isIntact( dm_ );
388  }
389  //**********************************************************************************************
390 
391  //**CanAliased function*************************************************************************
397  template< typename Other > // Data type of the foreign expression
398  inline bool canAlias( const Other* alias ) const noexcept
399  {
400  return dm_.canAlias( alias );
401  }
402  //**********************************************************************************************
403 
404  //**IsAliased function**************************************************************************
410  template< typename Other > // Data type of the foreign expression
411  inline bool isAliased( const Other* alias ) const noexcept
412  {
413  return dm_.isAliased( alias );
414  }
415  //**********************************************************************************************
416 
417  //**IsAligned function**************************************************************************
422  inline bool isAligned() const noexcept
423  {
424  return dm_.isAligned();
425  }
426  //**********************************************************************************************
427 
428  //**CanSMPAssign function***********************************************************************
433  inline bool canSMPAssign() const noexcept
434  {
435  return dm_.canSMPAssign();
436  }
437  //**********************************************************************************************
438 
439  //**Load function*******************************************************************************
450  BLAZE_ALWAYS_INLINE SIMDType load( size_t i, size_t j ) const noexcept
451  {
452  return dm_.load( j, i );
453  }
454  //**********************************************************************************************
455 
456  //**Loada function******************************************************************************
467  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept
468  {
469  return dm_.loada( j, i );
470  }
471  //**********************************************************************************************
472 
473  //**Loadu function******************************************************************************
484  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept
485  {
486  return dm_.loadu( j, i );
487  }
488  //**********************************************************************************************
489 
490  //**Store function******************************************************************************
502  BLAZE_ALWAYS_INLINE void store( size_t i, size_t j, const SIMDType& value ) noexcept
503  {
504  dm_.store( j, i, value );
505  }
506  //**********************************************************************************************
507 
508  //**Storea function******************************************************************************
520  BLAZE_ALWAYS_INLINE void storea( size_t i, size_t j, const SIMDType& value ) noexcept
521  {
522  dm_.storea( j, i, value );
523  }
524  //**********************************************************************************************
525 
526  //**Storeu function*****************************************************************************
538  BLAZE_ALWAYS_INLINE void storeu( size_t i, size_t j, const SIMDType& value ) noexcept
539  {
540  dm_.storeu( j, i, value );
541  }
542  //**********************************************************************************************
543 
544  //**Stream function*****************************************************************************
556  BLAZE_ALWAYS_INLINE void stream( size_t i, size_t j, const SIMDType& value ) noexcept
557  {
558  dm_.stream( j, i, value );
559  }
560  //**********************************************************************************************
561 
562  //**Transpose assignment of row-major dense matrices********************************************
573  template< typename MT2 > // Type of the right-hand side dense matrix
574  inline void assign( const DenseMatrix<MT2,SO>& rhs )
575  {
577 
578  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
579  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
580 
581  const size_t m( rows() );
582  const size_t n( columns() );
583 
584  const size_t jpos( n & size_t(-2) );
585  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jpos, "Invalid end calculation" );
586 
587  for( size_t i=0UL; i<m; ++i ) {
588  for( size_t j=0UL; j<jpos; j+=2UL ) {
589  dm_(j ,i) = (~rhs)(i,j );
590  dm_(j+1UL,i) = (~rhs)(i,j+1UL);
591  }
592  if( jpos < n ) {
593  dm_(jpos,i) = (~rhs)(i,jpos);
594  }
595  }
596  }
597  //**********************************************************************************************
598 
599  //**Transpose assignment of column-major dense matrices*****************************************
610  template< typename MT2 > // Type of the right-hand side dense matrix
611  inline void assign( const DenseMatrix<MT2,!SO>& rhs )
612  {
614 
615  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
616  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
617 
618  const size_t m( rows() );
619  const size_t n( columns() );
620  const size_t block( BLOCK_SIZE );
621 
622  for( size_t ii=0UL; ii<m; ii+=block ) {
623  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
624  for( size_t jj=0UL; jj<n; jj+=block ) {
625  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
626  for( size_t i=ii; i<iend; ++i ) {
627  for( size_t j=jj; j<jend; ++j ) {
628  dm_(j,i) = (~rhs)(i,j);
629  }
630  }
631  }
632  }
633  }
634  //**********************************************************************************************
635 
636  //**Transpose assignment of row-major sparse matrices*******************************************
647  template< typename MT2 > // Type of the right-hand side sparse matrix
648  inline void assign( const SparseMatrix<MT2,SO>& rhs )
649  {
651 
652  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
653  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
654 
655  typedef ConstIterator_<MT2> RhsConstIterator;
656 
657  for( size_t i=0UL; i<(~rhs).rows(); ++i )
658  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
659  dm_(element->index(),i) = element->value();
660  }
661  //**********************************************************************************************
662 
663  //**Transpose assignment of column-major sparse matrices****************************************
674  template< typename MT2 > // Type of the right-hand side sparse matrix
675  inline void assign( const SparseMatrix<MT2,!SO>& rhs )
676  {
678 
679  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
680  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
681 
682  typedef ConstIterator_<MT2> RhsConstIterator;
683 
684  for( size_t j=0UL; j<(~rhs).columns(); ++j )
685  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
686  dm_(j,element->index()) = element->value();
687  }
688  //**********************************************************************************************
689 
690  //**Transpose addition assignment of row-major dense matrices***********************************
701  template< typename MT2 > // Type of the right-hand side dense matrix
702  inline void addAssign( const DenseMatrix<MT2,SO>& rhs )
703  {
705 
706  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
707  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
708 
709  const size_t m( rows() );
710  const size_t n( columns() );
711 
712  const size_t jpos( n & size_t(-2) );
713  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jpos, "Invalid end calculation" );
714 
715  for( size_t i=0UL; i<m; ++i ) {
716  for( size_t j=0UL; j<jpos; j+=2UL ) {
717  dm_(j ,i) += (~rhs)(i,j );
718  dm_(j+1UL,i) += (~rhs)(i,j+1UL);
719 
720  }
721  if( jpos < n ) {
722  dm_(jpos,i) += (~rhs)(i,jpos);
723  }
724  }
725  }
726  //**********************************************************************************************
727 
728  //**Transpose addition assignment of column-major dense matrices********************************
739  template< typename MT2 > // Type of the right-hand side dense matrix
740  inline void addAssign( const DenseMatrix<MT2,!SO>& rhs )
741  {
743 
744  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
745  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
746 
747  const size_t m( rows() );
748  const size_t n( columns() );
749  const size_t block( BLOCK_SIZE );
750 
751  for( size_t ii=0UL; ii<m; ii+=block ) {
752  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
753  for( size_t jj=0UL; jj<n; jj+=block ) {
754  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
755  for( size_t i=ii; i<iend; ++i ) {
756  for( size_t j=jj; j<jend; ++j ) {
757  dm_(j,i) += (~rhs)(i,j);
758  }
759  }
760  }
761  }
762  }
763  //**********************************************************************************************
764 
765  //**Transpose addition assignment of row-major sparse matrices**********************************
776  template< typename MT2 > // Type of the right-hand side sparse matrix
777  inline void addAssign( const SparseMatrix<MT2,SO>& rhs )
778  {
780 
781  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
782  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
783 
784  typedef ConstIterator_<MT2> RhsConstIterator;
785 
786  for( size_t i=0UL; i<(~rhs).rows(); ++i )
787  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
788  dm_(element->index(),i) += element->value();
789  }
790  //**********************************************************************************************
791 
792  //**Transpose addition assignment of column-major sparse matrices*******************************
803  template< typename MT2 > // Type of the right-hand side sparse matrix
804  inline void addAssign( const SparseMatrix<MT2,!SO>& rhs )
805  {
807 
808  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
809  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
810 
811  typedef ConstIterator_<MT2> RhsConstIterator;
812 
813  for( size_t j=0UL; j<(~rhs).columns(); ++j )
814  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
815  dm_(j,element->index()) += element->value();
816  }
817  //**********************************************************************************************
818 
819  //**Transpose subtraction assignment of row-major dense matrices********************************
830  template< typename MT2 > // Type of the right-hand side dense matrix
831  inline void subAssign( const DenseMatrix<MT2,SO>& rhs )
832  {
834 
835  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
836  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
837 
838  const size_t m( rows() );
839  const size_t n( columns() );
840 
841  const size_t jpos( n & size_t(-2) );
842  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jpos, "Invalid end calculation" );
843 
844  for( size_t i=0UL; i<m; ++i ) {
845  for( size_t j=0UL; j<jpos; j+=2UL ) {
846  dm_(j ,i) -= (~rhs)(i,j );
847  dm_(j+1UL,i) -= (~rhs)(i,j+1UL);
848 
849  }
850  if( jpos < n ) {
851  dm_(jpos,i) -= (~rhs)(i,jpos);
852  }
853  }
854  }
855  //**********************************************************************************************
856 
857  //**Transpose subtraction assignment of column-major dense matrices*****************************
868  template< typename MT2 > // Type of the right-hand side dense matrix
869  inline void subAssign( const DenseMatrix<MT2,!SO>& rhs )
870  {
872 
873  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
874  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
875 
876  const size_t m( rows() );
877  const size_t n( columns() );
878  const size_t block( BLOCK_SIZE );
879 
880  for( size_t ii=0UL; ii<m; ii+=block ) {
881  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
882  for( size_t jj=0UL; jj<n; jj+=block ) {
883  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
884  for( size_t i=ii; i<iend; ++i ) {
885  for( size_t j=jj; j<jend; ++j ) {
886  dm_(j,i) -= (~rhs)(i,j);
887  }
888  }
889  }
890  }
891  }
892  //**********************************************************************************************
893 
894  //**Transpose subtraction assignment of row-major sparse matrices*******************************
905  template< typename MT2 > // Type of the right-hand side sparse matrix
906  inline void subAssign( const SparseMatrix<MT2,SO>& rhs )
907  {
909 
910  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
911  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
912 
913  typedef ConstIterator_<MT2> RhsConstIterator;
914 
915  for( size_t i=0UL; i<(~rhs).rows(); ++i )
916  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
917  dm_(element->index(),i) -= element->value();
918  }
919  //**********************************************************************************************
920 
921  //**Transpose subtraction assignment of column-major dense matrices*****************************
932  template< typename MT2 > // Type of the right-hand side sparse matrix
933  inline void subAssign( const SparseMatrix<MT2,!SO>& rhs )
934  {
936 
937  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
938  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
939 
940  typedef ConstIterator_<MT2> RhsConstIterator;
941 
942  for( size_t j=0UL; j<(~rhs).columns(); ++j )
943  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
944  dm_(j,element->index()) -= element->value();
945  }
946  //**********************************************************************************************
947 
948  //**Transpose multiplication assignment of dense matrices***************************************
949  // No special implementation for the transpose multiplication assignment of dense matrices.
950  //**********************************************************************************************
951 
952  //**Transpose multiplication assignment of sparse matrices**************************************
953  // No special implementation for the transpose multiplication assignment of sparse matrices.
954  //**********************************************************************************************
955 
956  private:
957  //**Member variables****************************************************************************
958  MT& dm_;
959  //**********************************************************************************************
960 
961  //**Compile time checks*************************************************************************
967  //**********************************************************************************************
968 };
969 //*************************************************************************************************
970 
971 
972 
973 
974 //=================================================================================================
975 //
976 // CLASS TEMPLATE SPECIALIZATION FOR ROW-MAJOR MATRICES
977 //
978 //=================================================================================================
979 
980 //*************************************************************************************************
988 template< typename MT > // Type of the dense matrix
989 class DMatTransposer<MT,true> : public DenseMatrix< DMatTransposer<MT,true>, true >
990 {
991  public:
992  //**Type definitions****************************************************************************
993  typedef DMatTransposer<MT,true> This;
997  typedef ElementType_<MT> ElementType;
999  typedef ReturnType_<MT> ReturnType;
1000  typedef const This& CompositeType;
1001  typedef Reference_<MT> Reference;
1003  typedef Pointer_<MT> Pointer;
1005  typedef Iterator_<MT> Iterator;
1007  //**********************************************************************************************
1008 
1009  //**Compilation flags***************************************************************************
1011 
1014  enum : bool { simdEnabled = MT::simdEnabled };
1015 
1017 
1020  enum : bool { smpAssignable = MT::smpAssignable };
1021  //**********************************************************************************************
1022 
1023  //**Constructor*********************************************************************************
1028  explicit inline DMatTransposer( MT& dm ) noexcept
1029  : dm_( dm ) // The dense matrix operand
1030  {}
1031  //**********************************************************************************************
1032 
1033  //**Access operator*****************************************************************************
1040  inline Reference operator()( size_t i, size_t j ) {
1041  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
1042  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
1043  return dm_(j,i);
1044  }
1045  //**********************************************************************************************
1046 
1047  //**Access operator*****************************************************************************
1054  inline ConstReference operator()( size_t i, size_t j ) const {
1055  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
1056  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
1057  return dm_(j,i);
1058  }
1059  //**********************************************************************************************
1060 
1061  //**At function*********************************************************************************
1069  inline Reference at( size_t i, size_t j ) {
1070  if( i >= dm_.columns() ) {
1071  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1072  }
1073  if( j >= dm_.rows() ) {
1074  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1075  }
1076  return (*this)(i,j);
1077  }
1078  //**********************************************************************************************
1079 
1080  //**At function*********************************************************************************
1088  inline ConstReference at( size_t i, size_t j ) const {
1089  if( i >= dm_.columns() ) {
1090  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1091  }
1092  if( j >= dm_.rows() ) {
1093  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1094  }
1095  return (*this)(i,j);
1096  }
1097  //**********************************************************************************************
1098 
1099  //**Low-level data access***********************************************************************
1104  inline Pointer data() noexcept {
1105  return dm_.data();
1106  }
1107  //**********************************************************************************************
1108 
1109  //**Low-level data access***********************************************************************
1114  inline ConstPointer data() const noexcept {
1115  return dm_.data();
1116  }
1117  //**********************************************************************************************
1118 
1119  //**Begin function******************************************************************************
1125  inline Iterator begin( size_t j ) {
1126  return dm_.begin(j);
1127  }
1128  //**********************************************************************************************
1129 
1130  //**Begin function******************************************************************************
1136  inline ConstIterator begin( size_t j ) const {
1137  return dm_.cbegin(j);
1138  }
1139  //**********************************************************************************************
1140 
1141  //**Cbegin function*****************************************************************************
1147  inline ConstIterator cbegin( size_t j ) const {
1148  return dm_.cbegin(j);
1149  }
1150  //**********************************************************************************************
1151 
1152  //**End function********************************************************************************
1158  inline Iterator end( size_t j ) {
1159  return dm_.end(j);
1160  }
1161  //**********************************************************************************************
1162 
1163  //**End function********************************************************************************
1169  inline ConstIterator end( size_t j ) const {
1170  return dm_.cend(j);
1171  }
1172  //**********************************************************************************************
1173 
1174  //**Cend function*******************************************************************************
1180  inline ConstIterator cend( size_t j ) const {
1181  return dm_.cend(j);
1182  }
1183  //**********************************************************************************************
1184 
1185  //**Multiplication assignment operator**********************************************************
1192  template< typename Other > // Data type of the right-hand side scalar
1193  inline EnableIf_< IsNumeric<Other>, DMatTransposer >& operator*=( Other rhs )
1194  {
1195  (~dm_) *= rhs;
1196  return *this;
1197  }
1198  //**********************************************************************************************
1199 
1200  //**Division assignment operator****************************************************************
1209  template< typename Other > // Data type of the right-hand side scalar
1210  inline EnableIf_< IsNumeric<Other>, DMatTransposer >& operator/=( Other rhs )
1211  {
1212  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
1213 
1214  (~dm_) /= rhs;
1215  return *this;
1216  }
1217  //**********************************************************************************************
1218 
1219  //**Rows function*******************************************************************************
1224  inline size_t rows() const noexcept {
1225  return dm_.columns();
1226  }
1227  //**********************************************************************************************
1228 
1229  //**Columns function****************************************************************************
1234  inline size_t columns() const noexcept {
1235  return dm_.rows();
1236  }
1237  //**********************************************************************************************
1238 
1239  //**Spacing function****************************************************************************
1244  inline size_t spacing() const noexcept {
1245  return dm_.spacing();
1246  }
1247  //**********************************************************************************************
1248 
1249  //**Reset function******************************************************************************
1254  inline void reset() {
1255  return dm_.reset();
1256  }
1257  //**********************************************************************************************
1258 
1259  //**IsIntact function***************************************************************************
1264  inline bool isIntact() const noexcept {
1265  using blaze::isIntact;
1266  return isIntact( dm_ );
1267  }
1268  //**********************************************************************************************
1269 
1270  //**CanAliased function*************************************************************************
1276  template< typename Other > // Data type of the foreign expression
1277  inline bool canAlias( const Other* alias ) const noexcept
1278  {
1279  return dm_.canAlias( alias );
1280  }
1281  //**********************************************************************************************
1282 
1283  //**IsAliased function**************************************************************************
1289  template< typename Other > // Data type of the foreign expression
1290  inline bool isAliased( const Other* alias ) const noexcept
1291  {
1292  return dm_.isAliased( alias );
1293  }
1294  //**********************************************************************************************
1295 
1296  //**IsAligned function**************************************************************************
1301  inline bool isAligned() const noexcept
1302  {
1303  return dm_.isAligned();
1304  }
1305  //**********************************************************************************************
1306 
1307  //**CanSMPAssign function***********************************************************************
1312  inline bool canSMPAssign() const noexcept
1313  {
1314  return dm_.canSMPAssign();
1315  }
1316  //**********************************************************************************************
1317 
1318  //**Load function*******************************************************************************
1329  BLAZE_ALWAYS_INLINE SIMDType load( size_t i, size_t j ) const noexcept
1330  {
1331  return dm_.load( j, i );
1332  }
1333  //**********************************************************************************************
1334 
1335  //**Loada function*******************************************************************************
1346  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept
1347  {
1348  return dm_.loada( j, i );
1349  }
1350  //**********************************************************************************************
1351 
1352  //**Loadu function******************************************************************************
1363  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept
1364  {
1365  return dm_.loadu( j, i );
1366  }
1367  //**********************************************************************************************
1368 
1369  //**Store function******************************************************************************
1381  BLAZE_ALWAYS_INLINE void store( size_t i, size_t j, const SIMDType& value ) noexcept
1382  {
1383  dm_.store( j, i, value );
1384  }
1385  //**********************************************************************************************
1386 
1387  //**Storea function******************************************************************************
1399  BLAZE_ALWAYS_INLINE void storea( size_t i, size_t j, const SIMDType& value ) noexcept
1400  {
1401  dm_.storea( j, i, value );
1402  }
1403  //**********************************************************************************************
1404 
1405  //**Storeu function*****************************************************************************
1417  BLAZE_ALWAYS_INLINE void storeu( size_t i, size_t j, const SIMDType& value ) noexcept
1418  {
1419  dm_.storeu( j, i, value );
1420  }
1421  //**********************************************************************************************
1422 
1423  //**Stream function*****************************************************************************
1435  BLAZE_ALWAYS_INLINE void stream( size_t i, size_t j, const SIMDType& value ) noexcept
1436  {
1437  dm_.stream( j, i, value );
1438  }
1439  //**********************************************************************************************
1440 
1441  //**Transpose assignment of column-major dense matrices*****************************************
1452  template< typename MT2 > // Type of the right-hand side dense matrix
1453  inline void assign( const DenseMatrix<MT2,true>& rhs )
1454  {
1456 
1457  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1458  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1459 
1460  const size_t m( rows() );
1461  const size_t n( columns() );
1462 
1463  const size_t ipos( m & size_t(-2) );
1464  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == ipos, "Invalid end calculation" );
1465 
1466  for( size_t j=0UL; j<n; ++j ) {
1467  for( size_t i=0UL; i<ipos; i+=2UL ) {
1468  dm_(j,i ) = (~rhs)(i ,j);
1469  dm_(j,i+1UL) = (~rhs)(i+1UL,j);
1470  }
1471  if( ipos < m ) {
1472  dm_(j,ipos) = (~rhs)(ipos,j);
1473  }
1474  }
1475  }
1476  //**********************************************************************************************
1477 
1478  //**Transpose assignment of row-major dense matrices********************************************
1489  template< typename MT2 > // Type of the right-hand side dense matrix
1490  inline void assign( const DenseMatrix<MT2,false>& rhs )
1491  {
1493 
1494  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1495  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1496 
1497  const size_t m( rows() );
1498  const size_t n( columns() );
1499  const size_t block( BLOCK_SIZE );
1500 
1501  for( size_t jj=0UL; jj<n; jj+=block ) {
1502  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
1503  for( size_t ii=0UL; ii<m; ii+=block ) {
1504  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
1505  for( size_t j=jj; j<jend; ++j ) {
1506  for( size_t i=ii; i<iend; ++i ) {
1507  dm_(j,i) = (~rhs)(i,j);
1508  }
1509  }
1510  }
1511  }
1512  }
1513  //**********************************************************************************************
1514 
1515  //**Transpose assignment of column-major sparse matrices****************************************
1526  template< typename MT2 > // Type of the right-hand side sparse matrix
1527  inline void assign( const SparseMatrix<MT2,true>& rhs )
1528  {
1530 
1531  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1532  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1533 
1534  typedef ConstIterator_<MT2> RhsConstIterator;
1535 
1536  for( size_t j=0UL; j<(~rhs).columns(); ++j )
1537  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
1538  dm_(j,element->index()) = element->value();
1539  }
1540  //**********************************************************************************************
1541 
1542  //**Transpose assignment of row-major sparse matrices*******************************************
1553  template< typename MT2 > // Type of the right-hand side sparse matrix
1554  inline void assign( const SparseMatrix<MT2,false>& rhs )
1555  {
1557 
1558  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1559  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1560 
1561  typedef ConstIterator_<MT2> RhsConstIterator;
1562 
1563  for( size_t i=0UL; i<(~rhs).rows(); ++i )
1564  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
1565  dm_(element->index(),i) = element->value();
1566  }
1567  //**********************************************************************************************
1568 
1569  //**Transpose addition assignment of column-major dense matrices********************************
1580  template< typename MT2 > // Type of the right-hand side dense matrix
1581  inline void addAssign( const DenseMatrix<MT2,true>& rhs )
1582  {
1584 
1585  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1586  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1587 
1588  const size_t m( rows() );
1589  const size_t n( columns() );
1590 
1591  const size_t ipos( m & size_t(-2) );
1592  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == ipos, "Invalid end calculation" );
1593 
1594  for( size_t j=0UL; j<n; ++j ) {
1595  for( size_t i=0UL; i<ipos; i+=2UL ) {
1596  dm_(j,i ) += (~rhs)(i ,j);
1597  dm_(j,i+1UL) += (~rhs)(i+1UL,j);
1598  }
1599  if( ipos < m ) {
1600  dm_(j,ipos) += (~rhs)(ipos,j);
1601  }
1602  }
1603  }
1604  //**********************************************************************************************
1605 
1606  //**Transpose addition assignment of row-major dense matrices***********************************
1617  template< typename MT2 > // Type of the right-hand side dense matrix
1618  inline void addAssign( const DenseMatrix<MT2,false>& rhs )
1619  {
1621 
1622  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1623  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1624 
1625  const size_t m( rows() );
1626  const size_t n( columns() );
1627  const size_t block( BLOCK_SIZE );
1628 
1629  for( size_t jj=0UL; jj<n; jj+=block ) {
1630  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
1631  for( size_t ii=0UL; ii<m; ii+=block ) {
1632  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
1633  for( size_t j=jj; j<jend; ++j ) {
1634  for( size_t i=ii; i<iend; ++i ) {
1635  dm_(j,i) += (~rhs)(i,j);
1636  }
1637  }
1638  }
1639  }
1640  }
1641  //**********************************************************************************************
1642 
1643  //**Transpose addition assignment of column-major sparse matrices*******************************
1654  template< typename MT2 > // Type of the right-hand side sparse matrix
1655  inline void addAssign( const SparseMatrix<MT2,true>& rhs )
1656  {
1658 
1659  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1660  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1661 
1662  typedef ConstIterator_<MT2> RhsConstIterator;
1663 
1664  for( size_t j=0UL; j<(~rhs).columns(); ++j )
1665  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
1666  dm_(j,element->index()) += element->value();
1667  }
1668  //**********************************************************************************************
1669 
1670  //**Transpose addition assignment of row-major sparse matrices**********************************
1681  template< typename MT2 > // Type of the right-hand side sparse matrix
1682  inline void addAssign( const SparseMatrix<MT2,false>& rhs )
1683  {
1685 
1686  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1687  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1688 
1689  typedef ConstIterator_<MT2> RhsConstIterator;
1690 
1691  for( size_t i=0UL; i<(~rhs).rows(); ++i )
1692  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
1693  dm_(element->index(),i) += element->value();
1694  }
1695  //**********************************************************************************************
1696 
1697  //**Transpose subtraction assignment of column-major dense matrices*****************************
1708  template< typename MT2 > // Type of the right-hand side dense matrix
1709  inline void subAssign( const DenseMatrix<MT2,true>& rhs )
1710  {
1712 
1713  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1714  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1715 
1716  const size_t m( rows() );
1717  const size_t n( columns() );
1718 
1719  const size_t ipos( m & size_t(-2) );
1720  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == ipos, "Invalid end calculation" );
1721 
1722  for( size_t j=0UL; j<n; ++j ) {
1723  for( size_t i=0UL; i<ipos; i+=2UL ) {
1724  dm_(j,i ) -= (~rhs)(i ,j);
1725  dm_(j,i+1UL) -= (~rhs)(i+1UL,j);
1726  }
1727  if( ipos < m ) {
1728  dm_(j,ipos) -= (~rhs)(ipos,j);
1729  }
1730  }
1731  }
1732  //**********************************************************************************************
1733 
1734  //**Transpose subtraction assignment of row-major dense matrices********************************
1745  template< typename MT2 > // Type of the right-hand side dense matrix
1746  inline void subAssign( const DenseMatrix<MT2,false>& rhs )
1747  {
1749 
1750  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1751  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1752 
1753  const size_t m( rows() );
1754  const size_t n( columns() );
1755  const size_t block( BLOCK_SIZE );
1756 
1757  for( size_t jj=0UL; jj<n; jj+=block ) {
1758  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
1759  for( size_t ii=0UL; ii<m; ii+=block ) {
1760  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
1761  for( size_t j=jj; j<jend; ++j ) {
1762  for( size_t i=ii; i<iend; ++i ) {
1763  dm_(j,i) -= (~rhs)(i,j);
1764  }
1765  }
1766  }
1767  }
1768  }
1769  //**********************************************************************************************
1770 
1771  //**Transpose subtraction assignment of column-major sparse matrices****************************
1782  template< typename MT2 > // Type of the right-hand side sparse matrix
1783  inline void subAssign( const SparseMatrix<MT2,true>& rhs )
1784  {
1786 
1787  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1788  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1789 
1790  typedef ConstIterator_<MT2> RhsConstIterator;
1791 
1792  for( size_t j=0UL; j<(~rhs).columns(); ++j )
1793  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
1794  dm_(j,element->index()) -= element->value();
1795  }
1796  //**********************************************************************************************
1797 
1798  //**Transpose subtraction assignment of row-major dense matrices********************************
1809  template< typename MT2 > // Type of the right-hand side sparse matrix
1810  inline void subAssign( const SparseMatrix<MT2,false>& rhs )
1811  {
1813 
1814  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1815  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1816 
1817  typedef ConstIterator_<MT2> RhsConstIterator;
1818 
1819  for( size_t i=0UL; i<(~rhs).rows(); ++i )
1820  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
1821  dm_(element->index(),i) -= element->value();
1822  }
1823  //**********************************************************************************************
1824 
1825  //**Transpose multiplication assignment of dense matrices***************************************
1826  // No special implementation for the transpose multiplication assignment of dense matrices.
1827  //**********************************************************************************************
1828 
1829  //**Transpose multiplication assignment of sparse matrices**************************************
1830  // No special implementation for the transpose multiplication assignment of sparse matrices.
1831  //**********************************************************************************************
1832 
1833  private:
1834  //**Member variables****************************************************************************
1835  MT& dm_;
1836  //**********************************************************************************************
1837 
1838  //**Compile time checks*************************************************************************
1844  //**********************************************************************************************
1845 };
1847 //*************************************************************************************************
1848 
1849 
1850 
1851 
1852 //=================================================================================================
1853 //
1854 // GLOBAL OPERATORS
1855 //
1856 //=================================================================================================
1857 
1858 //*************************************************************************************************
1866 template< typename MT // Type of the dense matrix
1867  , bool SO > // Storage order
1868 inline void reset( DMatTransposer<MT,SO>& m )
1869 {
1870  m.reset();
1871 }
1873 //*************************************************************************************************
1874 
1875 
1876 //*************************************************************************************************
1884 template< typename MT // Type of the dense matrix
1885  , bool SO > // Storage order
1886 inline bool isIntact( const DMatTransposer<MT,SO>& m ) noexcept
1887 {
1888  return m.isIntact();
1889 }
1891 //*************************************************************************************************
1892 
1893 
1894 
1895 
1896 //=================================================================================================
1897 //
1898 // HASMUTABLEDATAACCESS SPECIALIZATIONS
1899 //
1900 //=================================================================================================
1901 
1902 //*************************************************************************************************
1904 template< typename MT, bool SO >
1905 struct HasMutableDataAccess< DMatTransposer<MT,SO> >
1906  : public BoolConstant< HasMutableDataAccess<MT>::value >
1907 {};
1909 //*************************************************************************************************
1910 
1911 
1912 
1913 
1914 //=================================================================================================
1915 //
1916 // ISALIGNED SPECIALIZATIONS
1917 //
1918 //=================================================================================================
1919 
1920 //*************************************************************************************************
1922 template< typename MT, bool SO >
1923 struct IsAligned< DMatTransposer<MT,SO> >
1924  : public BoolConstant< IsAligned<MT>::value >
1925 {};
1927 //*************************************************************************************************
1928 
1929 
1930 
1931 
1932 //=================================================================================================
1933 //
1934 // ISPADDED SPECIALIZATIONS
1935 //
1936 //=================================================================================================
1937 
1938 //*************************************************************************************************
1940 template< typename MT, bool SO >
1941 struct IsPadded< DMatTransposer<MT,SO> >
1942  : public BoolConstant< IsPadded<MT>::value >
1943 {};
1945 //*************************************************************************************************
1946 
1947 
1948 
1949 
1950 //=================================================================================================
1951 //
1952 // SUBMATRIXTRAIT SPECIALIZATIONS
1953 //
1954 //=================================================================================================
1955 
1956 //*************************************************************************************************
1958 template< typename MT, bool SO >
1959 struct SubmatrixTrait< DMatTransposer<MT,SO> >
1960 {
1961  using Type = SubmatrixTrait_< ResultType_< DMatTransposer<MT,SO> > >;
1962 };
1964 //*************************************************************************************************
1965 
1966 } // namespace blaze
1967 
1968 #endif
Pointer_< MT > Pointer
Pointer to a non-constant matrix value.
Definition: DMatTransposer.h:94
ConstReference operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatTransposer.h:145
Constraint on the data type.
BLAZE_ALWAYS_INLINE void storea(size_t i, size_t j, const SIMDType &value) noexcept
Aligned store of a SIMD element of the matrix.
Definition: DMatTransposer.h:520
Header file for auxiliary alias declarations.
void addAssign(const SparseMatrix< MT2, SO > &rhs)
Implementation of the transpose addition assignment of a row-major sparse matrix. ...
Definition: DMatTransposer.h:777
Header file for kernel specific block sizes.
size_t spacing() const noexcept
Returns the spacing between the beginning of two rows.
Definition: DMatTransposer.h:365
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
DMatTransposer< MT, SO > This
Type of this DMatTransposer instance.
Definition: DMatTransposer.h:84
BLAZE_ALWAYS_INLINE void storeu(size_t i, size_t j, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the matrix.
Definition: DMatTransposer.h:538
Header file for basic type definitions.
DMatTransposer(MT &dm) noexcept
Constructor for the DMatTransposer class.
Definition: DMatTransposer.h:119
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatTransposer.h:285
OppositeType_< MT > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatTransposer.h:86
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i...
Definition: Computation.h:81
#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
BLAZE_ALWAYS_INLINE SIMDType loada(size_t i, size_t j) const noexcept
Aligned load of a SIMD element of the matrix.
Definition: DMatTransposer.h:467
bool isIntact() const noexcept
Returns whether the invariants of the matrix are intact.
Definition: DMatTransposer.h:385
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:315
void subAssign(const SparseMatrix< MT2,!SO > &rhs)
Implementation of the transpose subtraction assignment of a column-major sparse matrix.
Definition: DMatTransposer.h:933
ConstIterator_< MT > ConstIterator
Iterator over constant elements.
Definition: DMatTransposer.h:97
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
Constraints on the storage order of matrix types.
Reference_< MT > Reference
Reference to a non-constant matrix value.
Definition: DMatTransposer.h:92
ConstReference_< MT > ConstReference
Reference to a constant matrix value.
Definition: DMatTransposer.h:93
void addAssign(const DenseMatrix< MT2, SO > &rhs)
Implementation of the transpose addition assignment of a row-major dense matrix.
Definition: DMatTransposer.h:702
Header file for the SIMD trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
Pointer data() noexcept
Low-level data access to the matrix elements.
Definition: DMatTransposer.h:195
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatTransposer.h:355
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: DMatTransposer.h:398
const This & CompositeType
Data type for composite expression templates.
Definition: DMatTransposer.h:91
Constraint on the data type.
typename T::Pointer Pointer_
Alias declaration for nested Pointer type definitions.The Pointer_ alias declaration provides a conve...
Definition: Aliases.h:263
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
void subAssign(const DenseMatrix< MT2, SO > &rhs)
Implementation of the transpose subtraction assignment of a row-major dense matrix.
Definition: DMatTransposer.h:831
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: ColumnMajorMatrix.h:61
Reference operator()(size_t i, size_t j)
2D-access to the matrix elements.
Definition: DMatTransposer.h:131
ElementType_< MT > ElementType
Type of the matrix elements.
Definition: DMatTransposer.h:88
#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.
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
ResultType_< MT > TransposeType
Transpose type for expression template evaluations.
Definition: DMatTransposer.h:87
Expression object for the transposition of a dense matrix.The DMatTransposer class is a wrapper objec...
Definition: DMatTransposer.h:80
bool isAligned() const noexcept
Returns whether the matrix is properly aligned in memory.
Definition: DMatTransposer.h:422
MT & dm_
The dense matrix operand.
Definition: DMatTransposer.h:958
Header file for the IsAligned type trait.
Header file for the exception macros of the math module.
EnableIf_< IsNumeric< Other >, DMatTransposer > & operator/=(Other rhs)
Division assignment operator for the division of a matrix by a scalar value ( ).
Definition: DMatTransposer.h:331
void assign(const SparseMatrix< MT2,!SO > &rhs)
Implementation of the transpose assignment of a column-major sparse matrix.
Definition: DMatTransposer.h:675
void reset()
Resets the matrix elements.
Definition: DMatTransposer.h:375
BLAZE_ALWAYS_INLINE void store(size_t i, size_t j, const SIMDType &value) noexcept
Store of a SIMD element of the matrix.
Definition: DMatTransposer.h:502
typename T::Reference Reference_
Alias declaration for nested Reference type definitions.The Reference_ alias declaration provides a c...
Definition: Aliases.h:283
BLAZE_ALWAYS_INLINE void stream(size_t i, size_t j, const SIMDType &value) noexcept
Aligned, non-temporal store of a SIMD element of the matrix.
Definition: DMatTransposer.h:556
Header file for the EnableIf class template.
void assign(const DenseMatrix< MT2,!SO > &rhs)
Implementation of the transpose assignment of a column-major dense matrix.
Definition: DMatTransposer.h:611
Header file for the IsPadded type trait.
SIMDTrait_< ElementType > SIMDType
SIMD type of the matrix elements.
Definition: DMatTransposer.h:89
Iterator_< MT > Iterator
Iterator over non-constant elements.
Definition: DMatTransposer.h:96
void assign(const DenseMatrix< MT2, SO > &rhs)
Implementation of the transpose assignment of a row-major dense matrix.
Definition: DMatTransposer.h:574
Header file for the IsNumeric type trait.
void subAssign(const SparseMatrix< MT2, SO > &rhs)
Implementation of the transpose subtraction assignment of a row-major sparse matrix.
Definition: DMatTransposer.h:906
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: RowMajorMatrix.h:61
Header file for run time assertion macros.
void subAssign(const DenseMatrix< MT2,!SO > &rhs)
Implementation of the transpose subtraction assignment of a column-major dense matrix.
Definition: DMatTransposer.h:869
Header file for the submatrix trait.
ConstPointer_< MT > ConstPointer
Pointer to a constant matrix value.
Definition: DMatTransposer.h:95
ConstIterator cend(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatTransposer.h:301
void addAssign(const DenseMatrix< MT2,!SO > &rhs)
Implementation of the transpose addition assignment of a column-major dense matrix.
Definition: DMatTransposer.h:740
ConstIterator cbegin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatTransposer.h:253
BLAZE_ALWAYS_INLINE SIMDType load(size_t i, size_t j) const noexcept
Load of a SIMD element of the matrix.
Definition: DMatTransposer.h:450
EnableIf_< IsNumeric< Other >, DMatTransposer > & operator*=(Other rhs)
Multiplication assignment operator for the multiplication between a matrix and a scalar value ( )...
Definition: DMatTransposer.h:314
bool canSMPAssign() const noexcept
Returns whether the matrix can be used in SMP assignments.
Definition: DMatTransposer.h:433
ConstReference at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatTransposer.h:179
Constraints on the storage order of matrix types.
TransposeType_< MT > ResultType
Result type for expression template evaluations.
Definition: DMatTransposer.h:85
Header file for the HasMutableDataAccess type trait.
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
typename T::Iterator Iterator_
Alias declaration for nested Iterator type definitions.The Iterator_ alias declaration provides a con...
Definition: Aliases.h:183
typename T::ConstPointer ConstPointer_
Alias declaration for nested ConstPointer type definitions.The ConstPointer_ alias declaration provid...
Definition: Aliases.h:123
typename T::ConstReference ConstReference_
Alias declaration for nested ConstReference type definitions.The ConstReference_ alias declaration pr...
Definition: Aliases.h:143
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
void addAssign(const SparseMatrix< MT2,!SO > &rhs)
Implementation of the transpose addition assignment of a column-major sparse matrix.
Definition: DMatTransposer.h:804
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: DMatTransposer.h:160
Iterator begin(size_t i)
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatTransposer.h:221
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatTransposer.h:345
ConstPointer data() const noexcept
Low-level data access to the matrix elements.
Definition: DMatTransposer.h:205
void assign(const SparseMatrix< MT2, SO > &rhs)
Implementation of the transpose assignment of a row-major sparse matrix.
Definition: DMatTransposer.h:648
Header file for the IntegralConstant class template.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
ReturnType_< MT > ReturnType
Return type for expression template evaluations.
Definition: DMatTransposer.h:90
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: DMatTransposer.h:411
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
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t i, size_t j) const noexcept
Unaligned load of a SIMD element of the matrix.
Definition: DMatTransposer.h:484
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatTransposer.h:237
Iterator end(size_t i)
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatTransposer.h:269