All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DenseColumn.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_VIEWS_DENSECOLUMN_H_
36 #define _BLAZE_MATH_VIEWS_DENSECOLUMN_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <stdexcept>
55 #include <blaze/math/Intrinsics.h>
56 #include <blaze/math/shims/Clear.h>
66 #include <blaze/system/CacheSize.h>
67 #include <blaze/system/Streaming.h>
69 #include <blaze/util/Assert.h>
71 #include <blaze/util/DisableIf.h>
72 #include <blaze/util/EnableIf.h>
74 #include <blaze/util/mpl/Or.h>
75 #include <blaze/util/Null.h>
76 #include <blaze/util/Template.h>
77 #include <blaze/util/Types.h>
83 
84 
85 namespace blaze {
86 
87 //=================================================================================================
88 //
89 // CLASS DEFINITION
90 //
91 //=================================================================================================
92 
93 //*************************************************************************************************
313 template< typename MT // Type of the dense matrix
314  , bool SO = IsColumnMajorMatrix<MT>::value // Storage order
315  , bool SF = IsSymmetric<MT>::value > // Symmetry flag
316 class DenseColumn : public DenseVector< DenseColumn<MT,SO,SF>, false >
317  , private Column
318 {
319  private:
320  //**Type definitions****************************************************************************
322  typedef typename SelectType< IsExpression<MT>::value, MT, MT& >::Type Operand;
323 
326  //**********************************************************************************************
327 
328  //**********************************************************************************************
330 
336  enum { useConst = IsConst<MT>::value };
337  //**********************************************************************************************
338 
339  public:
340  //**Type definitions****************************************************************************
344  typedef typename MT::ElementType ElementType;
345  typedef typename IT::Type IntrinsicType;
346  typedef typename MT::ReturnType ReturnType;
347  typedef const DenseColumn& CompositeType;
348 
351 
354 
356  typedef const ElementType* ConstPointer;
357 
360 
363 
366  //**********************************************************************************************
367 
368  //**Compilation flags***************************************************************************
370  enum { vectorizable = MT::vectorizable };
371 
373  enum { smpAssignable = MT::smpAssignable };
374  //**********************************************************************************************
375 
376  //**Constructors********************************************************************************
379  explicit inline DenseColumn( MT& matrix, size_t index );
380  // No explicitly declared copy constructor.
382  //**********************************************************************************************
383 
384  //**Destructor**********************************************************************************
385  // No explicitly declared destructor.
386  //**********************************************************************************************
387 
388  //**Data access functions***********************************************************************
391  inline Reference operator[]( size_t index );
392  inline ConstReference operator[]( size_t index ) const;
393  inline Pointer data ();
394  inline ConstPointer data () const;
395  inline Iterator begin ();
396  inline ConstIterator begin () const;
397  inline ConstIterator cbegin() const;
398  inline Iterator end ();
399  inline ConstIterator end () const;
400  inline ConstIterator cend () const;
402  //**********************************************************************************************
403 
404  //**Assignment operators************************************************************************
407  inline DenseColumn& operator= ( const ElementType& rhs );
408  inline DenseColumn& operator= ( const DenseColumn& rhs );
409  template< typename VT > inline DenseColumn& operator= ( const Vector<VT,false>& rhs );
410  template< typename VT > inline DenseColumn& operator+=( const Vector<VT,false>& rhs );
411  template< typename VT > inline DenseColumn& operator-=( const Vector<VT,false>& rhs );
412  template< typename VT > inline DenseColumn& operator*=( const Vector<VT,false>& rhs );
413 
414  template< typename Other >
415  inline typename EnableIf< IsNumeric<Other>, DenseColumn >::Type&
416  operator*=( Other rhs );
417 
418  template< typename Other >
419  inline typename EnableIf< IsNumeric<Other>, DenseColumn >::Type&
420  operator/=( Other rhs );
422  //**********************************************************************************************
423 
424  //**Utility functions***************************************************************************
427  inline size_t size() const;
428  inline size_t capacity() const;
429  inline size_t nonZeros() const;
430  inline void reset();
431  template< typename Other > inline DenseColumn& scale( const Other& scalar );
433  //**********************************************************************************************
434 
435  private:
436  //**********************************************************************************************
438  template< typename VT >
440  struct VectorizedAssign {
441  enum { value = vectorizable && VT::vectorizable &&
442  IsSame<ElementType,typename VT::ElementType>::value };
443  };
445  //**********************************************************************************************
446 
447  //**********************************************************************************************
449  template< typename VT >
451  struct VectorizedAddAssign {
452  enum { value = vectorizable && VT::vectorizable &&
453  IsSame<ElementType,typename VT::ElementType>::value &&
454  IntrinsicTrait<ElementType>::addition };
455  };
457  //**********************************************************************************************
458 
459  //**********************************************************************************************
461  template< typename VT >
463  struct VectorizedSubAssign {
464  enum { value = vectorizable && VT::vectorizable &&
465  IsSame<ElementType,typename VT::ElementType>::value &&
466  IntrinsicTrait<ElementType>::subtraction };
467  };
469  //**********************************************************************************************
470 
471  //**********************************************************************************************
473  template< typename VT >
475  struct VectorizedMultAssign {
476  enum { value = vectorizable && VT::vectorizable &&
477  IsSame<ElementType,typename VT::ElementType>::value &&
478  IntrinsicTrait<ElementType>::multiplication };
479  };
481  //**********************************************************************************************
482 
483  public:
484  //**Expression template evaluation functions****************************************************
487  template< typename Other >
488  inline bool canAlias( const Other* alias ) const;
489 
490  template< typename MT2, bool SO2, bool SF2 >
491  inline bool canAlias( const DenseColumn<MT2,SO2,SF2>* alias ) const;
492 
493  template< typename Other >
494  inline bool isAliased( const Other* alias ) const;
495 
496  template< typename MT2, bool SO2, bool SF2 >
497  inline bool isAliased( const DenseColumn<MT2,SO2,SF2>* alias ) const;
498 
499  inline bool isAligned () const;
500  inline bool canSMPAssign() const;
501 
502  inline IntrinsicType load ( size_t index ) const;
503  inline IntrinsicType loadu ( size_t index ) const;
504  inline void store ( size_t index, const IntrinsicType& value );
505  inline void storeu( size_t index, const IntrinsicType& value );
506  inline void stream( size_t index, const IntrinsicType& value );
507 
508  template< typename VT >
509  inline typename DisableIf< VectorizedAssign<VT> >::Type
510  assign( const DenseVector<VT,false>& rhs );
511 
512  template< typename VT >
513  inline typename EnableIf< VectorizedAssign<VT> >::Type
514  assign( const DenseVector<VT,false>& rhs );
515 
516  template< typename VT > inline void assign( const SparseVector<VT,false>& rhs );
517 
518  template< typename VT >
519  inline typename DisableIf< VectorizedAddAssign<VT> >::Type
520  addAssign( const DenseVector<VT,false>& rhs );
521 
522  template< typename VT >
523  inline typename EnableIf< VectorizedAddAssign<VT> >::Type
524  addAssign( const DenseVector<VT,false>& rhs );
525 
526  template< typename VT > inline void addAssign( const SparseVector<VT,false>& rhs );
527 
528  template< typename VT >
529  inline typename DisableIf< VectorizedSubAssign<VT> >::Type
530  subAssign( const DenseVector<VT,false>& rhs );
531 
532  template< typename VT >
533  inline typename EnableIf< VectorizedSubAssign<VT> >::Type
534  subAssign( const DenseVector<VT,false>& rhs );
535 
536  template< typename VT > inline void subAssign( const SparseVector<VT,false>& rhs );
537 
538  template< typename VT >
539  inline typename DisableIf< VectorizedMultAssign<VT> >::Type
540  multAssign( const DenseVector<VT,false>& rhs );
541 
542  template< typename VT >
543  inline typename EnableIf< VectorizedMultAssign<VT> >::Type
544  multAssign( const DenseVector<VT,false>& rhs );
545 
546  template< typename VT > inline void multAssign( const SparseVector<VT,false>& rhs );
548  //**********************************************************************************************
549 
550  private:
551  //**Member variables****************************************************************************
555  const size_t col_;
556 
557  //**********************************************************************************************
558 
559  //**Friend declarations*************************************************************************
561  template< typename MT2, bool SO2, bool SF2 > friend class DenseColumn;
562 
563  template< typename MT2, bool SO2, bool SF2 >
564  friend bool isSame( const DenseColumn<MT2,SO2,SF2>& a, const DenseColumn<MT2,SO2,SF2>& b );
566  //**********************************************************************************************
567 
568  //**Compile time checks*************************************************************************
575  //**********************************************************************************************
576 };
577 //*************************************************************************************************
578 
579 
580 
581 
582 //=================================================================================================
583 //
584 // CONSTRUCTOR
585 //
586 //=================================================================================================
587 
588 //*************************************************************************************************
595 template< typename MT // Type of the dense matrix
596  , bool SO // Storage order
597  , bool SF > // Symmetry flag
598 inline DenseColumn<MT,SO,SF>::DenseColumn( MT& matrix, size_t index )
599  : matrix_( matrix ) // The dense matrix containing the column
600  , col_ ( index ) // The index of the column in the matrix
601 {
602  if( matrix_.columns() <= index )
603  throw std::invalid_argument( "Invalid column access index" );
604 }
605 //*************************************************************************************************
606 
607 
608 
609 
610 //=================================================================================================
611 //
612 // DATA ACCESS FUNCTIONS
613 //
614 //=================================================================================================
615 
616 //*************************************************************************************************
622 template< typename MT // Type of the dense matrix
623  , bool SO // Storage order
624  , bool SF > // Symmetry flag
626 {
627  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
628  return matrix_(index,col_);
629 }
630 //*************************************************************************************************
631 
632 
633 //*************************************************************************************************
639 template< typename MT // Type of the dense matrix
640  , bool SO // Storage order
641  , bool SF > // Symmetry flag
643  DenseColumn<MT,SO,SF>::operator[]( size_t index ) const
644 {
645  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
646  return matrix_(index,col_);
647 }
648 //*************************************************************************************************
649 
650 
651 //*************************************************************************************************
658 template< typename MT // Type of the dense matrix
659  , bool SO // Storage order
660  , bool SF > // Symmetry flag
662 {
663  return matrix_.data( col_ );
664 }
665 //*************************************************************************************************
666 
667 
668 //*************************************************************************************************
675 template< typename MT // Type of the dense matrix
676  , bool SO // Storage order
677  , bool SF > // Symmetry flag
679 {
680  return matrix_.data( col_ );
681 }
682 //*************************************************************************************************
683 
684 
685 //*************************************************************************************************
692 template< typename MT // Type of the dense matrix
693  , bool SO // Storage order
694  , bool SF > // Symmetry flag
696 {
697  return matrix_.begin( col_ );
698 }
699 //*************************************************************************************************
700 
701 
702 //*************************************************************************************************
709 template< typename MT // Type of the dense matrix
710  , bool SO // Storage order
711  , bool SF > // Symmetry flag
713 {
714  return matrix_.cbegin( col_ );
715 }
716 //*************************************************************************************************
717 
718 
719 //*************************************************************************************************
726 template< typename MT // Type of the dense matrix
727  , bool SO // Storage order
728  , bool SF > // Symmetry flag
730 {
731  return matrix_.cbegin( col_ );
732 }
733 //*************************************************************************************************
734 
735 
736 //*************************************************************************************************
743 template< typename MT // Type of the dense matrix
744  , bool SO // Storage order
745  , bool SF > // Symmetry flag
747 {
748  return matrix_.end( col_ );
749 }
750 //*************************************************************************************************
751 
752 
753 //*************************************************************************************************
760 template< typename MT // Type of the dense matrix
761  , bool SO // Storage order
762  , bool SF > // Symmetry flag
764 {
765  return matrix_.cend( col_ );
766 }
767 //*************************************************************************************************
768 
769 
770 //*************************************************************************************************
777 template< typename MT // Type of the dense matrix
778  , bool SO // Storage order
779  , bool SF > // Symmetry flag
781 {
782  return matrix_.cend( col_ );
783 }
784 //*************************************************************************************************
785 
786 
787 
788 
789 //=================================================================================================
790 //
791 // ASSIGNMENT OPERATORS
792 //
793 //=================================================================================================
794 
795 //*************************************************************************************************
801 template< typename MT // Type of the dense matrix
802  , bool SO // Storage order
803  , bool SF > // Symmetry flag
805 {
806  const size_t rows( size() );
807 
808  for( size_t i=0UL; i<rows; ++i )
809  matrix_(i,col_) = rhs;
810 
811  return *this;
812 }
813 //*************************************************************************************************
814 
815 
816 //*************************************************************************************************
826 template< typename MT // Type of the dense matrix
827  , bool SO // Storage order
828  , bool SF > // Symmetry flag
830 {
831  if( &rhs == this ) return *this;
832 
833  if( size() != rhs.size() )
834  throw std::invalid_argument( "Column sizes do not match" );
835 
836  const size_t rows( size() );
837 
838  for( size_t i=0UL; i<rows; ++i )
839  matrix_(i,col_) = rhs[i];
840 
841  return *this;
842 }
843 //*************************************************************************************************
844 
845 
846 //*************************************************************************************************
856 template< typename MT // Type of the dense matrix
857  , bool SO // Storage order
858  , bool SF > // Symmetry flag
859 template< typename VT > // Type of the right-hand side vector
861 {
864 
865  if( size() != (~rhs).size() )
866  throw std::invalid_argument( "Vector sizes do not match" );
867 
868  if( (~rhs).canAlias( &matrix_ ) ) {
869  const typename VT::ResultType tmp( ~rhs );
870  smpAssign( *this, tmp );
871  }
872  else {
874  reset();
875  smpAssign( *this, ~rhs );
876  }
877 
878  return *this;
879 }
880 //*************************************************************************************************
881 
882 
883 //*************************************************************************************************
893 template< typename MT // Type of the dense matrix
894  , bool SO // Storage order
895  , bool SF > // Symmetry flag
896 template< typename VT > // Type of the right-hand side vector
898 {
901 
902  if( size() != (~rhs).size() )
903  throw std::invalid_argument( "Vector sizes do not match" );
904 
905  if( (~rhs).canAlias( &matrix_ ) ) {
906  const typename VT::ResultType tmp( ~rhs );
907  smpAddAssign( *this, tmp );
908  }
909  else {
910  smpAddAssign( *this, ~rhs );
911  }
912 
913  return *this;
914 }
915 //*************************************************************************************************
916 
917 
918 //*************************************************************************************************
928 template< typename MT // Type of the dense matrix
929  , bool SO // Storage order
930  , bool SF > // Symmetry flag
931 template< typename VT > // Type of the right-hand side vector
933 {
936 
937  if( size() != (~rhs).size() )
938  throw std::invalid_argument( "Vector sizes do not match" );
939 
940  if( (~rhs).canAlias( &matrix_ ) ) {
941  const typename VT::ResultType tmp( ~rhs );
942  smpSubAssign( *this, tmp );
943  }
944  else {
945  smpSubAssign( *this, ~rhs );
946  }
947 
948  return *this;
949 }
950 //*************************************************************************************************
951 
952 
953 //*************************************************************************************************
964 template< typename MT // Type of the dense matrix
965  , bool SO // Storage order
966  , bool SF > // Symmetry flag
967 template< typename VT > // Type of the right-hand side vector
969 {
972 
973  if( size() != (~rhs).size() )
974  throw std::invalid_argument( "Vector sizes do not match" );
975 
976  if( (~rhs).canAlias( &matrix_ ) || IsSparseVector<VT>::value ) {
977  const ResultType tmp( *this * (~rhs) );
978  smpAssign( *this, tmp );
979  }
980  else {
981  smpMultAssign( *this, ~rhs );
982  }
983 
984  return *this;
985 }
986 //*************************************************************************************************
987 
988 
989 //*************************************************************************************************
996 template< typename MT // Type of the dense matrix
997  , bool SO // Storage order
998  , bool SF > // Symmetry flag
999 template< typename Other > // Data type of the right-hand side scalar
1000 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,SO,SF> >::Type&
1002 {
1003  return operator=( (*this) * rhs );
1004 }
1005 //*************************************************************************************************
1006 
1007 
1008 //*************************************************************************************************
1017 template< typename MT // Type of the dense matrix
1018  , bool SO // Storage order
1019  , bool SF > // Symmetry flag
1020 template< typename Other > // Data type of the right-hand side scalar
1021 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,SO,SF> >::Type&
1023 {
1024  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
1025 
1026  return operator=( (*this) / rhs );
1027 }
1028 //*************************************************************************************************
1029 
1030 
1031 
1032 
1033 //=================================================================================================
1034 //
1035 // UTILITY FUNCTIONS
1036 //
1037 //=================================================================================================
1038 
1039 //*************************************************************************************************
1044 template< typename MT // Type of the dense matrix
1045  , bool SO // Storage order
1046  , bool SF > // Symmetry flag
1047 inline size_t DenseColumn<MT,SO,SF>::size() const
1048 {
1049  return matrix_.rows();
1050 }
1051 //*************************************************************************************************
1052 
1053 
1054 //*************************************************************************************************
1059 template< typename MT // Type of the dense matrix
1060  , bool SO // Storage order
1061  , bool SF > // Symmetry flag
1062 inline size_t DenseColumn<MT,SO,SF>::capacity() const
1063 {
1064  return matrix_.capacity( col_ );
1065 }
1066 //*************************************************************************************************
1067 
1068 
1069 //*************************************************************************************************
1077 template< typename MT // Type of the dense matrix
1078  , bool SO // Storage order
1079  , bool SF > // Symmetry flag
1080 inline size_t DenseColumn<MT,SO,SF>::nonZeros() const
1081 {
1082  return matrix_.nonZeros( col_ );
1083 }
1084 //*************************************************************************************************
1085 
1086 
1087 //*************************************************************************************************
1092 template< typename MT // Type of the dense matrix
1093  , bool SO // Storage order
1094  , bool SF > // Symmetry flag
1096 {
1097  matrix_.reset( col_ );
1098 }
1099 //*************************************************************************************************
1100 
1101 
1102 //*************************************************************************************************
1108 template< typename MT // Type of the dense matrix
1109  , bool SO // Storage order
1110  , bool SF > // Symmetry flag
1111 template< typename Other > // Data type of the scalar value
1113 {
1114  for( size_t i=0UL; i<size(); ++i ) {
1115  matrix_(i,col_) *= scalar;
1116  }
1117  return *this;
1118 }
1119 //*************************************************************************************************
1120 
1121 
1122 
1123 
1124 //=================================================================================================
1125 //
1126 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
1127 //
1128 //=================================================================================================
1129 
1130 //*************************************************************************************************
1140 template< typename MT // Type of the dense matrix
1141  , bool SO // Storage order
1142  , bool SF > // Symmetry flag
1143 template< typename Other > // Data type of the foreign expression
1144 inline bool DenseColumn<MT,SO,SF>::canAlias( const Other* alias ) const
1145 {
1146  return matrix_.isAliased( alias );
1147 }
1148 //*************************************************************************************************
1149 
1150 
1151 //*************************************************************************************************
1161 template< typename MT // Type of the dense matrix
1162  , bool SO // Storage order
1163  , bool SF > // Symmetry flag
1164 template< typename MT2 // Data type of the foreign dense column
1165  , bool SO2 // Storage order of the foreign dense column
1166  , bool SF2 > // Symmetry flag of the foreign dense column
1168 {
1169  return matrix_.isAliased( alias->matrix_ ) && ( col_ == alias->col_ );
1170 }
1171 //*************************************************************************************************
1172 
1173 
1174 //*************************************************************************************************
1184 template< typename MT // Type of the dense matrix
1185  , bool SO // Storage order
1186  , bool SF > // Symmetry flag
1187 template< typename Other > // Data type of the foreign expression
1188 inline bool DenseColumn<MT,SO,SF>::isAliased( const Other* alias ) const
1189 {
1190  return matrix_.isAliased( alias );
1191 }
1192 //*************************************************************************************************
1193 
1194 
1195 //*************************************************************************************************
1205 template< typename MT // Type of the dense matrix
1206  , bool SO // Storage order
1207  , bool SF > // Symmetry flag
1208 template< typename MT2 // Data type of the foreign dense column
1209  , bool SO2 // Storage order of the foreign dense column
1210  , bool SF2 > // Symmetry flag of the foreign dense column
1212 {
1213  return matrix_.isAliased( &alias->matrix_ ) && ( col_ == alias->col_ );
1214 }
1215 //*************************************************************************************************
1216 
1217 
1218 //*************************************************************************************************
1227 template< typename MT // Type of the dense matrix
1228  , bool SO // Storage order
1229  , bool SF > // Symmetry flag
1231 {
1232  return matrix_.isAligned();
1233 }
1234 //*************************************************************************************************
1235 
1236 
1237 //*************************************************************************************************
1247 template< typename MT // Type of the dense matrix
1248  , bool SO // Storage order
1249  , bool SF > // Symmetry flag
1251 {
1252  return ( size() > SMP_DVECASSIGN_THRESHOLD );
1253 }
1254 //*************************************************************************************************
1255 
1256 
1257 //*************************************************************************************************
1269 template< typename MT // Type of the dense matrix
1270  , bool SO // Storage order
1271  , bool SF > // Symmetry flag
1273 {
1274  return matrix_.load( index, col_ );
1275 }
1276 //*************************************************************************************************
1277 
1278 
1279 //*************************************************************************************************
1291 template< typename MT // Type of the dense matrix
1292  , bool SO // Storage order
1293  , bool SF > // Symmetry flag
1295 {
1296  return matrix_.loadu( index, col_ );
1297 }
1298 //*************************************************************************************************
1299 
1300 
1301 //*************************************************************************************************
1314 template< typename MT // Type of the dense matrix
1315  , bool SO // Storage order
1316  , bool SF > // Symmetry flag
1317 inline void DenseColumn<MT,SO,SF>::store( size_t index, const IntrinsicType& value )
1318 {
1319  matrix_.store( index, col_, value );
1320 }
1321 //*************************************************************************************************
1322 
1323 
1324 //*************************************************************************************************
1337 template< typename MT // Type of the dense matrix
1338  , bool SO // Storage order
1339  , bool SF > // Symmetry flag
1340 inline void DenseColumn<MT,SO,SF>::storeu( size_t index, const IntrinsicType& value )
1341 {
1342  matrix_.storeu( index, col_, value );
1343 }
1344 //*************************************************************************************************
1345 
1346 
1347 //*************************************************************************************************
1360 template< typename MT // Type of the dense matrix
1361  , bool SO // Storage order
1362  , bool SF > // Symmetry flag
1363 inline void DenseColumn<MT,SO,SF>::stream( size_t index, const IntrinsicType& value )
1364 {
1365  matrix_.stream( index, col_, value );
1366 }
1367 //*************************************************************************************************
1368 
1369 
1370 //*************************************************************************************************
1381 template< typename MT // Type of the dense matrix
1382  , bool SO // Storage order
1383  , bool SF > // Symmetry flag
1384 template< typename VT > // Type of the right-hand side dense vector
1385 inline typename DisableIf< typename DenseColumn<MT,SO,SF>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type
1387 {
1388  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1389 
1390  const size_t iend( (~rhs).size() & size_t(-2) );
1391  for( size_t i=0UL; i<iend; i+=2UL ) {
1392  matrix_(i ,col_) = (~rhs)[i ];
1393  matrix_(i+1UL,col_) = (~rhs)[i+1UL];
1394  }
1395  if( iend < (~rhs).size() )
1396  matrix_(iend,col_) = (~rhs)[iend];
1397 }
1398 //*************************************************************************************************
1399 
1400 
1401 //*************************************************************************************************
1412 template< typename MT // Type of the dense matrix
1413  , bool SO // Storage order
1414  , bool SF > // Symmetry flag
1415 template< typename VT > // Type of the right-hand side dense vector
1416 inline typename EnableIf< typename DenseColumn<MT,SO,SF>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type
1418 {
1419  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1420 
1422 
1423  const size_t rows( size() );
1424 
1425  if( useStreaming && rows > ( cacheSize/( sizeof(ElementType) * 3UL ) ) && !(~rhs).isAliased( this ) )
1426  {
1427  for( size_t i=0UL; i<rows; i+=IT::size ) {
1428  matrix_.stream( i, col_, (~rhs).load(i) );
1429  }
1430  }
1431  else
1432  {
1433  const size_t iend( rows & size_t(-IT::size*4) );
1434  BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (IT::size*4UL) ) ) == iend, "Invalid end calculation" );
1435 
1436  typename VT::ConstIterator it( (~rhs).begin() );
1437  for( size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1438  matrix_.store( i , col_, it.load() ); it+=IT::size;
1439  matrix_.store( i+IT::size , col_, it.load() ); it+=IT::size;
1440  matrix_.store( i+IT::size*2UL, col_, it.load() ); it+=IT::size;
1441  matrix_.store( i+IT::size*3UL, col_, it.load() ); it+=IT::size;
1442  }
1443  for( size_t i=iend; i<rows; i+=IT::size, it+=IT::size ) {
1444  matrix_.store( i, col_, it.load() );
1445  }
1446  }
1447 }
1448 //*************************************************************************************************
1449 
1450 
1451 //*************************************************************************************************
1462 template< typename MT // Type of the dense matrix
1463  , bool SO // Storage order
1464  , bool SF > // Symmetry flag
1465 template< typename VT > // Type of the right-hand side sparse vector
1467 {
1468  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1469 
1470  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1471  matrix_(element->index(),col_) = element->value();
1472 }
1473 //*************************************************************************************************
1474 
1475 
1476 //*************************************************************************************************
1487 template< typename MT // Type of the dense matrix
1488  , bool SO // Storage order
1489  , bool SF > // Symmetry flag
1490 template< typename VT > // Type of the right-hand side dense vector
1491 inline typename DisableIf< typename DenseColumn<MT,SO,SF>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type
1493 {
1494  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1495 
1496  const size_t iend( (~rhs).size() & size_t(-2) );
1497  for( size_t i=0UL; i<iend; i+=2UL ) {
1498  matrix_(i ,col_) += (~rhs)[i ];
1499  matrix_(i+1UL,col_) += (~rhs)[i+1UL];
1500  }
1501  if( iend < (~rhs).size() )
1502  matrix_(iend,col_) += (~rhs)[iend];
1503 }
1504 //*************************************************************************************************
1505 
1506 
1507 //*************************************************************************************************
1518 template< typename MT // Type of the dense matrix
1519  , bool SO // Storage order
1520  , bool SF > // Symmetry flag
1521 template< typename VT > // Type of the right-hand side dense vector
1522 inline typename EnableIf< typename DenseColumn<MT,SO,SF>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type
1524 {
1525  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1526 
1528 
1529  const size_t rows( size() );
1530 
1531  const size_t iend( rows & size_t(-IT::size*4) );
1532  BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (IT::size*4UL) ) ) == iend, "Invalid end calculation" );
1533 
1534  typename VT::ConstIterator it( (~rhs).begin() );
1535  for( size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1536  matrix_.store( i , col_, matrix_.load(i ,col_) + it.load() ); it += IT::size;
1537  matrix_.store( i+IT::size , col_, matrix_.load(i+IT::size ,col_) + it.load() ); it += IT::size;
1538  matrix_.store( i+IT::size*2UL, col_, matrix_.load(i+IT::size*2UL,col_) + it.load() ); it += IT::size;
1539  matrix_.store( i+IT::size*3UL, col_, matrix_.load(i+IT::size*3UL,col_) + it.load() ); it += IT::size;
1540  }
1541  for( size_t i=iend; i<rows; i+=IT::size, it+=IT::size ) {
1542  matrix_.store( i, col_, matrix_.load(i,col_) + it.load() );
1543  }
1544 }
1545 //*************************************************************************************************
1546 
1547 
1548 //*************************************************************************************************
1559 template< typename MT // Type of the dense matrix
1560  , bool SO // Storage order
1561  , bool SF > // Symmetry flag
1562 template< typename VT > // Type of the right-hand side sparse vector
1564 {
1565  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1566 
1567  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1568  matrix_(element->index(),col_) += element->value();
1569 }
1570 //*************************************************************************************************
1571 
1572 
1573 //*************************************************************************************************
1584 template< typename MT // Type of the dense matrix
1585  , bool SO // Storage order
1586  , bool SF > // Symmetry flag
1587 template< typename VT > // Type of the right-hand side dense vector
1588 inline typename DisableIf< typename DenseColumn<MT,SO,SF>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type
1590 {
1591  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1592 
1593  const size_t iend( (~rhs).size() & size_t(-2) );
1594  for( size_t i=0UL; i<iend; i+=2UL ) {
1595  matrix_(i ,col_) -= (~rhs)[i ];
1596  matrix_(i+1UL,col_) -= (~rhs)[i+1UL];
1597  }
1598  if( iend < (~rhs).size() )
1599  matrix_(iend,col_) -= (~rhs)[iend];
1600 }
1601 //*************************************************************************************************
1602 
1603 
1604 //*************************************************************************************************
1615 template< typename MT // Type of the dense matrix
1616  , bool SO // Storage order
1617  , bool SF > // Symmetry flag
1618 template< typename VT > // Type of the right-hand side dense vector
1619 inline typename EnableIf< typename DenseColumn<MT,SO,SF>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type
1621 {
1622  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1623 
1625 
1626  const size_t rows( size() );
1627 
1628  const size_t iend( rows & size_t(-IT::size*4) );
1629  BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (IT::size*4UL) ) ) == iend, "Invalid end calculation" );
1630 
1631  typename VT::ConstIterator it( (~rhs).begin() );
1632  for( size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1633  matrix_.store( i , col_, matrix_.load(i ,col_) - it.load() ); it += IT::size;
1634  matrix_.store( i+IT::size , col_, matrix_.load(i+IT::size ,col_) - it.load() ); it += IT::size;
1635  matrix_.store( i+IT::size*2UL, col_, matrix_.load(i+IT::size*2UL,col_) - it.load() ); it += IT::size;
1636  matrix_.store( i+IT::size*3UL, col_, matrix_.load(i+IT::size*3UL,col_) - it.load() ); it += IT::size;
1637  }
1638  for( size_t i=iend; i<rows; i+=IT::size, it+=IT::size ) {
1639  matrix_.store( i, col_, matrix_.load(i,col_) - it.load() );
1640  }
1641 }
1642 //*************************************************************************************************
1643 
1644 
1645 //*************************************************************************************************
1656 template< typename MT // Type of the dense matrix
1657  , bool SO // Storage order
1658  , bool SF > // Symmetry flag
1659 template< typename VT > // Type of the right-hand side sparse vector
1661 {
1662  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1663 
1664  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1665  matrix_(element->index(),col_) -= element->value();
1666 }
1667 //*************************************************************************************************
1668 
1669 
1670 //*************************************************************************************************
1681 template< typename MT // Type of the dense matrix
1682  , bool SO // Storage order
1683  , bool SF > // Symmetry flag
1684 template< typename VT > // Type of the right-hand side dense vector
1685 inline typename DisableIf< typename DenseColumn<MT,SO,SF>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type
1687 {
1688  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1689 
1690  const size_t iend( (~rhs).size() & size_t(-2) );
1691  for( size_t i=0UL; i<iend; i+=2UL ) {
1692  matrix_(i ,col_) *= (~rhs)[i ];
1693  matrix_(i+1UL,col_) *= (~rhs)[i+1UL];
1694  }
1695  if( iend < (~rhs).size() )
1696  matrix_(iend,col_) *= (~rhs)[iend];
1697 }
1698 //*************************************************************************************************
1699 
1700 
1701 //*************************************************************************************************
1712 template< typename MT // Type of the dense matrix
1713  , bool SO // Storage order
1714  , bool SF > // Symmetry flag
1715 template< typename VT > // Type of the right-hand side dense vector
1716 inline typename EnableIf< typename DenseColumn<MT,SO,SF>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type
1718 {
1719  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1720 
1722 
1723  const size_t rows( size() );
1724 
1725  const size_t iend( rows & size_t(-IT::size*4) );
1726  BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (IT::size*4UL) ) ) == iend, "Invalid end calculation" );
1727 
1728  typename VT::ConstIterator it( (~rhs).begin() );
1729  for( size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1730  matrix_.store( i , col_, matrix_.load(i ,col_) * it.load() ); it += IT::size;
1731  matrix_.store( i+IT::size , col_, matrix_.load(i+IT::size ,col_) * it.load() ); it += IT::size;
1732  matrix_.store( i+IT::size*2UL, col_, matrix_.load(i+IT::size*2UL,col_) * it.load() ); it += IT::size;
1733  matrix_.store( i+IT::size*3UL, col_, matrix_.load(i+IT::size*3UL,col_) * it.load() ); it += IT::size;
1734  }
1735  for( size_t i=iend; i<rows; i+=IT::size, it+=IT::size ) {
1736  matrix_.store( i, col_, matrix_.load(i,col_) * it.load() );
1737  }
1738 }
1739 //*************************************************************************************************
1740 
1741 
1742 //*************************************************************************************************
1753 template< typename MT // Type of the dense matrix
1754  , bool SO // Storage order
1755  , bool SF > // Symmetry flag
1756 template< typename VT > // Type of the right-hand side sparse vector
1758 {
1759  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1760 
1761  const ResultType tmp( serial( *this ) );
1762 
1763  reset();
1764 
1765  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1766  matrix_(element->index(),col_) = tmp[element->index()] * element->value();
1767 }
1768 //*************************************************************************************************
1769 
1770 
1771 
1772 
1773 
1774 
1775 
1776 
1777 //=================================================================================================
1778 //
1779 // CLASS TEMPLATE SPECIALIZATION FOR GENERAL ROW-MAJOR MATRICES
1780 //
1781 //=================================================================================================
1782 
1783 //*************************************************************************************************
1791 template< typename MT > // Type of the dense matrix
1792 class DenseColumn<MT,false,false> : public DenseVector< DenseColumn<MT,false,false>, false >
1793  , private Column
1794 {
1795  private:
1796  //**Type definitions****************************************************************************
1798  typedef typename SelectType< IsExpression<MT>::value, MT, MT& >::Type Operand;
1799  //**********************************************************************************************
1800 
1801  //**********************************************************************************************
1803 
1809  enum { useConst = IsConst<MT>::value };
1810  //**********************************************************************************************
1811 
1812  public:
1813  //**Type definitions****************************************************************************
1814  typedef DenseColumn<MT,false,false> This;
1815  typedef typename ColumnTrait<MT>::Type ResultType;
1816  typedef typename ResultType::TransposeType TransposeType;
1817  typedef typename MT::ElementType ElementType;
1818  typedef typename MT::ReturnType ReturnType;
1819  typedef const DenseColumn& CompositeType;
1820 
1822  typedef typename MT::ConstReference ConstReference;
1823 
1825  typedef typename SelectType< useConst, ConstReference, typename MT::Reference >::Type Reference;
1826  //**********************************************************************************************
1827 
1828  //**ColumnIterator class definition*************************************************************
1831  template< typename MatrixType > // Type of the dense matrix
1832  class ColumnIterator
1833  {
1834  private:
1835  //*******************************************************************************************
1837 
1842  enum { returnConst = IsConst<MatrixType>::value };
1843  //*******************************************************************************************
1844 
1845  public:
1846  //**Type definitions*************************************************************************
1848  typedef typename SelectType< returnConst
1849  , typename MatrixType::ConstReference
1850  , typename MatrixType::Reference >::Type Reference;
1851 
1852  typedef std::random_access_iterator_tag IteratorCategory;
1853  typedef RemoveReference<Reference> ValueType;
1854  typedef ValueType* PointerType;
1855  typedef Reference ReferenceType;
1856  typedef ptrdiff_t DifferenceType;
1857 
1858  // STL iterator requirements
1859  typedef IteratorCategory iterator_category;
1860  typedef ValueType value_type;
1861  typedef PointerType pointer;
1862  typedef ReferenceType reference;
1863  typedef DifferenceType difference_type;
1864  //*******************************************************************************************
1865 
1866  //**Constructor******************************************************************************
1869  inline ColumnIterator()
1870  : matrix_( NULL ) // The dense matrix containing the column.
1871  , row_ ( 0UL ) // The current row index.
1872  , column_( 0UL ) // The current column index.
1873  {}
1874  //*******************************************************************************************
1875 
1876  //**Constructor******************************************************************************
1883  inline ColumnIterator( MatrixType& matrix, size_t row, size_t column )
1884  : matrix_( &matrix ) // The dense matrix containing the column.
1885  , row_ ( row ) // The current row index.
1886  , column_( column ) // The current column index.
1887  {}
1888  //*******************************************************************************************
1889 
1890  //**Constructor******************************************************************************
1895  template< typename MatrixType2 >
1896  inline ColumnIterator( const ColumnIterator<MatrixType2>& it )
1897  : matrix_( it.matrix_ ) // The dense matrix containing the column.
1898  , row_ ( it.row_ ) // The current row index.
1899  , column_( it.column_ ) // The current column index.
1900  {}
1901  //*******************************************************************************************
1902 
1903  //**Addition assignment operator*************************************************************
1909  inline ColumnIterator& operator+=( size_t inc ) {
1910  row_ += inc;
1911  return *this;
1912  }
1913  //*******************************************************************************************
1914 
1915  //**Subtraction assignment operator**********************************************************
1921  inline ColumnIterator& operator-=( size_t dec ) {
1922  row_ -= dec;
1923  return *this;
1924  }
1925  //*******************************************************************************************
1926 
1927  //**Prefix increment operator****************************************************************
1932  inline ColumnIterator& operator++() {
1933  ++row_;
1934  return *this;
1935  }
1936  //*******************************************************************************************
1937 
1938  //**Postfix increment operator***************************************************************
1943  inline const ColumnIterator operator++( int ) {
1944  const ColumnIterator tmp( *this );
1945  ++(*this);
1946  return tmp;
1947  }
1948  //*******************************************************************************************
1949 
1950  //**Prefix decrement operator****************************************************************
1955  inline ColumnIterator& operator--() {
1956  --row_;
1957  return *this;
1958  }
1959  //*******************************************************************************************
1960 
1961  //**Postfix decrement operator***************************************************************
1966  inline const ColumnIterator operator--( int ) {
1967  const ColumnIterator tmp( *this );
1968  --(*this);
1969  return tmp;
1970  }
1971  //*******************************************************************************************
1972 
1973  //**Subscript operator***********************************************************************
1979  inline ReferenceType operator[]( size_t index ) const {
1980  return (*matrix_)(row_+index,column_);
1981  }
1982  //*******************************************************************************************
1983 
1984  //**Element access operator******************************************************************
1989  inline ReferenceType operator*() const {
1990  return (*matrix_)(row_,column_);
1991  }
1992  //*******************************************************************************************
1993 
1994  //**Element access operator******************************************************************
1999  inline PointerType operator->() const {
2000  return &(*matrix_)(row_,column_);
2001  }
2002  //*******************************************************************************************
2003 
2004  //**Equality operator************************************************************************
2010  template< typename MatrixType2 >
2011  inline bool operator==( const ColumnIterator<MatrixType2>& rhs ) const {
2012  return ( matrix_ == rhs.matrix_ ) && ( row_ == rhs.row_ ) && ( column_ == rhs.column_ );
2013  }
2014  //*******************************************************************************************
2015 
2016  //**Inequality operator**********************************************************************
2022  template< typename MatrixType2 >
2023  inline bool operator!=( const ColumnIterator<MatrixType2>& rhs ) const {
2024  return !( *this == rhs );
2025  }
2026  //*******************************************************************************************
2027 
2028  //**Less-than operator***********************************************************************
2034  template< typename MatrixType2 >
2035  inline bool operator<( const ColumnIterator<MatrixType2>& rhs ) const {
2036  return ( matrix_ == rhs.matrix_ ) && ( row_ < rhs.row_ ) && ( column_ == rhs.column_ );
2037  }
2038  //*******************************************************************************************
2039 
2040  //**Greater-than operator********************************************************************
2046  template< typename MatrixType2 >
2047  inline bool operator>( const ColumnIterator<MatrixType2>& rhs ) const {
2048  return ( matrix_ == rhs.matrix_ ) && ( row_ > rhs.row_ ) && ( column_ == rhs.column_ );
2049  }
2050  //*******************************************************************************************
2051 
2052  //**Less-or-equal-than operator**************************************************************
2058  template< typename MatrixType2 >
2059  inline bool operator<=( const ColumnIterator<MatrixType2>& rhs ) const {
2060  return ( matrix_ == rhs.matrix_ ) && ( row_ <= rhs.row_ ) && ( column_ == rhs.column_ );
2061  }
2062  //*******************************************************************************************
2063 
2064  //**Greater-or-equal-than operator***********************************************************
2070  template< typename MatrixType2 >
2071  inline bool operator>=( const ColumnIterator<MatrixType2>& rhs ) const {
2072  return ( matrix_ == rhs.matrix_ ) && ( row_ >= rhs.row_ ) && ( column_ == rhs.column_ );
2073  }
2074  //*******************************************************************************************
2075 
2076  //**Subtraction operator*********************************************************************
2082  inline DifferenceType operator-( const ColumnIterator& rhs ) const {
2083  return row_ - rhs.row_;
2084  }
2085  //*******************************************************************************************
2086 
2087  //**Addition operator************************************************************************
2094  friend inline const ColumnIterator operator+( const ColumnIterator& it, size_t inc ) {
2095  return ColumnIterator( *it.matrix_, it.row_+inc, it.column_ );
2096  }
2097  //*******************************************************************************************
2098 
2099  //**Addition operator************************************************************************
2106  friend inline const ColumnIterator operator+( size_t inc, const ColumnIterator& it ) {
2107  return ColumnIterator( *it.matrix_, it.row_+inc, it.column_ );
2108  }
2109  //*******************************************************************************************
2110 
2111  //**Subtraction operator*********************************************************************
2118  friend inline const ColumnIterator operator-( const ColumnIterator& it, size_t dec ) {
2119  return ColumnIterator( *it.matrix_, it.row_-dec, it.column_ );
2120  }
2121  //*******************************************************************************************
2122 
2123  private:
2124  //**Member variables*************************************************************************
2125  MatrixType* matrix_;
2126  size_t row_;
2127  size_t column_;
2128  //*******************************************************************************************
2129 
2130  //**Friend declarations**********************************************************************
2131  template< typename MatrixType2 > friend class ColumnIterator;
2132  //*******************************************************************************************
2133  };
2134  //**********************************************************************************************
2135 
2136  //**Type definitions****************************************************************************
2138  typedef ColumnIterator<const MT> ConstIterator;
2139 
2141  typedef typename SelectType< useConst, ConstIterator, ColumnIterator<MT> >::Type Iterator;
2142  //**********************************************************************************************
2143 
2144  //**Compilation flags***************************************************************************
2146  enum { vectorizable = 0 };
2147 
2149  enum { smpAssignable = MT::smpAssignable };
2150  //**********************************************************************************************
2151 
2152  //**Constructors********************************************************************************
2155  explicit inline DenseColumn( MT& matrix, size_t index );
2156  // No explicitly declared copy constructor.
2158  //**********************************************************************************************
2159 
2160  //**Destructor**********************************************************************************
2161  // No explicitly declared destructor.
2162  //**********************************************************************************************
2163 
2164  //**Data access functions***********************************************************************
2167  inline Reference operator[]( size_t index );
2168  inline ConstReference operator[]( size_t index ) const;
2169  inline Iterator begin ();
2170  inline ConstIterator begin () const;
2171  inline ConstIterator cbegin() const;
2172  inline Iterator end ();
2173  inline ConstIterator end () const;
2174  inline ConstIterator cend () const;
2176  //**********************************************************************************************
2177 
2178  //**Assignment operators************************************************************************
2181  inline DenseColumn& operator= ( const ElementType& rhs );
2182  inline DenseColumn& operator= ( const DenseColumn& rhs );
2183  template< typename VT > inline DenseColumn& operator= ( const Vector<VT,false>& rhs );
2184  template< typename VT > inline DenseColumn& operator+=( const Vector<VT,false>& rhs );
2185  template< typename VT > inline DenseColumn& operator-=( const Vector<VT,false>& rhs );
2186  template< typename VT > inline DenseColumn& operator*=( const Vector<VT,false>& rhs );
2187 
2188  template< typename Other >
2189  inline typename EnableIf< IsNumeric<Other>, DenseColumn >::Type&
2190  operator*=( Other rhs );
2191 
2192  template< typename Other >
2193  inline typename EnableIf< IsNumeric<Other>, DenseColumn >::Type&
2194  operator/=( Other rhs );
2196  //**********************************************************************************************
2197 
2198  //**Utility functions***************************************************************************
2201  inline size_t size() const;
2202  inline size_t capacity() const;
2203  inline size_t nonZeros() const;
2204  inline void reset();
2205  template< typename Other > inline DenseColumn& scale( const Other& scalar );
2207  //**********************************************************************************************
2208 
2209  public:
2210  //**Expression template evaluation functions****************************************************
2213  template< typename Other >
2214  inline bool canAlias ( const Other* alias ) const;
2215 
2216  template< typename MT2, bool SO2, bool SF2 >
2217  inline bool canAlias ( const DenseColumn<MT2,SO2,SF2>* alias ) const;
2218 
2219  template< typename Other >
2220  inline bool isAliased( const Other* alias ) const;
2221 
2222  template< typename MT2, bool SO2, bool SF2 >
2223  inline bool isAliased( const DenseColumn<MT2,SO2,SF2>* alias ) const;
2224 
2225  inline bool isAligned () const;
2226  inline bool canSMPAssign() const;
2227 
2228  template< typename VT > inline void assign ( const DenseVector <VT,false>& rhs );
2229  template< typename VT > inline void assign ( const SparseVector<VT,false>& rhs );
2230  template< typename VT > inline void addAssign ( const DenseVector <VT,false>& rhs );
2231  template< typename VT > inline void addAssign ( const SparseVector<VT,false>& rhs );
2232  template< typename VT > inline void subAssign ( const DenseVector <VT,false>& rhs );
2233  template< typename VT > inline void subAssign ( const SparseVector<VT,false>& rhs );
2234  template< typename VT > inline void multAssign( const DenseVector <VT,false>& rhs );
2235  template< typename VT > inline void multAssign( const SparseVector<VT,false>& rhs );
2237  //**********************************************************************************************
2238 
2239  private:
2240  //**Member variables****************************************************************************
2243  Operand matrix_;
2244  const size_t col_;
2245 
2246  //**********************************************************************************************
2247 
2248  //**Friend declarations*************************************************************************
2249  template< typename MT2, bool SO2, bool SF2 > friend class DenseColumn;
2250 
2251  template< typename MT2, bool SO2, bool SF2 >
2252  friend bool isSame( const DenseColumn<MT2,SO2,SF2>& a, const DenseColumn<MT2,SO2,SF2>& b );
2253  //**********************************************************************************************
2254 
2255  //**Compile time checks*************************************************************************
2261  //**********************************************************************************************
2262 };
2264 //*************************************************************************************************
2265 
2266 
2267 
2268 
2269 //=================================================================================================
2270 //
2271 // CONSTRUCTOR
2272 //
2273 //=================================================================================================
2274 
2275 //*************************************************************************************************
2283 template< typename MT > // Type of the dense matrix
2284 inline DenseColumn<MT,false,false>::DenseColumn( MT& matrix, size_t index )
2285  : matrix_( matrix ) // The dense matrix containing the column
2286  , col_ ( index ) // The index of the column in the matrix
2287 {
2288  if( matrix_.columns() <= index )
2289  throw std::invalid_argument( "Invalid column access index" );
2290 }
2292 //*************************************************************************************************
2293 
2294 
2295 
2296 
2297 //=================================================================================================
2298 //
2299 // DATA ACCESS FUNCTIONS
2300 //
2301 //=================================================================================================
2302 
2303 //*************************************************************************************************
2310 template< typename MT > // Type of the dense matrix
2313 {
2314  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
2315  return matrix_(index,col_);
2316 }
2318 //*************************************************************************************************
2319 
2320 
2321 //*************************************************************************************************
2328 template< typename MT > // Type of the dense matrix
2330  DenseColumn<MT,false,false>::operator[]( size_t index ) const
2331 {
2332  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
2333  return matrix_(index,col_);
2334 }
2336 //*************************************************************************************************
2337 
2338 
2339 //*************************************************************************************************
2347 template< typename MT > // Type of the dense matrix
2349 {
2350  return Iterator( matrix_, 0UL, col_ );
2351 }
2353 //*************************************************************************************************
2354 
2355 
2356 //*************************************************************************************************
2364 template< typename MT > // Type of the dense matrix
2367 {
2368  return ConstIterator( matrix_, 0UL, col_ );
2369 }
2371 //*************************************************************************************************
2372 
2373 
2374 //*************************************************************************************************
2382 template< typename MT > // Type of the dense matrix
2385 {
2386  return ConstIterator( matrix_, 0UL, col_ );
2387 }
2389 //*************************************************************************************************
2390 
2391 
2392 //*************************************************************************************************
2400 template< typename MT > // Type of the dense matrix
2402 {
2403  return Iterator( matrix_, size(), col_ );
2404 }
2406 //*************************************************************************************************
2407 
2408 
2409 //*************************************************************************************************
2417 template< typename MT > // Type of the dense matrix
2420 {
2421  return ConstIterator( matrix_, size(), col_ );
2422 }
2424 //*************************************************************************************************
2425 
2426 
2427 //*************************************************************************************************
2435 template< typename MT > // Type of the dense matrix
2438 {
2439  return ConstIterator( matrix_, size(), col_ );
2440 }
2442 //*************************************************************************************************
2443 
2444 
2445 
2446 
2447 //=================================================================================================
2448 //
2449 // ASSIGNMENT OPERATORS
2450 //
2451 //=================================================================================================
2452 
2453 //*************************************************************************************************
2460 template< typename MT > // Type of the dense matrix
2461 inline DenseColumn<MT,false,false>&
2463 {
2464  const size_t rows( size() );
2465 
2466  for( size_t i=0UL; i<rows; ++i )
2467  matrix_(i,col_) = rhs;
2468 
2469  return *this;
2470 }
2472 //*************************************************************************************************
2473 
2474 
2475 //*************************************************************************************************
2486 template< typename MT > // Type of the dense matrix
2487 inline DenseColumn<MT,false,false>&
2488  DenseColumn<MT,false,false>::operator=( const DenseColumn& rhs )
2489 {
2490  if( &rhs == this ) return *this;
2491 
2492  if( size() != rhs.size() )
2493  throw std::invalid_argument( "Column sizes do not match" );
2494 
2495  const size_t rows( size() );
2496 
2497  for( size_t i=0UL; i<rows; ++i )
2498  matrix_(i,col_) = rhs[i];
2499 
2500  return *this;
2501 }
2503 //*************************************************************************************************
2504 
2505 
2506 //*************************************************************************************************
2517 template< typename MT > // Type of the dense matrix
2518 template< typename VT > // Type of the right-hand side vector
2519 inline DenseColumn<MT,false,false>&
2520  DenseColumn<MT,false,false>::operator=( const Vector<VT,false>& rhs )
2521 {
2525 
2526  if( size() != (~rhs).size() )
2527  throw std::invalid_argument( "Vector sizes do not match" );
2528 
2529  if( (~rhs).canAlias( &matrix_ ) ) {
2530  const ResultType tmp( ~rhs );
2531  smpAssign( *this, tmp );
2532  }
2533  else {
2534  if( IsSparseVector<VT>::value )
2535  reset();
2536  smpAssign( *this, ~rhs );
2537  }
2538 
2539  return *this;
2540 }
2542 //*************************************************************************************************
2543 
2544 
2545 //*************************************************************************************************
2556 template< typename MT > // Type of the dense matrix
2557 template< typename VT > // Type of the right-hand side vector
2558 inline DenseColumn<MT,false,false>&
2559  DenseColumn<MT,false,false>::operator+=( const Vector<VT,false>& rhs )
2560 {
2563 
2564  if( size() != (~rhs).size() )
2565  throw std::invalid_argument( "Vector sizes do not match" );
2566 
2567  if( (~rhs).canAlias( &matrix_ ) ) {
2568  const typename VT::ResultType tmp( ~rhs );
2569  smpAddAssign( *this, tmp );
2570  }
2571  else {
2572  smpAddAssign( *this, ~rhs );
2573  }
2574 
2575  return *this;
2576 }
2578 //*************************************************************************************************
2579 
2580 
2581 //*************************************************************************************************
2592 template< typename MT > // Type of the dense matrix
2593 template< typename VT > // Type of the right-hand side vector
2594 inline DenseColumn<MT,false,false>&
2595  DenseColumn<MT,false,false>::operator-=( const Vector<VT,false>& rhs )
2596 {
2599 
2600  if( size() != (~rhs).size() )
2601  throw std::invalid_argument( "Vector sizes do not match" );
2602 
2603  if( (~rhs).canAlias( &matrix_ ) ) {
2604  const typename VT::ResultType tmp( ~rhs );
2605  smpSubAssign( *this, tmp );
2606  }
2607  else {
2608  smpSubAssign( *this, ~rhs );
2609  }
2610 
2611  return *this;
2612 }
2614 //*************************************************************************************************
2615 
2616 
2617 //*************************************************************************************************
2629 template< typename MT > // Type of the dense matrix
2630 template< typename VT > // Type of the right-hand side vector
2631 inline DenseColumn<MT,false,false>&
2632  DenseColumn<MT,false,false>::operator*=( const Vector<VT,false>& rhs )
2633 {
2636 
2637  if( size() != (~rhs).size() )
2638  throw std::invalid_argument( "Vector sizes do not match" );
2639 
2640  if( (~rhs).canAlias( &matrix_ ) || IsSparseVector<VT>::value ) {
2641  const ResultType tmp( *this * (~rhs) );
2642  smpAssign( *this, tmp );
2643  }
2644  else {
2645  smpMultAssign( *this, ~rhs );
2646  }
2647 
2648  return *this;
2649 }
2651 //*************************************************************************************************
2652 
2653 
2654 //*************************************************************************************************
2662 template< typename MT > // Type of the dense matrix
2663 template< typename Other > // Data type of the right-hand side scalar
2664 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false,false> >::Type&
2665  DenseColumn<MT,false,false>::operator*=( Other rhs )
2666 {
2667  for( size_t i=0UL; i<size(); ++i )
2668  matrix_(i,col_) *= rhs;
2669  return *this;
2670 }
2672 //*************************************************************************************************
2673 
2674 
2675 //*************************************************************************************************
2685 template< typename MT > // Type of the dense matrix
2686 template< typename Other > // Data type of the right-hand side scalar
2687 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false,false> >::Type&
2688  DenseColumn<MT,false,false>::operator/=( Other rhs )
2689 {
2690  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
2691 
2692  typedef typename DivTrait<ElementType,Other>::Type DT;
2693  typedef typename If< IsNumeric<DT>, DT, Other >::Type Tmp;
2694 
2695  // Depending on the two involved data types, an integer division is applied or a
2696  // floating point division is selected.
2697  if( IsNumeric<DT>::value && IsFloatingPoint<DT>::value ) {
2698  const Tmp tmp( Tmp(1)/static_cast<Tmp>( rhs ) );
2699  for( size_t i=0UL; i<size(); ++i )
2700  matrix_(i,col_) *= tmp;
2701  }
2702  else {
2703  for( size_t i=0UL; i<size(); ++i )
2704  matrix_(i,col_) /= rhs;
2705  }
2706 
2707  return *this;
2708 }
2710 //*************************************************************************************************
2711 
2712 
2713 
2714 
2715 //=================================================================================================
2716 //
2717 // UTILITY FUNCTIONS
2718 //
2719 //=================================================================================================
2720 
2721 //*************************************************************************************************
2727 template< typename MT > // Type of the dense matrix
2728 inline size_t DenseColumn<MT,false,false>::size() const
2729 {
2730  return matrix_.rows();
2731 }
2733 //*************************************************************************************************
2734 
2735 
2736 //*************************************************************************************************
2742 template< typename MT > // Type of the dense matrix
2743 inline size_t DenseColumn<MT,false,false>::capacity() const
2744 {
2745  return matrix_.rows();
2746 }
2748 //*************************************************************************************************
2749 
2750 
2751 //*************************************************************************************************
2760 template< typename MT > // Type of the dense matrix
2761 inline size_t DenseColumn<MT,false,false>::nonZeros() const
2762 {
2763  const size_t rows( size() );
2764  size_t nonzeros( 0UL );
2765 
2766  for( size_t i=0UL; i<rows; ++i )
2767  if( !isDefault( matrix_(i,col_) ) )
2768  ++nonzeros;
2769 
2770  return nonzeros;
2771 }
2773 //*************************************************************************************************
2774 
2775 
2776 //*************************************************************************************************
2782 template< typename MT > // Type of the dense matrix
2784 {
2785  using blaze::clear;
2786  const size_t rows( size() );
2787  for( size_t i=0UL; i<rows; ++i )
2788  clear( matrix_(i,col_) );
2789 }
2791 //*************************************************************************************************
2792 
2793 
2794 //*************************************************************************************************
2801 template< typename MT > // Type of the dense matrix
2802 template< typename Other > // Data type of the scalar value
2803 inline DenseColumn<MT,false,false>& DenseColumn<MT,false,false>::scale( const Other& scalar )
2804 {
2805  for( size_t i=0UL; i<size(); ++i ) {
2806  matrix_(i,col_) *= scalar;
2807  }
2808  return *this;
2809 }
2811 //*************************************************************************************************
2812 
2813 
2814 
2815 
2816 //=================================================================================================
2817 //
2818 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2819 //
2820 //=================================================================================================
2821 
2822 //*************************************************************************************************
2833 template< typename MT > // Type of the dense matrix
2834 template< typename Other > // Data type of the foreign expression
2835 inline bool DenseColumn<MT,false,false>::canAlias( const Other* alias ) const
2836 {
2837  return matrix_.isAliased( alias );
2838 }
2840 //*************************************************************************************************
2841 
2842 
2843 //*************************************************************************************************
2854 template< typename MT > // Type of the dense matrix
2855 template< typename MT2 // Data type of the foreign dense column
2856  , bool SO2 // Storage order of the foreign dense column
2857  , bool SF2 > // Symmetry flag of the foreign dense column
2858 inline bool DenseColumn<MT,false,false>::canAlias( const DenseColumn<MT2,SO2,SF2>* alias ) const
2859 {
2860  return matrix_.isAliased( &alias->matrix_ ) && ( col_ == alias->col_ );
2861 }
2863 //*************************************************************************************************
2864 
2865 
2866 //*************************************************************************************************
2877 template< typename MT > // Type of the dense matrix
2878 template< typename Other > // Data type of the foreign expression
2879 inline bool DenseColumn<MT,false,false>::isAliased( const Other* alias ) const
2880 {
2881  return matrix_.isAliased( alias );
2882 }
2884 //*************************************************************************************************
2885 
2886 
2887 //*************************************************************************************************
2898 template< typename MT > // Type of the dense matrix
2899 template< typename MT2 // Data type of the foreign dense column
2900  , bool SO2 // Storage order of the foreign dense column
2901  , bool SF2 > // Symmetry flag of the foreign dense column
2902 inline bool DenseColumn<MT,false,false>::isAliased( const DenseColumn<MT2,SO2,SF2>* alias ) const
2903 {
2904  return matrix_.isAliased( &alias->matrix_ ) && ( col_ == alias->col_ );
2905 }
2907 //*************************************************************************************************
2908 
2909 
2910 //*************************************************************************************************
2920 template< typename MT > // Type of the dense matrix
2921 inline bool DenseColumn<MT,false,false>::isAligned() const
2922 {
2923  return false;
2924 }
2926 //*************************************************************************************************
2927 
2928 
2929 //*************************************************************************************************
2940 template< typename MT > // Type of the dense matrix
2942 {
2943  return ( size() > SMP_DVECASSIGN_THRESHOLD );
2944 }
2946 //*************************************************************************************************
2947 
2948 
2949 //*************************************************************************************************
2961 template< typename MT > // Type of the dense matrix
2962 template< typename VT > // Type of the right-hand side dense vector
2963 inline void DenseColumn<MT,false,false>::assign( const DenseVector<VT,false>& rhs )
2964 {
2965  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2966 
2967  const size_t iend( (~rhs).size() & size_t(-2) );
2968  for( size_t i=0UL; i<iend; i+=2UL ) {
2969  matrix_(i ,col_) = (~rhs)[i ];
2970  matrix_(i+1UL,col_) = (~rhs)[i+1UL];
2971  }
2972  if( iend < (~rhs).size() )
2973  matrix_(iend,col_) = (~rhs)[iend];
2974 }
2976 //*************************************************************************************************
2977 
2978 
2979 //*************************************************************************************************
2991 template< typename MT > // Type of the dense matrix
2992 template< typename VT > // Type of the right-hand side sparse vector
2993 inline void DenseColumn<MT,false,false>::assign( const SparseVector<VT,false>& rhs )
2994 {
2995  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2996 
2997  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2998  matrix_(element->index(),col_) = element->value();
2999 }
3001 //*************************************************************************************************
3002 
3003 
3004 //*************************************************************************************************
3016 template< typename MT > // Type of the dense matrix
3017 template< typename VT > // Type of the right-hand side dense vector
3018 inline void DenseColumn<MT,false,false>::addAssign( const DenseVector<VT,false>& rhs )
3019 {
3020  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3021 
3022  const size_t iend( (~rhs).size() & size_t(-2) );
3023  for( size_t i=0UL; i<iend; i+=2UL ) {
3024  matrix_(i ,col_) += (~rhs)[i ];
3025  matrix_(i+1UL,col_) += (~rhs)[i+1UL];
3026  }
3027  if( iend < (~rhs).size() )
3028  matrix_(iend,col_) += (~rhs)[iend];
3029 }
3031 //*************************************************************************************************
3032 
3033 
3034 //*************************************************************************************************
3046 template< typename MT > // Type of the dense matrix
3047 template< typename VT > // Type of the right-hand side sparse vector
3048 inline void DenseColumn<MT,false,false>::addAssign( const SparseVector<VT,false>& rhs )
3049 {
3050  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3051 
3052  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
3053  matrix_(element->index(),col_) += element->value();
3054 }
3056 //*************************************************************************************************
3057 
3058 
3059 //*************************************************************************************************
3071 template< typename MT > // Type of the dense matrix
3072 template< typename VT > // Type of the right-hand side dense vector
3073 inline void DenseColumn<MT,false,false>::subAssign( const DenseVector<VT,false>& rhs )
3074 {
3075  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3076 
3077  const size_t iend( (~rhs).size() & size_t(-2) );
3078  for( size_t i=0UL; i<iend; i+=2UL ) {
3079  matrix_(i ,col_) -= (~rhs)[i ];
3080  matrix_(i+1UL,col_) -= (~rhs)[i+1UL];
3081  }
3082  if( iend < (~rhs).size() )
3083  matrix_(iend,col_) -= (~rhs)[iend];
3084 }
3086 //*************************************************************************************************
3087 
3088 
3089 //*************************************************************************************************
3101 template< typename MT > // Type of the dense matrix
3102 template< typename VT > // Type of the right-hand side sparse vector
3103 inline void DenseColumn<MT,false,false>::subAssign( const SparseVector<VT,false>& rhs )
3104 {
3105  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3106 
3107  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
3108  matrix_(element->index(),col_) -= element->value();
3109 }
3111 //*************************************************************************************************
3112 
3113 
3114 //*************************************************************************************************
3126 template< typename MT > // Type of the dense matrix
3127 template< typename VT > // Type of the right-hand side dense vector
3128 inline void DenseColumn<MT,false,false>::multAssign( const DenseVector<VT,false>& rhs )
3129 {
3130  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3131 
3132  const size_t iend( (~rhs).size() & size_t(-2) );
3133  for( size_t i=0UL; i<iend; i+=2UL ) {
3134  matrix_(i ,col_) *= (~rhs)[i ];
3135  matrix_(i+1UL,col_) *= (~rhs)[i+1UL];
3136  }
3137  if( iend < (~rhs).size() )
3138  matrix_(iend,col_) *= (~rhs)[iend];
3139 }
3141 //*************************************************************************************************
3142 
3143 
3144 //*************************************************************************************************
3156 template< typename MT > // Type of the dense matrix
3157 template< typename VT > // Type of the right-hand side sparse vector
3158 inline void DenseColumn<MT,false,false>::multAssign( const SparseVector<VT,false>& rhs )
3159 {
3160  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3161 
3162  const ResultType tmp( serial( *this ) );
3163 
3164  reset();
3165 
3166  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
3167  matrix_(element->index(),col_) = tmp[element->index()] * element->value();
3168 }
3170 //*************************************************************************************************
3171 
3172 
3173 
3174 
3175 
3176 
3177 
3178 
3179 //=================================================================================================
3180 //
3181 // CLASS TEMPLATE SPECIALIZATION FOR SYMMETRIC ROW-MAJOR MATRICES
3182 //
3183 //=================================================================================================
3184 
3185 //*************************************************************************************************
3193 template< typename MT > // Type of the dense matrix
3194 class DenseColumn<MT,false,true> : public DenseVector< DenseColumn<MT,false,true>, false >
3195  , private Column
3196 {
3197  private:
3198  //**Type definitions****************************************************************************
3200  typedef typename SelectType< IsExpression<MT>::value, MT, MT& >::Type Operand;
3201 
3203  typedef IntrinsicTrait<typename MT::ElementType> IT;
3204  //**********************************************************************************************
3205 
3206  //**********************************************************************************************
3208 
3214  enum { useConst = IsConst<MT>::value };
3215  //**********************************************************************************************
3216 
3217  public:
3218  //**Type definitions****************************************************************************
3219  typedef DenseColumn<MT,false,true> This;
3220  typedef typename ColumnTrait<MT>::Type ResultType;
3221  typedef typename ResultType::TransposeType TransposeType;
3222  typedef typename MT::ElementType ElementType;
3223  typedef typename IT::Type IntrinsicType;
3224  typedef typename MT::ReturnType ReturnType;
3225  typedef const DenseColumn& CompositeType;
3226 
3228  typedef typename MT::ConstReference ConstReference;
3229 
3231  typedef typename SelectType< useConst, ConstReference, typename MT::Reference >::Type Reference;
3232 
3234  typedef const ElementType* ConstPointer;
3235 
3237  typedef typename SelectType< useConst, ConstPointer, ElementType* >::Type Pointer;
3238 
3240  typedef typename MT::ConstIterator ConstIterator;
3241 
3243  typedef typename SelectType< useConst, ConstIterator, typename MT::Iterator >::Type Iterator;
3244  //**********************************************************************************************
3245 
3246  //**Compilation flags***************************************************************************
3248  enum { vectorizable = MT::vectorizable };
3249 
3251  enum { smpAssignable = MT::smpAssignable };
3252  //**********************************************************************************************
3253 
3254  //**Constructors********************************************************************************
3257  explicit inline DenseColumn( MT& matrix, size_t index );
3258  // No explicitly declared copy constructor.
3260  //**********************************************************************************************
3261 
3262  //**Destructor**********************************************************************************
3263  // No explicitly declared destructor.
3264  //**********************************************************************************************
3265 
3266  //**Data access functions***********************************************************************
3269  inline Reference operator[]( size_t index );
3270  inline ConstReference operator[]( size_t index ) const;
3271  inline Pointer data ();
3272  inline ConstPointer data () const;
3273  inline Iterator begin ();
3274  inline ConstIterator begin () const;
3275  inline ConstIterator cbegin() const;
3276  inline Iterator end ();
3277  inline ConstIterator end () const;
3278  inline ConstIterator cend () const;
3280  //**********************************************************************************************
3281 
3282  //**Assignment operators************************************************************************
3285  inline DenseColumn& operator= ( const ElementType& rhs );
3286  inline DenseColumn& operator= ( const DenseColumn& rhs );
3287  template< typename VT > inline DenseColumn& operator= ( const Vector<VT,false>& rhs );
3288  template< typename VT > inline DenseColumn& operator+=( const Vector<VT,false>& rhs );
3289  template< typename VT > inline DenseColumn& operator-=( const Vector<VT,false>& rhs );
3290  template< typename VT > inline DenseColumn& operator*=( const Vector<VT,false>& rhs );
3291 
3292  template< typename Other >
3293  inline typename EnableIf< IsNumeric<Other>, DenseColumn >::Type&
3294  operator*=( Other rhs );
3295 
3296  template< typename Other >
3297  inline typename EnableIf< IsNumeric<Other>, DenseColumn >::Type&
3298  operator/=( Other rhs );
3300  //**********************************************************************************************
3301 
3302  //**Utility functions***************************************************************************
3305  inline size_t size() const;
3306  inline size_t capacity() const;
3307  inline size_t nonZeros() const;
3308  inline void reset();
3309  template< typename Other > inline DenseColumn& scale( const Other& scalar );
3311  //**********************************************************************************************
3312 
3313  private:
3314  //**********************************************************************************************
3316  template< typename VT >
3317  struct VectorizedAssign {
3318  enum { value = vectorizable && VT::vectorizable &&
3319  IsSame<ElementType,typename VT::ElementType>::value };
3320  };
3321  //**********************************************************************************************
3322 
3323  //**********************************************************************************************
3325  template< typename VT >
3326  struct VectorizedAddAssign {
3327  enum { value = vectorizable && VT::vectorizable &&
3328  IsSame<ElementType,typename VT::ElementType>::value &&
3329  IntrinsicTrait<ElementType>::addition };
3330  };
3331  //**********************************************************************************************
3332 
3333  //**********************************************************************************************
3335  template< typename VT >
3336  struct VectorizedSubAssign {
3337  enum { value = vectorizable && VT::vectorizable &&
3338  IsSame<ElementType,typename VT::ElementType>::value &&
3339  IntrinsicTrait<ElementType>::subtraction };
3340  };
3341  //**********************************************************************************************
3342 
3343  //**********************************************************************************************
3345  template< typename VT >
3346  struct VectorizedMultAssign {
3347  enum { value = vectorizable && VT::vectorizable &&
3348  IsSame<ElementType,typename VT::ElementType>::value &&
3349  IntrinsicTrait<ElementType>::multiplication };
3350  };
3351  //**********************************************************************************************
3352 
3353  public:
3354  //**Expression template evaluation functions****************************************************
3357  template< typename Other >
3358  inline bool canAlias( const Other* alias ) const;
3359 
3360  template< typename MT2, bool SO2, bool SF2 >
3361  inline bool canAlias( const DenseColumn<MT2,SO2,SF2>* alias ) const;
3362 
3363  template< typename Other >
3364  inline bool isAliased( const Other* alias ) const;
3365 
3366  template< typename MT2, bool SO2, bool SF2 >
3367  inline bool isAliased( const DenseColumn<MT2,SO2,SF2>* alias ) const;
3368 
3369  inline bool isAligned () const;
3370  inline bool canSMPAssign() const;
3371 
3372  inline IntrinsicType load ( size_t index ) const;
3373  inline IntrinsicType loadu ( size_t index ) const;
3374  inline void store ( size_t index, const IntrinsicType& value );
3375  inline void storeu( size_t index, const IntrinsicType& value );
3376  inline void stream( size_t index, const IntrinsicType& value );
3377 
3378  template< typename VT >
3379  inline typename DisableIf< VectorizedAssign<VT> >::Type
3380  assign( const DenseVector<VT,false>& rhs );
3381 
3382  template< typename VT >
3383  inline typename EnableIf< VectorizedAssign<VT> >::Type
3384  assign( const DenseVector<VT,false>& rhs );
3385 
3386  template< typename VT > inline void assign( const SparseVector<VT,false>& rhs );
3387 
3388  template< typename VT >
3389  inline typename DisableIf< VectorizedAddAssign<VT> >::Type
3390  addAssign( const DenseVector<VT,false>& rhs );
3391 
3392  template< typename VT >
3393  inline typename EnableIf< VectorizedAddAssign<VT> >::Type
3394  addAssign( const DenseVector<VT,false>& rhs );
3395 
3396  template< typename VT > inline void addAssign( const SparseVector<VT,false>& rhs );
3397 
3398  template< typename VT >
3399  inline typename DisableIf< VectorizedSubAssign<VT> >::Type
3400  subAssign( const DenseVector<VT,false>& rhs );
3401 
3402  template< typename VT >
3403  inline typename EnableIf< VectorizedSubAssign<VT> >::Type
3404  subAssign( const DenseVector<VT,false>& rhs );
3405 
3406  template< typename VT > inline void subAssign( const SparseVector<VT,false>& rhs );
3407 
3408  template< typename VT >
3409  inline typename DisableIf< VectorizedMultAssign<VT> >::Type
3410  multAssign( const DenseVector<VT,false>& rhs );
3411 
3412  template< typename VT >
3413  inline typename EnableIf< VectorizedMultAssign<VT> >::Type
3414  multAssign( const DenseVector<VT,false>& rhs );
3415 
3416  template< typename VT > inline void multAssign( const SparseVector<VT,false>& rhs );
3418  //**********************************************************************************************
3419 
3420  private:
3421  //**Member variables****************************************************************************
3424  Operand matrix_;
3425  const size_t col_;
3426 
3427  //**********************************************************************************************
3428 
3429  //**Friend declarations*************************************************************************
3430  template< typename MT2, bool SO2, bool SF2 > friend class DenseColumn;
3431 
3432  template< typename MT2, bool SO2, bool SF2 >
3433  friend bool isSame( const DenseColumn<MT2,SO2,SF2>& a, const DenseColumn<MT2,SO2,SF2>& b );
3434  //**********************************************************************************************
3435 
3436  //**Compile time checks*************************************************************************
3442  //**********************************************************************************************
3443 };
3445 //*************************************************************************************************
3446 
3447 
3448 
3449 
3450 //=================================================================================================
3451 //
3452 // CONSTRUCTOR
3453 //
3454 //=================================================================================================
3455 
3456 //*************************************************************************************************
3464 template< typename MT > // Type of the dense matrix
3465 inline DenseColumn<MT,false,true>::DenseColumn( MT& matrix, size_t index )
3466  : matrix_( matrix ) // The dense matrix containing the column
3467  , col_ ( index ) // The index of the column in the matrix
3468 {
3469  if( matrix_.columns() <= index )
3470  throw std::invalid_argument( "Invalid column access index" );
3471 }
3473 //*************************************************************************************************
3474 
3475 
3476 
3477 
3478 //=================================================================================================
3479 //
3480 // DATA ACCESS FUNCTIONS
3481 //
3482 //=================================================================================================
3483 
3484 //*************************************************************************************************
3491 template< typename MT > // Type of the dense matrix
3494 {
3495  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
3496  return matrix_(col_,index);
3497 }
3499 //*************************************************************************************************
3500 
3501 
3502 //*************************************************************************************************
3509 template< typename MT > // Type of the dense matrix
3511  DenseColumn<MT,false,true>::operator[]( size_t index ) const
3512 {
3513  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
3514  return matrix_(col_,index);
3515 }
3517 //*************************************************************************************************
3518 
3519 
3520 //*************************************************************************************************
3528 template< typename MT > // Type of the dense matrix
3529 inline typename DenseColumn<MT,false,true>::Pointer DenseColumn<MT,false,true>::data()
3530 {
3531  return matrix_.data( col_ );
3532 }
3534 //*************************************************************************************************
3535 
3536 
3537 //*************************************************************************************************
3545 template< typename MT > // Type of the dense matrix
3546 inline typename DenseColumn<MT,false,true>::ConstPointer DenseColumn<MT,false,true>::data() const
3547 {
3548  return matrix_.data( col_ );
3549 }
3551 //*************************************************************************************************
3552 
3553 
3554 //*************************************************************************************************
3562 template< typename MT > // Type of the dense matrix
3564 {
3565  return matrix_.begin( col_ );
3566 }
3568 //*************************************************************************************************
3569 
3570 
3571 //*************************************************************************************************
3579 template< typename MT > // Type of the dense matrix
3581 {
3582  return matrix_.cbegin( col_ );
3583 }
3585 //*************************************************************************************************
3586 
3587 
3588 //*************************************************************************************************
3596 template< typename MT > // Type of the dense matrix
3598 {
3599  return matrix_.cbegin( col_ );
3600 }
3602 //*************************************************************************************************
3603 
3604 
3605 //*************************************************************************************************
3613 template< typename MT > // Type of the dense matrix
3615 {
3616  return matrix_.end( col_ );
3617 }
3619 //*************************************************************************************************
3620 
3621 
3622 //*************************************************************************************************
3630 template< typename MT > // Type of the dense matrix
3632 {
3633  return matrix_.cend( col_ );
3634 }
3636 //*************************************************************************************************
3637 
3638 
3639 //*************************************************************************************************
3647 template< typename MT > // Type of the dense matrix
3649 {
3650  return matrix_.cend( col_ );
3651 }
3653 //*************************************************************************************************
3654 
3655 
3656 
3657 
3658 //=================================================================================================
3659 //
3660 // ASSIGNMENT OPERATORS
3661 //
3662 //=================================================================================================
3663 
3664 //*************************************************************************************************
3671 template< typename MT > // Type of the dense matrix
3672 inline DenseColumn<MT,false,true>& DenseColumn<MT,false,true>::operator=( const ElementType& rhs )
3673 {
3674  const size_t columns( size() );
3675 
3676  for( size_t j=0UL; j<columns; ++j )
3677  matrix_(col_,j) = rhs;
3678 
3679  return *this;
3680 }
3682 //*************************************************************************************************
3683 
3684 
3685 //*************************************************************************************************
3696 template< typename MT > // Type of the dense matrix
3697 inline DenseColumn<MT,false,true>& DenseColumn<MT,false,true>::operator=( const DenseColumn& rhs )
3698 {
3699  if( &rhs == this ) return *this;
3700 
3701  if( size() != rhs.size() )
3702  throw std::invalid_argument( "Column sizes do not match" );
3703 
3704  const size_t columns( size() );
3705 
3706  for( size_t j=0UL; j<columns; ++j )
3707  matrix_(col_,j) = rhs[j];
3708 
3709  return *this;
3710 }
3712 //*************************************************************************************************
3713 
3714 
3715 //*************************************************************************************************
3726 template< typename MT > // Type of the dense matrix
3727 template< typename VT > // Type of the right-hand side vector
3728 inline DenseColumn<MT,false,true>&
3729  DenseColumn<MT,false,true>::operator=( const Vector<VT,false>& rhs )
3730 {
3733 
3734  if( size() != (~rhs).size() )
3735  throw std::invalid_argument( "Vector sizes do not match" );
3736 
3737  if( (~rhs).canAlias( &matrix_ ) ) {
3738  const typename VT::ResultType tmp( ~rhs );
3739  smpAssign( *this, tmp );
3740  }
3741  else {
3742  if( IsSparseVector<VT>::value )
3743  reset();
3744  smpAssign( *this, ~rhs );
3745  }
3746 
3747  return *this;
3748 }
3750 //*************************************************************************************************
3751 
3752 
3753 //*************************************************************************************************
3764 template< typename MT > // Type of the dense matrix
3765 template< typename VT > // Type of the right-hand side vector
3766 inline DenseColumn<MT,false,true>&
3767  DenseColumn<MT,false,true>::operator+=( const Vector<VT,false>& rhs )
3768 {
3771 
3772  if( size() != (~rhs).size() )
3773  throw std::invalid_argument( "Vector sizes do not match" );
3774 
3775  if( (~rhs).canAlias( &matrix_ ) ) {
3776  const typename VT::ResultType tmp( ~rhs );
3777  smpAddAssign( *this, tmp );
3778  }
3779  else {
3780  smpAddAssign( *this, ~rhs );
3781  }
3782 
3783  return *this;
3784 }
3786 //*************************************************************************************************
3787 
3788 
3789 //*************************************************************************************************
3800 template< typename MT > // Type of the dense matrix
3801 template< typename VT > // Type of the right-hand side vector
3802 inline DenseColumn<MT,false,true>&
3803  DenseColumn<MT,false,true>::operator-=( const Vector<VT,false>& rhs )
3804 {
3807 
3808  if( size() != (~rhs).size() )
3809  throw std::invalid_argument( "Vector sizes do not match" );
3810 
3811  if( (~rhs).canAlias( &matrix_ ) ) {
3812  const typename VT::ResultType tmp( ~rhs );
3813  smpSubAssign( *this, tmp );
3814  }
3815  else {
3816  smpSubAssign( *this, ~rhs );
3817  }
3818 
3819  return *this;
3820 }
3822 //*************************************************************************************************
3823 
3824 
3825 //*************************************************************************************************
3837 template< typename MT > // Type of the dense matrix
3838 template< typename VT > // Type of the right-hand side vector
3839 inline DenseColumn<MT,false,true>&
3840  DenseColumn<MT,false,true>::operator*=( const Vector<VT,false>& rhs )
3841 {
3844 
3845  if( size() != (~rhs).size() )
3846  throw std::invalid_argument( "Vector sizes do not match" );
3847 
3848  if( (~rhs).canAlias( &matrix_ ) || IsSparseVector<VT>::value ) {
3849  const ResultType tmp( *this * (~rhs) );
3850  smpAssign( *this, tmp );
3851  }
3852  else {
3853  smpMultAssign( *this, ~rhs );
3854  }
3855 
3856  return *this;
3857 }
3859 //*************************************************************************************************
3860 
3861 
3862 //*************************************************************************************************
3870 template< typename MT > // Type of the dense matrix
3871 template< typename Other > // Data type of the right-hand side scalar
3872 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false,true> >::Type&
3873  DenseColumn<MT,false,true>::operator*=( Other rhs )
3874 {
3875  return operator=( (*this) * rhs );
3876 }
3878 //*************************************************************************************************
3879 
3880 
3881 //*************************************************************************************************
3891 template< typename MT > // Type of the dense matrix
3892 template< typename Other > // Data type of the right-hand side scalar
3893 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false,true> >::Type&
3894  DenseColumn<MT,false,true>::operator/=( Other rhs )
3895 {
3896  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
3897 
3898  return operator=( (*this) / rhs );
3899 }
3901 //*************************************************************************************************
3902 
3903 
3904 
3905 
3906 //=================================================================================================
3907 //
3908 // UTILITY FUNCTIONS
3909 //
3910 //=================================================================================================
3911 
3912 //*************************************************************************************************
3918 template< typename MT > // Type of the dense matrix
3919 inline size_t DenseColumn<MT,false,true>::size() const
3920 {
3921  return matrix_.rows();
3922 }
3924 //*************************************************************************************************
3925 
3926 
3927 //*************************************************************************************************
3933 template< typename MT > // Type of the dense matrix
3934 inline size_t DenseColumn<MT,false,true>::capacity() const
3935 {
3936  return matrix_.capacity( col_ );
3937 }
3939 //*************************************************************************************************
3940 
3941 
3942 //*************************************************************************************************
3951 template< typename MT > // Type of the dense matrix
3952 inline size_t DenseColumn<MT,false,true>::nonZeros() const
3953 {
3954  return matrix_.nonZeros( col_ );
3955 }
3957 //*************************************************************************************************
3958 
3959 
3960 //*************************************************************************************************
3966 template< typename MT > // Type of the dense matrix
3968 {
3969  matrix_.reset( col_ );
3970 }
3972 //*************************************************************************************************
3973 
3974 
3975 //*************************************************************************************************
3982 template< typename MT > // Type of the dense matrix
3983 template< typename Other > // Data type of the scalar value
3984 inline DenseColumn<MT,false,true>& DenseColumn<MT,false,true>::scale( const Other& scalar )
3985 {
3986  for( size_t j=0UL; j<size(); ++j ) {
3987  matrix_(col_,j) *= scalar;
3988  }
3989  return *this;
3990 }
3992 //*************************************************************************************************
3993 
3994 
3995 
3996 
3997 //=================================================================================================
3998 //
3999 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
4000 //
4001 //=================================================================================================
4002 
4003 //*************************************************************************************************
4014 template< typename MT > // Type of the dense matrix
4015 template< typename Other > // Data type of the foreign expression
4016 inline bool DenseColumn<MT,false,true>::canAlias( const Other* alias ) const
4017 {
4018  return matrix_.isAliased( alias );
4019 }
4021 //*************************************************************************************************
4022 
4023 
4024 //*************************************************************************************************
4035 template< typename MT > // Type of the dense matrix
4036 template< typename MT2 // Data type of the foreign dense column
4037  , bool SO2 // Storage order of the foreign dense column
4038  , bool SF2 > // Symmetry flag of the foreign dense column
4039 inline bool DenseColumn<MT,false,true>::canAlias( const DenseColumn<MT2,SO2,SF2>* alias ) const
4040 {
4041  return matrix_.isAliased( alias->matrix_ ) && ( col_ == alias->col_ );
4042 }
4044 //*************************************************************************************************
4045 
4046 
4047 //*************************************************************************************************
4058 template< typename MT > // Type of the dense matrix
4059 template< typename Other > // Data type of the foreign expression
4060 inline bool DenseColumn<MT,false,true>::isAliased( const Other* alias ) const
4061 {
4062  return matrix_.isAliased( alias );
4063 }
4065 //*************************************************************************************************
4066 
4067 
4068 //*************************************************************************************************
4079 template< typename MT > // Type of the dense matrix
4080 template< typename MT2 // Data type of the foreign dense column
4081  , bool SO2 // Storage order of the foreign dense column
4082  , bool SF2 > // Symmetry flag of the foreign dense column
4083 inline bool DenseColumn<MT,false,true>::isAliased( const DenseColumn<MT2,SO2,SF2>* alias ) const
4084 {
4085  return matrix_.isAliased( &alias->matrix_ ) && ( col_ == alias->col_ );
4086 }
4088 //*************************************************************************************************
4089 
4090 
4091 //*************************************************************************************************
4101 template< typename MT > // Type of the dense matrix
4102 inline bool DenseColumn<MT,false,true>::isAligned() const
4103 {
4104  return matrix_.isAligned();
4105 }
4107 //*************************************************************************************************
4108 
4109 
4110 //*************************************************************************************************
4121 template< typename MT > // Type of the dense matrix
4122 inline bool DenseColumn<MT,false,true>::canSMPAssign() const
4123 {
4124  return ( size() > SMP_DVECASSIGN_THRESHOLD );
4125 }
4127 //*************************************************************************************************
4128 
4129 
4130 //*************************************************************************************************
4143 template< typename MT > // Type of the dense matrix
4144 inline typename DenseColumn<MT,false,true>::IntrinsicType
4145  DenseColumn<MT,false,true>::load( size_t index ) const
4146 {
4147  return matrix_.load( col_, index );
4148 }
4150 //*************************************************************************************************
4151 
4152 
4153 //*************************************************************************************************
4166 template< typename MT > // Type of the dense matrix
4167 inline typename DenseColumn<MT,false,true>::IntrinsicType
4168  DenseColumn<MT,false,true>::loadu( size_t index ) const
4169 {
4170  return matrix_.loadu( col_, index );
4171 }
4173 //*************************************************************************************************
4174 
4175 
4176 //*************************************************************************************************
4190 template< typename MT > // Type of the dense matrix
4191 inline void DenseColumn<MT,false,true>::store( size_t index, const IntrinsicType& value )
4192 {
4193  matrix_.store( col_, index, value );
4194 }
4196 //*************************************************************************************************
4197 
4198 
4199 //*************************************************************************************************
4213 template< typename MT > // Type of the dense matrix
4214 inline void DenseColumn<MT,false,true>::storeu( size_t index, const IntrinsicType& value )
4215 {
4216  matrix_.storeu( col_, index, value );
4217 }
4219 //*************************************************************************************************
4220 
4221 
4222 //*************************************************************************************************
4236 template< typename MT > // Type of the dense matrix
4237 inline void DenseColumn<MT,false,true>::stream( size_t index, const IntrinsicType& value )
4238 {
4239  matrix_.stream( col_, index, value );
4240 }
4242 //*************************************************************************************************
4243 
4244 
4245 //*************************************************************************************************
4257 template< typename MT > // Type of the dense matrix
4258 template< typename VT > // Type of the right-hand side dense vector
4259 inline typename DisableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type
4260  DenseColumn<MT,false,true>::assign( const DenseVector<VT,false>& rhs )
4261 {
4262  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4263 
4264  const size_t jend( (~rhs).size() & size_t(-2) );
4265  for( size_t j=0UL; j<jend; j+=2UL ) {
4266  matrix_(col_,j ) = (~rhs)[j ];
4267  matrix_(col_,j+1UL) = (~rhs)[j+1UL];
4268  }
4269  if( jend < (~rhs).size() )
4270  matrix_(col_,jend) = (~rhs)[jend];
4271 }
4273 //*************************************************************************************************
4274 
4275 
4276 //*************************************************************************************************
4288 template< typename MT > // Type of the dense matrix
4289 template< typename VT > // Type of the right-hand side dense vector
4290 inline typename EnableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type
4291  DenseColumn<MT,false,true>::assign( const DenseVector<VT,false>& rhs )
4292 {
4293  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4294 
4296 
4297  const size_t columns( size() );
4298 
4299  if( useStreaming && columns > ( cacheSize/( sizeof(ElementType) * 3UL ) ) && !(~rhs).isAliased( this ) )
4300  {
4301  for( size_t j=0UL; j<columns; j+=IT::size ) {
4302  matrix_.stream( col_, j, (~rhs).load(j) );
4303  }
4304  }
4305  else
4306  {
4307  const size_t jend( columns & size_t(-IT::size*4) );
4308  BLAZE_INTERNAL_ASSERT( ( columns - ( columns % (IT::size*4UL) ) ) == jend, "Invalid end calculation" );
4309 
4310  typename VT::ConstIterator it( (~rhs).begin() );
4311  for( size_t j=0UL; j<jend; j+=IT::size*4UL ) {
4312  matrix_.store( col_, j , it.load() ); it+=IT::size;
4313  matrix_.store( col_, j+IT::size , it.load() ); it+=IT::size;
4314  matrix_.store( col_, j+IT::size*2UL, it.load() ); it+=IT::size;
4315  matrix_.store( col_, j+IT::size*3UL, it.load() ); it+=IT::size;
4316  }
4317  for( size_t j=jend; j<columns; j+=IT::size, it+=IT::size ) {
4318  matrix_.store( col_, j, it.load() );
4319  }
4320  }
4321 }
4323 //*************************************************************************************************
4324 
4325 
4326 //*************************************************************************************************
4338 template< typename MT > // Type of the dense matrix
4339 template< typename VT > // Type of the right-hand side sparse vector
4340 inline void DenseColumn<MT,false,true>::assign( const SparseVector<VT,false>& rhs )
4341 {
4342  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4343 
4344  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
4345  matrix_(col_,element->index()) = element->value();
4346 }
4348 //*************************************************************************************************
4349 
4350 
4351 //*************************************************************************************************
4363 template< typename MT > // Type of the dense matrix
4364 template< typename VT > // Type of the right-hand side dense vector
4365 inline typename DisableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type
4366  DenseColumn<MT,false,true>::addAssign( const DenseVector<VT,false>& rhs )
4367 {
4368  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4369 
4370  const size_t jend( (~rhs).size() & size_t(-2) );
4371  for( size_t j=0UL; j<jend; j+=2UL ) {
4372  matrix_(col_,j ) += (~rhs)[j ];
4373  matrix_(col_,j+1UL) += (~rhs)[j+1UL];
4374  }
4375  if( jend < (~rhs).size() )
4376  matrix_(col_,jend) += (~rhs)[jend];
4377 }
4379 //*************************************************************************************************
4380 
4381 
4382 //*************************************************************************************************
4394 template< typename MT > // Type of the dense matrix
4395 template< typename VT > // Type of the right-hand side dense vector
4396 inline typename EnableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type
4397  DenseColumn<MT,false,true>::addAssign( const DenseVector<VT,false>& rhs )
4398 {
4399  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4400 
4402 
4403  const size_t columns( size() );
4404 
4405  const size_t jend( columns & size_t(-IT::size*4) );
4406  BLAZE_INTERNAL_ASSERT( ( columns - ( columns % (IT::size*4UL) ) ) == jend, "Invalid end calculation" );
4407 
4408  typename VT::ConstIterator it( (~rhs).begin() );
4409  for( size_t j=0UL; j<jend; j+=IT::size*4UL ) {
4410  matrix_.store( col_, j , matrix_.load(col_,j ) + it.load() ); it += IT::size;
4411  matrix_.store( col_, j+IT::size , matrix_.load(col_,j+IT::size ) + it.load() ); it += IT::size;
4412  matrix_.store( col_, j+IT::size*2UL, matrix_.load(col_,j+IT::size*2UL) + it.load() ); it += IT::size;
4413  matrix_.store( col_, j+IT::size*3UL, matrix_.load(col_,j+IT::size*3UL) + it.load() ); it += IT::size;
4414  }
4415  for( size_t j=jend; j<columns; j+=IT::size, it+=IT::size ) {
4416  matrix_.store( col_, j, matrix_.load(col_,j) + it.load() );
4417  }
4418 }
4420 //*************************************************************************************************
4421 
4422 
4423 //*************************************************************************************************
4435 template< typename MT > // Type of the dense matrix
4436 template< typename VT > // Type of the right-hand side sparse vector
4437 inline void DenseColumn<MT,false,true>::addAssign( const SparseVector<VT,false>& rhs )
4438 {
4439  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4440 
4441  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
4442  matrix_(col_,element->index()) += element->value();
4443 }
4445 //*************************************************************************************************
4446 
4447 
4448 //*************************************************************************************************
4460 template< typename MT > // Type of the dense matrix
4461 template< typename VT > // Type of the right-hand side dense vector
4462 inline typename DisableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type
4463  DenseColumn<MT,false,true>::subAssign( const DenseVector<VT,false>& rhs )
4464 {
4465  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4466 
4467  const size_t jend( (~rhs).size() & size_t(-2) );
4468  for( size_t j=0UL; j<jend; j+=2UL ) {
4469  matrix_(col_,j ) -= (~rhs)[j ];
4470  matrix_(col_,j+1UL) -= (~rhs)[j+1UL];
4471  }
4472  if( jend < (~rhs).size() )
4473  matrix_(col_,jend) -= (~rhs)[jend];
4474 }
4476 //*************************************************************************************************
4477 
4478 
4479 //*************************************************************************************************
4491 template< typename MT > // Type of the dense matrix
4492 template< typename VT > // Type of the right-hand side dense vector
4493 inline typename EnableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type
4494  DenseColumn<MT,false,true>::subAssign( const DenseVector<VT,false>& rhs )
4495 {
4496  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4497 
4499 
4500  const size_t columns( size() );
4501 
4502  const size_t jend( columns & size_t(-IT::size*4) );
4503  BLAZE_INTERNAL_ASSERT( ( columns - ( columns % (IT::size*4UL) ) ) == jend, "Invalid end calculation" );
4504 
4505  typename VT::ConstIterator it( (~rhs).begin() );
4506  for( size_t j=0UL; j<jend; j+=IT::size*4UL ) {
4507  matrix_.store( col_, j , matrix_.load(col_,j ) - it.load() ); it += IT::size;
4508  matrix_.store( col_, j+IT::size , matrix_.load(col_,j+IT::size ) - it.load() ); it += IT::size;
4509  matrix_.store( col_, j+IT::size*2UL, matrix_.load(col_,j+IT::size*2UL) - it.load() ); it += IT::size;
4510  matrix_.store( col_, j+IT::size*3UL, matrix_.load(col_,j+IT::size*3UL) - it.load() ); it += IT::size;
4511  }
4512  for( size_t j=jend; j<columns; j+=IT::size, it+=IT::size ) {
4513  matrix_.store( col_, j, matrix_.load(col_,j) - it.load() );
4514  }
4515 }
4517 //*************************************************************************************************
4518 
4519 
4520 //*************************************************************************************************
4532 template< typename MT > // Type of the dense matrix
4533 template< typename VT > // Type of the right-hand side sparse vector
4534 inline void DenseColumn<MT,false,true>::subAssign( const SparseVector<VT,false>& rhs )
4535 {
4536  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4537 
4538  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
4539  matrix_(col_,element->index()) -= element->value();
4540 }
4542 //*************************************************************************************************
4543 
4544 
4545 //*************************************************************************************************
4557 template< typename MT > // Type of the dense matrix
4558 template< typename VT > // Type of the right-hand side dense vector
4559 inline typename DisableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type
4560  DenseColumn<MT,false,true>::multAssign( const DenseVector<VT,false>& rhs )
4561 {
4562  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4563 
4564  const size_t jend( (~rhs).size() & size_t(-2) );
4565  for( size_t j=0UL; j<jend; j+=2UL ) {
4566  matrix_(col_,j ) *= (~rhs)[j ];
4567  matrix_(col_,j+1UL) *= (~rhs)[j+1UL];
4568  }
4569  if( jend < (~rhs).size() )
4570  matrix_(col_,jend) *= (~rhs)[jend];
4571 }
4573 //*************************************************************************************************
4574 
4575 
4576 //*************************************************************************************************
4588 template< typename MT > // Type of the dense matrix
4589 template< typename VT > // Type of the right-hand side dense vector
4590 inline typename EnableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type
4591  DenseColumn<MT,false,true>::multAssign( const DenseVector<VT,false>& rhs )
4592 {
4593  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4594 
4596 
4597  const size_t columns( size() );
4598 
4599  const size_t jend( columns & size_t(-IT::size*4) );
4600  BLAZE_INTERNAL_ASSERT( ( columns - ( columns % (IT::size*4UL) ) ) == jend, "Invalid end calculation" );
4601 
4602  typename VT::ConstIterator it( (~rhs).begin() );
4603  for( size_t j=0UL; j<jend; j+=IT::size*4UL ) {
4604  matrix_.store( col_, j , matrix_.load(col_,j ) * it.load() ); it += IT::size;
4605  matrix_.store( col_, j+IT::size , matrix_.load(col_,j+IT::size ) * it.load() ); it += IT::size;
4606  matrix_.store( col_, j+IT::size*2UL, matrix_.load(col_,j+IT::size*2UL) * it.load() ); it += IT::size;
4607  matrix_.store( col_, j+IT::size*3UL, matrix_.load(col_,j+IT::size*3UL) * it.load() ); it += IT::size;
4608  }
4609  for( size_t j=jend; j<columns; j+=IT::size, it+=IT::size ) {
4610  matrix_.store( col_, j, matrix_.load(col_,j) * it.load() );
4611  }
4612 }
4614 //*************************************************************************************************
4615 
4616 
4617 //*************************************************************************************************
4629 template< typename MT > // Type of the dense matrix
4630 template< typename VT > // Type of the right-hand side sparse vector
4631 inline void DenseColumn<MT,false,true>::multAssign( const SparseVector<VT,false>& rhs )
4632 {
4633  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4634 
4635  const ResultType tmp( serial( *this ) );
4636 
4637  reset();
4638 
4639  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
4640  matrix_(col_,element->index()) = tmp[element->index()] * element->value();
4641 }
4643 //*************************************************************************************************
4644 
4645 
4646 
4647 
4648 
4649 
4650 
4651 
4652 //=================================================================================================
4653 //
4654 // DENSECOLUMN OPERATORS
4655 //
4656 //=================================================================================================
4657 
4658 //*************************************************************************************************
4661 template< typename MT, bool SO, bool SF >
4662 inline void reset( DenseColumn<MT,SO,SF>& column );
4663 
4664 template< typename MT, bool SO, bool SF >
4665 inline void clear( DenseColumn<MT,SO,SF>& column );
4666 
4667 template< typename MT, bool SO, bool SF >
4668 inline bool isDefault( const DenseColumn<MT,SO,SF>& column );
4669 
4670 template< typename MT, bool SO, bool SF >
4671 inline bool isSame( const DenseColumn<MT,SO,SF>& a, const DenseColumn<MT,SO,SF>& b );
4673 //*************************************************************************************************
4674 
4675 
4676 //*************************************************************************************************
4683 template< typename MT // Type of the dense matrix
4684  , bool SO // Storage order
4685  , bool SF > // Symmetry flag
4687 {
4688  column.reset();
4689 }
4690 //*************************************************************************************************
4691 
4692 
4693 //*************************************************************************************************
4702 template< typename MT // Type of the dense matrix
4703  , bool SO // Storage order
4704  , bool SF > // Symmetry flag
4706 {
4707  column.reset();
4708 }
4709 //*************************************************************************************************
4710 
4711 
4712 //*************************************************************************************************
4730 template< typename MT // Type of the dense matrix
4731  , bool SO // Storage order
4732  , bool SF > // Symmetry flag
4734 {
4735  for( size_t i=0UL; i<column.size(); ++i )
4736  if( !isDefault( column[i] ) ) return false;
4737  return true;
4738 }
4739 //*************************************************************************************************
4740 
4741 
4742 //*************************************************************************************************
4754 template< typename MT // Type of the dense matrix
4755  , bool SO // Storage order
4756  , bool SF > // Symmetry flag
4757 inline bool isSame( const DenseColumn<MT,SO,SF>& a, const DenseColumn<MT,SO,SF>& b )
4758 {
4759  return ( isSame( a.matrix_, b.matrix_ ) && ( a.col_ == b.col_ ) );
4760 }
4761 //*************************************************************************************************
4762 
4763 
4764 
4765 
4766 //=================================================================================================
4767 //
4768 // SUBVECTORTRAIT SPECIALIZATIONS
4769 //
4770 //=================================================================================================
4771 
4772 //*************************************************************************************************
4774 template< typename MT, bool SO >
4775 struct SubvectorTrait< DenseColumn<MT,SO> >
4776 {
4777  typedef typename SubvectorTrait< typename DenseColumn<MT,SO>::ResultType >::Type Type;
4778 };
4780 //*************************************************************************************************
4781 
4782 } // namespace blaze
4783 
4784 #endif
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:879
#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
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:4838
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:258
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:115
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a column dense or sparse vector type...
Definition: TransposeFlag.h:159
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
IntrinsicTrait< typename MT::ElementType > IT
Intrinsic trait for the column element type.
Definition: DenseColumn.h:325
#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
Pointer data()
Low-level data access to the column elements.
Definition: DenseColumn.h:661
BLAZE_ALWAYS_INLINE bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b)
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:946
Header file for the IsSame and IsStrictlySame type traits.
DenseColumn(MT &matrix, size_t index)
The constructor for DenseColumn.
Definition: DenseColumn.h:598
const bool useStreaming
Configuration of the streaming behavior.For large vectors and matrices non-temporal stores can provid...
Definition: Streaming.h:50
Header file for the IsColumnMajorMatrix type trait.
Iterator begin()
Returns an iterator to the first element of the column.
Definition: DenseColumn.h:695
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:316
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T >, Load< T, sizeof(T)> >::Type::Type load(const T *address)
Loads a vector of integral values.
Definition: Load.h:224
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename ColumnExprTrait< MT >::Type >::Type column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:103
bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:366
Header file for the DenseVector base class.
bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:442
bool canSMPAssign() const
Returns whether the dense column can be used in SMP assignments.
Definition: DenseColumn.h:1250
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:695
#define BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a symmetric matrix type...
Definition: Symmetric.h:78
void store(size_t index, const IntrinsicType &value)
Aligned store of an intrinsic element of the dense column.
Definition: DenseColumn.h:1317
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a transposition expression (i...
Definition: TransExpr.h:118
SelectType< useConst, ConstPointer, ElementType * >::Type Pointer
Pointer to a non-constant row value.
Definition: DenseColumn.h:359
Header file for the column base class.
MT::ConstReference ConstReference
Reference to a constant column value.
Definition: DenseColumn.h:350
Constraint on the data type.
const ElementType * ConstPointer
Pointer to a constant row value.
Definition: DenseColumn.h:356
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the DisableIf class template.
Header file for the IsSymmetric type trait.
Header file for the clear shim.
Header file for nested template disabiguation.
IT::Type IntrinsicType
Intrinsic type of the column elements.
Definition: DenseColumn.h:345
Header file for the IsFloatingPoint type trait.
#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: StorageOrder.h:161
MT::ConstIterator ConstIterator
Iterator over constant elements.
Definition: DenseColumn.h:362
const DenseColumn & CompositeType
Data type for composite expression templates.
Definition: DenseColumn.h:347
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
Header file for the Or class template.
size_t capacity() const
Returns the maximum capacity of the dense column.
Definition: DenseColumn.h:1062
Reference to a specific column of a dense matrix.The DenseColumn template represents a reference to a...
Definition: DenseColumn.h:316
bool isAligned() const
Returns whether the dense column is properly aligned in memory.
Definition: DenseColumn.h:1230
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
Base class for all columns.The Column class serves as a tag for all columns (i.e. dense and sparse co...
Definition: Column.h:64
BLAZE_ALWAYS_INLINE void clear(const NonNumericProxy< MT > &proxy)
Clearing the represented element.
Definition: NonNumericProxy.h:854
Header file for the subvector trait.
SelectType< useConst, ConstIterator, typename MT::Iterator >::Type Iterator
Iterator over non-constant elements.
Definition: DenseColumn.h:365
const DenseIterator< Type > operator+(const DenseIterator< Type > &it, ptrdiff_t inc)
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:556
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Compile time check for sparse vector types.This type trait tests whether or not the given template pa...
Definition: IsSparseVector.h:103
void stream(size_t index, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the dense column.
Definition: DenseColumn.h:1363
Constraint on the data type.
Constraint on the data type.
DenseColumn & operator=(const ElementType &rhs)
Homogenous assignment to all column elements.
Definition: DenseColumn.h:804
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a vectorizable data type...
Definition: Vectorizable.h:79
Reference operator[](size_t index)
Subscript operator for the direct access to the column elements.
Definition: DenseColumn.h:625
Constraints on the storage order of matrix types.
Operand matrix_
The dense matrix containing the column.
Definition: DenseColumn.h:554
Constraint on the data type.
DenseColumn< MT, SO, SF > This
Type of this DenseColumn instance.
Definition: DenseColumn.h:341
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:195
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
Constraint on the data type.
ConstIterator cbegin() const
Returns an iterator to the first element of the column.
Definition: DenseColumn.h:729
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2480
System settings for streaming (non-temporal stores)
Header file for the EnableIf class template.
bool canAlias(const Other *alias) const
Returns whether the dense column can alias with the given address alias.
Definition: DenseColumn.h:1144
IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the dense column.
Definition: DenseColumn.h:1294
Header file for the IsNumeric type trait.
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename RowExprTrait< MT >::Type >::Type row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:103
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
size_t nonZeros() const
Returns the number of non-zero elements in the column.
Definition: DenseColumn.h:1080
Header file for the IsSparseVector type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:116
void storeu(size_t index, const IntrinsicType &value)
Unaligned store of an intrinsic element of the dense column.
Definition: DenseColumn.h:1340
#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: StorageOrder.h:81
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2477
Header file for the IsConst type trait.
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:749
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
SelectType< IsExpression< MT >::value, MT, MT & >::Type Operand
Composite data type of the dense matrix expression.
Definition: DenseColumn.h:322
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DenseColumn.h:343
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
Header file for the division trait.
Iterator end()
Returns an iterator just past the last element of the column.
Definition: DenseColumn.h:746
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Header file for the cache size of the target architecture.
void reset()
Reset to the default initial values.
Definition: DenseColumn.h:1095
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2481
Header file for the column trait.
Header file for the isDefault shim.
BLAZE_ALWAYS_INLINE bool isDefault(const NonNumericProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: NonNumericProxy.h:874
Constraint on the data type.
BLAZE_ALWAYS_INLINE void reset(const NonNumericProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: NonNumericProxy.h:833
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
Header file for the RemoveReference type trait.
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
Compile time check for constant data types.The IsConst type trait tests whether or not the given temp...
Definition: IsConst.h:94
Header file for all intrinsic functionality.
bool isAliased(const Other *alias) const
Returns whether the dense column is aliased with the given address alias.
Definition: DenseColumn.h:1188
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:79
const size_t col_
The index of the column in the matrix.
Definition: DenseColumn.h:555
Header file for the IsRowMajorMatrix type trait.
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:151
CompressedMatrix< Type,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:256
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
size_t size() const
Returns the current size/dimension of the column.
Definition: DenseColumn.h:1047
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
MT::ElementType ElementType
Type of the column elements.
Definition: DenseColumn.h:344
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:332
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
Header file for basic type definitions.
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DenseColumn.h:346
IntrinsicType load(size_t index) const
Aligned load of an intrinsic element of the dense column.
Definition: DenseColumn.h:1272
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2479
const size_t SMP_DVECASSIGN_THRESHOLD
SMP dense vector assignment threshold.This threshold specifies when an assignment of a simple dense v...
Definition: Thresholds.h:207
ColumnTrait< MT >::Type ResultType
Result type for expression template evaluations.
Definition: DenseColumn.h:342
const size_t cacheSize
Cache size of the target architecture.This setting specifies the available cache size in Byte of the ...
Definition: CacheSize.h:48
SelectType< useConst, ConstReference, typename MT::Reference >::Type Reference
Reference to a non-constant column value.
Definition: DenseColumn.h:353
ConstIterator cend() const
Returns an iterator just past the last element of the column.
Definition: DenseColumn.h:780
EnableIf< IsDenseVector< VT1 > >::Type smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:189
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849
Header file for a safe C++ NULL pointer implementation.