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 
53 #include <blaze/system/Blocking.h>
54 #include <blaze/system/Inline.h>
55 #include <blaze/util/Assert.h>
56 #include <blaze/util/EnableIf.h>
57 #include <blaze/util/Exception.h>
58 #include <blaze/util/Types.h>
61 
62 
63 namespace blaze {
64 
65 //=================================================================================================
66 //
67 // CLASS DMATTRANSPOSER
68 //
69 //=================================================================================================
70 
71 //*************************************************************************************************
77 template< typename MT // Type of the dense matrix
78  , bool SO > // Storage order
79 class DMatTransposer : public DenseMatrix< DMatTransposer<MT,SO>, SO >
80 {
81  private:
82  //**Type definitions****************************************************************************
84  //**********************************************************************************************
85 
86  public:
87  //**Type definitions****************************************************************************
89  typedef typename MT::TransposeType ResultType;
90  typedef typename MT::OppositeType OppositeType;
91  typedef typename MT::ResultType TransposeType;
92  typedef typename MT::ElementType ElementType;
93  typedef typename IT::Type IntrinsicType;
94  typedef typename MT::ReturnType ReturnType;
95  typedef const This& CompositeType;
96  typedef typename MT::Reference Reference;
98  typedef typename MT::Pointer Pointer;
99  typedef typename MT::ConstPointer ConstPointer;
100  typedef typename MT::Iterator Iterator;
101  typedef typename MT::ConstIterator ConstIterator;
102  //**********************************************************************************************
103 
104  //**Compilation flags***************************************************************************
106 
109  enum { vectorizable = MT::vectorizable };
110 
112 
115  enum { smpAssignable = MT::smpAssignable };
116  //**********************************************************************************************
117 
118  //**Constructor*********************************************************************************
123  explicit inline DMatTransposer( MT& dm )
124  : dm_( dm ) // The dense matrix operand
125  {}
126  //**********************************************************************************************
127 
128  //**Access operator*****************************************************************************
135  inline Reference operator()( size_t i, size_t j ) {
136  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
137  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
138  return dm_(j,i);
139  }
140  //**********************************************************************************************
141 
142  //**Access operator*****************************************************************************
149  inline ConstReference operator()( size_t i, size_t j ) const {
150  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
151  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
152  return dm_(j,i);
153  }
154  //**********************************************************************************************
155 
156  //**At function*********************************************************************************
164  inline Reference at( size_t i, size_t j ) {
165  if( i >= dm_.columns() ) {
166  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
167  }
168  if( j >= dm_.rows() ) {
169  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
170  }
171  return (*this)(i,j);
172  }
173  //**********************************************************************************************
174 
175  //**At function*********************************************************************************
183  inline ConstReference at( size_t i, size_t j ) const {
184  if( i >= dm_.columns() ) {
185  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
186  }
187  if( j >= dm_.rows() ) {
188  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
189  }
190  return (*this)(i,j);
191  }
192  //**********************************************************************************************
193 
194  //**Low-level data access***********************************************************************
199  inline Pointer data() {
200  return dm_.data();
201  }
202  //**********************************************************************************************
203 
204  //**Low-level data access***********************************************************************
209  inline ConstPointer data() const {
210  return dm_.data();
211  }
212  //**********************************************************************************************
213 
214  //**Begin function******************************************************************************
225  inline Iterator begin( size_t i ) {
226  return dm_.begin( i );
227  }
228  //**********************************************************************************************
229 
230  //**Begin function******************************************************************************
241  inline ConstIterator begin( size_t i ) const {
242  return dm_.cbegin( i );
243  }
244  //**********************************************************************************************
245 
246  //**Cbegin function*****************************************************************************
257  inline ConstIterator cbegin( size_t i ) const {
258  return dm_.cbegin( i );
259  }
260  //**********************************************************************************************
261 
262  //**End function********************************************************************************
273  inline Iterator end( size_t i ) {
274  return dm_.end( i );
275  }
276  //**********************************************************************************************
277 
278  //**End function********************************************************************************
289  inline ConstIterator end( size_t i ) const {
290  return dm_.cend( i );
291  }
292  //**********************************************************************************************
293 
294  //**Cend function*******************************************************************************
305  inline ConstIterator cend( size_t i ) const {
306  return dm_.cend( i );
307  }
308  //**********************************************************************************************
309 
310  //**Multiplication assignment operator**********************************************************
317  template< typename Other > // Data type of the right-hand side scalar
318  inline typename EnableIf< IsNumeric<Other>, DMatTransposer >::Type& operator*=( Other rhs )
319  {
320  (~dm_) *= rhs;
321  return *this;
322  }
323  //**********************************************************************************************
324 
325  //**Division assignment operator****************************************************************
334  template< typename Other > // Data type of the right-hand side scalar
335  inline typename EnableIf< IsNumeric<Other>, DMatTransposer >::Type& operator/=( Other rhs )
336  {
337  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
338 
339  (~dm_) /= rhs;
340  return *this;
341  }
342  //**********************************************************************************************
343 
344  //**Rows function*******************************************************************************
349  inline size_t rows() const {
350  return dm_.columns();
351  }
352  //**********************************************************************************************
353 
354  //**Columns function****************************************************************************
359  inline size_t columns() const {
360  return dm_.rows();
361  }
362  //**********************************************************************************************
363 
364  //**Spacing function****************************************************************************
369  inline size_t spacing() const {
370  return dm_.spacing();
371  }
372  //**********************************************************************************************
373 
374  //**Reset function******************************************************************************
379  inline void reset() {
380  return dm_.reset();
381  }
382  //**********************************************************************************************
383 
384  //**IsIntact function***************************************************************************
389  inline bool isIntact() const {
390  using blaze::isIntact;
391  return isIntact( dm_ );
392  }
393  //**********************************************************************************************
394 
395  //**CanAliased function*************************************************************************
401  template< typename Other > // Data type of the foreign expression
402  inline bool canAlias( const Other* alias ) const
403  {
404  return dm_.canAlias( alias );
405  }
406  //**********************************************************************************************
407 
408  //**IsAliased function**************************************************************************
414  template< typename Other > // Data type of the foreign expression
415  inline bool isAliased( const Other* alias ) const
416  {
417  return dm_.isAliased( alias );
418  }
419  //**********************************************************************************************
420 
421  //**IsAligned function**************************************************************************
426  inline bool isAligned() const
427  {
428  return dm_.isAligned();
429  }
430  //**********************************************************************************************
431 
432  //**CanSMPAssign function***********************************************************************
437  inline bool canSMPAssign() const
438  {
439  return dm_.canSMPAssign();
440  }
441  //**********************************************************************************************
442 
443  //**Load function*******************************************************************************
454  BLAZE_ALWAYS_INLINE IntrinsicType load( size_t i, size_t j ) const
455  {
456  return dm_.load( j, i );
457  }
458  //**********************************************************************************************
459 
460  //**Loada function******************************************************************************
471  BLAZE_ALWAYS_INLINE IntrinsicType loada( size_t i, size_t j ) const
472  {
473  return dm_.loada( j, i );
474  }
475  //**********************************************************************************************
476 
477  //**Loadu function******************************************************************************
488  BLAZE_ALWAYS_INLINE IntrinsicType loadu( size_t i, size_t j ) const
489  {
490  return dm_.loadu( j, i );
491  }
492  //**********************************************************************************************
493 
494  //**Store function******************************************************************************
506  BLAZE_ALWAYS_INLINE void store( size_t i, size_t j, const IntrinsicType& value )
507  {
508  dm_.store( j, i, value );
509  }
510  //**********************************************************************************************
511 
512  //**Storea function******************************************************************************
524  BLAZE_ALWAYS_INLINE void storea( size_t i, size_t j, const IntrinsicType& value )
525  {
526  dm_.storea( j, i, value );
527  }
528  //**********************************************************************************************
529 
530  //**Storeu function*****************************************************************************
542  BLAZE_ALWAYS_INLINE void storeu( size_t i, size_t j, const IntrinsicType& value )
543  {
544  dm_.storeu( j, i, value );
545  }
546  //**********************************************************************************************
547 
548  //**Stream function*****************************************************************************
560  BLAZE_ALWAYS_INLINE void stream( size_t i, size_t j, const IntrinsicType& value )
561  {
562  dm_.stream( j, i, value );
563  }
564  //**********************************************************************************************
565 
566  //**Transpose assignment of row-major dense matrices********************************************
577  template< typename MT2 > // Type of the right-hand side dense matrix
578  inline void assign( const DenseMatrix<MT2,SO>& rhs )
579  {
581 
582  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
583  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
584 
585  const size_t m( rows() );
586  const size_t n( columns() );
587 
588  const size_t jpos( n & size_t(-2) );
589  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jpos, "Invalid end calculation" );
590 
591  for( size_t i=0UL; i<m; ++i ) {
592  for( size_t j=0UL; j<jpos; j+=2UL ) {
593  dm_(j ,i) = (~rhs)(i,j );
594  dm_(j+1UL,i) = (~rhs)(i,j+1UL);
595  }
596  if( jpos < n ) {
597  dm_(jpos,i) = (~rhs)(i,jpos);
598  }
599  }
600  }
601  //**********************************************************************************************
602 
603  //**Transpose assignment of column-major dense matrices*****************************************
614  template< typename MT2 > // Type of the right-hand side dense matrix
615  inline void assign( const DenseMatrix<MT2,!SO>& rhs )
616  {
618 
619  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
620  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
621 
622  const size_t m( rows() );
623  const size_t n( columns() );
624  const size_t block( BLOCK_SIZE );
625 
626  for( size_t ii=0UL; ii<m; ii+=block ) {
627  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
628  for( size_t jj=0UL; jj<n; jj+=block ) {
629  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
630  for( size_t i=ii; i<iend; ++i ) {
631  for( size_t j=jj; j<jend; ++j ) {
632  dm_(j,i) = (~rhs)(i,j);
633  }
634  }
635  }
636  }
637  }
638  //**********************************************************************************************
639 
640  //**Transpose assignment of row-major sparse matrices*******************************************
651  template< typename MT2 > // Type of the right-hand side sparse matrix
652  inline void assign( const SparseMatrix<MT2,SO>& rhs )
653  {
655 
656  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
657  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
658 
659  typedef typename MT2::ConstIterator RhsConstIterator;
660 
661  for( size_t i=0UL; i<(~rhs).rows(); ++i )
662  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
663  dm_(element->index(),i) = element->value();
664  }
665  //**********************************************************************************************
666 
667  //**Transpose assignment of column-major sparse matrices****************************************
678  template< typename MT2 > // Type of the right-hand side sparse matrix
679  inline void assign( const SparseMatrix<MT2,!SO>& rhs )
680  {
682 
683  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
684  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
685 
686  typedef typename MT2::ConstIterator RhsConstIterator;
687 
688  for( size_t j=0UL; j<(~rhs).columns(); ++j )
689  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
690  dm_(j,element->index()) = element->value();
691  }
692  //**********************************************************************************************
693 
694  //**Transpose addition assignment of row-major dense matrices***********************************
705  template< typename MT2 > // Type of the right-hand side dense matrix
706  inline void addAssign( const DenseMatrix<MT2,SO>& rhs )
707  {
709 
710  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
711  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
712 
713  const size_t m( rows() );
714  const size_t n( columns() );
715 
716  const size_t jpos( n & size_t(-2) );
717  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jpos, "Invalid end calculation" );
718 
719  for( size_t i=0UL; i<m; ++i ) {
720  for( size_t j=0UL; j<jpos; j+=2UL ) {
721  dm_(j ,i) += (~rhs)(i,j );
722  dm_(j+1UL,i) += (~rhs)(i,j+1UL);
723 
724  }
725  if( jpos < n ) {
726  dm_(jpos,i) += (~rhs)(i,jpos);
727  }
728  }
729  }
730  //**********************************************************************************************
731 
732  //**Transpose addition assignment of column-major dense matrices********************************
743  template< typename MT2 > // Type of the right-hand side dense matrix
744  inline void addAssign( const DenseMatrix<MT2,!SO>& rhs )
745  {
747 
748  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
749  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
750 
751  const size_t m( rows() );
752  const size_t n( columns() );
753  const size_t block( BLOCK_SIZE );
754 
755  for( size_t ii=0UL; ii<m; ii+=block ) {
756  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
757  for( size_t jj=0UL; jj<n; jj+=block ) {
758  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
759  for( size_t i=ii; i<iend; ++i ) {
760  for( size_t j=jj; j<jend; ++j ) {
761  dm_(j,i) += (~rhs)(i,j);
762  }
763  }
764  }
765  }
766  }
767  //**********************************************************************************************
768 
769  //**Transpose addition assignment of row-major sparse matrices**********************************
780  template< typename MT2 > // Type of the right-hand side sparse matrix
781  inline void addAssign( const SparseMatrix<MT2,SO>& rhs )
782  {
784 
785  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
786  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
787 
788  typedef typename MT2::ConstIterator RhsConstIterator;
789 
790  for( size_t i=0UL; i<(~rhs).rows(); ++i )
791  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
792  dm_(element->index(),i) += element->value();
793  }
794  //**********************************************************************************************
795 
796  //**Transpose addition assignment of column-major sparse matrices*******************************
807  template< typename MT2 > // Type of the right-hand side sparse matrix
808  inline void addAssign( const SparseMatrix<MT2,!SO>& rhs )
809  {
811 
812  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
813  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
814 
815  typedef typename MT2::ConstIterator RhsConstIterator;
816 
817  for( size_t j=0UL; j<(~rhs).columns(); ++j )
818  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
819  dm_(j,element->index()) += element->value();
820  }
821  //**********************************************************************************************
822 
823  //**Transpose subtraction assignment of row-major dense matrices********************************
834  template< typename MT2 > // Type of the right-hand side dense matrix
835  inline void subAssign( const DenseMatrix<MT2,SO>& rhs )
836  {
838 
839  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
840  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
841 
842  const size_t m( rows() );
843  const size_t n( columns() );
844 
845  const size_t jpos( n & size_t(-2) );
846  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jpos, "Invalid end calculation" );
847 
848  for( size_t i=0UL; i<m; ++i ) {
849  for( size_t j=0UL; j<jpos; j+=2UL ) {
850  dm_(j ,i) -= (~rhs)(i,j );
851  dm_(j+1UL,i) -= (~rhs)(i,j+1UL);
852 
853  }
854  if( jpos < n ) {
855  dm_(jpos,i) -= (~rhs)(i,jpos);
856  }
857  }
858  }
859  //**********************************************************************************************
860 
861  //**Transpose subtraction assignment of column-major dense matrices*****************************
872  template< typename MT2 > // Type of the right-hand side dense matrix
873  inline void subAssign( const DenseMatrix<MT2,!SO>& rhs )
874  {
876 
877  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
878  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
879 
880  const size_t m( rows() );
881  const size_t n( columns() );
882  const size_t block( BLOCK_SIZE );
883 
884  for( size_t ii=0UL; ii<m; ii+=block ) {
885  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
886  for( size_t jj=0UL; jj<n; jj+=block ) {
887  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
888  for( size_t i=ii; i<iend; ++i ) {
889  for( size_t j=jj; j<jend; ++j ) {
890  dm_(j,i) -= (~rhs)(i,j);
891  }
892  }
893  }
894  }
895  }
896  //**********************************************************************************************
897 
898  //**Transpose subtraction assignment of row-major sparse matrices*******************************
909  template< typename MT2 > // Type of the right-hand side sparse matrix
910  inline void subAssign( const SparseMatrix<MT2,SO>& rhs )
911  {
913 
914  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
915  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
916 
917  typedef typename MT2::ConstIterator RhsConstIterator;
918 
919  for( size_t i=0UL; i<(~rhs).rows(); ++i )
920  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
921  dm_(element->index(),i) -= element->value();
922  }
923  //**********************************************************************************************
924 
925  //**Transpose subtraction assignment of column-major dense matrices*****************************
936  template< typename MT2 > // Type of the right-hand side sparse matrix
937  inline void subAssign( const SparseMatrix<MT2,!SO>& rhs )
938  {
940 
941  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
942  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
943 
944  typedef typename MT2::ConstIterator RhsConstIterator;
945 
946  for( size_t j=0UL; j<(~rhs).columns(); ++j )
947  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
948  dm_(j,element->index()) -= element->value();
949  }
950  //**********************************************************************************************
951 
952  //**Transpose multiplication assignment of dense matrices***************************************
953  // No special implementation for the transpose multiplication assignment of dense matrices.
954  //**********************************************************************************************
955 
956  //**Transpose multiplication assignment of sparse matrices**************************************
957  // No special implementation for the transpose multiplication assignment of sparse matrices.
958  //**********************************************************************************************
959 
960  private:
961  //**Member variables****************************************************************************
962  MT& dm_;
963  //**********************************************************************************************
964 
965  //**Compile time checks*************************************************************************
971  //**********************************************************************************************
972 };
973 //*************************************************************************************************
974 
975 
976 
977 
978 //=================================================================================================
979 //
980 // CLASS TEMPLATE SPECIALIZATION FOR ROW-MAJOR MATRICES
981 //
982 //=================================================================================================
983 
984 //*************************************************************************************************
992 template< typename MT > // Type of the dense matrix
993 class DMatTransposer<MT,true> : public DenseMatrix< DMatTransposer<MT,true>, true >
994 {
995  private:
996  //**Type definitions****************************************************************************
998  //**********************************************************************************************
999 
1000  public:
1001  //**Type definitions****************************************************************************
1002  typedef DMatTransposer<MT,true> This;
1003  typedef typename MT::TransposeType ResultType;
1004  typedef typename MT::OppositeType OppositeType;
1005  typedef typename MT::ResultType TransposeType;
1006  typedef typename MT::ElementType ElementType;
1007  typedef typename IT::Type IntrinsicType;
1008  typedef typename MT::ReturnType ReturnType;
1009  typedef const This& CompositeType;
1010  typedef typename MT::Reference Reference;
1011  typedef typename MT::ConstReference ConstReference;
1012  typedef typename MT::Pointer Pointer;
1013  typedef typename MT::ConstPointer ConstPointer;
1014  typedef typename MT::Iterator Iterator;
1015  typedef typename MT::ConstIterator ConstIterator;
1016  //**********************************************************************************************
1017 
1018  //**Compilation flags***************************************************************************
1020 
1023  enum { vectorizable = MT::vectorizable };
1024 
1026 
1029  enum { smpAssignable = MT::smpAssignable };
1030  //**********************************************************************************************
1031 
1032  //**Constructor*********************************************************************************
1037  explicit inline DMatTransposer( MT& dm )
1038  : dm_( dm ) // The dense matrix operand
1039  {}
1040  //**********************************************************************************************
1041 
1042  //**Access operator*****************************************************************************
1049  inline Reference operator()( size_t i, size_t j ) {
1050  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
1051  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
1052  return dm_(j,i);
1053  }
1054  //**********************************************************************************************
1055 
1056  //**Access operator*****************************************************************************
1063  inline ConstReference operator()( size_t i, size_t j ) const {
1064  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
1065  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
1066  return dm_(j,i);
1067  }
1068  //**********************************************************************************************
1069 
1070  //**At function*********************************************************************************
1078  inline Reference at( size_t i, size_t j ) {
1079  if( i >= dm_.columns() ) {
1080  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1081  }
1082  if( j >= dm_.rows() ) {
1083  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1084  }
1085  return (*this)(i,j);
1086  }
1087  //**********************************************************************************************
1088 
1089  //**At function*********************************************************************************
1097  inline ConstReference at( size_t i, size_t j ) const {
1098  if( i >= dm_.columns() ) {
1099  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1100  }
1101  if( j >= dm_.rows() ) {
1102  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1103  }
1104  return (*this)(i,j);
1105  }
1106  //**********************************************************************************************
1107 
1108  //**Low-level data access***********************************************************************
1113  inline Pointer data() {
1114  return dm_.data();
1115  }
1116  //**********************************************************************************************
1117 
1118  //**Low-level data access***********************************************************************
1123  inline ConstPointer data() const {
1124  return dm_.data();
1125  }
1126  //**********************************************************************************************
1127 
1128  //**Begin function******************************************************************************
1134  inline Iterator begin( size_t j ) {
1135  return dm_.begin(j);
1136  }
1137  //**********************************************************************************************
1138 
1139  //**Begin function******************************************************************************
1145  inline ConstIterator begin( size_t j ) const {
1146  return dm_.cbegin(j);
1147  }
1148  //**********************************************************************************************
1149 
1150  //**Cbegin function*****************************************************************************
1156  inline ConstIterator cbegin( size_t j ) const {
1157  return dm_.cbegin(j);
1158  }
1159  //**********************************************************************************************
1160 
1161  //**End function********************************************************************************
1167  inline Iterator end( size_t j ) {
1168  return dm_.end(j);
1169  }
1170  //**********************************************************************************************
1171 
1172  //**End function********************************************************************************
1178  inline ConstIterator end( size_t j ) const {
1179  return dm_.cend(j);
1180  }
1181  //**********************************************************************************************
1182 
1183  //**Cend function*******************************************************************************
1189  inline ConstIterator cend( size_t j ) const {
1190  return dm_.cend(j);
1191  }
1192  //**********************************************************************************************
1193 
1194  //**Multiplication assignment operator**********************************************************
1201  template< typename Other > // Data type of the right-hand side scalar
1202  inline typename EnableIf< IsNumeric<Other>, DMatTransposer >::Type& operator*=( Other rhs )
1203  {
1204  (~dm_) *= rhs;
1205  return *this;
1206  }
1207  //**********************************************************************************************
1208 
1209  //**Division assignment operator****************************************************************
1218  template< typename Other > // Data type of the right-hand side scalar
1219  inline typename EnableIf< IsNumeric<Other>, DMatTransposer >::Type& operator/=( Other rhs )
1220  {
1221  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
1222 
1223  (~dm_) /= rhs;
1224  return *this;
1225  }
1226  //**********************************************************************************************
1227 
1228  //**Rows function*******************************************************************************
1233  inline size_t rows() const {
1234  return dm_.columns();
1235  }
1236  //**********************************************************************************************
1237 
1238  //**Columns function****************************************************************************
1243  inline size_t columns() const {
1244  return dm_.rows();
1245  }
1246  //**********************************************************************************************
1247 
1248  //**Spacing function****************************************************************************
1253  inline size_t spacing() const {
1254  return dm_.spacing();
1255  }
1256  //**********************************************************************************************
1257 
1258  //**Reset function******************************************************************************
1263  inline void reset() {
1264  return dm_.reset();
1265  }
1266  //**********************************************************************************************
1267 
1268  //**IsIntact function***************************************************************************
1273  inline bool isIntact() const {
1274  using blaze::isIntact;
1275  return isIntact( dm_ );
1276  }
1277  //**********************************************************************************************
1278 
1279  //**CanAliased function*************************************************************************
1285  template< typename Other > // Data type of the foreign expression
1286  inline bool canAlias( const Other* alias ) const
1287  {
1288  return dm_.canAlias( alias );
1289  }
1290  //**********************************************************************************************
1291 
1292  //**IsAliased function**************************************************************************
1298  template< typename Other > // Data type of the foreign expression
1299  inline bool isAliased( const Other* alias ) const
1300  {
1301  return dm_.isAliased( alias );
1302  }
1303  //**********************************************************************************************
1304 
1305  //**IsAligned function**************************************************************************
1310  inline bool isAligned() const
1311  {
1312  return dm_.isAligned();
1313  }
1314  //**********************************************************************************************
1315 
1316  //**CanSMPAssign function***********************************************************************
1321  inline bool canSMPAssign() const
1322  {
1323  return dm_.canSMPAssign();
1324  }
1325  //**********************************************************************************************
1326 
1327  //**Load function*******************************************************************************
1338  BLAZE_ALWAYS_INLINE IntrinsicType load( size_t i, size_t j ) const
1339  {
1340  return dm_.load( j, i );
1341  }
1342  //**********************************************************************************************
1343 
1344  //**Loada function*******************************************************************************
1355  BLAZE_ALWAYS_INLINE IntrinsicType loada( size_t i, size_t j ) const
1356  {
1357  return dm_.loada( j, i );
1358  }
1359  //**********************************************************************************************
1360 
1361  //**Loadu function******************************************************************************
1372  BLAZE_ALWAYS_INLINE IntrinsicType loadu( size_t i, size_t j ) const
1373  {
1374  return dm_.loadu( j, i );
1375  }
1376  //**********************************************************************************************
1377 
1378  //**Store function******************************************************************************
1390  BLAZE_ALWAYS_INLINE void store( size_t i, size_t j, const IntrinsicType& value )
1391  {
1392  dm_.store( j, i, value );
1393  }
1394  //**********************************************************************************************
1395 
1396  //**Storea function******************************************************************************
1408  BLAZE_ALWAYS_INLINE void storea( size_t i, size_t j, const IntrinsicType& value )
1409  {
1410  dm_.storea( j, i, value );
1411  }
1412  //**********************************************************************************************
1413 
1414  //**Storeu function*****************************************************************************
1426  BLAZE_ALWAYS_INLINE void storeu( size_t i, size_t j, const IntrinsicType& value )
1427  {
1428  dm_.storeu( j, i, value );
1429  }
1430  //**********************************************************************************************
1431 
1432  //**Stream function*****************************************************************************
1444  BLAZE_ALWAYS_INLINE void stream( size_t i, size_t j, const IntrinsicType& value )
1445  {
1446  dm_.stream( j, i, value );
1447  }
1448  //**********************************************************************************************
1449 
1450  //**Transpose assignment of column-major dense matrices*****************************************
1461  template< typename MT2 > // Type of the right-hand side dense matrix
1462  inline void assign( const DenseMatrix<MT2,true>& rhs )
1463  {
1465 
1466  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1467  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1468 
1469  const size_t m( rows() );
1470  const size_t n( columns() );
1471 
1472  const size_t ipos( m & size_t(-2) );
1473  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == ipos, "Invalid end calculation" );
1474 
1475  for( size_t j=0UL; j<n; ++j ) {
1476  for( size_t i=0UL; i<ipos; i+=2UL ) {
1477  dm_(j,i ) = (~rhs)(i ,j);
1478  dm_(j,i+1UL) = (~rhs)(i+1UL,j);
1479  }
1480  if( ipos < m ) {
1481  dm_(j,ipos) = (~rhs)(ipos,j);
1482  }
1483  }
1484  }
1485  //**********************************************************************************************
1486 
1487  //**Transpose assignment of row-major dense matrices********************************************
1498  template< typename MT2 > // Type of the right-hand side dense matrix
1499  inline void assign( const DenseMatrix<MT2,false>& rhs )
1500  {
1502 
1503  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1504  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1505 
1506  const size_t m( rows() );
1507  const size_t n( columns() );
1508  const size_t block( BLOCK_SIZE );
1509 
1510  for( size_t jj=0UL; jj<n; jj+=block ) {
1511  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
1512  for( size_t ii=0UL; ii<m; ii+=block ) {
1513  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
1514  for( size_t j=jj; j<jend; ++j ) {
1515  for( size_t i=ii; i<iend; ++i ) {
1516  dm_(j,i) = (~rhs)(i,j);
1517  }
1518  }
1519  }
1520  }
1521  }
1522  //**********************************************************************************************
1523 
1524  //**Transpose assignment of column-major sparse matrices****************************************
1535  template< typename MT2 > // Type of the right-hand side sparse matrix
1536  inline void assign( const SparseMatrix<MT2,true>& rhs )
1537  {
1539 
1540  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1541  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1542 
1543  typedef typename MT2::ConstIterator RhsConstIterator;
1544 
1545  for( size_t j=0UL; j<(~rhs).columns(); ++j )
1546  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
1547  dm_(j,element->index()) = element->value();
1548  }
1549  //**********************************************************************************************
1550 
1551  //**Transpose assignment of row-major sparse matrices*******************************************
1562  template< typename MT2 > // Type of the right-hand side sparse matrix
1563  inline void assign( const SparseMatrix<MT2,false>& rhs )
1564  {
1566 
1567  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1568  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1569 
1570  typedef typename MT2::ConstIterator RhsConstIterator;
1571 
1572  for( size_t i=0UL; i<(~rhs).rows(); ++i )
1573  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
1574  dm_(element->index(),i) = element->value();
1575  }
1576  //**********************************************************************************************
1577 
1578  //**Transpose addition assignment of column-major dense matrices********************************
1589  template< typename MT2 > // Type of the right-hand side dense matrix
1590  inline void addAssign( const DenseMatrix<MT2,true>& rhs )
1591  {
1593 
1594  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1595  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1596 
1597  const size_t m( rows() );
1598  const size_t n( columns() );
1599 
1600  const size_t ipos( m & size_t(-2) );
1601  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == ipos, "Invalid end calculation" );
1602 
1603  for( size_t j=0UL; j<n; ++j ) {
1604  for( size_t i=0UL; i<ipos; i+=2UL ) {
1605  dm_(j,i ) += (~rhs)(i ,j);
1606  dm_(j,i+1UL) += (~rhs)(i+1UL,j);
1607  }
1608  if( ipos < m ) {
1609  dm_(j,ipos) += (~rhs)(ipos,j);
1610  }
1611  }
1612  }
1613  //**********************************************************************************************
1614 
1615  //**Transpose addition assignment of row-major dense matrices***********************************
1626  template< typename MT2 > // Type of the right-hand side dense matrix
1627  inline void addAssign( const DenseMatrix<MT2,false>& rhs )
1628  {
1630 
1631  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1632  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1633 
1634  const size_t m( rows() );
1635  const size_t n( columns() );
1636  const size_t block( BLOCK_SIZE );
1637 
1638  for( size_t jj=0UL; jj<n; jj+=block ) {
1639  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
1640  for( size_t ii=0UL; ii<m; ii+=block ) {
1641  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
1642  for( size_t j=jj; j<jend; ++j ) {
1643  for( size_t i=ii; i<iend; ++i ) {
1644  dm_(j,i) += (~rhs)(i,j);
1645  }
1646  }
1647  }
1648  }
1649  }
1650  //**********************************************************************************************
1651 
1652  //**Transpose addition assignment of column-major sparse matrices*******************************
1663  template< typename MT2 > // Type of the right-hand side sparse matrix
1664  inline void addAssign( const SparseMatrix<MT2,true>& rhs )
1665  {
1667 
1668  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1669  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1670 
1671  typedef typename MT2::ConstIterator RhsConstIterator;
1672 
1673  for( size_t j=0UL; j<(~rhs).columns(); ++j )
1674  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
1675  dm_(j,element->index()) += element->value();
1676  }
1677  //**********************************************************************************************
1678 
1679  //**Transpose addition assignment of row-major sparse matrices**********************************
1690  template< typename MT2 > // Type of the right-hand side sparse matrix
1691  inline void addAssign( const SparseMatrix<MT2,false>& rhs )
1692  {
1694 
1695  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1696  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1697 
1698  typedef typename MT2::ConstIterator RhsConstIterator;
1699 
1700  for( size_t i=0UL; i<(~rhs).rows(); ++i )
1701  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
1702  dm_(element->index(),i) += element->value();
1703  }
1704  //**********************************************************************************************
1705 
1706  //**Transpose subtraction assignment of column-major dense matrices*****************************
1717  template< typename MT2 > // Type of the right-hand side dense matrix
1718  inline void subAssign( const DenseMatrix<MT2,true>& rhs )
1719  {
1721 
1722  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1723  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1724 
1725  const size_t m( rows() );
1726  const size_t n( columns() );
1727 
1728  const size_t ipos( m & size_t(-2) );
1729  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == ipos, "Invalid end calculation" );
1730 
1731  for( size_t j=0UL; j<n; ++j ) {
1732  for( size_t i=0UL; i<ipos; i+=2UL ) {
1733  dm_(j,i ) -= (~rhs)(i ,j);
1734  dm_(j,i+1UL) -= (~rhs)(i+1UL,j);
1735  }
1736  if( ipos < m ) {
1737  dm_(j,ipos) -= (~rhs)(ipos,j);
1738  }
1739  }
1740  }
1741  //**********************************************************************************************
1742 
1743  //**Transpose subtraction assignment of row-major dense matrices********************************
1754  template< typename MT2 > // Type of the right-hand side dense matrix
1755  inline void subAssign( const DenseMatrix<MT2,false>& rhs )
1756  {
1758 
1759  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1760  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1761 
1762  const size_t m( rows() );
1763  const size_t n( columns() );
1764  const size_t block( BLOCK_SIZE );
1765 
1766  for( size_t jj=0UL; jj<n; jj+=block ) {
1767  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
1768  for( size_t ii=0UL; ii<m; ii+=block ) {
1769  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
1770  for( size_t j=jj; j<jend; ++j ) {
1771  for( size_t i=ii; i<iend; ++i ) {
1772  dm_(j,i) -= (~rhs)(i,j);
1773  }
1774  }
1775  }
1776  }
1777  }
1778  //**********************************************************************************************
1779 
1780  //**Transpose subtraction assignment of column-major sparse matrices****************************
1791  template< typename MT2 > // Type of the right-hand side sparse matrix
1792  inline void subAssign( const SparseMatrix<MT2,true>& rhs )
1793  {
1795 
1796  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1797  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1798 
1799  typedef typename MT2::ConstIterator RhsConstIterator;
1800 
1801  for( size_t j=0UL; j<(~rhs).columns(); ++j )
1802  for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
1803  dm_(j,element->index()) -= element->value();
1804  }
1805  //**********************************************************************************************
1806 
1807  //**Transpose subtraction assignment of row-major dense matrices********************************
1818  template< typename MT2 > // Type of the right-hand side sparse matrix
1819  inline void subAssign( const SparseMatrix<MT2,false>& rhs )
1820  {
1822 
1823  BLAZE_INTERNAL_ASSERT( dm_.columns() == (~rhs).rows(), "Invalid number of rows" );
1824  BLAZE_INTERNAL_ASSERT( dm_.rows() == (~rhs).columns(), "Invalid number of columns" );
1825 
1826  typedef typename MT2::ConstIterator RhsConstIterator;
1827 
1828  for( size_t i=0UL; i<(~rhs).rows(); ++i )
1829  for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
1830  dm_(element->index(),i) -= element->value();
1831  }
1832  //**********************************************************************************************
1833 
1834  //**Transpose multiplication assignment of dense matrices***************************************
1835  // No special implementation for the transpose multiplication assignment of dense matrices.
1836  //**********************************************************************************************
1837 
1838  //**Transpose multiplication assignment of sparse matrices**************************************
1839  // No special implementation for the transpose multiplication assignment of sparse matrices.
1840  //**********************************************************************************************
1841 
1842  private:
1843  //**Member variables****************************************************************************
1844  MT& dm_;
1845  //**********************************************************************************************
1846 
1847  //**Compile time checks*************************************************************************
1853  //**********************************************************************************************
1854 };
1856 //*************************************************************************************************
1857 
1858 
1859 
1860 
1861 //=================================================================================================
1862 //
1863 // GLOBAL OPERATORS
1864 //
1865 //=================================================================================================
1866 
1867 //*************************************************************************************************
1875 template< typename MT // Type of the dense matrix
1876  , bool SO > // Storage order
1877 inline void reset( DMatTransposer<MT,SO>& m )
1878 {
1879  m.reset();
1880 }
1882 //*************************************************************************************************
1883 
1884 
1885 //*************************************************************************************************
1893 template< typename MT // Type of the dense matrix
1894  , bool SO > // Storage order
1895 inline bool isIntact( const DMatTransposer<MT,SO>& m )
1896 {
1897  return m.isIntact();
1898 }
1900 //*************************************************************************************************
1901 
1902 
1903 
1904 
1905 //=================================================================================================
1906 //
1907 // HASMUTABLEDATAACCESS SPECIALIZATIONS
1908 //
1909 //=================================================================================================
1910 
1911 //*************************************************************************************************
1913 template< typename MT, bool SO >
1914 struct HasMutableDataAccess< DMatTransposer<MT,SO> >
1915  : public IsTrue< HasMutableDataAccess<MT>::value >
1916 {};
1918 //*************************************************************************************************
1919 
1920 
1921 
1922 
1923 //=================================================================================================
1924 //
1925 // ISALIGNED SPECIALIZATIONS
1926 //
1927 //=================================================================================================
1928 
1929 //*************************************************************************************************
1931 template< typename MT, bool SO >
1932 struct IsAligned< DMatTransposer<MT,SO> > : public IsTrue< IsAligned<MT>::value >
1933 {};
1935 //*************************************************************************************************
1936 
1937 
1938 
1939 
1940 //=================================================================================================
1941 //
1942 // ISPADDED SPECIALIZATIONS
1943 //
1944 //=================================================================================================
1945 
1946 //*************************************************************************************************
1948 template< typename MT, bool SO >
1949 struct IsPadded< DMatTransposer<MT,SO> > : public IsTrue< IsPadded<MT>::value >
1950 {};
1952 //*************************************************************************************************
1953 
1954 
1955 
1956 
1957 //=================================================================================================
1958 //
1959 // SUBMATRIXTRAIT SPECIALIZATIONS
1960 //
1961 //=================================================================================================
1962 
1963 //*************************************************************************************************
1965 template< typename MT, bool SO >
1966 struct SubmatrixTrait< DMatTransposer<MT,SO> >
1967 {
1968  typedef typename SubmatrixTrait< typename DMatTransposer<MT,SO>::ResultType >::Type Type;
1969 };
1971 //*************************************************************************************************
1972 
1973 } // namespace blaze
1974 
1975 #endif
ConstReference operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatTransposer.h:149
Constraint on the data type.
void addAssign(const SparseMatrix< MT2, SO > &rhs)
Implementation of the transpose addition assignment of a row-major sparse matrix. ...
Definition: DMatTransposer.h:781
Header file for kernel specific block sizes.
bool canSMPAssign() const
Returns whether the matrix can be used in SMP assignments.
Definition: DMatTransposer.h:437
#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:88
Header file for basic type definitions.
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatTransposer.h:289
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t i, size_t j) const
Load of an intrinsic element of the matrix.
Definition: DMatTransposer.h:454
EnableIf< IsNumeric< Other >, DMatTransposer >::Type & operator/=(Other rhs)
Division assignment operator for the division of a matrix by a scalar value ( ).
Definition: DMatTransposer.h:335
#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:118
#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:79
void subAssign(const SparseMatrix< MT2,!SO > &rhs)
Implementation of the transpose subtraction assignment of a column-major sparse matrix.
Definition: DMatTransposer.h:937
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:507
size_t rows() const
Returns the current number of rows of the matrix.
Definition: DMatTransposer.h:349
Constraints on the storage order of matrix types.
void addAssign(const DenseMatrix< MT2, SO > &rhs)
Implementation of the transpose addition assignment of a row-major dense matrix.
Definition: DMatTransposer.h:706
size_t columns() const
Returns the current number of columns of the matrix.
Definition: DMatTransposer.h:359
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DMatTransposer.h:94
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2584
Header file for the intrinsic trait.
BLAZE_ALWAYS_INLINE void storea(size_t i, size_t j, const IntrinsicType &value)
Aligned store of an intrinsic element of the matrix.
Definition: DMatTransposer.h:524
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:117
MT::Iterator Iterator
Iterator over non-constant elements.
Definition: DMatTransposer.h:100
const This & CompositeType
Data type for composite expression templates.
Definition: DMatTransposer.h:95
Constraint on the data type.
Pointer data()
Low-level data access to the matrix elements.
Definition: DMatTransposer.h:199
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:835
#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:79
Reference operator()(size_t i, size_t j)
2D-access to the matrix elements.
Definition: DMatTransposer.h:135
MT::ConstPointer ConstPointer
Pointer to a constant matrix value.
Definition: DMatTransposer.h:99
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
bool isAliased(const Other *alias) const
Returns whether the matrix is aliased with the given address alias.
Definition: DMatTransposer.h:415
Header file for the DenseMatrix base class.
EnableIf< IsNumeric< Other >, DMatTransposer >::Type & operator*=(Other rhs)
Multiplication assignment operator for the multiplication between a matrix and a scalar value ( )...
Definition: DMatTransposer.h:318
Expression object for the transposition of a dense matrix.The DMatTransposer class is a wrapper objec...
Definition: DMatTransposer.h:79
MT & dm_
The dense matrix operand.
Definition: DMatTransposer.h:962
Header file for the IsAligned type trait.
bool isAligned() const
Returns whether the matrix is properly aligned in memory.
Definition: DMatTransposer.h:426
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
BLAZE_ALWAYS_INLINE IntrinsicType loadu(size_t i, size_t j) const
Unaligned load of an intrinsic element of the matrix.
Definition: DMatTransposer.h:488
MT::TransposeType ResultType
Result type for expression template evaluations.
Definition: DMatTransposer.h:89
void assign(const SparseMatrix< MT2,!SO > &rhs)
Implementation of the transpose assignment of a column-major sparse matrix.
Definition: DMatTransposer.h:679
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
BLAZE_ALWAYS_INLINE void stream(size_t i, size_t j, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the matrix.
Definition: DMatTransposer.h:560
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2590
ConstPointer data() const
Low-level data access to the matrix elements.
Definition: DMatTransposer.h:209
void reset()
Resets the matrix elements.
Definition: DMatTransposer.h:379
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:615
Header file for the IsPadded type trait.
size_t spacing() const
Returns the spacing between the beginning of two rows.
Definition: DMatTransposer.h:369
void assign(const DenseMatrix< MT2, SO > &rhs)
Implementation of the transpose assignment of a row-major dense matrix.
Definition: DMatTransposer.h:578
Header file for the IsNumeric type trait.
IntrinsicTrait< typename MT::ElementType > IT
Intrinsic trait for the vector element type.
Definition: DMatTransposer.h:83
void subAssign(const SparseMatrix< MT2, SO > &rhs)
Implementation of the transpose subtraction assignment of a row-major sparse matrix.
Definition: DMatTransposer.h:910
#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:79
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
MT::ElementType ElementType
Type of the matrix elements.
Definition: DMatTransposer.h:92
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
IT::Type IntrinsicType
Intrinsic type of the matrix elements.
Definition: DMatTransposer.h:93
Header file for run time assertion macros.
bool isIntact() const
Returns whether the invariants of the matrix are intact.
Definition: DMatTransposer.h:389
void subAssign(const DenseMatrix< MT2,!SO > &rhs)
Implementation of the transpose subtraction assignment of a column-major dense matrix.
Definition: DMatTransposer.h:873
Header file for the submatrix trait.
ConstIterator cend(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatTransposer.h:305
MT::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatTransposer.h:90
void addAssign(const DenseMatrix< MT2,!SO > &rhs)
Implementation of the transpose addition assignment of a column-major dense matrix.
Definition: DMatTransposer.h:744
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
ConstIterator cbegin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatTransposer.h:257
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2591
ConstReference at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatTransposer.h:183
bool canAlias(const Other *alias) const
Returns whether the matrix can alias with the given address alias.
Definition: DMatTransposer.h:402
MT::Reference Reference
Reference to a non-constant matrix value.
Definition: DMatTransposer.h:96
BLAZE_ALWAYS_INLINE void storeu(size_t i, size_t j, const IntrinsicType &value)
Unaligned store of an intrinsic element of the matrix.
Definition: DMatTransposer.h:542
Constraints on the storage order of matrix types.
Header file for the HasMutableDataAccess type trait.
MT::ResultType TransposeType
Transpose type for expression template evaluations.
Definition: DMatTransposer.h:91
MT::ConstReference ConstReference
Reference to a constant matrix value.
Definition: DMatTransposer.h:97
void addAssign(const SparseMatrix< MT2,!SO > &rhs)
Implementation of the transpose addition assignment of a column-major sparse matrix.
Definition: DMatTransposer.h:808
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: DMatTransposer.h:164
MT::ConstIterator ConstIterator
Iterator over constant elements.
Definition: DMatTransposer.h:101
Iterator begin(size_t i)
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatTransposer.h:225
MT::Pointer Pointer
Pointer to a non-constant matrix value.
Definition: DMatTransposer.h:98
void assign(const SparseMatrix< MT2, SO > &rhs)
Implementation of the transpose assignment of a row-major sparse matrix.
Definition: DMatTransposer.h:652
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the IsTrue value trait.
BLAZE_ALWAYS_INLINE IntrinsicType loada(size_t i, size_t j) const
Aligned load of an intrinsic element of the matrix.
Definition: DMatTransposer.h:471
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:237
DMatTransposer(MT &dm)
Constructor for the DMatTransposer class.
Definition: DMatTransposer.h:123
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2589
Header file for exception macros.
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 void store(size_t i, size_t j, const IntrinsicType &value)
Store of an intrinsic element of the matrix.
Definition: DMatTransposer.h:506
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatTransposer.h:241
Iterator end(size_t i)
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatTransposer.h:273