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>
54 #include <blaze/math/Intrinsics.h>
55 #include <blaze/math/shims/Reset.h>
63 #include <blaze/system/CacheSize.h>
64 #include <blaze/system/Streaming.h>
65 #include <blaze/util/Assert.h>
67 #include <blaze/util/DisableIf.h>
68 #include <blaze/util/EnableIf.h>
70 #include <blaze/util/mpl/Or.h>
71 #include <blaze/util/Template.h>
72 #include <blaze/util/Types.h>
78 
79 
80 namespace blaze {
81 
82 //=================================================================================================
83 //
84 // CLASS DEFINITION
85 //
86 //=================================================================================================
87 
88 //*************************************************************************************************
305 template< typename MT // Type of the dense matrix
306  , bool SO = IsColumnMajorMatrix<MT>::value > // Storage order
307 class DenseColumn : public DenseVector< DenseColumn<MT,SO>, false >
308  , private View
309 {
310  private:
311  //**Type definitions****************************************************************************
313  typedef typename SelectType< IsExpression<MT>::value, MT, MT& >::Type Operand;
314 
317  //**********************************************************************************************
318 
319  //**********************************************************************************************
321 
327  enum { useConst = IsConst<MT>::value };
328  //**********************************************************************************************
329 
330  public:
331  //**Type definitions****************************************************************************
335  typedef typename MT::ElementType ElementType;
336  typedef typename IT::Type IntrinsicType;
337  typedef typename MT::ReturnType ReturnType;
338  typedef const DenseColumn& CompositeType;
339 
342 
345 
347  typedef const ElementType* ConstPointer;
348 
351 
354 
357  //**********************************************************************************************
358 
359  //**Compilation flags***************************************************************************
361  enum { vectorizable = MT::vectorizable };
362 
364  enum { smpAssignable = 0 };
365  //**********************************************************************************************
366 
367  //**Constructors********************************************************************************
370  explicit inline DenseColumn( MT& matrix, size_t index );
371  // No explicitly declared copy constructor.
373  //**********************************************************************************************
374 
375  //**Destructor**********************************************************************************
376  // No explicitly declared destructor.
377  //**********************************************************************************************
378 
379  //**Data access functions***********************************************************************
382  inline Reference operator[]( size_t index );
383  inline ConstReference operator[]( size_t index ) const;
384  inline Pointer data ();
385  inline ConstPointer data () const;
386  inline Iterator begin ();
387  inline ConstIterator begin () const;
388  inline ConstIterator cbegin() const;
389  inline Iterator end ();
390  inline ConstIterator end () const;
391  inline ConstIterator cend () const;
393  //**********************************************************************************************
394 
395  //**Assignment operators************************************************************************
398  inline DenseColumn& operator= ( const ElementType& rhs );
399  inline DenseColumn& operator= ( const DenseColumn& rhs );
400  template< typename VT > inline DenseColumn& operator= ( const Vector<VT,false>& rhs );
401  template< typename VT > inline DenseColumn& operator+=( const Vector<VT,false>& rhs );
402  template< typename VT > inline DenseColumn& operator-=( const Vector<VT,false>& rhs );
403  template< typename VT > inline DenseColumn& operator*=( const Vector<VT,false>& rhs );
404 
405  template< typename Other >
406  inline typename EnableIf< IsNumeric<Other>, DenseColumn >::Type&
407  operator*=( Other rhs );
408 
409  template< typename Other >
410  inline typename EnableIf< IsNumeric<Other>, DenseColumn >::Type&
411  operator/=( Other rhs );
413  //**********************************************************************************************
414 
415  //**Utility functions***************************************************************************
418  inline size_t size() const;
419  inline size_t capacity() const;
420  inline size_t nonZeros() const;
421  inline void reset();
422  template< typename Other > inline DenseColumn& scale( const Other& scalar );
424  //**********************************************************************************************
425 
426  private:
427  //**********************************************************************************************
429  template< typename VT >
431  struct VectorizedAssign {
432  enum { value = vectorizable && VT::vectorizable &&
433  IsSame<ElementType,typename VT::ElementType>::value };
434  };
436  //**********************************************************************************************
437 
438  //**********************************************************************************************
440  template< typename VT >
442  struct VectorizedAddAssign {
443  enum { value = vectorizable && VT::vectorizable &&
444  IsSame<ElementType,typename VT::ElementType>::value &&
445  IntrinsicTrait<ElementType>::addition };
446  };
448  //**********************************************************************************************
449 
450  //**********************************************************************************************
452  template< typename VT >
454  struct VectorizedSubAssign {
455  enum { value = vectorizable && VT::vectorizable &&
456  IsSame<ElementType,typename VT::ElementType>::value &&
457  IntrinsicTrait<ElementType>::subtraction };
458  };
460  //**********************************************************************************************
461 
462  //**********************************************************************************************
464  template< typename VT >
466  struct VectorizedMultAssign {
467  enum { value = vectorizable && VT::vectorizable &&
468  IsSame<ElementType,typename VT::ElementType>::value &&
469  IntrinsicTrait<ElementType>::multiplication };
470  };
472  //**********************************************************************************************
473 
474  public:
475  //**Expression template evaluation functions****************************************************
478  template< typename Other > inline bool canAlias ( const Other* alias ) const;
479  template< typename Other > inline bool isAliased( const Other* alias ) const;
480 
481  inline IntrinsicType load ( size_t index ) const;
482  inline IntrinsicType loadu ( size_t index ) const;
483  inline void store ( size_t index, const IntrinsicType& value );
484  inline void storeu( size_t index, const IntrinsicType& value );
485  inline void stream( size_t index, const IntrinsicType& value );
486 
487  template< typename VT >
488  inline typename DisableIf< VectorizedAssign<VT> >::Type
489  assign( const DenseVector<VT,false>& rhs );
490 
491  template< typename VT >
492  inline typename EnableIf< VectorizedAssign<VT> >::Type
493  assign( const DenseVector<VT,false>& rhs );
494 
495  template< typename VT > inline void assign( const SparseVector<VT,false>& rhs );
496 
497  template< typename VT >
498  inline typename DisableIf< VectorizedAddAssign<VT> >::Type
499  addAssign( const DenseVector<VT,false>& rhs );
500 
501  template< typename VT >
502  inline typename EnableIf< VectorizedAddAssign<VT> >::Type
503  addAssign( const DenseVector<VT,false>& rhs );
504 
505  template< typename VT > inline void addAssign( const SparseVector<VT,false>& rhs );
506 
507  template< typename VT >
508  inline typename DisableIf< VectorizedSubAssign<VT> >::Type
509  subAssign( const DenseVector<VT,false>& rhs );
510 
511  template< typename VT >
512  inline typename EnableIf< VectorizedSubAssign<VT> >::Type
513  subAssign( const DenseVector<VT,false>& rhs );
514 
515  template< typename VT > inline void subAssign( const SparseVector<VT,false>& rhs );
516 
517  template< typename VT >
518  inline typename DisableIf< VectorizedMultAssign<VT> >::Type
519  multAssign( const DenseVector<VT,false>& rhs );
520 
521  template< typename VT >
522  inline typename EnableIf< VectorizedMultAssign<VT> >::Type
523  multAssign( const DenseVector<VT,false>& rhs );
524 
525  template< typename VT > inline void multAssign( const SparseVector<VT,false>& rhs );
527  //**********************************************************************************************
528 
529  private:
530  //**Member variables****************************************************************************
534  const size_t col_;
535 
536  //**********************************************************************************************
537 
538  //**Compile time checks*************************************************************************
545  //**********************************************************************************************
546 };
547 //*************************************************************************************************
548 
549 
550 
551 
552 //=================================================================================================
553 //
554 // CONSTRUCTOR
555 //
556 //=================================================================================================
557 
558 //*************************************************************************************************
565 template< typename MT // Type of the dense matrix
566  , bool SO > // Storage order
567 inline DenseColumn<MT,SO>::DenseColumn( MT& matrix, size_t index )
568  : matrix_( matrix ) // The dense matrix containing the column
569  , col_ ( index ) // The index of the column in the matrix
570 {
571  if( matrix_.columns() <= index )
572  throw std::invalid_argument( "Invalid column access index" );
573 }
574 //*************************************************************************************************
575 
576 
577 
578 
579 //=================================================================================================
580 //
581 // DATA ACCESS FUNCTIONS
582 //
583 //=================================================================================================
584 
585 //*************************************************************************************************
591 template< typename MT // Type of the dense matrix
592  , bool SO > // Storage order
594 {
595  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
596  return matrix_(index,col_);
597 }
598 //*************************************************************************************************
599 
600 
601 //*************************************************************************************************
607 template< typename MT // Type of the dense matrix
608  , bool SO > // Storage order
610 {
611  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
612  return matrix_(index,col_);
613 }
614 //*************************************************************************************************
615 
616 
617 //*************************************************************************************************
624 template< typename MT // Type of the dense matrix
625  , bool SO > // Storage order
627 {
628  return matrix_.data( col_ );
629 }
630 //*************************************************************************************************
631 
632 
633 //*************************************************************************************************
640 template< typename MT // Type of the dense matrix
641  , bool SO > // Storage order
643 {
644  return matrix_.data( col_ );
645 }
646 //*************************************************************************************************
647 
648 
649 //*************************************************************************************************
656 template< typename MT // Type of the dense matrix
657  , bool SO > // Storage order
659 {
660  return matrix_.begin( col_ );
661 }
662 //*************************************************************************************************
663 
664 
665 //*************************************************************************************************
672 template< typename MT // Type of the dense matrix
673  , bool SO > // Storage order
675 {
676  return matrix_.cbegin( col_ );
677 }
678 //*************************************************************************************************
679 
680 
681 //*************************************************************************************************
688 template< typename MT // Type of the dense matrix
689  , bool SO > // Storage order
691 {
692  return matrix_.cbegin( col_ );
693 }
694 //*************************************************************************************************
695 
696 
697 //*************************************************************************************************
704 template< typename MT // Type of the dense matrix
705  , bool SO > // Storage order
707 {
708  return matrix_.end( col_ );
709 }
710 //*************************************************************************************************
711 
712 
713 //*************************************************************************************************
720 template< typename MT // Type of the dense matrix
721  , bool SO > // Storage order
723 {
724  return matrix_.cend( col_ );
725 }
726 //*************************************************************************************************
727 
728 
729 //*************************************************************************************************
736 template< typename MT // Type of the dense matrix
737  , bool SO > // Storage order
739 {
740  return matrix_.cend( col_ );
741 }
742 //*************************************************************************************************
743 
744 
745 
746 
747 //=================================================================================================
748 //
749 // ASSIGNMENT OPERATORS
750 //
751 //=================================================================================================
752 
753 //*************************************************************************************************
759 template< typename MT // Type of the dense matrix
760  , bool SO > // Storage order
762 {
763  const size_t rows( size() );
764 
765  for( size_t i=0UL; i<rows; ++i )
766  matrix_(i,col_) = rhs;
767 
768  return *this;
769 }
770 //*************************************************************************************************
771 
772 
773 //*************************************************************************************************
783 template< typename MT // Type of the dense matrix
784  , bool SO > // Storage order
786 {
787  if( &rhs == this ) return *this;
788 
789  if( size() != rhs.size() )
790  throw std::invalid_argument( "Column sizes do not match" );
791 
792  const size_t rows( size() );
793 
794  for( size_t i=0UL; i<rows; ++i )
795  matrix_(i,col_) = rhs[i];
796 
797  return *this;
798 }
799 //*************************************************************************************************
800 
801 
802 //*************************************************************************************************
812 template< typename MT // Type of the dense matrix
813  , bool SO > // Storage order
814 template< typename VT > // Type of the right-hand side vector
816 {
817  using blaze::assign;
818 
821 
822  if( size() != (~rhs).size() )
823  throw std::invalid_argument( "Vector sizes do not match" );
824 
825  if( (~rhs).canAlias( &matrix_ ) ) {
826  const typename VT::ResultType tmp( ~rhs );
827  assign( *this, tmp );
828  }
829  else {
831  reset();
832  assign( *this, ~rhs );
833  }
834 
835  return *this;
836 }
837 //*************************************************************************************************
838 
839 
840 //*************************************************************************************************
850 template< typename MT // Type of the dense matrix
851  , bool SO > // Storage order
852 template< typename VT > // Type of the right-hand side vector
854 {
855  using blaze::addAssign;
856 
859 
860  if( size() != (~rhs).size() )
861  throw std::invalid_argument( "Vector sizes do not match" );
862 
863  if( (~rhs).canAlias( &matrix_ ) ) {
864  const typename VT::ResultType tmp( ~rhs );
865  addAssign( *this, tmp );
866  }
867  else {
868  addAssign( *this, ~rhs );
869  }
870 
871  return *this;
872 }
873 //*************************************************************************************************
874 
875 
876 //*************************************************************************************************
886 template< typename MT // Type of the dense matrix
887  , bool SO > // Storage order
888 template< typename VT > // Type of the right-hand side vector
890 {
891  using blaze::subAssign;
892 
895 
896  if( size() != (~rhs).size() )
897  throw std::invalid_argument( "Vector sizes do not match" );
898 
899  if( (~rhs).canAlias( &matrix_ ) ) {
900  const typename VT::ResultType tmp( ~rhs );
901  subAssign( *this, tmp );
902  }
903  else {
904  subAssign( *this, ~rhs );
905  }
906 
907  return *this;
908 }
909 //*************************************************************************************************
910 
911 
912 //*************************************************************************************************
923 template< typename MT // Type of the dense matrix
924  , bool SO > // Storage order
925 template< typename VT > // Type of the right-hand side vector
927 {
928  using blaze::multAssign;
929 
932 
933  if( size() != (~rhs).size() )
934  throw std::invalid_argument( "Vector sizes do not match" );
935 
936  if( (~rhs).canAlias( &matrix_ ) || IsSparseVector<VT>::value ) {
937  const typename VT::ResultType tmp( ~rhs );
938  multAssign( *this, tmp );
939  }
940  else {
941  multAssign( *this, ~rhs );
942  }
943 
944  return *this;
945 }
946 //*************************************************************************************************
947 
948 
949 //*************************************************************************************************
956 template< typename MT // Type of the dense matrix
957  , bool SO > // Storage order
958 template< typename Other > // Data type of the right-hand side scalar
959 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,SO> >::Type&
961 {
962  return operator=( (*this) * rhs );
963 }
964 //*************************************************************************************************
965 
966 
967 //*************************************************************************************************
976 template< typename MT // Type of the dense matrix
977  , bool SO > // Storage order
978 template< typename Other > // Data type of the right-hand side scalar
979 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,SO> >::Type&
981 {
982  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
983 
984  return operator=( (*this) / rhs );
985 }
986 //*************************************************************************************************
987 
988 
989 
990 
991 //=================================================================================================
992 //
993 // UTILITY FUNCTIONS
994 //
995 //=================================================================================================
996 
997 //*************************************************************************************************
1002 template< typename MT // Type of the dense matrix
1003  , bool SO > // Storage order
1004 inline size_t DenseColumn<MT,SO>::size() const
1005 {
1006  return matrix_.rows();
1007 }
1008 //*************************************************************************************************
1009 
1010 
1011 //*************************************************************************************************
1016 template< typename MT // Type of the dense matrix
1017  , bool SO > // Storage order
1018 inline size_t DenseColumn<MT,SO>::capacity() const
1019 {
1020  return matrix_.capacity( col_ );
1021 }
1022 //*************************************************************************************************
1023 
1024 
1025 //*************************************************************************************************
1033 template< typename MT // Type of the dense matrix
1034  , bool SO > // Storage order
1035 inline size_t DenseColumn<MT,SO>::nonZeros() const
1036 {
1037  return matrix_.nonZeros( col_ );
1038 }
1039 //*************************************************************************************************
1040 
1041 
1042 //*************************************************************************************************
1047 template< typename MT // Type of the dense matrix
1048  , bool SO > // Storage order
1050 {
1051  matrix_.reset( col_ );
1052 }
1053 //*************************************************************************************************
1054 
1055 
1056 //*************************************************************************************************
1062 template< typename MT // Type of the dense matrix
1063  , bool SO > // Storage order
1064 template< typename Other > // Data type of the scalar value
1065 inline DenseColumn<MT,SO>& DenseColumn<MT,SO>::scale( const Other& scalar )
1066 {
1067  for( size_t j=0UL; j<size(); ++j ) {
1068  matrix_(j,col_) *= scalar;
1069  }
1070  return *this;
1071 }
1072 //*************************************************************************************************
1073 
1074 
1075 
1076 
1077 //=================================================================================================
1078 //
1079 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
1080 //
1081 //=================================================================================================
1082 
1083 //*************************************************************************************************
1093 template< typename MT // Type of the dense matrix
1094  , bool SO > // Storage order
1095 template< typename Other > // Data type of the foreign expression
1096 inline bool DenseColumn<MT,SO>::canAlias( const Other* alias ) const
1097 {
1098  return static_cast<const void*>( &matrix_ ) == static_cast<const void*>( alias );
1099 }
1100 //*************************************************************************************************
1101 
1102 
1103 //*************************************************************************************************
1113 template< typename MT // Type of the dense matrix
1114  , bool SO > // Storage order
1115 template< typename Other > // Data type of the foreign expression
1116 inline bool DenseColumn<MT,SO>::isAliased( const Other* alias ) const
1117 {
1118  return static_cast<const void*>( &matrix_ ) == static_cast<const void*>( alias );
1119 }
1120 //*************************************************************************************************
1121 
1122 
1123 //*************************************************************************************************
1135 template< typename MT // Type of the dense matrix
1136  , bool SO > // Storage order
1138 {
1139  return matrix_.load( index, col_ );
1140 }
1141 //*************************************************************************************************
1142 
1143 
1144 //*************************************************************************************************
1156 template< typename MT // Type of the dense matrix
1157  , bool SO > // Storage order
1159 {
1160  return matrix_.loadu( index, col_ );
1161 }
1162 //*************************************************************************************************
1163 
1164 
1165 //*************************************************************************************************
1178 template< typename MT // Type of the dense matrix
1179  , bool SO > // Storage order
1180 inline void DenseColumn<MT,SO>::store( size_t index, const IntrinsicType& value )
1181 {
1182  matrix_.store( index, col_, value );
1183 }
1184 //*************************************************************************************************
1185 
1186 
1187 //*************************************************************************************************
1200 template< typename MT // Type of the dense matrix
1201  , bool SO > // Storage order
1202 inline void DenseColumn<MT,SO>::storeu( size_t index, const IntrinsicType& value )
1203 {
1204  matrix_.storeu( index, col_, value );
1205 }
1206 //*************************************************************************************************
1207 
1208 
1209 //*************************************************************************************************
1222 template< typename MT // Type of the dense matrix
1223  , bool SO > // Storage order
1224 inline void DenseColumn<MT,SO>::stream( size_t index, const IntrinsicType& value )
1225 {
1226  matrix_.stream( index, col_, value );
1227 }
1228 //*************************************************************************************************
1229 
1230 
1231 //*************************************************************************************************
1242 template< typename MT // Type of the dense matrix
1243  , bool SO > // Storage order
1244 template< typename VT > // Type of the right-hand side dense vector
1245 inline typename DisableIf< typename DenseColumn<MT,SO>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type
1247 {
1248  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1249 
1250  const size_t iend( (~rhs).size() & size_t(-2) );
1251  for( size_t i=0UL; i<iend; i+=2UL ) {
1252  matrix_(i ,col_) = (~rhs)[i ];
1253  matrix_(i+1UL,col_) = (~rhs)[i+1UL];
1254  }
1255  if( iend < (~rhs).size() )
1256  matrix_(iend,col_) = (~rhs)[iend];
1257 }
1258 //*************************************************************************************************
1259 
1260 
1261 //*************************************************************************************************
1272 template< typename MT // Type of the dense matrix
1273  , bool SO > // Storage order
1274 template< typename VT > // Type of the right-hand side dense vector
1275 inline typename EnableIf< typename DenseColumn<MT,SO>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type
1277 {
1278  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1279 
1281 
1282  const size_t rows( size() );
1283 
1284  if( useStreaming && rows > ( cacheSize/( sizeof(ElementType) * 3UL ) ) && !(~rhs).isAliased( this ) )
1285  {
1286  for( size_t i=0UL; i<rows; i+=IT::size ) {
1287  matrix_.stream( i, col_, (~rhs).load(i) );
1288  }
1289  }
1290  else
1291  {
1292  const size_t iend( rows & size_t(-IT::size*4) );
1293  BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (IT::size*4UL) ) ) == iend, "Invalid end calculation" );
1294 
1295  typename VT::ConstIterator it( (~rhs).begin() );
1296  for( size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1297  matrix_.store( i , col_, it.load() ); it+=IT::size;
1298  matrix_.store( i+IT::size , col_, it.load() ); it+=IT::size;
1299  matrix_.store( i+IT::size*2UL, col_, it.load() ); it+=IT::size;
1300  matrix_.store( i+IT::size*3UL, col_, it.load() ); it+=IT::size;
1301  }
1302  for( size_t i=iend; i<rows; i+=IT::size, it+=IT::size ) {
1303  matrix_.store( i, col_, it.load() );
1304  }
1305  }
1306 }
1307 //*************************************************************************************************
1308 
1309 
1310 //*************************************************************************************************
1321 template< typename MT // Type of the dense matrix
1322  , bool SO > // Storage order
1323 template< typename VT > // Type of the right-hand side sparse vector
1325 {
1326  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1327 
1328  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1329  matrix_(element->index(),col_) = element->value();
1330 }
1331 //*************************************************************************************************
1332 
1333 
1334 //*************************************************************************************************
1345 template< typename MT // Type of the dense matrix
1346  , bool SO > // Storage order
1347 template< typename VT > // Type of the right-hand side dense vector
1348 inline typename DisableIf< typename DenseColumn<MT,SO>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type
1350 {
1351  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1352 
1353  const size_t iend( (~rhs).size() & size_t(-2) );
1354  for( size_t i=0UL; i<iend; i+=2UL ) {
1355  matrix_(i ,col_) += (~rhs)[i ];
1356  matrix_(i+1UL,col_) += (~rhs)[i+1UL];
1357  }
1358  if( iend < (~rhs).size() )
1359  matrix_(iend,col_) += (~rhs)[iend];
1360 }
1361 //*************************************************************************************************
1362 
1363 
1364 //*************************************************************************************************
1375 template< typename MT // Type of the dense matrix
1376  , bool SO > // Storage order
1377 template< typename VT > // Type of the right-hand side dense vector
1378 inline typename EnableIf< typename DenseColumn<MT,SO>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type
1380 {
1381  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1382 
1384 
1385  const size_t rows( size() );
1386 
1387  const size_t iend( rows & size_t(-IT::size*4) );
1388  BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (IT::size*4UL) ) ) == iend, "Invalid end calculation" );
1389 
1390  typename VT::ConstIterator it( (~rhs).begin() );
1391  for( size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1392  matrix_.store( i , col_, matrix_.load(i ,col_) + it.load() ); it += IT::size;
1393  matrix_.store( i+IT::size , col_, matrix_.load(i+IT::size ,col_) + it.load() ); it += IT::size;
1394  matrix_.store( i+IT::size*2UL, col_, matrix_.load(i+IT::size*2UL,col_) + it.load() ); it += IT::size;
1395  matrix_.store( i+IT::size*3UL, col_, matrix_.load(i+IT::size*3UL,col_) + it.load() ); it += IT::size;
1396  }
1397  for( size_t i=iend; i<rows; i+=IT::size, it+=IT::size ) {
1398  matrix_.store( i, col_, matrix_.load(i,col_) + it.load() );
1399  }
1400 }
1401 //*************************************************************************************************
1402 
1403 
1404 //*************************************************************************************************
1415 template< typename MT // Type of the dense matrix
1416  , bool SO > // Storage order
1417 template< typename VT > // Type of the right-hand side sparse vector
1419 {
1420  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1421 
1422  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1423  matrix_(element->index(),col_) += element->value();
1424 }
1425 //*************************************************************************************************
1426 
1427 
1428 //*************************************************************************************************
1439 template< typename MT // Type of the dense matrix
1440  , bool SO > // Storage order
1441 template< typename VT > // Type of the right-hand side dense vector
1442 inline typename DisableIf< typename DenseColumn<MT,SO>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type
1444 {
1445  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1446 
1447  const size_t iend( (~rhs).size() & size_t(-2) );
1448  for( size_t i=0UL; i<iend; i+=2UL ) {
1449  matrix_(i ,col_) -= (~rhs)[i ];
1450  matrix_(i+1UL,col_) -= (~rhs)[i+1UL];
1451  }
1452  if( iend < (~rhs).size() )
1453  matrix_(iend,col_) -= (~rhs)[iend];
1454 }
1455 //*************************************************************************************************
1456 
1457 
1458 //*************************************************************************************************
1469 template< typename MT // Type of the dense matrix
1470  , bool SO > // Storage order
1471 template< typename VT > // Type of the right-hand side dense vector
1472 inline typename EnableIf< typename DenseColumn<MT,SO>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type
1474 {
1475  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1476 
1478 
1479  const size_t rows( size() );
1480 
1481  const size_t iend( rows & size_t(-IT::size*4) );
1482  BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (IT::size*4UL) ) ) == iend, "Invalid end calculation" );
1483 
1484  typename VT::ConstIterator it( (~rhs).begin() );
1485  for( size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1486  matrix_.store( i , col_, matrix_.load(i ,col_) - it.load() ); it += IT::size;
1487  matrix_.store( i+IT::size , col_, matrix_.load(i+IT::size ,col_) - it.load() ); it += IT::size;
1488  matrix_.store( i+IT::size*2UL, col_, matrix_.load(i+IT::size*2UL,col_) - it.load() ); it += IT::size;
1489  matrix_.store( i+IT::size*3UL, col_, matrix_.load(i+IT::size*3UL,col_) - it.load() ); it += IT::size;
1490  }
1491  for( size_t i=iend; i<rows; i+=IT::size, it+=IT::size ) {
1492  matrix_.store( i, col_, matrix_.load(i,col_) - it.load() );
1493  }
1494 }
1495 //*************************************************************************************************
1496 
1497 
1498 //*************************************************************************************************
1509 template< typename MT // Type of the dense matrix
1510  , bool SO > // Storage order
1511 template< typename VT > // Type of the right-hand side sparse vector
1513 {
1514  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1515 
1516  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1517  matrix_(element->index(),col_) -= element->value();
1518 }
1519 //*************************************************************************************************
1520 
1521 
1522 //*************************************************************************************************
1533 template< typename MT // Type of the dense matrix
1534  , bool SO > // Storage order
1535 template< typename VT > // Type of the right-hand side dense vector
1536 inline typename DisableIf< typename DenseColumn<MT,SO>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type
1538 {
1539  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1540 
1541  const size_t iend( (~rhs).size() & size_t(-2) );
1542  for( size_t i=0UL; i<iend; i+=2UL ) {
1543  matrix_(i ,col_) *= (~rhs)[i ];
1544  matrix_(i+1UL,col_) *= (~rhs)[i+1UL];
1545  }
1546  if( iend < (~rhs).size() )
1547  matrix_(iend,col_) *= (~rhs)[iend];
1548 }
1549 //*************************************************************************************************
1550 
1551 
1552 //*************************************************************************************************
1563 template< typename MT // Type of the dense matrix
1564  , bool SO > // Storage order
1565 template< typename VT > // Type of the right-hand side dense vector
1566 inline typename EnableIf< typename DenseColumn<MT,SO>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type
1568 {
1569  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1570 
1572 
1573  const size_t rows( size() );
1574 
1575  const size_t iend( rows & size_t(-IT::size*4) );
1576  BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (IT::size*4UL) ) ) == iend, "Invalid end calculation" );
1577 
1578  typename VT::ConstIterator it( (~rhs).begin() );
1579  for( size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1580  matrix_.store( i , col_, matrix_.load(i ,col_) * it.load() ); it += IT::size;
1581  matrix_.store( i+IT::size , col_, matrix_.load(i+IT::size ,col_) * it.load() ); it += IT::size;
1582  matrix_.store( i+IT::size*2UL, col_, matrix_.load(i+IT::size*2UL,col_) * it.load() ); it += IT::size;
1583  matrix_.store( i+IT::size*3UL, col_, matrix_.load(i+IT::size*3UL,col_) * it.load() ); it += IT::size;
1584  }
1585  for( size_t i=iend; i<rows; i+=IT::size, it+=IT::size ) {
1586  matrix_.store( i, col_, matrix_.load(i,col_) * it.load() );
1587  }
1588 }
1589 //*************************************************************************************************
1590 
1591 
1592 //*************************************************************************************************
1603 template< typename MT // Type of the dense matrix
1604  , bool SO > // Storage order
1605 template< typename VT > // Type of the right-hand side sparse vector
1607 {
1608  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1609 
1610  const ResultType tmp( *this );
1611 
1612  reset();
1613 
1614  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1615  matrix_(element->index(),col_) = tmp[element->index()] * element->value();
1616 }
1617 //*************************************************************************************************
1618 
1619 
1620 
1621 
1622 
1623 
1624 
1625 
1626 //=================================================================================================
1627 //
1628 // CLASS TEMPLATE SPECIALIZATION FOR ROW-MAJOR MATRICES
1629 //
1630 //=================================================================================================
1631 
1632 //*************************************************************************************************
1640 template< typename MT > // Type of the dense matrix
1641 class DenseColumn<MT,false> : public DenseVector< DenseColumn<MT,false>, false >
1642  , private View
1643 {
1644  private:
1645  //**Type definitions****************************************************************************
1647  typedef typename SelectType< IsExpression<MT>::value, MT, MT& >::Type Operand;
1648  //**********************************************************************************************
1649 
1650  //**********************************************************************************************
1652 
1658  enum { useConst = IsConst<MT>::value };
1659  //**********************************************************************************************
1660 
1661  public:
1662  //**Type definitions****************************************************************************
1663  typedef DenseColumn<MT,false> This;
1664  typedef typename ColumnTrait<MT>::Type ResultType;
1665  typedef typename ResultType::TransposeType TransposeType;
1666  typedef typename MT::ElementType ElementType;
1667  typedef typename MT::ReturnType ReturnType;
1668  typedef const ResultType CompositeType;
1669 
1671  typedef typename MT::ConstReference ConstReference;
1672 
1674  typedef typename SelectType< useConst, ConstReference, typename MT::Reference >::Type Reference;
1675  //**********************************************************************************************
1676 
1677  //**ColumnIterator class definition*************************************************************
1680  template< typename MatrixType > // Type of the dense matrix
1681  class ColumnIterator
1682  {
1683  private:
1684  //*******************************************************************************************
1686 
1691  enum { returnConst = IsConst<MatrixType>::value };
1692  //*******************************************************************************************
1693 
1694  public:
1695  //**Type definitions*************************************************************************
1697  typedef typename SelectType< returnConst, typename MT::ConstReference, typename MT::Reference >::Type Reference;
1698 
1699  typedef std::random_access_iterator_tag IteratorCategory;
1700  typedef RemoveReference<Reference> ValueType;
1701  typedef ValueType* PointerType;
1702  typedef Reference ReferenceType;
1703  typedef ptrdiff_t DifferenceType;
1704 
1705  // STL iterator requirements
1706  typedef IteratorCategory iterator_category;
1707  typedef ValueType value_type;
1708  typedef PointerType pointer;
1709  typedef ReferenceType reference;
1710  typedef DifferenceType difference_type;
1711  //*******************************************************************************************
1712 
1713  //**Constructor******************************************************************************
1720  inline ColumnIterator( MatrixType& matrix, size_t row, size_t column )
1721  : matrix_( &matrix ) // The dense matrix containing the column.
1722  , row_ ( row ) // The current row index.
1723  , column_( column ) // The current column index.
1724  {}
1725  //*******************************************************************************************
1726 
1727  //**Constructor******************************************************************************
1732  template< typename MatrixType2 >
1733  inline ColumnIterator( const ColumnIterator<MatrixType2>& it )
1734  : matrix_( it.matrix_ ) // The dense matrix containing the column.
1735  , row_ ( it.row_ ) // The current row index.
1736  , column_( it.column_ ) // The current column index.
1737  {}
1738  //*******************************************************************************************
1739 
1740  //**Addition assignment operator*************************************************************
1746  inline ColumnIterator& operator+=( size_t inc ) {
1747  row_ += inc;
1748  return *this;
1749  }
1750  //*******************************************************************************************
1751 
1752  //**Subtraction assignment operator**********************************************************
1758  inline ColumnIterator& operator-=( size_t dec ) {
1759  row_ -= dec;
1760  return *this;
1761  }
1762  //*******************************************************************************************
1763 
1764  //**Prefix increment operator****************************************************************
1769  inline ColumnIterator& operator++() {
1770  ++row_;
1771  return *this;
1772  }
1773  //*******************************************************************************************
1774 
1775  //**Postfix increment operator***************************************************************
1780  inline const ColumnIterator operator++( int ) {
1781  const ColumnIterator tmp( *this );
1782  ++(*this);
1783  return tmp;
1784  }
1785  //*******************************************************************************************
1786 
1787  //**Prefix decrement operator****************************************************************
1792  inline ColumnIterator& operator--() {
1793  --row_;
1794  return *this;
1795  }
1796  //*******************************************************************************************
1797 
1798  //**Postfix decrement operator***************************************************************
1803  inline const ColumnIterator operator--( int ) {
1804  const ColumnIterator tmp( *this );
1805  --(*this);
1806  return tmp;
1807  }
1808  //*******************************************************************************************
1809 
1810  //**Subscript operator***********************************************************************
1816  inline ReferenceType operator[]( size_t index ) const {
1817  return (*matrix_)(row_+index,column_);
1818  }
1819  //*******************************************************************************************
1820 
1821  //**Element access operator******************************************************************
1826  inline ReferenceType operator*() const {
1827  return (*matrix_)(row_,column_);
1828  }
1829  //*******************************************************************************************
1830 
1831  //**Element access operator******************************************************************
1836  inline PointerType operator->() const {
1837  return &(*matrix_)(row_,column_);
1838  }
1839  //*******************************************************************************************
1840 
1841  //**Equality operator************************************************************************
1847  template< typename MatrixType2 >
1848  inline bool operator==( const ColumnIterator<MatrixType2>& rhs ) const {
1849  return ( matrix_ == rhs.matrix_ ) && ( row_ == rhs.row_ ) && ( column_ == rhs.column_ );
1850  }
1851  //*******************************************************************************************
1852 
1853  //**Inequality operator**********************************************************************
1859  template< typename MatrixType2 >
1860  inline bool operator!=( const ColumnIterator<MatrixType2>& rhs ) const {
1861  return !( *this == rhs );
1862  }
1863  //*******************************************************************************************
1864 
1865  //**Less-than operator***********************************************************************
1871  template< typename MatrixType2 >
1872  inline bool operator<( const ColumnIterator<MatrixType2>& rhs ) const {
1873  return ( matrix_ == rhs.matrix_ ) && ( row_ < rhs.row_ ) && ( column_ == rhs.column_ );
1874  }
1875  //*******************************************************************************************
1876 
1877  //**Greater-than operator********************************************************************
1883  template< typename MatrixType2 >
1884  inline bool operator>( const ColumnIterator<MatrixType2>& rhs ) const {
1885  return ( matrix_ == rhs.matrix_ ) && ( row_ > rhs.row_ ) && ( column_ == rhs.column_ );
1886  }
1887  //*******************************************************************************************
1888 
1889  //**Less-or-equal-than operator**************************************************************
1895  template< typename MatrixType2 >
1896  inline bool operator<=( const ColumnIterator<MatrixType2>& rhs ) const {
1897  return ( matrix_ == rhs.matrix_ ) && ( row_ <= rhs.row_ ) && ( column_ == rhs.column_ );
1898  }
1899  //*******************************************************************************************
1900 
1901  //**Greater-or-equal-than operator***********************************************************
1907  template< typename MatrixType2 >
1908  inline bool operator>=( const ColumnIterator<MatrixType2>& rhs ) const {
1909  return ( matrix_ == rhs.matrix_ ) && ( row_ >= rhs.row_ ) && ( column_ == rhs.column_ );
1910  }
1911  //*******************************************************************************************
1912 
1913  //**Subtraction operator*********************************************************************
1919  inline DifferenceType operator-( const ColumnIterator& rhs ) const {
1920  return row_ - rhs.row_;
1921  }
1922  //*******************************************************************************************
1923 
1924  //**Addition operator************************************************************************
1931  friend inline const ColumnIterator operator+( const ColumnIterator& it, size_t inc ) {
1932  return ColumnIterator( *it.matrix_, it.row_+inc, it.column_ );
1933  }
1934  //*******************************************************************************************
1935 
1936  //**Addition operator************************************************************************
1943  friend inline const ColumnIterator operator+( size_t inc, const ColumnIterator& it ) {
1944  return ColumnIterator( *it.matrix_, it.row_+inc, it.column_ );
1945  }
1946  //*******************************************************************************************
1947 
1948  //**Subtraction operator*********************************************************************
1955  friend inline const ColumnIterator operator-( const ColumnIterator& it, size_t dec ) {
1956  return ColumnIterator( *it.matrix_, it.row_-dec, it.column_ );
1957  }
1958  //*******************************************************************************************
1959 
1960  private:
1961  //**Member variables*************************************************************************
1962  MatrixType* matrix_;
1963  size_t row_;
1964  size_t column_;
1965  //*******************************************************************************************
1966 
1967  //**Friend declarations**********************************************************************
1969  template< typename MatrixType2 > friend class ColumnIterator;
1971  //*******************************************************************************************
1972  };
1973  //**********************************************************************************************
1974 
1975  //**Type definitions****************************************************************************
1977  typedef ColumnIterator<const MT> ConstIterator;
1978 
1980  typedef typename SelectType< useConst, ConstIterator, ColumnIterator<MT> >::Type Iterator;
1981  //**********************************************************************************************
1982 
1983  //**Compilation flags***************************************************************************
1985  enum { vectorizable = 0 };
1986 
1988  enum { smpAssignable = 0 };
1989  //**********************************************************************************************
1990 
1991  //**Constructors********************************************************************************
1994  explicit inline DenseColumn( MT& matrix, size_t index );
1995  // No explicitly declared copy constructor.
1997  //**********************************************************************************************
1998 
1999  //**Destructor**********************************************************************************
2000  // No explicitly declared destructor.
2001  //**********************************************************************************************
2002 
2003  //**Data access functions***********************************************************************
2006  inline Reference operator[]( size_t index );
2007  inline ConstReference operator[]( size_t index ) const;
2008  inline Iterator begin ();
2009  inline ConstIterator begin () const;
2010  inline ConstIterator cbegin() const;
2011  inline Iterator end ();
2012  inline ConstIterator end () const;
2013  inline ConstIterator cend () const;
2015  //**********************************************************************************************
2016 
2017  //**Assignment operators************************************************************************
2020  inline DenseColumn& operator= ( const ElementType& rhs );
2021  inline DenseColumn& operator= ( const DenseColumn& rhs );
2022  template< typename VT > inline DenseColumn& operator= ( const Vector<VT,false>& rhs );
2023  template< typename VT > inline DenseColumn& operator+=( const Vector<VT,false>& rhs );
2024  template< typename VT > inline DenseColumn& operator-=( const Vector<VT,false>& rhs );
2025  template< typename VT > inline DenseColumn& operator*=( const Vector<VT,false>& rhs );
2026 
2027  template< typename Other >
2028  inline typename EnableIf< IsNumeric<Other>, DenseColumn >::Type&
2029  operator*=( Other rhs );
2030 
2031  template< typename Other >
2032  inline typename EnableIf< IsNumeric<Other>, DenseColumn >::Type&
2033  operator/=( Other rhs );
2035  //**********************************************************************************************
2036 
2037  //**Utility functions***************************************************************************
2040  inline size_t size() const;
2041  inline size_t capacity() const;
2042  inline size_t nonZeros() const;
2043  inline void reset();
2044  template< typename Other > inline DenseColumn& scale( const Other& scalar );
2046  //**********************************************************************************************
2047 
2048  public:
2049  //**Expression template evaluation functions****************************************************
2052  template< typename Other > inline bool canAlias ( const Other* alias ) const;
2053  template< typename Other > inline bool isAliased ( const Other* alias ) const;
2054  template< typename VT > inline void assign ( const DenseVector <VT,false>& rhs );
2055  template< typename VT > inline void assign ( const SparseVector<VT,false>& rhs );
2056  template< typename VT > inline void addAssign ( const DenseVector <VT,false>& rhs );
2057  template< typename VT > inline void addAssign ( const SparseVector<VT,false>& rhs );
2058  template< typename VT > inline void subAssign ( const DenseVector <VT,false>& rhs );
2059  template< typename VT > inline void subAssign ( const SparseVector<VT,false>& rhs );
2060  template< typename VT > inline void multAssign( const DenseVector <VT,false>& rhs );
2061  template< typename VT > inline void multAssign( const SparseVector<VT,false>& rhs );
2063  //**********************************************************************************************
2064 
2065  private:
2066  //**Member variables****************************************************************************
2070  const size_t col_;
2071 
2072  //**********************************************************************************************
2073 
2074  //**Compile time checks*************************************************************************
2081  //**********************************************************************************************
2082 };
2084 //*************************************************************************************************
2085 
2086 
2087 
2088 
2089 //=================================================================================================
2090 //
2091 // CONSTRUCTOR
2092 //
2093 //=================================================================================================
2094 
2095 //*************************************************************************************************
2103 template< typename MT > // Type of the dense matrix
2104 inline DenseColumn<MT,false>::DenseColumn( MT& matrix, size_t index )
2105  : matrix_( matrix ) // The dense matrix containing the column
2106  , col_ ( index ) // The index of the column in the matrix
2107 {
2108  if( matrix_.columns() <= index )
2109  throw std::invalid_argument( "Invalid column access index" );
2110 }
2112 //*************************************************************************************************
2113 
2114 
2115 
2116 
2117 //=================================================================================================
2118 //
2119 // DATA ACCESS FUNCTIONS
2120 //
2121 //=================================================================================================
2122 
2123 //*************************************************************************************************
2130 template< typename MT > // Type of the dense matrix
2131 inline typename DenseColumn<MT,false>::Reference DenseColumn<MT,false>::operator[]( size_t index )
2132 {
2133  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
2134  return matrix_(index,col_);
2135 }
2137 //*************************************************************************************************
2138 
2139 
2140 //*************************************************************************************************
2147 template< typename MT > // Type of the dense matrix
2148 inline typename DenseColumn<MT,false>::ConstReference DenseColumn<MT,false>::operator[]( size_t index ) const
2149 {
2150  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
2151  return matrix_(index,col_);
2152 }
2154 //*************************************************************************************************
2155 
2156 
2157 //*************************************************************************************************
2165 template< typename MT > // Type of the dense matrix
2166 inline typename DenseColumn<MT,false>::Iterator DenseColumn<MT,false>::begin()
2167 {
2168  return Iterator( matrix_, 0UL, col_ );
2169 }
2171 //*************************************************************************************************
2172 
2173 
2174 //*************************************************************************************************
2182 template< typename MT > // Type of the dense matrix
2183 inline typename DenseColumn<MT,false>::ConstIterator DenseColumn<MT,false>::begin() const
2184 {
2185  return ConstIterator( matrix_, 0UL, col_ );
2186 }
2188 //*************************************************************************************************
2189 
2190 
2191 //*************************************************************************************************
2199 template< typename MT > // Type of the dense matrix
2200 inline typename DenseColumn<MT,false>::ConstIterator DenseColumn<MT,false>::cbegin() const
2201 {
2202  return ConstIterator( matrix_, 0UL, col_ );
2203 }
2205 //*************************************************************************************************
2206 
2207 
2208 //*************************************************************************************************
2216 template< typename MT > // Type of the dense matrix
2217 inline typename DenseColumn<MT,false>::Iterator DenseColumn<MT,false>::end()
2218 {
2219  return Iterator( matrix_, size(), col_ );
2220 }
2222 //*************************************************************************************************
2223 
2224 
2225 //*************************************************************************************************
2233 template< typename MT > // Type of the dense matrix
2234 inline typename DenseColumn<MT,false>::ConstIterator DenseColumn<MT,false>::end() const
2235 {
2236  return ConstIterator( matrix_, size(), col_ );
2237 }
2239 //*************************************************************************************************
2240 
2241 
2242 //*************************************************************************************************
2250 template< typename MT > // Type of the dense matrix
2251 inline typename DenseColumn<MT,false>::ConstIterator DenseColumn<MT,false>::cend() const
2252 {
2253  return ConstIterator( matrix_, size(), col_ );
2254 }
2256 //*************************************************************************************************
2257 
2258 
2259 
2260 
2261 //=================================================================================================
2262 //
2263 // ASSIGNMENT OPERATORS
2264 //
2265 //=================================================================================================
2266 
2267 //*************************************************************************************************
2274 template< typename MT > // Type of the dense matrix
2275 inline DenseColumn<MT,false>& DenseColumn<MT,false>::operator=( const ElementType& rhs )
2276 {
2277  const size_t rows( size() );
2278 
2279  for( size_t i=0UL; i<rows; ++i )
2280  matrix_(i,col_) = rhs;
2281 
2282  return *this;
2283 }
2285 //*************************************************************************************************
2286 
2287 
2288 //*************************************************************************************************
2299 template< typename MT > // Type of the dense matrix
2300 inline DenseColumn<MT,false>& DenseColumn<MT,false>::operator=( const DenseColumn& rhs )
2301 {
2302  if( &rhs == this ) return *this;
2303 
2304  if( size() != rhs.size() )
2305  throw std::invalid_argument( "Column sizes do not match" );
2306 
2307  const size_t rows( size() );
2308 
2309  for( size_t i=0UL; i<rows; ++i )
2310  matrix_(i,col_) = rhs[i];
2311 
2312  return *this;
2313 }
2315 //*************************************************************************************************
2316 
2317 
2318 //*************************************************************************************************
2329 template< typename MT > // Type of the dense matrix
2330 template< typename VT > // Type of the right-hand side vector
2331 inline DenseColumn<MT,false>& DenseColumn<MT,false>::operator=( const Vector<VT,false>& rhs )
2332 {
2333  using blaze::assign;
2334 
2338 
2339  if( size() != (~rhs).size() )
2340  throw std::invalid_argument( "Vector sizes do not match" );
2341 
2342  if( (~rhs).canAlias( &matrix_ ) ) {
2343  const ResultType tmp( ~rhs );
2344  assign( *this, tmp );
2345  }
2346  else {
2347  if( IsSparseVector<VT>::value )
2348  reset();
2349  assign( *this, ~rhs );
2350  }
2351 
2352  return *this;
2353 }
2355 //*************************************************************************************************
2356 
2357 
2358 //*************************************************************************************************
2369 template< typename MT > // Type of the dense matrix
2370 template< typename VT > // Type of the right-hand side vector
2371 inline DenseColumn<MT,false>& DenseColumn<MT,false>::operator+=( const Vector<VT,false>& rhs )
2372 {
2373  using blaze::addAssign;
2374 
2377 
2378  if( size() != (~rhs).size() )
2379  throw std::invalid_argument( "Vector sizes do not match" );
2380 
2381  if( (~rhs).canAlias( &matrix_ ) ) {
2382  const typename VT::ResultType tmp( ~rhs );
2383  addAssign( *this, tmp );
2384  }
2385  else {
2386  addAssign( *this, ~rhs );
2387  }
2388 
2389  return *this;
2390 }
2392 //*************************************************************************************************
2393 
2394 
2395 //*************************************************************************************************
2406 template< typename MT > // Type of the dense matrix
2407 template< typename VT > // Type of the right-hand side vector
2408 inline DenseColumn<MT,false>& DenseColumn<MT,false>::operator-=( const Vector<VT,false>& rhs )
2409 {
2410  using blaze::subAssign;
2411 
2414 
2415  if( size() != (~rhs).size() )
2416  throw std::invalid_argument( "Vector sizes do not match" );
2417 
2418  if( (~rhs).canAlias( &matrix_ ) ) {
2419  const typename VT::ResultType tmp( ~rhs );
2420  subAssign( *this, tmp );
2421  }
2422  else {
2423  subAssign( *this, ~rhs );
2424  }
2425 
2426  return *this;
2427 }
2429 //*************************************************************************************************
2430 
2431 
2432 //*************************************************************************************************
2444 template< typename MT > // Type of the dense matrix
2445 template< typename VT > // Type of the right-hand side vector
2446 inline DenseColumn<MT,false>& DenseColumn<MT,false>::operator*=( const Vector<VT,false>& rhs )
2447 {
2448  using blaze::multAssign;
2449 
2452 
2453  if( size() != (~rhs).size() )
2454  throw std::invalid_argument( "Vector sizes do not match" );
2455 
2456  if( (~rhs).canAlias( &matrix_ ) || IsSparseVector<VT>::value ) {
2457  const typename VT::ResultType tmp( ~rhs );
2458  multAssign( *this, tmp );
2459  }
2460  else {
2461  multAssign( *this, ~rhs );
2462  }
2463 
2464  return *this;
2465 }
2467 //*************************************************************************************************
2468 
2469 
2470 //*************************************************************************************************
2478 template< typename MT > // Type of the dense matrix
2479 template< typename Other > // Data type of the right-hand side scalar
2480 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false> >::Type&
2481  DenseColumn<MT,false>::operator*=( Other rhs )
2482 {
2483  for( size_t i=0UL; i<size(); ++i )
2484  matrix_(i,col_) *= rhs;
2485  return *this;
2486 }
2488 //*************************************************************************************************
2489 
2490 
2491 //*************************************************************************************************
2501 template< typename MT > // Type of the dense matrix
2502 template< typename Other > // Data type of the right-hand side scalar
2503 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false> >::Type&
2504  DenseColumn<MT,false>::operator/=( Other rhs )
2505 {
2506  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
2507 
2508  typedef typename DivTrait<ElementType,Other>::Type DT;
2509  typedef typename If< IsNumeric<DT>, DT, Other >::Type Tmp;
2510 
2511  // Depending on the two involved data types, an integer division is applied or a
2512  // floating point division is selected.
2513  if( IsNumeric<DT>::value && IsFloatingPoint<DT>::value ) {
2514  const Tmp tmp( Tmp(1)/static_cast<Tmp>( rhs ) );
2515  for( size_t i=0UL; i<size(); ++i )
2516  matrix_(i,col_) *= tmp;
2517  }
2518  else {
2519  for( size_t i=0UL; i<size(); ++i )
2520  matrix_(i,col_) /= rhs;
2521  }
2522 
2523  return *this;
2524 }
2526 //*************************************************************************************************
2527 
2528 
2529 
2530 
2531 //=================================================================================================
2532 //
2533 // UTILITY FUNCTIONS
2534 //
2535 //=================================================================================================
2536 
2537 //*************************************************************************************************
2543 template< typename MT > // Type of the dense matrix
2544 inline size_t DenseColumn<MT,false>::size() const
2545 {
2546  return matrix_.rows();
2547 }
2549 //*************************************************************************************************
2550 
2551 
2552 //*************************************************************************************************
2558 template< typename MT > // Type of the dense matrix
2559 inline size_t DenseColumn<MT,false>::capacity() const
2560 {
2561  return matrix_.rows();
2562 }
2564 //*************************************************************************************************
2565 
2566 
2567 //*************************************************************************************************
2576 template< typename MT > // Type of the dense matrix
2577 inline size_t DenseColumn<MT,false>::nonZeros() const
2578 {
2579  const size_t rows( size() );
2580  size_t nonzeros( 0UL );
2581 
2582  for( size_t i=0UL; i<rows; ++i )
2583  if( !isDefault( matrix_(i,col_) ) )
2584  ++nonzeros;
2585 
2586  return nonzeros;
2587 }
2589 //*************************************************************************************************
2590 
2591 
2592 //*************************************************************************************************
2598 template< typename MT > // Type of the dense matrix
2599 inline void DenseColumn<MT,false>::reset()
2600 {
2601  using blaze::reset;
2602  const size_t rows( size() );
2603  for( size_t i=0UL; i<rows; ++i )
2604  reset( matrix_(i,col_) );
2605 }
2607 //*************************************************************************************************
2608 
2609 
2610 //*************************************************************************************************
2617 template< typename MT > // Type of the dense matrix
2618 template< typename Other > // Data type of the scalar value
2619 inline DenseColumn<MT,false>& DenseColumn<MT,false>::scale( const Other& scalar )
2620 {
2621  for( size_t i=0UL; i<size(); ++i ) {
2622  matrix_(i,col_) *= scalar;
2623  }
2624  return *this;
2625 }
2627 //*************************************************************************************************
2628 
2629 
2630 
2631 
2632 //=================================================================================================
2633 //
2634 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2635 //
2636 //=================================================================================================
2637 
2638 //*************************************************************************************************
2649 template< typename MT > // Type of the dense matrix
2650 template< typename Other > // Data type of the foreign expression
2651 inline bool DenseColumn<MT,false>::canAlias( const Other* alias ) const
2652 {
2653  return static_cast<const void*>( &matrix_ ) == static_cast<const void*>( alias );
2654 }
2656 //*************************************************************************************************
2657 
2658 
2659 //*************************************************************************************************
2670 template< typename MT > // Type of the dense matrix
2671 template< typename Other > // Data type of the foreign expression
2672 inline bool DenseColumn<MT,false>::isAliased( const Other* alias ) const
2673 {
2674  return static_cast<const void*>( &matrix_ ) == static_cast<const void*>( alias );
2675 }
2677 //*************************************************************************************************
2678 
2679 
2680 //*************************************************************************************************
2692 template< typename MT > // Type of the dense matrix
2693 template< typename VT > // Type of the right-hand side dense vector
2694 inline void DenseColumn<MT,false>::assign( const DenseVector<VT,false>& rhs )
2695 {
2696  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2697 
2698  const size_t iend( (~rhs).size() & size_t(-2) );
2699  for( size_t i=0UL; i<iend; i+=2UL ) {
2700  matrix_(i ,col_) = (~rhs)[i ];
2701  matrix_(i+1UL,col_) = (~rhs)[i+1UL];
2702  }
2703  if( iend < (~rhs).size() )
2704  matrix_(iend,col_) = (~rhs)[iend];
2705 }
2707 //*************************************************************************************************
2708 
2709 
2710 //*************************************************************************************************
2722 template< typename MT > // Type of the dense matrix
2723 template< typename VT > // Type of the right-hand side sparse vector
2724 inline void DenseColumn<MT,false>::assign( const SparseVector<VT,false>& rhs )
2725 {
2726  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2727 
2728  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2729  matrix_(element->index(),col_) = element->value();
2730 }
2732 //*************************************************************************************************
2733 
2734 
2735 //*************************************************************************************************
2747 template< typename MT > // Type of the dense matrix
2748 template< typename VT > // Type of the right-hand side dense vector
2749 inline void DenseColumn<MT,false>::addAssign( const DenseVector<VT,false>& rhs )
2750 {
2751  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2752 
2753  const size_t iend( (~rhs).size() & size_t(-2) );
2754  for( size_t i=0UL; i<iend; i+=2UL ) {
2755  matrix_(i ,col_) += (~rhs)[i ];
2756  matrix_(i+1UL,col_) += (~rhs)[i+1UL];
2757  }
2758  if( iend < (~rhs).size() )
2759  matrix_(iend,col_) += (~rhs)[iend];
2760 }
2762 //*************************************************************************************************
2763 
2764 
2765 //*************************************************************************************************
2777 template< typename MT > // Type of the dense matrix
2778 template< typename VT > // Type of the right-hand side sparse vector
2779 inline void DenseColumn<MT,false>::addAssign( const SparseVector<VT,false>& rhs )
2780 {
2781  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2782 
2783  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2784  matrix_(element->index(),col_) += element->value();
2785 }
2787 //*************************************************************************************************
2788 
2789 
2790 //*************************************************************************************************
2802 template< typename MT > // Type of the dense matrix
2803 template< typename VT > // Type of the right-hand side dense vector
2804 inline void DenseColumn<MT,false>::subAssign( const DenseVector<VT,false>& rhs )
2805 {
2806  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2807 
2808  const size_t iend( (~rhs).size() & size_t(-2) );
2809  for( size_t i=0UL; i<iend; i+=2UL ) {
2810  matrix_(i ,col_) -= (~rhs)[i ];
2811  matrix_(i+1UL,col_) -= (~rhs)[i+1UL];
2812  }
2813  if( iend < (~rhs).size() )
2814  matrix_(iend,col_) -= (~rhs)[iend];
2815 }
2817 //*************************************************************************************************
2818 
2819 
2820 //*************************************************************************************************
2832 template< typename MT > // Type of the dense matrix
2833 template< typename VT > // Type of the right-hand side sparse vector
2834 inline void DenseColumn<MT,false>::subAssign( const SparseVector<VT,false>& rhs )
2835 {
2836  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2837 
2838  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2839  matrix_(element->index(),col_) -= element->value();
2840 }
2842 //*************************************************************************************************
2843 
2844 
2845 //*************************************************************************************************
2857 template< typename MT > // Type of the dense matrix
2858 template< typename VT > // Type of the right-hand side dense vector
2859 inline void DenseColumn<MT,false>::multAssign( const DenseVector<VT,false>& rhs )
2860 {
2861  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2862 
2863  const size_t iend( (~rhs).size() & size_t(-2) );
2864  for( size_t i=0UL; i<iend; i+=2UL ) {
2865  matrix_(i ,col_) *= (~rhs)[i ];
2866  matrix_(i+1UL,col_) *= (~rhs)[i+1UL];
2867  }
2868  if( iend < (~rhs).size() )
2869  matrix_(iend,col_) *= (~rhs)[iend];
2870 }
2872 //*************************************************************************************************
2873 
2874 
2875 //*************************************************************************************************
2887 template< typename MT > // Type of the dense matrix
2888 template< typename VT > // Type of the right-hand side sparse vector
2889 inline void DenseColumn<MT,false>::multAssign( const SparseVector<VT,false>& rhs )
2890 {
2891  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2892 
2893  const ResultType tmp( *this );
2894 
2895  reset();
2896 
2897  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2898  matrix_(element->index(),col_) = tmp[element->index()] * element->value();
2899 }
2901 //*************************************************************************************************
2902 
2903 
2904 
2905 
2906 
2907 
2908 
2909 
2910 //=================================================================================================
2911 //
2912 // DENSECOLUMN OPERATORS
2913 //
2914 //=================================================================================================
2915 
2916 //*************************************************************************************************
2919 template< typename MT, bool SO >
2920 inline void reset( DenseColumn<MT,SO>& column );
2921 
2922 template< typename MT, bool SO >
2923 inline void clear( DenseColumn<MT,SO>& column );
2924 
2925 template< typename MT, bool SO >
2926 inline bool isDefault( const DenseColumn<MT,SO>& column );
2928 //*************************************************************************************************
2929 
2930 
2931 //*************************************************************************************************
2938 template< typename MT // Type of the dense matrix
2939  , bool SO > // Storage order
2940 inline void reset( DenseColumn<MT,SO>& column )
2941 {
2942  column.reset();
2943 }
2944 //*************************************************************************************************
2945 
2946 
2947 //*************************************************************************************************
2956 template< typename MT // Type of the dense matrix
2957  , bool SO > // Storage order
2958 inline void clear( DenseColumn<MT,SO>& column )
2959 {
2960  column.reset();
2961 }
2962 //*************************************************************************************************
2963 
2964 
2965 //*************************************************************************************************
2983 template< typename MT // Type of the dense matrix
2984  , bool SO > // Storage order
2985 inline bool isDefault( const DenseColumn<MT,SO>& column )
2986 {
2987  for( size_t i=0UL; i<column.size(); ++i )
2988  if( !isDefault( column[i] ) ) return false;
2989  return true;
2990 }
2991 //*************************************************************************************************
2992 
2993 
2994 
2995 
2996 //=================================================================================================
2997 //
2998 // GLOBAL OPERATORS
2999 //
3000 //=================================================================================================
3001 
3002 //*************************************************************************************************
3023 template< typename MT // Type of the dense matrix
3024  , bool SO > // Storage order
3025 inline typename DisableIf< Or< IsComputation<MT>, IsTransExpr<MT> >, DenseColumn<MT> >::Type
3026  column( DenseMatrix<MT,SO>& dm, size_t index )
3027 {
3029 
3030  return DenseColumn<MT>( ~dm, index );
3031 }
3032 //*************************************************************************************************
3033 
3034 
3035 //*************************************************************************************************
3056 template< typename MT // Type of the dense matrix
3057  , bool SO > // Storage order
3058 inline typename DisableIf< Or< IsComputation<MT>, IsTransExpr<MT> >, DenseColumn<const MT> >::Type
3059  column( const DenseMatrix<MT,SO>& dm, size_t index )
3060 {
3062 
3063  return DenseColumn<const MT>( ~dm, index );
3064 }
3065 //*************************************************************************************************
3066 
3067 
3068 
3069 
3070 //=================================================================================================
3071 //
3072 // SUBVECTORTRAIT SPECIALIZATIONS
3073 //
3074 //=================================================================================================
3075 
3076 //*************************************************************************************************
3078 template< typename MT, bool SO >
3079 struct SubvectorTrait< DenseColumn<MT,SO> >
3080 {
3081  typedef typename SubvectorTrait< typename DenseColumn<MT,SO>::ResultType >::Type Type;
3082 };
3084 //*************************************************************************************************
3085 
3086 } // namespace blaze
3087 
3088 #endif
Constraint on the data type.
Constraint on the data type.
SelectType< useConst, ConstReference, typename MT::Reference >::Type Reference
Reference to a non-constant column value.
Definition: DenseColumn.h:344
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, DenseColumn< MT > >::Type column(DenseMatrix< MT, SO > &dm, size_t index)
Creating a view on a specific column of the given dense matrix.
Definition: DenseColumn.h:3026
const ElementType * ConstPointer
Pointer to a constant row value.
Definition: DenseColumn.h:347
void reset(DynamicMatrix< Type, SO > &m)
Resetting the given dense matrix.
Definition: DynamicMatrix.h:4512
#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
EnableIf< IsIntegral< T >, Load< T, sizeof(T)> >::Type::Type load(const T *address)
Loads a vector of integral values.
Definition: Load.h:222
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:3703
Header file for the View base class.
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:114
size_t size() const
Returns the current size/dimension of the column.
Definition: DenseColumn.h:1004
#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
bool isDefault(const DynamicMatrix< Type, SO > &m)
Returns whether the given dense matrix is in default state.
Definition: DynamicMatrix.h:4555
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:196
#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
Header file for the IsSame and IsStrictlySame type traits.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DenseColumn.h:334
MT::ElementType ElementType
Type of the column elements.
Definition: DenseColumn.h:335
const size_t col_
The index of the column in the matrix.
Definition: DenseColumn.h:2070
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.
void stream(size_t index, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the dense column.
Definition: DenseColumn.h:1224
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
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DenseColumn.h:337
const size_t row_
The first row of the submatrix.
Definition: DenseSubmatrix.h:2793
#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
MT::ConstIterator ConstIterator
Iterator over constant elements.
Definition: DenseColumn.h:353
void clear(DynamicMatrix< Type, SO > &m)
Clearing the given dense matrix.
Definition: DynamicMatrix.h:4528
size_t nonZeros() const
Returns the number of non-zero elements in the column.
Definition: DenseColumn.h:1035
SelectType< IsExpression< MT >::value, MT, MT & >::Type Operand
Composite data type of the dense matrix expression.
Definition: DenseColumn.h:313
DenseColumn & operator=(const ElementType &rhs)
Homogenous assignment to all column elements.
Definition: DenseColumn.h:761
Constraint on the data type.
Iterator end()
Returns an iterator just past the last element of the column.
Definition: DenseColumn.h:706
void store(size_t index, const IntrinsicType &value)
Aligned store of an intrinsic element of the dense column.
Definition: DenseColumn.h:1180
SelectType< useConst, ConstPointer, ElementType * >::Type Pointer
Pointer to a constant row value.
Definition: DenseColumn.h:350
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.
ConstIterator cbegin() const
Returns an iterator to the first element of the column.
Definition: DenseColumn.h:690
Reference operator[](size_t index)
Subscript operator for the direct access to the column elements.
Definition: DenseColumn.h:593
Header file for nested template disabiguation.
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
DenseColumn(MT &matrix, size_t index)
The constructor for DenseColumn.
Definition: DenseColumn.h:567
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2379
IT::Type IntrinsicType
Intrinsic type of the column elements.
Definition: DenseColumn.h:336
bool canAlias(const Other *alias) const
Returns whether the dense column can alias with the given address alias.
Definition: DenseColumn.h:1096
const size_t col_
The index of the column in the matrix.
Definition: DenseColumn.h:534
Header file for the Or class template.
IntrinsicType load(size_t index) const
Aligned load of an intrinsic element of the dense column.
Definition: DenseColumn.h:1137
MT::ConstReference ConstReference
Reference to a constant column value.
Definition: DenseColumn.h:341
Reference to a specific column of a dense matrix.The DenseColumn template represents a reference to a...
Definition: DenseColumn.h:307
IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the dense column.
Definition: DenseColumn.h:1158
Header file for the subvector trait.
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:179
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 storeu(size_t index, const IntrinsicType &value)
Unaligned store of an intrinsic element of the dense column.
Definition: DenseColumn.h:1202
Constraint on the data type.
Constraint on the data type.
Operand matrix_
The dense matrix containing the column.
Definition: DenseColumn.h:2069
size_t capacity() const
Returns the maximum capacity of the dense column.
Definition: DenseColumn.h:1018
#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
Constraints on the storage order of matrix types.
Constraint on the data type.
ColumnTrait< MT >::Type ResultType
Result type for expression template evaluations.
Definition: DenseColumn.h:333
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2373
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:269
Constraint on the data type.
const size_t column_
The first column of the submatrix.
Definition: DenseSubmatrix.h:2794
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2377
System settings for streaming (non-temporal stores)
SelectType< useConst, ConstIterator, typename MT::Iterator >::Type Iterator
Iterator over non-constant elements.
Definition: DenseColumn.h:356
Header file for the EnableIf class template.
Operand matrix_
The dense matrix containing the column.
Definition: DenseColumn.h:533
ColumnIterator< const MT > ConstIterator
Iterator over constant elements.
Definition: DenseColumn.h:1972
Header file for the IsNumeric type trait.
Header file for the IsSparseVector type trait.
#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:2374
Header file for the IsConst type trait.
IntrinsicTrait< typename MT::ElementType > IT
Intrinsic trait for the column element type.
Definition: DenseColumn.h:316
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:648
Header file for run time assertion macros.
Header file for the division trait.
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:209
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 reset shim.
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, DenseRow< MT > >::Type row(DenseMatrix< MT, SO > &dm, size_t index)
Creating a view on a specific row of the given dense matrix.
Definition: DenseRow.h:3025
Header file for the cache size of the target architecture.
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:239
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2378
DenseColumn< MT, SO > This
Type of this DenseColumn instance.
Definition: DenseColumn.h:332
Header file for the column trait.
void reset()
Reset to the default initial values.
Definition: DenseColumn.h:1049
Pointer data()
Low-level data access to the column elements.
Definition: DenseColumn.h:626
#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.
#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
ConstIterator cend() const
Returns an iterator just past the last element of the column.
Definition: DenseColumn.h:738
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:147
Base class for all views.The View class serves as a tag for all views (subvectors, submatrices, rows, columns, ...). All classes that represent a view and that are used within the expression template environment of the Blaze library have to derive from this class in order to qualify as a view. Only in case a class is derived from the View base class, the IsView type trait recognizes the class as valid view.
Definition: View.h:64
CompressedMatrix< Type,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:247
Iterator begin()
Returns an iterator to the first element of the column.
Definition: DenseColumn.h:658
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:105
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
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:2370
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.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2376
SelectType< useConst, ConstIterator, ColumnIterator< MT > >::Type Iterator
Iterator over non-constant elements.
Definition: DenseColumn.h:1980
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
bool isAliased(const Other *alias) const
Returns whether the dense column is aliased with the given address alias.
Definition: DenseColumn.h:1116
size_t rows(const Matrix< MT, SO > &m)
Returns the current number of rows of the matrix.
Definition: Matrix.h:138
#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
Operand matrix_
The dense matrix containing the submatrix.
Definition: DenseSubmatrix.h:2792
Header file for the IsExpression type trait class.
const DenseColumn & CompositeType
Data type for composite expression templates.
Definition: DenseColumn.h:338
Header file for the FunctionTrace class.