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  constexpr size_t block( BLOCK_SIZE );
619 
620  const size_t m( rows() );
621  const size_t n( columns() );
622 
623  for( size_t ii=0UL; ii<m; ii+=block ) {
624  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
625  for( size_t jj=0UL; jj<n; jj+=block ) {
626  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
627  for( size_t i=ii; i<iend; ++i ) {
628  for( size_t j=jj; j<jend; ++j ) {
629  dm_(j,i) = (~rhs)(i,j);
630  }
631  }
632  }
633  }
634  }
635  //**********************************************************************************************
636 
637  //**Transpose assignment of row-major sparse matrices*******************************************
648  template< typename MT2 > // Type of the right-hand side sparse matrix
649  inline void assign( const SparseMatrix<MT2,SO>& rhs )
650  {
652 
653  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
654  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
655 
656  typedef ConstIterator_<MT2> RhsConstIterator;
657 
658  for( size_t i=0UL; i<(~rhs).rows(); ++i )
659  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
660  dm_(element->index(),i) = element->value();
661  }
662  //**********************************************************************************************
663 
664  //**Transpose assignment of column-major sparse matrices****************************************
675  template< typename MT2 > // Type of the right-hand side sparse matrix
676  inline void assign( const SparseMatrix<MT2,!SO>& rhs )
677  {
679 
680  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
681  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
682 
683  typedef ConstIterator_<MT2> RhsConstIterator;
684 
685  for( size_t j=0UL; j<(~rhs).columns(); ++j )
686  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
687  dm_(j,element->index()) = element->value();
688  }
689  //**********************************************************************************************
690 
691  //**Transpose addition assignment of row-major dense matrices***********************************
702  template< typename MT2 > // Type of the right-hand side dense matrix
703  inline void addAssign( const DenseMatrix<MT2,SO>& rhs )
704  {
706 
707  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
708  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
709 
710  const size_t m( rows() );
711  const size_t n( columns() );
712 
713  const size_t jpos( n & size_t(-2) );
714  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jpos, "Invalid end calculation" );
715 
716  for( size_t i=0UL; i<m; ++i ) {
717  for( size_t j=0UL; j<jpos; j+=2UL ) {
718  dm_(j ,i) += (~rhs)(i,j );
719  dm_(j+1UL,i) += (~rhs)(i,j+1UL);
720 
721  }
722  if( jpos < n ) {
723  dm_(jpos,i) += (~rhs)(i,jpos);
724  }
725  }
726  }
727  //**********************************************************************************************
728 
729  //**Transpose addition assignment of column-major dense matrices********************************
740  template< typename MT2 > // Type of the right-hand side dense matrix
741  inline void addAssign( const DenseMatrix<MT2,!SO>& rhs )
742  {
744 
745  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
746  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
747 
748  constexpr size_t block( BLOCK_SIZE );
749 
750  const size_t m( rows() );
751  const size_t n( columns() );
752 
753  for( size_t ii=0UL; ii<m; ii+=block ) {
754  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
755  for( size_t jj=0UL; jj<n; jj+=block ) {
756  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
757  for( size_t i=ii; i<iend; ++i ) {
758  for( size_t j=jj; j<jend; ++j ) {
759  dm_(j,i) += (~rhs)(i,j);
760  }
761  }
762  }
763  }
764  }
765  //**********************************************************************************************
766 
767  //**Transpose addition assignment of row-major sparse matrices**********************************
778  template< typename MT2 > // Type of the right-hand side sparse matrix
779  inline void addAssign( const SparseMatrix<MT2,SO>& rhs )
780  {
782 
783  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
784  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
785 
786  typedef ConstIterator_<MT2> RhsConstIterator;
787 
788  for( size_t i=0UL; i<(~rhs).rows(); ++i )
789  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
790  dm_(element->index(),i) += element->value();
791  }
792  //**********************************************************************************************
793 
794  //**Transpose addition assignment of column-major sparse matrices*******************************
805  template< typename MT2 > // Type of the right-hand side sparse matrix
806  inline void addAssign( const SparseMatrix<MT2,!SO>& rhs )
807  {
809 
810  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
811  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
812 
813  typedef ConstIterator_<MT2> RhsConstIterator;
814 
815  for( size_t j=0UL; j<(~rhs).columns(); ++j )
816  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
817  dm_(j,element->index()) += element->value();
818  }
819  //**********************************************************************************************
820 
821  //**Transpose subtraction assignment of row-major dense matrices********************************
832  template< typename MT2 > // Type of the right-hand side dense matrix
833  inline void subAssign( const DenseMatrix<MT2,SO>& rhs )
834  {
836 
837  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
838  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
839 
840  const size_t m( rows() );
841  const size_t n( columns() );
842 
843  const size_t jpos( n & size_t(-2) );
844  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jpos, "Invalid end calculation" );
845 
846  for( size_t i=0UL; i<m; ++i ) {
847  for( size_t j=0UL; j<jpos; j+=2UL ) {
848  dm_(j ,i) -= (~rhs)(i,j );
849  dm_(j+1UL,i) -= (~rhs)(i,j+1UL);
850 
851  }
852  if( jpos < n ) {
853  dm_(jpos,i) -= (~rhs)(i,jpos);
854  }
855  }
856  }
857  //**********************************************************************************************
858 
859  //**Transpose subtraction assignment of column-major dense matrices*****************************
870  template< typename MT2 > // Type of the right-hand side dense matrix
871  inline void subAssign( const DenseMatrix<MT2,!SO>& rhs )
872  {
874 
875  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
876  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
877 
878  constexpr size_t block( BLOCK_SIZE );
879 
880  const size_t m( rows() );
881  const size_t n( columns() );
882 
883  for( size_t ii=0UL; ii<m; ii+=block ) {
884  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
885  for( size_t jj=0UL; jj<n; jj+=block ) {
886  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
887  for( size_t i=ii; i<iend; ++i ) {
888  for( size_t j=jj; j<jend; ++j ) {
889  dm_(j,i) -= (~rhs)(i,j);
890  }
891  }
892  }
893  }
894  }
895  //**********************************************************************************************
896 
897  //**Transpose subtraction assignment of row-major sparse matrices*******************************
908  template< typename MT2 > // Type of the right-hand side sparse matrix
909  inline void subAssign( const SparseMatrix<MT2,SO>& rhs )
910  {
912 
913  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
914  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
915 
916  typedef ConstIterator_<MT2> RhsConstIterator;
917 
918  for( size_t i=0UL; i<(~rhs).rows(); ++i )
919  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
920  dm_(element->index(),i) -= element->value();
921  }
922  //**********************************************************************************************
923 
924  //**Transpose subtraction assignment of column-major dense matrices*****************************
935  template< typename MT2 > // Type of the right-hand side sparse matrix
936  inline void subAssign( const SparseMatrix<MT2,!SO>& rhs )
937  {
939 
940  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
941  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
942 
943  typedef ConstIterator_<MT2> RhsConstIterator;
944 
945  for( size_t j=0UL; j<(~rhs).columns(); ++j )
946  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
947  dm_(j,element->index()) -= element->value();
948  }
949  //**********************************************************************************************
950 
951  //**Transpose multiplication assignment of dense matrices***************************************
952  // No special implementation for the transpose multiplication assignment of dense matrices.
953  //**********************************************************************************************
954 
955  //**Transpose multiplication assignment of sparse matrices**************************************
956  // No special implementation for the transpose multiplication assignment of sparse matrices.
957  //**********************************************************************************************
958 
959  private:
960  //**Member variables****************************************************************************
961  MT& dm_;
962  //**********************************************************************************************
963 
964  //**Compile time checks*************************************************************************
970  //**********************************************************************************************
971 };
972 //*************************************************************************************************
973 
974 
975 
976 
977 //=================================================================================================
978 //
979 // CLASS TEMPLATE SPECIALIZATION FOR ROW-MAJOR MATRICES
980 //
981 //=================================================================================================
982 
983 //*************************************************************************************************
991 template< typename MT > // Type of the dense matrix
992 class DMatTransposer<MT,true> : public DenseMatrix< DMatTransposer<MT,true>, true >
993 {
994  public:
995  //**Type definitions****************************************************************************
996  typedef DMatTransposer<MT,true> This;
1000  typedef ElementType_<MT> ElementType;
1002  typedef ReturnType_<MT> ReturnType;
1003  typedef const This& CompositeType;
1004  typedef Reference_<MT> Reference;
1006  typedef Pointer_<MT> Pointer;
1008  typedef Iterator_<MT> Iterator;
1010  //**********************************************************************************************
1011 
1012  //**Compilation flags***************************************************************************
1014 
1017  enum : bool { simdEnabled = MT::simdEnabled };
1018 
1020 
1023  enum : bool { smpAssignable = MT::smpAssignable };
1024  //**********************************************************************************************
1025 
1026  //**Constructor*********************************************************************************
1031  explicit inline DMatTransposer( MT& dm ) noexcept
1032  : dm_( dm ) // The dense matrix operand
1033  {}
1034  //**********************************************************************************************
1035 
1036  //**Access operator*****************************************************************************
1043  inline Reference operator()( size_t i, size_t j ) {
1044  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
1045  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
1046  return dm_(j,i);
1047  }
1048  //**********************************************************************************************
1049 
1050  //**Access operator*****************************************************************************
1057  inline ConstReference operator()( size_t i, size_t j ) const {
1058  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
1059  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
1060  return dm_(j,i);
1061  }
1062  //**********************************************************************************************
1063 
1064  //**At function*********************************************************************************
1072  inline Reference at( size_t i, size_t j ) {
1073  if( i >= dm_.columns() ) {
1074  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1075  }
1076  if( j >= dm_.rows() ) {
1077  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1078  }
1079  return (*this)(i,j);
1080  }
1081  //**********************************************************************************************
1082 
1083  //**At function*********************************************************************************
1091  inline ConstReference at( size_t i, size_t j ) const {
1092  if( i >= dm_.columns() ) {
1093  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1094  }
1095  if( j >= dm_.rows() ) {
1096  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1097  }
1098  return (*this)(i,j);
1099  }
1100  //**********************************************************************************************
1101 
1102  //**Low-level data access***********************************************************************
1107  inline Pointer data() noexcept {
1108  return dm_.data();
1109  }
1110  //**********************************************************************************************
1111 
1112  //**Low-level data access***********************************************************************
1117  inline ConstPointer data() const noexcept {
1118  return dm_.data();
1119  }
1120  //**********************************************************************************************
1121 
1122  //**Begin function******************************************************************************
1128  inline Iterator begin( size_t j ) {
1129  return dm_.begin(j);
1130  }
1131  //**********************************************************************************************
1132 
1133  //**Begin function******************************************************************************
1139  inline ConstIterator begin( size_t j ) const {
1140  return dm_.cbegin(j);
1141  }
1142  //**********************************************************************************************
1143 
1144  //**Cbegin function*****************************************************************************
1150  inline ConstIterator cbegin( size_t j ) const {
1151  return dm_.cbegin(j);
1152  }
1153  //**********************************************************************************************
1154 
1155  //**End function********************************************************************************
1161  inline Iterator end( size_t j ) {
1162  return dm_.end(j);
1163  }
1164  //**********************************************************************************************
1165 
1166  //**End function********************************************************************************
1172  inline ConstIterator end( size_t j ) const {
1173  return dm_.cend(j);
1174  }
1175  //**********************************************************************************************
1176 
1177  //**Cend function*******************************************************************************
1183  inline ConstIterator cend( size_t j ) const {
1184  return dm_.cend(j);
1185  }
1186  //**********************************************************************************************
1187 
1188  //**Multiplication assignment operator**********************************************************
1195  template< typename Other > // Data type of the right-hand side scalar
1196  inline EnableIf_< IsNumeric<Other>, DMatTransposer >& operator*=( Other rhs )
1197  {
1198  (~dm_) *= rhs;
1199  return *this;
1200  }
1201  //**********************************************************************************************
1202 
1203  //**Division assignment operator****************************************************************
1212  template< typename Other > // Data type of the right-hand side scalar
1213  inline EnableIf_< IsNumeric<Other>, DMatTransposer >& operator/=( Other rhs )
1214  {
1215  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
1216 
1217  (~dm_) /= rhs;
1218  return *this;
1219  }
1220  //**********************************************************************************************
1221 
1222  //**Rows function*******************************************************************************
1227  inline size_t rows() const noexcept {
1228  return dm_.columns();
1229  }
1230  //**********************************************************************************************
1231 
1232  //**Columns function****************************************************************************
1237  inline size_t columns() const noexcept {
1238  return dm_.rows();
1239  }
1240  //**********************************************************************************************
1241 
1242  //**Spacing function****************************************************************************
1247  inline size_t spacing() const noexcept {
1248  return dm_.spacing();
1249  }
1250  //**********************************************************************************************
1251 
1252  //**Reset function******************************************************************************
1257  inline void reset() {
1258  return dm_.reset();
1259  }
1260  //**********************************************************************************************
1261 
1262  //**IsIntact function***************************************************************************
1267  inline bool isIntact() const noexcept {
1268  using blaze::isIntact;
1269  return isIntact( dm_ );
1270  }
1271  //**********************************************************************************************
1272 
1273  //**CanAliased function*************************************************************************
1279  template< typename Other > // Data type of the foreign expression
1280  inline bool canAlias( const Other* alias ) const noexcept
1281  {
1282  return dm_.canAlias( alias );
1283  }
1284  //**********************************************************************************************
1285 
1286  //**IsAliased function**************************************************************************
1292  template< typename Other > // Data type of the foreign expression
1293  inline bool isAliased( const Other* alias ) const noexcept
1294  {
1295  return dm_.isAliased( alias );
1296  }
1297  //**********************************************************************************************
1298 
1299  //**IsAligned function**************************************************************************
1304  inline bool isAligned() const noexcept
1305  {
1306  return dm_.isAligned();
1307  }
1308  //**********************************************************************************************
1309 
1310  //**CanSMPAssign function***********************************************************************
1315  inline bool canSMPAssign() const noexcept
1316  {
1317  return dm_.canSMPAssign();
1318  }
1319  //**********************************************************************************************
1320 
1321  //**Load function*******************************************************************************
1332  BLAZE_ALWAYS_INLINE SIMDType load( size_t i, size_t j ) const noexcept
1333  {
1334  return dm_.load( j, i );
1335  }
1336  //**********************************************************************************************
1337 
1338  //**Loada function*******************************************************************************
1349  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept
1350  {
1351  return dm_.loada( j, i );
1352  }
1353  //**********************************************************************************************
1354 
1355  //**Loadu function******************************************************************************
1366  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept
1367  {
1368  return dm_.loadu( j, i );
1369  }
1370  //**********************************************************************************************
1371 
1372  //**Store function******************************************************************************
1384  BLAZE_ALWAYS_INLINE void store( size_t i, size_t j, const SIMDType& value ) noexcept
1385  {
1386  dm_.store( j, i, value );
1387  }
1388  //**********************************************************************************************
1389 
1390  //**Storea function******************************************************************************
1402  BLAZE_ALWAYS_INLINE void storea( size_t i, size_t j, const SIMDType& value ) noexcept
1403  {
1404  dm_.storea( j, i, value );
1405  }
1406  //**********************************************************************************************
1407 
1408  //**Storeu function*****************************************************************************
1420  BLAZE_ALWAYS_INLINE void storeu( size_t i, size_t j, const SIMDType& value ) noexcept
1421  {
1422  dm_.storeu( j, i, value );
1423  }
1424  //**********************************************************************************************
1425 
1426  //**Stream function*****************************************************************************
1438  BLAZE_ALWAYS_INLINE void stream( size_t i, size_t j, const SIMDType& value ) noexcept
1439  {
1440  dm_.stream( j, i, value );
1441  }
1442  //**********************************************************************************************
1443 
1444  //**Transpose assignment of column-major dense matrices*****************************************
1455  template< typename MT2 > // Type of the right-hand side dense matrix
1456  inline void assign( const DenseMatrix<MT2,true>& rhs )
1457  {
1459 
1460  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1461  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1462 
1463  const size_t m( rows() );
1464  const size_t n( columns() );
1465 
1466  const size_t ipos( m & size_t(-2) );
1467  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == ipos, "Invalid end calculation" );
1468 
1469  for( size_t j=0UL; j<n; ++j ) {
1470  for( size_t i=0UL; i<ipos; i+=2UL ) {
1471  dm_(j,i ) = (~rhs)(i ,j);
1472  dm_(j,i+1UL) = (~rhs)(i+1UL,j);
1473  }
1474  if( ipos < m ) {
1475  dm_(j,ipos) = (~rhs)(ipos,j);
1476  }
1477  }
1478  }
1479  //**********************************************************************************************
1480 
1481  //**Transpose assignment of row-major dense matrices********************************************
1492  template< typename MT2 > // Type of the right-hand side dense matrix
1493  inline void assign( const DenseMatrix<MT2,false>& rhs )
1494  {
1496 
1497  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1498  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1499 
1500  constexpr size_t block( BLOCK_SIZE );
1501 
1502  const size_t m( rows() );
1503  const size_t n( columns() );
1504 
1505  for( size_t jj=0UL; jj<n; jj+=block ) {
1506  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
1507  for( size_t ii=0UL; ii<m; ii+=block ) {
1508  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
1509  for( size_t j=jj; j<jend; ++j ) {
1510  for( size_t i=ii; i<iend; ++i ) {
1511  dm_(j,i) = (~rhs)(i,j);
1512  }
1513  }
1514  }
1515  }
1516  }
1517  //**********************************************************************************************
1518 
1519  //**Transpose assignment of column-major sparse matrices****************************************
1530  template< typename MT2 > // Type of the right-hand side sparse matrix
1531  inline void assign( const SparseMatrix<MT2,true>& rhs )
1532  {
1534 
1535  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1536  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1537 
1538  typedef ConstIterator_<MT2> RhsConstIterator;
1539 
1540  for( size_t j=0UL; j<(~rhs).columns(); ++j )
1541  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
1542  dm_(j,element->index()) = element->value();
1543  }
1544  //**********************************************************************************************
1545 
1546  //**Transpose assignment of row-major sparse matrices*******************************************
1557  template< typename MT2 > // Type of the right-hand side sparse matrix
1558  inline void assign( const SparseMatrix<MT2,false>& rhs )
1559  {
1561 
1562  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1563  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1564 
1565  typedef ConstIterator_<MT2> RhsConstIterator;
1566 
1567  for( size_t i=0UL; i<(~rhs).rows(); ++i )
1568  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
1569  dm_(element->index(),i) = element->value();
1570  }
1571  //**********************************************************************************************
1572 
1573  //**Transpose addition assignment of column-major dense matrices********************************
1584  template< typename MT2 > // Type of the right-hand side dense matrix
1585  inline void addAssign( const DenseMatrix<MT2,true>& rhs )
1586  {
1588 
1589  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1590  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1591 
1592  const size_t m( rows() );
1593  const size_t n( columns() );
1594 
1595  const size_t ipos( m & size_t(-2) );
1596  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == ipos, "Invalid end calculation" );
1597 
1598  for( size_t j=0UL; j<n; ++j ) {
1599  for( size_t i=0UL; i<ipos; i+=2UL ) {
1600  dm_(j,i ) += (~rhs)(i ,j);
1601  dm_(j,i+1UL) += (~rhs)(i+1UL,j);
1602  }
1603  if( ipos < m ) {
1604  dm_(j,ipos) += (~rhs)(ipos,j);
1605  }
1606  }
1607  }
1608  //**********************************************************************************************
1609 
1610  //**Transpose addition assignment of row-major dense matrices***********************************
1621  template< typename MT2 > // Type of the right-hand side dense matrix
1622  inline void addAssign( const DenseMatrix<MT2,false>& rhs )
1623  {
1625 
1626  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1627  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1628 
1629  constexpr size_t block( BLOCK_SIZE );
1630 
1631  const size_t m( rows() );
1632  const size_t n( columns() );
1633 
1634  for( size_t jj=0UL; jj<n; jj+=block ) {
1635  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
1636  for( size_t ii=0UL; ii<m; ii+=block ) {
1637  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
1638  for( size_t j=jj; j<jend; ++j ) {
1639  for( size_t i=ii; i<iend; ++i ) {
1640  dm_(j,i) += (~rhs)(i,j);
1641  }
1642  }
1643  }
1644  }
1645  }
1646  //**********************************************************************************************
1647 
1648  //**Transpose addition assignment of column-major sparse matrices*******************************
1659  template< typename MT2 > // Type of the right-hand side sparse matrix
1660  inline void addAssign( const SparseMatrix<MT2,true>& rhs )
1661  {
1663 
1664  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1665  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1666 
1667  typedef ConstIterator_<MT2> RhsConstIterator;
1668 
1669  for( size_t j=0UL; j<(~rhs).columns(); ++j )
1670  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
1671  dm_(j,element->index()) += element->value();
1672  }
1673  //**********************************************************************************************
1674 
1675  //**Transpose addition assignment of row-major sparse matrices**********************************
1686  template< typename MT2 > // Type of the right-hand side sparse matrix
1687  inline void addAssign( const SparseMatrix<MT2,false>& rhs )
1688  {
1690 
1691  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1692  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1693 
1694  typedef ConstIterator_<MT2> RhsConstIterator;
1695 
1696  for( size_t i=0UL; i<(~rhs).rows(); ++i )
1697  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
1698  dm_(element->index(),i) += element->value();
1699  }
1700  //**********************************************************************************************
1701 
1702  //**Transpose subtraction assignment of column-major dense matrices*****************************
1713  template< typename MT2 > // Type of the right-hand side dense matrix
1714  inline void subAssign( const DenseMatrix<MT2,true>& rhs )
1715  {
1717 
1718  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1719  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1720 
1721  const size_t m( rows() );
1722  const size_t n( columns() );
1723 
1724  const size_t ipos( m & size_t(-2) );
1725  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == ipos, "Invalid end calculation" );
1726 
1727  for( size_t j=0UL; j<n; ++j ) {
1728  for( size_t i=0UL; i<ipos; i+=2UL ) {
1729  dm_(j,i ) -= (~rhs)(i ,j);
1730  dm_(j,i+1UL) -= (~rhs)(i+1UL,j);
1731  }
1732  if( ipos < m ) {
1733  dm_(j,ipos) -= (~rhs)(ipos,j);
1734  }
1735  }
1736  }
1737  //**********************************************************************************************
1738 
1739  //**Transpose subtraction assignment of row-major dense matrices********************************
1750  template< typename MT2 > // Type of the right-hand side dense matrix
1751  inline void subAssign( const DenseMatrix<MT2,false>& rhs )
1752  {
1754 
1755  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1756  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1757 
1758  constexpr size_t block( BLOCK_SIZE );
1759 
1760  const size_t m( rows() );
1761  const size_t n( columns() );
1762 
1763  for( size_t jj=0UL; jj<n; jj+=block ) {
1764  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
1765  for( size_t ii=0UL; ii<m; ii+=block ) {
1766  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
1767  for( size_t j=jj; j<jend; ++j ) {
1768  for( size_t i=ii; i<iend; ++i ) {
1769  dm_(j,i) -= (~rhs)(i,j);
1770  }
1771  }
1772  }
1773  }
1774  }
1775  //**********************************************************************************************
1776 
1777  //**Transpose subtraction assignment of column-major sparse matrices****************************
1788  template< typename MT2 > // Type of the right-hand side sparse matrix
1789  inline void subAssign( const SparseMatrix<MT2,true>& rhs )
1790  {
1792 
1793  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1794  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1795 
1796  typedef ConstIterator_<MT2> RhsConstIterator;
1797 
1798  for( size_t j=0UL; j<(~rhs).columns(); ++j )
1799  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
1800  dm_(j,element->index()) -= element->value();
1801  }
1802  //**********************************************************************************************
1803 
1804  //**Transpose subtraction assignment of row-major dense matrices********************************
1815  template< typename MT2 > // Type of the right-hand side sparse matrix
1816  inline void subAssign( const SparseMatrix<MT2,false>& rhs )
1817  {
1819 
1820  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1821  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1822 
1823  typedef ConstIterator_<MT2> RhsConstIterator;
1824 
1825  for( size_t i=0UL; i<(~rhs).rows(); ++i )
1826  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
1827  dm_(element->index(),i) -= element->value();
1828  }
1829  //**********************************************************************************************
1830 
1831  //**Transpose multiplication assignment of dense matrices***************************************
1832  // No special implementation for the transpose multiplication assignment of dense matrices.
1833  //**********************************************************************************************
1834 
1835  //**Transpose multiplication assignment of sparse matrices**************************************
1836  // No special implementation for the transpose multiplication assignment of sparse matrices.
1837  //**********************************************************************************************
1838 
1839  private:
1840  //**Member variables****************************************************************************
1841  MT& dm_;
1842  //**********************************************************************************************
1843 
1844  //**Compile time checks*************************************************************************
1850  //**********************************************************************************************
1851 };
1853 //*************************************************************************************************
1854 
1855 
1856 
1857 
1858 //=================================================================================================
1859 //
1860 // GLOBAL OPERATORS
1861 //
1862 //=================================================================================================
1863 
1864 //*************************************************************************************************
1872 template< typename MT // Type of the dense matrix
1873  , bool SO > // Storage order
1874 inline void reset( DMatTransposer<MT,SO>& m )
1875 {
1876  m.reset();
1877 }
1879 //*************************************************************************************************
1880 
1881 
1882 //*************************************************************************************************
1890 template< typename MT // Type of the dense matrix
1891  , bool SO > // Storage order
1892 inline bool isIntact( const DMatTransposer<MT,SO>& m ) noexcept
1893 {
1894  return m.isIntact();
1895 }
1897 //*************************************************************************************************
1898 
1899 
1900 
1901 
1902 //=================================================================================================
1903 //
1904 // HASMUTABLEDATAACCESS SPECIALIZATIONS
1905 //
1906 //=================================================================================================
1907 
1908 //*************************************************************************************************
1910 template< typename MT, bool SO >
1911 struct HasMutableDataAccess< DMatTransposer<MT,SO> >
1912  : public BoolConstant< HasMutableDataAccess<MT>::value >
1913 {};
1915 //*************************************************************************************************
1916 
1917 
1918 
1919 
1920 //=================================================================================================
1921 //
1922 // ISALIGNED SPECIALIZATIONS
1923 //
1924 //=================================================================================================
1925 
1926 //*************************************************************************************************
1928 template< typename MT, bool SO >
1929 struct IsAligned< DMatTransposer<MT,SO> >
1930  : public BoolConstant< IsAligned<MT>::value >
1931 {};
1933 //*************************************************************************************************
1934 
1935 
1936 
1937 
1938 //=================================================================================================
1939 //
1940 // ISPADDED SPECIALIZATIONS
1941 //
1942 //=================================================================================================
1943 
1944 //*************************************************************************************************
1946 template< typename MT, bool SO >
1947 struct IsPadded< DMatTransposer<MT,SO> >
1948  : public BoolConstant< IsPadded<MT>::value >
1949 {};
1951 //*************************************************************************************************
1952 
1953 
1954 
1955 
1956 //=================================================================================================
1957 //
1958 // SUBMATRIXTRAIT SPECIALIZATIONS
1959 //
1960 //=================================================================================================
1961 
1962 //*************************************************************************************************
1964 template< typename MT, bool SO >
1965 struct SubmatrixTrait< DMatTransposer<MT,SO> >
1966 {
1968 };
1970 //*************************************************************************************************
1971 
1972 } // namespace blaze
1973 
1974 #endif
Pointer_< MT > Pointer
Pointer to a non-constant matrix value.
Definition: DMatTransposer.h:94
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:779
Header file for kernel specific block sizes.
#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
ConstIterator cend(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatTransposer.h:301
Header file for basic type definitions.
DMatTransposer(MT &dm) noexcept
Constructor for the DMatTransposer class.
Definition: DMatTransposer.h:119
OppositeType_< MT > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatTransposer.h:86
Base template for the SubmatrixTrait class.
Definition: SubmatrixTrait.h:118
#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
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
#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
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatTransposer.h:237
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:936
ConstIterator_< MT > ConstIterator
Iterator over constant elements.
Definition: DMatTransposer.h:97
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: DMatTransposer.h:398
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:703
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
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:71
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:119
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
Compile time check for low-level access to mutable data.This type trait tests whether the given data ...
Definition: HasMutableDataAccess.h:75
const This & CompositeType
Data type for composite expression templates.
Definition: DMatTransposer.h:91
ConstReference operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatTransposer.h:145
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatTransposer.h:285
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
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
Constraint on the data type.
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
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:833
#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
ConstPointer data() const noexcept
Low-level data access to the matrix elements.
Definition: DMatTransposer.h:205
Reference operator()(size_t i, size_t j)
2D-access to the matrix elements.
Definition: DMatTransposer.h:131
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
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
size_t spacing() const noexcept
Returns the spacing between the beginning of two rows.
Definition: DMatTransposer.h:365
Expression object for the transposition of a dense matrix.The DMatTransposer class is a wrapper objec...
Definition: DMatTransposer.h:80
bool canSMPAssign() const noexcept
Returns whether the matrix can be used in SMP assignments.
Definition: DMatTransposer.h:433
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatTransposer.h:345
MT & dm_
The dense matrix operand.
Definition: DMatTransposer.h:961
Header file for the IsAligned type trait.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatTransposer.h:355
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:676
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:909
#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
ConstIterator cbegin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatTransposer.h:253
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:871
Header file for the submatrix trait.
ConstPointer_< MT > ConstPointer
Pointer to a constant matrix value.
Definition: DMatTransposer.h:95
void addAssign(const DenseMatrix< MT2,!SO > &rhs)
Implementation of the transpose addition assignment of a column-major dense matrix.
Definition: DMatTransposer.h:741
EnableIf_< IsNumeric< Other >, DMatTransposer > & operator*=(Other rhs)
Multiplication assignment operator for the multiplication between a matrix and a scalar value ( )...
Definition: DMatTransposer.h:314
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.
typename SubmatrixTrait< MT >::Type SubmatrixTrait_
Auxiliary alias declaration for the SubmatrixTrait type trait.The SubmatrixTrait_ alias declaration p...
Definition: SubmatrixTrait.h:153
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
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: DMatTransposer.h:411
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:806
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
void assign(const SparseMatrix< MT2, SO > &rhs)
Implementation of the transpose assignment of a row-major sparse matrix.
Definition: DMatTransposer.h:649
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:249
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
ConstReference at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatTransposer.h:179
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
bool isAligned() const noexcept
Returns whether the matrix is properly aligned in memory.
Definition: DMatTransposer.h:422
Iterator end(size_t i)
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatTransposer.h:269
bool isIntact() const noexcept
Returns whether the invariants of the matrix are intact.
Definition: DMatTransposer.h:385
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