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>
56 #include <blaze/math/shims/Reset.h>
66 #include <blaze/system/CacheSize.h>
67 #include <blaze/system/Streaming.h>
69 #include <blaze/util/Assert.h>
71 #include <blaze/util/DisableIf.h>
72 #include <blaze/util/EnableIf.h>
74 #include <blaze/util/mpl/Or.h>
75 #include <blaze/util/Template.h>
76 #include <blaze/util/Types.h>
82 
83 
84 namespace blaze {
85 
86 //=================================================================================================
87 //
88 // CLASS DEFINITION
89 //
90 //=================================================================================================
91 
92 //*************************************************************************************************
309 template< typename MT // Type of the dense matrix
310  , bool SO = IsColumnMajorMatrix<MT>::value > // Storage order
311 class DenseColumn : public DenseVector< DenseColumn<MT,SO>, false >
312  , private Column
313 {
314  private:
315  //**Type definitions****************************************************************************
317  typedef typename SelectType< IsExpression<MT>::value, MT, MT& >::Type Operand;
318 
321  //**********************************************************************************************
322 
323  //**********************************************************************************************
325 
331  enum { useConst = IsConst<MT>::value };
332  //**********************************************************************************************
333 
334  public:
335  //**Type definitions****************************************************************************
339  typedef typename MT::ElementType ElementType;
340  typedef typename IT::Type IntrinsicType;
341  typedef typename MT::ReturnType ReturnType;
342  typedef const DenseColumn& CompositeType;
343 
346 
349 
351  typedef const ElementType* ConstPointer;
352 
355 
358 
361  //**********************************************************************************************
362 
363  //**Compilation flags***************************************************************************
365  enum { vectorizable = MT::vectorizable };
366 
368  enum { smpAssignable = MT::smpAssignable };
369  //**********************************************************************************************
370 
371  //**Constructors********************************************************************************
374  explicit inline DenseColumn( MT& matrix, size_t index );
375  // No explicitly declared copy constructor.
377  //**********************************************************************************************
378 
379  //**Destructor**********************************************************************************
380  // No explicitly declared destructor.
381  //**********************************************************************************************
382 
383  //**Data access functions***********************************************************************
386  inline Reference operator[]( size_t index );
387  inline ConstReference operator[]( size_t index ) const;
388  inline Pointer data ();
389  inline ConstPointer data () const;
390  inline Iterator begin ();
391  inline ConstIterator begin () const;
392  inline ConstIterator cbegin() const;
393  inline Iterator end ();
394  inline ConstIterator end () const;
395  inline ConstIterator cend () const;
397  //**********************************************************************************************
398 
399  //**Assignment operators************************************************************************
402  inline DenseColumn& operator= ( const ElementType& rhs );
403  inline DenseColumn& operator= ( const DenseColumn& rhs );
404  template< typename VT > inline DenseColumn& operator= ( const Vector<VT,false>& rhs );
405  template< typename VT > inline DenseColumn& operator+=( const Vector<VT,false>& rhs );
406  template< typename VT > inline DenseColumn& operator-=( const Vector<VT,false>& rhs );
407  template< typename VT > inline DenseColumn& operator*=( const Vector<VT,false>& rhs );
408 
409  template< typename Other >
410  inline typename EnableIf< IsNumeric<Other>, DenseColumn >::Type&
411  operator*=( Other rhs );
412 
413  template< typename Other >
414  inline typename EnableIf< IsNumeric<Other>, DenseColumn >::Type&
415  operator/=( Other rhs );
417  //**********************************************************************************************
418 
419  //**Utility functions***************************************************************************
422  inline size_t size() const;
423  inline size_t capacity() const;
424  inline size_t nonZeros() const;
425  inline void reset();
426  template< typename Other > inline DenseColumn& scale( const Other& scalar );
428  //**********************************************************************************************
429 
430  private:
431  //**********************************************************************************************
433  template< typename VT >
435  struct VectorizedAssign {
436  enum { value = vectorizable && VT::vectorizable &&
437  IsSame<ElementType,typename VT::ElementType>::value };
438  };
440  //**********************************************************************************************
441 
442  //**********************************************************************************************
444  template< typename VT >
446  struct VectorizedAddAssign {
447  enum { value = vectorizable && VT::vectorizable &&
448  IsSame<ElementType,typename VT::ElementType>::value &&
449  IntrinsicTrait<ElementType>::addition };
450  };
452  //**********************************************************************************************
453 
454  //**********************************************************************************************
456  template< typename VT >
458  struct VectorizedSubAssign {
459  enum { value = vectorizable && VT::vectorizable &&
460  IsSame<ElementType,typename VT::ElementType>::value &&
461  IntrinsicTrait<ElementType>::subtraction };
462  };
464  //**********************************************************************************************
465 
466  //**********************************************************************************************
468  template< typename VT >
470  struct VectorizedMultAssign {
471  enum { value = vectorizable && VT::vectorizable &&
472  IsSame<ElementType,typename VT::ElementType>::value &&
473  IntrinsicTrait<ElementType>::multiplication };
474  };
476  //**********************************************************************************************
477 
478  public:
479  //**Expression template evaluation functions****************************************************
482  template< typename Other > inline bool canAlias ( const Other* alias ) const;
483  template< typename Other > inline bool isAliased( const Other* alias ) const;
484 
485  inline bool isAligned () const;
486  inline bool canSMPAssign() const;
487 
488  inline IntrinsicType load ( size_t index ) const;
489  inline IntrinsicType loadu ( size_t index ) const;
490  inline void store ( size_t index, const IntrinsicType& value );
491  inline void storeu( size_t index, const IntrinsicType& value );
492  inline void stream( size_t index, const IntrinsicType& value );
493 
494  template< typename VT >
495  inline typename DisableIf< VectorizedAssign<VT> >::Type
496  assign( const DenseVector<VT,false>& rhs );
497 
498  template< typename VT >
499  inline typename EnableIf< VectorizedAssign<VT> >::Type
500  assign( const DenseVector<VT,false>& rhs );
501 
502  template< typename VT > inline void assign( const SparseVector<VT,false>& rhs );
503 
504  template< typename VT >
505  inline typename DisableIf< VectorizedAddAssign<VT> >::Type
506  addAssign( const DenseVector<VT,false>& rhs );
507 
508  template< typename VT >
509  inline typename EnableIf< VectorizedAddAssign<VT> >::Type
510  addAssign( const DenseVector<VT,false>& rhs );
511 
512  template< typename VT > inline void addAssign( const SparseVector<VT,false>& rhs );
513 
514  template< typename VT >
515  inline typename DisableIf< VectorizedSubAssign<VT> >::Type
516  subAssign( const DenseVector<VT,false>& rhs );
517 
518  template< typename VT >
519  inline typename EnableIf< VectorizedSubAssign<VT> >::Type
520  subAssign( const DenseVector<VT,false>& rhs );
521 
522  template< typename VT > inline void subAssign( const SparseVector<VT,false>& rhs );
523 
524  template< typename VT >
525  inline typename DisableIf< VectorizedMultAssign<VT> >::Type
526  multAssign( const DenseVector<VT,false>& rhs );
527 
528  template< typename VT >
529  inline typename EnableIf< VectorizedMultAssign<VT> >::Type
530  multAssign( const DenseVector<VT,false>& rhs );
531 
532  template< typename VT > inline void multAssign( const SparseVector<VT,false>& rhs );
534  //**********************************************************************************************
535 
536  private:
537  //**Member variables****************************************************************************
541  const size_t col_;
542 
543  //**********************************************************************************************
544 
545  //**Compile time checks*************************************************************************
552  //**********************************************************************************************
553 };
554 //*************************************************************************************************
555 
556 
557 
558 
559 //=================================================================================================
560 //
561 // CONSTRUCTOR
562 //
563 //=================================================================================================
564 
565 //*************************************************************************************************
572 template< typename MT // Type of the dense matrix
573  , bool SO > // Storage order
574 inline DenseColumn<MT,SO>::DenseColumn( MT& matrix, size_t index )
575  : matrix_( matrix ) // The dense matrix containing the column
576  , col_ ( index ) // The index of the column in the matrix
577 {
578  if( matrix_.columns() <= index )
579  throw std::invalid_argument( "Invalid column access index" );
580 }
581 //*************************************************************************************************
582 
583 
584 
585 
586 //=================================================================================================
587 //
588 // DATA ACCESS FUNCTIONS
589 //
590 //=================================================================================================
591 
592 //*************************************************************************************************
598 template< typename MT // Type of the dense matrix
599  , bool SO > // Storage order
601 {
602  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
603  return matrix_(index,col_);
604 }
605 //*************************************************************************************************
606 
607 
608 //*************************************************************************************************
614 template< typename MT // Type of the dense matrix
615  , bool SO > // Storage order
617 {
618  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
619  return matrix_(index,col_);
620 }
621 //*************************************************************************************************
622 
623 
624 //*************************************************************************************************
631 template< typename MT // Type of the dense matrix
632  , bool SO > // Storage order
634 {
635  return matrix_.data( col_ );
636 }
637 //*************************************************************************************************
638 
639 
640 //*************************************************************************************************
647 template< typename MT // Type of the dense matrix
648  , bool SO > // Storage order
650 {
651  return matrix_.data( col_ );
652 }
653 //*************************************************************************************************
654 
655 
656 //*************************************************************************************************
663 template< typename MT // Type of the dense matrix
664  , bool SO > // Storage order
666 {
667  return matrix_.begin( col_ );
668 }
669 //*************************************************************************************************
670 
671 
672 //*************************************************************************************************
679 template< typename MT // Type of the dense matrix
680  , bool SO > // Storage order
682 {
683  return matrix_.cbegin( col_ );
684 }
685 //*************************************************************************************************
686 
687 
688 //*************************************************************************************************
695 template< typename MT // Type of the dense matrix
696  , bool SO > // Storage order
698 {
699  return matrix_.cbegin( col_ );
700 }
701 //*************************************************************************************************
702 
703 
704 //*************************************************************************************************
711 template< typename MT // Type of the dense matrix
712  , bool SO > // Storage order
714 {
715  return matrix_.end( col_ );
716 }
717 //*************************************************************************************************
718 
719 
720 //*************************************************************************************************
727 template< typename MT // Type of the dense matrix
728  , bool SO > // Storage order
730 {
731  return matrix_.cend( col_ );
732 }
733 //*************************************************************************************************
734 
735 
736 //*************************************************************************************************
743 template< typename MT // Type of the dense matrix
744  , bool SO > // Storage order
746 {
747  return matrix_.cend( col_ );
748 }
749 //*************************************************************************************************
750 
751 
752 
753 
754 //=================================================================================================
755 //
756 // ASSIGNMENT OPERATORS
757 //
758 //=================================================================================================
759 
760 //*************************************************************************************************
766 template< typename MT // Type of the dense matrix
767  , bool SO > // Storage order
769 {
770  const size_t rows( size() );
771 
772  for( size_t i=0UL; i<rows; ++i )
773  matrix_(i,col_) = rhs;
774 
775  return *this;
776 }
777 //*************************************************************************************************
778 
779 
780 //*************************************************************************************************
790 template< typename MT // Type of the dense matrix
791  , bool SO > // Storage order
793 {
794  if( &rhs == this ) return *this;
795 
796  if( size() != rhs.size() )
797  throw std::invalid_argument( "Column sizes do not match" );
798 
799  const size_t rows( size() );
800 
801  for( size_t i=0UL; i<rows; ++i )
802  matrix_(i,col_) = rhs[i];
803 
804  return *this;
805 }
806 //*************************************************************************************************
807 
808 
809 //*************************************************************************************************
819 template< typename MT // Type of the dense matrix
820  , bool SO > // Storage order
821 template< typename VT > // Type of the right-hand side vector
823 {
826 
827  if( size() != (~rhs).size() )
828  throw std::invalid_argument( "Vector sizes do not match" );
829 
830  if( (~rhs).canAlias( &matrix_ ) ) {
831  const typename VT::ResultType tmp( ~rhs );
832  smpAssign( *this, tmp );
833  }
834  else {
836  reset();
837  smpAssign( *this, ~rhs );
838  }
839 
840  return *this;
841 }
842 //*************************************************************************************************
843 
844 
845 //*************************************************************************************************
855 template< typename MT // Type of the dense matrix
856  , bool SO > // Storage order
857 template< typename VT > // Type of the right-hand side vector
859 {
862 
863  if( size() != (~rhs).size() )
864  throw std::invalid_argument( "Vector sizes do not match" );
865 
866  if( (~rhs).canAlias( &matrix_ ) ) {
867  const typename VT::ResultType tmp( ~rhs );
868  smpAddAssign( *this, tmp );
869  }
870  else {
871  smpAddAssign( *this, ~rhs );
872  }
873 
874  return *this;
875 }
876 //*************************************************************************************************
877 
878 
879 //*************************************************************************************************
889 template< typename MT // Type of the dense matrix
890  , bool SO > // Storage order
891 template< typename VT > // Type of the right-hand side vector
893 {
896 
897  if( size() != (~rhs).size() )
898  throw std::invalid_argument( "Vector sizes do not match" );
899 
900  if( (~rhs).canAlias( &matrix_ ) ) {
901  const typename VT::ResultType tmp( ~rhs );
902  smpSubAssign( *this, tmp );
903  }
904  else {
905  smpSubAssign( *this, ~rhs );
906  }
907 
908  return *this;
909 }
910 //*************************************************************************************************
911 
912 
913 //*************************************************************************************************
924 template< typename MT // Type of the dense matrix
925  , bool SO > // Storage order
926 template< typename VT > // Type of the right-hand side vector
928 {
931 
932  if( size() != (~rhs).size() )
933  throw std::invalid_argument( "Vector sizes do not match" );
934 
935  if( (~rhs).canAlias( &matrix_ ) || IsSparseVector<VT>::value ) {
936  const typename VT::ResultType tmp( ~rhs );
937  smpMultAssign( *this, tmp );
938  }
939  else {
940  smpMultAssign( *this, ~rhs );
941  }
942 
943  return *this;
944 }
945 //*************************************************************************************************
946 
947 
948 //*************************************************************************************************
955 template< typename MT // Type of the dense matrix
956  , bool SO > // Storage order
957 template< typename Other > // Data type of the right-hand side scalar
958 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,SO> >::Type&
960 {
961  return operator=( (*this) * rhs );
962 }
963 //*************************************************************************************************
964 
965 
966 //*************************************************************************************************
975 template< typename MT // Type of the dense matrix
976  , bool SO > // Storage order
977 template< typename Other > // Data type of the right-hand side scalar
978 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,SO> >::Type&
980 {
981  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
982 
983  return operator=( (*this) / rhs );
984 }
985 //*************************************************************************************************
986 
987 
988 
989 
990 //=================================================================================================
991 //
992 // UTILITY FUNCTIONS
993 //
994 //=================================================================================================
995 
996 //*************************************************************************************************
1001 template< typename MT // Type of the dense matrix
1002  , bool SO > // Storage order
1003 inline size_t DenseColumn<MT,SO>::size() const
1004 {
1005  return matrix_.rows();
1006 }
1007 //*************************************************************************************************
1008 
1009 
1010 //*************************************************************************************************
1015 template< typename MT // Type of the dense matrix
1016  , bool SO > // Storage order
1017 inline size_t DenseColumn<MT,SO>::capacity() const
1018 {
1019  return matrix_.capacity( col_ );
1020 }
1021 //*************************************************************************************************
1022 
1023 
1024 //*************************************************************************************************
1032 template< typename MT // Type of the dense matrix
1033  , bool SO > // Storage order
1034 inline size_t DenseColumn<MT,SO>::nonZeros() const
1035 {
1036  return matrix_.nonZeros( col_ );
1037 }
1038 //*************************************************************************************************
1039 
1040 
1041 //*************************************************************************************************
1046 template< typename MT // Type of the dense matrix
1047  , bool SO > // Storage order
1049 {
1050  matrix_.reset( col_ );
1051 }
1052 //*************************************************************************************************
1053 
1054 
1055 //*************************************************************************************************
1061 template< typename MT // Type of the dense matrix
1062  , bool SO > // Storage order
1063 template< typename Other > // Data type of the scalar value
1064 inline DenseColumn<MT,SO>& DenseColumn<MT,SO>::scale( const Other& scalar )
1065 {
1066  for( size_t j=0UL; j<size(); ++j ) {
1067  matrix_(j,col_) *= scalar;
1068  }
1069  return *this;
1070 }
1071 //*************************************************************************************************
1072 
1073 
1074 
1075 
1076 //=================================================================================================
1077 //
1078 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
1079 //
1080 //=================================================================================================
1081 
1082 //*************************************************************************************************
1092 template< typename MT // Type of the dense matrix
1093  , bool SO > // Storage order
1094 template< typename Other > // Data type of the foreign expression
1095 inline bool DenseColumn<MT,SO>::canAlias( const Other* alias ) const
1096 {
1097  return static_cast<const void*>( &matrix_ ) == static_cast<const void*>( alias );
1098 }
1099 //*************************************************************************************************
1100 
1101 
1102 //*************************************************************************************************
1112 template< typename MT // Type of the dense matrix
1113  , bool SO > // Storage order
1114 template< typename Other > // Data type of the foreign expression
1115 inline bool DenseColumn<MT,SO>::isAliased( const Other* alias ) const
1116 {
1117  return static_cast<const void*>( &matrix_ ) == static_cast<const void*>( alias );
1118 }
1119 //*************************************************************************************************
1120 
1121 
1122 //*************************************************************************************************
1131 template< typename MT // Type of the dense matrix
1132  , bool SO > // Storage order
1134 {
1135  return matrix_.isAligned();
1136 }
1137 //*************************************************************************************************
1138 
1139 
1140 //*************************************************************************************************
1150 template< typename MT // Type of the dense matrix
1151  , bool SO > // Storage order
1153 {
1154  return ( size() > OPENMP_DVECASSIGN_THRESHOLD );
1155 }
1156 //*************************************************************************************************
1157 
1158 
1159 //*************************************************************************************************
1171 template< typename MT // Type of the dense matrix
1172  , bool SO > // Storage order
1174 {
1175  return matrix_.load( index, col_ );
1176 }
1177 //*************************************************************************************************
1178 
1179 
1180 //*************************************************************************************************
1192 template< typename MT // Type of the dense matrix
1193  , bool SO > // Storage order
1195 {
1196  return matrix_.loadu( index, col_ );
1197 }
1198 //*************************************************************************************************
1199 
1200 
1201 //*************************************************************************************************
1214 template< typename MT // Type of the dense matrix
1215  , bool SO > // Storage order
1216 inline void DenseColumn<MT,SO>::store( size_t index, const IntrinsicType& value )
1217 {
1218  matrix_.store( index, col_, value );
1219 }
1220 //*************************************************************************************************
1221 
1222 
1223 //*************************************************************************************************
1236 template< typename MT // Type of the dense matrix
1237  , bool SO > // Storage order
1238 inline void DenseColumn<MT,SO>::storeu( size_t index, const IntrinsicType& value )
1239 {
1240  matrix_.storeu( index, col_, value );
1241 }
1242 //*************************************************************************************************
1243 
1244 
1245 //*************************************************************************************************
1258 template< typename MT // Type of the dense matrix
1259  , bool SO > // Storage order
1260 inline void DenseColumn<MT,SO>::stream( size_t index, const IntrinsicType& value )
1261 {
1262  matrix_.stream( index, col_, value );
1263 }
1264 //*************************************************************************************************
1265 
1266 
1267 //*************************************************************************************************
1278 template< typename MT // Type of the dense matrix
1279  , bool SO > // Storage order
1280 template< typename VT > // Type of the right-hand side dense vector
1281 inline typename DisableIf< typename DenseColumn<MT,SO>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type
1283 {
1284  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1285 
1286  const size_t iend( (~rhs).size() & size_t(-2) );
1287  for( size_t i=0UL; i<iend; i+=2UL ) {
1288  matrix_(i ,col_) = (~rhs)[i ];
1289  matrix_(i+1UL,col_) = (~rhs)[i+1UL];
1290  }
1291  if( iend < (~rhs).size() )
1292  matrix_(iend,col_) = (~rhs)[iend];
1293 }
1294 //*************************************************************************************************
1295 
1296 
1297 //*************************************************************************************************
1308 template< typename MT // Type of the dense matrix
1309  , bool SO > // Storage order
1310 template< typename VT > // Type of the right-hand side dense vector
1311 inline typename EnableIf< typename DenseColumn<MT,SO>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type
1313 {
1314  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1315 
1317 
1318  const size_t rows( size() );
1319 
1320  if( useStreaming && rows > ( cacheSize/( sizeof(ElementType) * 3UL ) ) && !(~rhs).isAliased( this ) )
1321  {
1322  for( size_t i=0UL; i<rows; i+=IT::size ) {
1323  matrix_.stream( i, col_, (~rhs).load(i) );
1324  }
1325  }
1326  else
1327  {
1328  const size_t iend( rows & size_t(-IT::size*4) );
1329  BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (IT::size*4UL) ) ) == iend, "Invalid end calculation" );
1330 
1331  typename VT::ConstIterator it( (~rhs).begin() );
1332  for( size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1333  matrix_.store( i , col_, it.load() ); it+=IT::size;
1334  matrix_.store( i+IT::size , col_, it.load() ); it+=IT::size;
1335  matrix_.store( i+IT::size*2UL, col_, it.load() ); it+=IT::size;
1336  matrix_.store( i+IT::size*3UL, col_, it.load() ); it+=IT::size;
1337  }
1338  for( size_t i=iend; i<rows; i+=IT::size, it+=IT::size ) {
1339  matrix_.store( i, col_, it.load() );
1340  }
1341  }
1342 }
1343 //*************************************************************************************************
1344 
1345 
1346 //*************************************************************************************************
1357 template< typename MT // Type of the dense matrix
1358  , bool SO > // Storage order
1359 template< typename VT > // Type of the right-hand side sparse vector
1361 {
1362  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1363 
1364  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1365  matrix_(element->index(),col_) = element->value();
1366 }
1367 //*************************************************************************************************
1368 
1369 
1370 //*************************************************************************************************
1381 template< typename MT // Type of the dense matrix
1382  , bool SO > // Storage order
1383 template< typename VT > // Type of the right-hand side dense vector
1384 inline typename DisableIf< typename DenseColumn<MT,SO>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type
1386 {
1387  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1388 
1389  const size_t iend( (~rhs).size() & size_t(-2) );
1390  for( size_t i=0UL; i<iend; i+=2UL ) {
1391  matrix_(i ,col_) += (~rhs)[i ];
1392  matrix_(i+1UL,col_) += (~rhs)[i+1UL];
1393  }
1394  if( iend < (~rhs).size() )
1395  matrix_(iend,col_) += (~rhs)[iend];
1396 }
1397 //*************************************************************************************************
1398 
1399 
1400 //*************************************************************************************************
1411 template< typename MT // Type of the dense matrix
1412  , bool SO > // Storage order
1413 template< typename VT > // Type of the right-hand side dense vector
1414 inline typename EnableIf< typename DenseColumn<MT,SO>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type
1416 {
1417  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1418 
1420 
1421  const size_t rows( size() );
1422 
1423  const size_t iend( rows & size_t(-IT::size*4) );
1424  BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (IT::size*4UL) ) ) == iend, "Invalid end calculation" );
1425 
1426  typename VT::ConstIterator it( (~rhs).begin() );
1427  for( size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1428  matrix_.store( i , col_, matrix_.load(i ,col_) + it.load() ); it += IT::size;
1429  matrix_.store( i+IT::size , col_, matrix_.load(i+IT::size ,col_) + it.load() ); it += IT::size;
1430  matrix_.store( i+IT::size*2UL, col_, matrix_.load(i+IT::size*2UL,col_) + it.load() ); it += IT::size;
1431  matrix_.store( i+IT::size*3UL, col_, matrix_.load(i+IT::size*3UL,col_) + it.load() ); it += IT::size;
1432  }
1433  for( size_t i=iend; i<rows; i+=IT::size, it+=IT::size ) {
1434  matrix_.store( i, col_, matrix_.load(i,col_) + it.load() );
1435  }
1436 }
1437 //*************************************************************************************************
1438 
1439 
1440 //*************************************************************************************************
1451 template< typename MT // Type of the dense matrix
1452  , bool SO > // Storage order
1453 template< typename VT > // Type of the right-hand side sparse vector
1455 {
1456  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1457 
1458  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1459  matrix_(element->index(),col_) += element->value();
1460 }
1461 //*************************************************************************************************
1462 
1463 
1464 //*************************************************************************************************
1475 template< typename MT // Type of the dense matrix
1476  , bool SO > // Storage order
1477 template< typename VT > // Type of the right-hand side dense vector
1478 inline typename DisableIf< typename DenseColumn<MT,SO>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type
1480 {
1481  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1482 
1483  const size_t iend( (~rhs).size() & size_t(-2) );
1484  for( size_t i=0UL; i<iend; i+=2UL ) {
1485  matrix_(i ,col_) -= (~rhs)[i ];
1486  matrix_(i+1UL,col_) -= (~rhs)[i+1UL];
1487  }
1488  if( iend < (~rhs).size() )
1489  matrix_(iend,col_) -= (~rhs)[iend];
1490 }
1491 //*************************************************************************************************
1492 
1493 
1494 //*************************************************************************************************
1505 template< typename MT // Type of the dense matrix
1506  , bool SO > // Storage order
1507 template< typename VT > // Type of the right-hand side dense vector
1508 inline typename EnableIf< typename DenseColumn<MT,SO>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type
1510 {
1511  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1512 
1514 
1515  const size_t rows( size() );
1516 
1517  const size_t iend( rows & size_t(-IT::size*4) );
1518  BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (IT::size*4UL) ) ) == iend, "Invalid end calculation" );
1519 
1520  typename VT::ConstIterator it( (~rhs).begin() );
1521  for( size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1522  matrix_.store( i , col_, matrix_.load(i ,col_) - it.load() ); it += IT::size;
1523  matrix_.store( i+IT::size , col_, matrix_.load(i+IT::size ,col_) - it.load() ); it += IT::size;
1524  matrix_.store( i+IT::size*2UL, col_, matrix_.load(i+IT::size*2UL,col_) - it.load() ); it += IT::size;
1525  matrix_.store( i+IT::size*3UL, col_, matrix_.load(i+IT::size*3UL,col_) - it.load() ); it += IT::size;
1526  }
1527  for( size_t i=iend; i<rows; i+=IT::size, it+=IT::size ) {
1528  matrix_.store( i, col_, matrix_.load(i,col_) - it.load() );
1529  }
1530 }
1531 //*************************************************************************************************
1532 
1533 
1534 //*************************************************************************************************
1545 template< typename MT // Type of the dense matrix
1546  , bool SO > // Storage order
1547 template< typename VT > // Type of the right-hand side sparse vector
1549 {
1550  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1551 
1552  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1553  matrix_(element->index(),col_) -= element->value();
1554 }
1555 //*************************************************************************************************
1556 
1557 
1558 //*************************************************************************************************
1569 template< typename MT // Type of the dense matrix
1570  , bool SO > // Storage order
1571 template< typename VT > // Type of the right-hand side dense vector
1572 inline typename DisableIf< typename DenseColumn<MT,SO>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type
1574 {
1575  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1576 
1577  const size_t iend( (~rhs).size() & size_t(-2) );
1578  for( size_t i=0UL; i<iend; i+=2UL ) {
1579  matrix_(i ,col_) *= (~rhs)[i ];
1580  matrix_(i+1UL,col_) *= (~rhs)[i+1UL];
1581  }
1582  if( iend < (~rhs).size() )
1583  matrix_(iend,col_) *= (~rhs)[iend];
1584 }
1585 //*************************************************************************************************
1586 
1587 
1588 //*************************************************************************************************
1599 template< typename MT // Type of the dense matrix
1600  , bool SO > // Storage order
1601 template< typename VT > // Type of the right-hand side dense vector
1602 inline typename EnableIf< typename DenseColumn<MT,SO>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type
1604 {
1605  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1606 
1608 
1609  const size_t rows( size() );
1610 
1611  const size_t iend( rows & size_t(-IT::size*4) );
1612  BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (IT::size*4UL) ) ) == iend, "Invalid end calculation" );
1613 
1614  typename VT::ConstIterator it( (~rhs).begin() );
1615  for( size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1616  matrix_.store( i , col_, matrix_.load(i ,col_) * it.load() ); it += IT::size;
1617  matrix_.store( i+IT::size , col_, matrix_.load(i+IT::size ,col_) * it.load() ); it += IT::size;
1618  matrix_.store( i+IT::size*2UL, col_, matrix_.load(i+IT::size*2UL,col_) * it.load() ); it += IT::size;
1619  matrix_.store( i+IT::size*3UL, col_, matrix_.load(i+IT::size*3UL,col_) * it.load() ); it += IT::size;
1620  }
1621  for( size_t i=iend; i<rows; i+=IT::size, it+=IT::size ) {
1622  matrix_.store( i, col_, matrix_.load(i,col_) * it.load() );
1623  }
1624 }
1625 //*************************************************************************************************
1626 
1627 
1628 //*************************************************************************************************
1639 template< typename MT // Type of the dense matrix
1640  , bool SO > // Storage order
1641 template< typename VT > // Type of the right-hand side sparse vector
1643 {
1644  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1645 
1646  const ResultType tmp( *this );
1647 
1648  reset();
1649 
1650  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1651  matrix_(element->index(),col_) = tmp[element->index()] * element->value();
1652 }
1653 //*************************************************************************************************
1654 
1655 
1656 
1657 
1658 
1659 
1660 
1661 
1662 //=================================================================================================
1663 //
1664 // CLASS TEMPLATE SPECIALIZATION FOR ROW-MAJOR MATRICES
1665 //
1666 //=================================================================================================
1667 
1668 //*************************************************************************************************
1676 template< typename MT > // Type of the dense matrix
1677 class DenseColumn<MT,false> : public DenseVector< DenseColumn<MT,false>, false >
1678  , private Column
1679 {
1680  private:
1681  //**Type definitions****************************************************************************
1683  typedef typename SelectType< IsExpression<MT>::value, MT, MT& >::Type Operand;
1684  //**********************************************************************************************
1685 
1686  //**********************************************************************************************
1688 
1694  enum { useConst = IsConst<MT>::value };
1695  //**********************************************************************************************
1696 
1697  public:
1698  //**Type definitions****************************************************************************
1699  typedef DenseColumn<MT,false> This;
1700  typedef typename ColumnTrait<MT>::Type ResultType;
1701  typedef typename ResultType::TransposeType TransposeType;
1702  typedef typename MT::ElementType ElementType;
1703  typedef typename MT::ReturnType ReturnType;
1704  typedef const ResultType CompositeType;
1705 
1707  typedef typename MT::ConstReference ConstReference;
1708 
1710  typedef typename SelectType< useConst, ConstReference, typename MT::Reference >::Type Reference;
1711  //**********************************************************************************************
1712 
1713  //**ColumnIterator class definition*************************************************************
1716  template< typename MatrixType > // Type of the dense matrix
1717  class ColumnIterator
1718  {
1719  private:
1720  //*******************************************************************************************
1722 
1727  enum { returnConst = IsConst<MatrixType>::value };
1728  //*******************************************************************************************
1729 
1730  public:
1731  //**Type definitions*************************************************************************
1733  typedef typename SelectType< returnConst, typename MT::ConstReference, typename MT::Reference >::Type Reference;
1734 
1735  typedef std::random_access_iterator_tag IteratorCategory;
1736  typedef RemoveReference<Reference> ValueType;
1737  typedef ValueType* PointerType;
1738  typedef Reference ReferenceType;
1739  typedef ptrdiff_t DifferenceType;
1740 
1741  // STL iterator requirements
1742  typedef IteratorCategory iterator_category;
1743  typedef ValueType value_type;
1744  typedef PointerType pointer;
1745  typedef ReferenceType reference;
1746  typedef DifferenceType difference_type;
1747  //*******************************************************************************************
1748 
1749  //**Constructor******************************************************************************
1756  inline ColumnIterator( MatrixType& matrix, size_t row, size_t column )
1757  : matrix_( &matrix ) // The dense matrix containing the column.
1758  , row_ ( row ) // The current row index.
1759  , column_( column ) // The current column index.
1760  {}
1761  //*******************************************************************************************
1762 
1763  //**Constructor******************************************************************************
1768  template< typename MatrixType2 >
1769  inline ColumnIterator( const ColumnIterator<MatrixType2>& it )
1770  : matrix_( it.matrix_ ) // The dense matrix containing the column.
1771  , row_ ( it.row_ ) // The current row index.
1772  , column_( it.column_ ) // The current column index.
1773  {}
1774  //*******************************************************************************************
1775 
1776  //**Addition assignment operator*************************************************************
1782  inline ColumnIterator& operator+=( size_t inc ) {
1783  row_ += inc;
1784  return *this;
1785  }
1786  //*******************************************************************************************
1787 
1788  //**Subtraction assignment operator**********************************************************
1794  inline ColumnIterator& operator-=( size_t dec ) {
1795  row_ -= dec;
1796  return *this;
1797  }
1798  //*******************************************************************************************
1799 
1800  //**Prefix increment operator****************************************************************
1805  inline ColumnIterator& operator++() {
1806  ++row_;
1807  return *this;
1808  }
1809  //*******************************************************************************************
1810 
1811  //**Postfix increment operator***************************************************************
1816  inline const ColumnIterator operator++( int ) {
1817  const ColumnIterator tmp( *this );
1818  ++(*this);
1819  return tmp;
1820  }
1821  //*******************************************************************************************
1822 
1823  //**Prefix decrement operator****************************************************************
1828  inline ColumnIterator& operator--() {
1829  --row_;
1830  return *this;
1831  }
1832  //*******************************************************************************************
1833 
1834  //**Postfix decrement operator***************************************************************
1839  inline const ColumnIterator operator--( int ) {
1840  const ColumnIterator tmp( *this );
1841  --(*this);
1842  return tmp;
1843  }
1844  //*******************************************************************************************
1845 
1846  //**Subscript operator***********************************************************************
1852  inline ReferenceType operator[]( size_t index ) const {
1853  return (*matrix_)(row_+index,column_);
1854  }
1855  //*******************************************************************************************
1856 
1857  //**Element access operator******************************************************************
1862  inline ReferenceType operator*() const {
1863  return (*matrix_)(row_,column_);
1864  }
1865  //*******************************************************************************************
1866 
1867  //**Element access operator******************************************************************
1872  inline PointerType operator->() const {
1873  return &(*matrix_)(row_,column_);
1874  }
1875  //*******************************************************************************************
1876 
1877  //**Equality 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  //**Inequality operator**********************************************************************
1895  template< typename MatrixType2 >
1896  inline bool operator!=( const ColumnIterator<MatrixType2>& rhs ) const {
1897  return !( *this == rhs );
1898  }
1899  //*******************************************************************************************
1900 
1901  //**Less-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  //**Greater-than operator********************************************************************
1919  template< typename MatrixType2 >
1920  inline bool operator>( const ColumnIterator<MatrixType2>& rhs ) const {
1921  return ( matrix_ == rhs.matrix_ ) && ( row_ > rhs.row_ ) && ( column_ == rhs.column_ );
1922  }
1923  //*******************************************************************************************
1924 
1925  //**Less-or-equal-than operator**************************************************************
1931  template< typename MatrixType2 >
1932  inline bool operator<=( const ColumnIterator<MatrixType2>& rhs ) const {
1933  return ( matrix_ == rhs.matrix_ ) && ( row_ <= rhs.row_ ) && ( column_ == rhs.column_ );
1934  }
1935  //*******************************************************************************************
1936 
1937  //**Greater-or-equal-than operator***********************************************************
1943  template< typename MatrixType2 >
1944  inline bool operator>=( const ColumnIterator<MatrixType2>& rhs ) const {
1945  return ( matrix_ == rhs.matrix_ ) && ( row_ >= rhs.row_ ) && ( column_ == rhs.column_ );
1946  }
1947  //*******************************************************************************************
1948 
1949  //**Subtraction operator*********************************************************************
1955  inline DifferenceType operator-( const ColumnIterator& rhs ) const {
1956  return row_ - rhs.row_;
1957  }
1958  //*******************************************************************************************
1959 
1960  //**Addition operator************************************************************************
1967  friend inline const ColumnIterator operator+( const ColumnIterator& it, size_t inc ) {
1968  return ColumnIterator( *it.matrix_, it.row_+inc, it.column_ );
1969  }
1970  //*******************************************************************************************
1971 
1972  //**Addition operator************************************************************************
1979  friend inline const ColumnIterator operator+( size_t inc, const ColumnIterator& it ) {
1980  return ColumnIterator( *it.matrix_, it.row_+inc, it.column_ );
1981  }
1982  //*******************************************************************************************
1983 
1984  //**Subtraction operator*********************************************************************
1991  friend inline const ColumnIterator operator-( const ColumnIterator& it, size_t dec ) {
1992  return ColumnIterator( *it.matrix_, it.row_-dec, it.column_ );
1993  }
1994  //*******************************************************************************************
1995 
1996  private:
1997  //**Member variables*************************************************************************
1998  MatrixType* matrix_;
1999  size_t row_;
2000  size_t column_;
2001  //*******************************************************************************************
2002 
2003  //**Friend declarations**********************************************************************
2004  template< typename MatrixType2 > friend class ColumnIterator;
2005  //*******************************************************************************************
2006  };
2007  //**********************************************************************************************
2008 
2009  //**Type definitions****************************************************************************
2011  typedef ColumnIterator<const MT> ConstIterator;
2012 
2014  typedef typename SelectType< useConst, ConstIterator, ColumnIterator<MT> >::Type Iterator;
2015  //**********************************************************************************************
2016 
2017  //**Compilation flags***************************************************************************
2019  enum { vectorizable = 0 };
2020 
2022  enum { smpAssignable = MT::smpAssignable };
2023  //**********************************************************************************************
2024 
2025  //**Constructors********************************************************************************
2028  explicit inline DenseColumn( MT& matrix, size_t index );
2029  // No explicitly declared copy constructor.
2031  //**********************************************************************************************
2032 
2033  //**Destructor**********************************************************************************
2034  // No explicitly declared destructor.
2035  //**********************************************************************************************
2036 
2037  //**Data access functions***********************************************************************
2040  inline Reference operator[]( size_t index );
2041  inline ConstReference operator[]( size_t index ) const;
2042  inline Iterator begin ();
2043  inline ConstIterator begin () const;
2044  inline ConstIterator cbegin() const;
2045  inline Iterator end ();
2046  inline ConstIterator end () const;
2047  inline ConstIterator cend () const;
2049  //**********************************************************************************************
2050 
2051  //**Assignment operators************************************************************************
2054  inline DenseColumn& operator= ( const ElementType& rhs );
2055  inline DenseColumn& operator= ( const DenseColumn& rhs );
2056  template< typename VT > inline DenseColumn& operator= ( const Vector<VT,false>& rhs );
2057  template< typename VT > inline DenseColumn& operator+=( const Vector<VT,false>& rhs );
2058  template< typename VT > inline DenseColumn& operator-=( const Vector<VT,false>& rhs );
2059  template< typename VT > inline DenseColumn& operator*=( const Vector<VT,false>& rhs );
2060 
2061  template< typename Other >
2062  inline typename EnableIf< IsNumeric<Other>, DenseColumn >::Type&
2063  operator*=( Other rhs );
2064 
2065  template< typename Other >
2066  inline typename EnableIf< IsNumeric<Other>, DenseColumn >::Type&
2067  operator/=( Other rhs );
2069  //**********************************************************************************************
2070 
2071  //**Utility functions***************************************************************************
2074  inline size_t size() const;
2075  inline size_t capacity() const;
2076  inline size_t nonZeros() const;
2077  inline void reset();
2078  template< typename Other > inline DenseColumn& scale( const Other& scalar );
2080  //**********************************************************************************************
2081 
2082  public:
2083  //**Expression template evaluation functions****************************************************
2086  template< typename Other > inline bool canAlias ( const Other* alias ) const;
2087  template< typename Other > inline bool isAliased( const Other* alias ) const;
2088 
2089  inline bool isAligned () const;
2090  inline bool canSMPAssign() const;
2091 
2092  template< typename VT > inline void assign ( const DenseVector <VT,false>& rhs );
2093  template< typename VT > inline void assign ( const SparseVector<VT,false>& rhs );
2094  template< typename VT > inline void addAssign ( const DenseVector <VT,false>& rhs );
2095  template< typename VT > inline void addAssign ( const SparseVector<VT,false>& rhs );
2096  template< typename VT > inline void subAssign ( const DenseVector <VT,false>& rhs );
2097  template< typename VT > inline void subAssign ( const SparseVector<VT,false>& rhs );
2098  template< typename VT > inline void multAssign( const DenseVector <VT,false>& rhs );
2099  template< typename VT > inline void multAssign( const SparseVector<VT,false>& rhs );
2101  //**********************************************************************************************
2102 
2103  private:
2104  //**Member variables****************************************************************************
2107  Operand matrix_;
2108  const size_t col_;
2109 
2110  //**********************************************************************************************
2111 
2112  //**Compile time checks*************************************************************************
2117  //**********************************************************************************************
2118 };
2120 //*************************************************************************************************
2121 
2122 
2123 
2124 
2125 //=================================================================================================
2126 //
2127 // CONSTRUCTOR
2128 //
2129 //=================================================================================================
2130 
2131 //*************************************************************************************************
2139 template< typename MT > // Type of the dense matrix
2140 inline DenseColumn<MT,false>::DenseColumn( MT& matrix, size_t index )
2141  : matrix_( matrix ) // The dense matrix containing the column
2142  , col_ ( index ) // The index of the column in the matrix
2143 {
2144  if( matrix_.columns() <= index )
2145  throw std::invalid_argument( "Invalid column access index" );
2146 }
2148 //*************************************************************************************************
2149 
2150 
2151 
2152 
2153 //=================================================================================================
2154 //
2155 // DATA ACCESS FUNCTIONS
2156 //
2157 //=================================================================================================
2158 
2159 //*************************************************************************************************
2166 template< typename MT > // Type of the dense matrix
2168 {
2169  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
2170  return matrix_(index,col_);
2171 }
2173 //*************************************************************************************************
2174 
2175 
2176 //*************************************************************************************************
2183 template< typename MT > // Type of the dense matrix
2185 {
2186  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
2187  return matrix_(index,col_);
2188 }
2190 //*************************************************************************************************
2191 
2192 
2193 //*************************************************************************************************
2201 template< typename MT > // Type of the dense matrix
2203 {
2204  return Iterator( matrix_, 0UL, col_ );
2205 }
2207 //*************************************************************************************************
2208 
2209 
2210 //*************************************************************************************************
2218 template< typename MT > // Type of the dense matrix
2220 {
2221  return ConstIterator( matrix_, 0UL, col_ );
2222 }
2224 //*************************************************************************************************
2225 
2226 
2227 //*************************************************************************************************
2235 template< typename MT > // Type of the dense matrix
2237 {
2238  return ConstIterator( matrix_, 0UL, col_ );
2239 }
2241 //*************************************************************************************************
2242 
2243 
2244 //*************************************************************************************************
2252 template< typename MT > // Type of the dense matrix
2254 {
2255  return Iterator( matrix_, size(), col_ );
2256 }
2258 //*************************************************************************************************
2259 
2260 
2261 //*************************************************************************************************
2269 template< typename MT > // Type of the dense matrix
2271 {
2272  return ConstIterator( matrix_, size(), col_ );
2273 }
2275 //*************************************************************************************************
2276 
2277 
2278 //*************************************************************************************************
2286 template< typename MT > // Type of the dense matrix
2288 {
2289  return ConstIterator( matrix_, size(), col_ );
2290 }
2292 //*************************************************************************************************
2293 
2294 
2295 
2296 
2297 //=================================================================================================
2298 //
2299 // ASSIGNMENT OPERATORS
2300 //
2301 //=================================================================================================
2302 
2303 //*************************************************************************************************
2310 template< typename MT > // Type of the dense matrix
2311 inline DenseColumn<MT,false>& DenseColumn<MT,false>::operator=( const ElementType& rhs )
2312 {
2313  const size_t rows( size() );
2314 
2315  for( size_t i=0UL; i<rows; ++i )
2316  matrix_(i,col_) = rhs;
2317 
2318  return *this;
2319 }
2321 //*************************************************************************************************
2322 
2323 
2324 //*************************************************************************************************
2335 template< typename MT > // Type of the dense matrix
2336 inline DenseColumn<MT,false>& DenseColumn<MT,false>::operator=( const DenseColumn& rhs )
2337 {
2338  if( &rhs == this ) return *this;
2339 
2340  if( size() != rhs.size() )
2341  throw std::invalid_argument( "Column sizes do not match" );
2342 
2343  const size_t rows( size() );
2344 
2345  for( size_t i=0UL; i<rows; ++i )
2346  matrix_(i,col_) = rhs[i];
2347 
2348  return *this;
2349 }
2351 //*************************************************************************************************
2352 
2353 
2354 //*************************************************************************************************
2365 template< typename MT > // Type of the dense matrix
2366 template< typename VT > // Type of the right-hand side vector
2367 inline DenseColumn<MT,false>& DenseColumn<MT,false>::operator=( const Vector<VT,false>& rhs )
2368 {
2372 
2373  if( size() != (~rhs).size() )
2374  throw std::invalid_argument( "Vector sizes do not match" );
2375 
2376  if( (~rhs).canAlias( &matrix_ ) ) {
2377  const ResultType tmp( ~rhs );
2378  smpAssign( *this, tmp );
2379  }
2380  else {
2381  if( IsSparseVector<VT>::value )
2382  reset();
2383  smpAssign( *this, ~rhs );
2384  }
2385 
2386  return *this;
2387 }
2389 //*************************************************************************************************
2390 
2391 
2392 //*************************************************************************************************
2403 template< typename MT > // Type of the dense matrix
2404 template< typename VT > // Type of the right-hand side vector
2405 inline DenseColumn<MT,false>& DenseColumn<MT,false>::operator+=( const Vector<VT,false>& rhs )
2406 {
2409 
2410  if( size() != (~rhs).size() )
2411  throw std::invalid_argument( "Vector sizes do not match" );
2412 
2413  if( (~rhs).canAlias( &matrix_ ) ) {
2414  const typename VT::ResultType tmp( ~rhs );
2415  smpAddAssign( *this, tmp );
2416  }
2417  else {
2418  smpAddAssign( *this, ~rhs );
2419  }
2420 
2421  return *this;
2422 }
2424 //*************************************************************************************************
2425 
2426 
2427 //*************************************************************************************************
2438 template< typename MT > // Type of the dense matrix
2439 template< typename VT > // Type of the right-hand side vector
2440 inline DenseColumn<MT,false>& DenseColumn<MT,false>::operator-=( const Vector<VT,false>& rhs )
2441 {
2444 
2445  if( size() != (~rhs).size() )
2446  throw std::invalid_argument( "Vector sizes do not match" );
2447 
2448  if( (~rhs).canAlias( &matrix_ ) ) {
2449  const typename VT::ResultType tmp( ~rhs );
2450  smpSubAssign( *this, tmp );
2451  }
2452  else {
2453  smpSubAssign( *this, ~rhs );
2454  }
2455 
2456  return *this;
2457 }
2459 //*************************************************************************************************
2460 
2461 
2462 //*************************************************************************************************
2474 template< typename MT > // Type of the dense matrix
2475 template< typename VT > // Type of the right-hand side vector
2476 inline DenseColumn<MT,false>& DenseColumn<MT,false>::operator*=( const Vector<VT,false>& rhs )
2477 {
2480 
2481  if( size() != (~rhs).size() )
2482  throw std::invalid_argument( "Vector sizes do not match" );
2483 
2484  if( (~rhs).canAlias( &matrix_ ) || IsSparseVector<VT>::value ) {
2485  const typename VT::ResultType tmp( ~rhs );
2486  smpMultAssign( *this, tmp );
2487  }
2488  else {
2489  smpMultAssign( *this, ~rhs );
2490  }
2491 
2492  return *this;
2493 }
2495 //*************************************************************************************************
2496 
2497 
2498 //*************************************************************************************************
2506 template< typename MT > // Type of the dense matrix
2507 template< typename Other > // Data type of the right-hand side scalar
2508 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false> >::Type&
2509  DenseColumn<MT,false>::operator*=( Other rhs )
2510 {
2511  for( size_t i=0UL; i<size(); ++i )
2512  matrix_(i,col_) *= rhs;
2513  return *this;
2514 }
2516 //*************************************************************************************************
2517 
2518 
2519 //*************************************************************************************************
2529 template< typename MT > // Type of the dense matrix
2530 template< typename Other > // Data type of the right-hand side scalar
2531 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false> >::Type&
2532  DenseColumn<MT,false>::operator/=( Other rhs )
2533 {
2534  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
2535 
2536  typedef typename DivTrait<ElementType,Other>::Type DT;
2537  typedef typename If< IsNumeric<DT>, DT, Other >::Type Tmp;
2538 
2539  // Depending on the two involved data types, an integer division is applied or a
2540  // floating point division is selected.
2541  if( IsNumeric<DT>::value && IsFloatingPoint<DT>::value ) {
2542  const Tmp tmp( Tmp(1)/static_cast<Tmp>( rhs ) );
2543  for( size_t i=0UL; i<size(); ++i )
2544  matrix_(i,col_) *= tmp;
2545  }
2546  else {
2547  for( size_t i=0UL; i<size(); ++i )
2548  matrix_(i,col_) /= rhs;
2549  }
2550 
2551  return *this;
2552 }
2554 //*************************************************************************************************
2555 
2556 
2557 
2558 
2559 //=================================================================================================
2560 //
2561 // UTILITY FUNCTIONS
2562 //
2563 //=================================================================================================
2564 
2565 //*************************************************************************************************
2571 template< typename MT > // Type of the dense matrix
2572 inline size_t DenseColumn<MT,false>::size() const
2573 {
2574  return matrix_.rows();
2575 }
2577 //*************************************************************************************************
2578 
2579 
2580 //*************************************************************************************************
2586 template< typename MT > // Type of the dense matrix
2587 inline size_t DenseColumn<MT,false>::capacity() const
2588 {
2589  return matrix_.rows();
2590 }
2592 //*************************************************************************************************
2593 
2594 
2595 //*************************************************************************************************
2604 template< typename MT > // Type of the dense matrix
2605 inline size_t DenseColumn<MT,false>::nonZeros() const
2606 {
2607  const size_t rows( size() );
2608  size_t nonzeros( 0UL );
2609 
2610  for( size_t i=0UL; i<rows; ++i )
2611  if( !isDefault( matrix_(i,col_) ) )
2612  ++nonzeros;
2613 
2614  return nonzeros;
2615 }
2617 //*************************************************************************************************
2618 
2619 
2620 //*************************************************************************************************
2626 template< typename MT > // Type of the dense matrix
2627 inline void DenseColumn<MT,false>::reset()
2628 {
2629  using blaze::reset;
2630  const size_t rows( size() );
2631  for( size_t i=0UL; i<rows; ++i )
2632  reset( matrix_(i,col_) );
2633 }
2635 //*************************************************************************************************
2636 
2637 
2638 //*************************************************************************************************
2645 template< typename MT > // Type of the dense matrix
2646 template< typename Other > // Data type of the scalar value
2647 inline DenseColumn<MT,false>& DenseColumn<MT,false>::scale( const Other& scalar )
2648 {
2649  for( size_t i=0UL; i<size(); ++i ) {
2650  matrix_(i,col_) *= scalar;
2651  }
2652  return *this;
2653 }
2655 //*************************************************************************************************
2656 
2657 
2658 
2659 
2660 //=================================================================================================
2661 //
2662 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2663 //
2664 //=================================================================================================
2665 
2666 //*************************************************************************************************
2677 template< typename MT > // Type of the dense matrix
2678 template< typename Other > // Data type of the foreign expression
2679 inline bool DenseColumn<MT,false>::canAlias( const Other* alias ) const
2680 {
2681  return static_cast<const void*>( &matrix_ ) == static_cast<const void*>( alias );
2682 }
2684 //*************************************************************************************************
2685 
2686 
2687 //*************************************************************************************************
2698 template< typename MT > // Type of the dense matrix
2699 template< typename Other > // Data type of the foreign expression
2700 inline bool DenseColumn<MT,false>::isAliased( const Other* alias ) const
2701 {
2702  return static_cast<const void*>( &matrix_ ) == static_cast<const void*>( alias );
2703 }
2705 //*************************************************************************************************
2706 
2707 
2708 //*************************************************************************************************
2718 template< typename MT > // Type of the dense matrix
2719 inline bool DenseColumn<MT,false>::isAligned() const
2720 {
2721  return false;
2722 }
2724 //*************************************************************************************************
2725 
2726 
2727 //*************************************************************************************************
2738 template< typename MT > // Type of the dense matrix
2739 inline bool DenseColumn<MT,false>::canSMPAssign() const
2740 {
2741  return ( size() > OPENMP_DVECASSIGN_THRESHOLD );
2742 }
2744 //*************************************************************************************************
2745 
2746 
2747 //*************************************************************************************************
2759 template< typename MT > // Type of the dense matrix
2760 template< typename VT > // Type of the right-hand side dense vector
2761 inline void DenseColumn<MT,false>::assign( const DenseVector<VT,false>& rhs )
2762 {
2763  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2764 
2765  const size_t iend( (~rhs).size() & size_t(-2) );
2766  for( size_t i=0UL; i<iend; i+=2UL ) {
2767  matrix_(i ,col_) = (~rhs)[i ];
2768  matrix_(i+1UL,col_) = (~rhs)[i+1UL];
2769  }
2770  if( iend < (~rhs).size() )
2771  matrix_(iend,col_) = (~rhs)[iend];
2772 }
2774 //*************************************************************************************************
2775 
2776 
2777 //*************************************************************************************************
2789 template< typename MT > // Type of the dense matrix
2790 template< typename VT > // Type of the right-hand side sparse vector
2791 inline void DenseColumn<MT,false>::assign( const SparseVector<VT,false>& rhs )
2792 {
2793  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2794 
2795  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2796  matrix_(element->index(),col_) = element->value();
2797 }
2799 //*************************************************************************************************
2800 
2801 
2802 //*************************************************************************************************
2814 template< typename MT > // Type of the dense matrix
2815 template< typename VT > // Type of the right-hand side dense vector
2816 inline void DenseColumn<MT,false>::addAssign( const DenseVector<VT,false>& rhs )
2817 {
2818  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2819 
2820  const size_t iend( (~rhs).size() & size_t(-2) );
2821  for( size_t i=0UL; i<iend; i+=2UL ) {
2822  matrix_(i ,col_) += (~rhs)[i ];
2823  matrix_(i+1UL,col_) += (~rhs)[i+1UL];
2824  }
2825  if( iend < (~rhs).size() )
2826  matrix_(iend,col_) += (~rhs)[iend];
2827 }
2829 //*************************************************************************************************
2830 
2831 
2832 //*************************************************************************************************
2844 template< typename MT > // Type of the dense matrix
2845 template< typename VT > // Type of the right-hand side sparse vector
2846 inline void DenseColumn<MT,false>::addAssign( const SparseVector<VT,false>& rhs )
2847 {
2848  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2849 
2850  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2851  matrix_(element->index(),col_) += element->value();
2852 }
2854 //*************************************************************************************************
2855 
2856 
2857 //*************************************************************************************************
2869 template< typename MT > // Type of the dense matrix
2870 template< typename VT > // Type of the right-hand side dense vector
2871 inline void DenseColumn<MT,false>::subAssign( const DenseVector<VT,false>& rhs )
2872 {
2873  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2874 
2875  const size_t iend( (~rhs).size() & size_t(-2) );
2876  for( size_t i=0UL; i<iend; i+=2UL ) {
2877  matrix_(i ,col_) -= (~rhs)[i ];
2878  matrix_(i+1UL,col_) -= (~rhs)[i+1UL];
2879  }
2880  if( iend < (~rhs).size() )
2881  matrix_(iend,col_) -= (~rhs)[iend];
2882 }
2884 //*************************************************************************************************
2885 
2886 
2887 //*************************************************************************************************
2899 template< typename MT > // Type of the dense matrix
2900 template< typename VT > // Type of the right-hand side sparse vector
2901 inline void DenseColumn<MT,false>::subAssign( const SparseVector<VT,false>& rhs )
2902 {
2903  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2904 
2905  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2906  matrix_(element->index(),col_) -= element->value();
2907 }
2909 //*************************************************************************************************
2910 
2911 
2912 //*************************************************************************************************
2924 template< typename MT > // Type of the dense matrix
2925 template< typename VT > // Type of the right-hand side dense vector
2926 inline void DenseColumn<MT,false>::multAssign( const DenseVector<VT,false>& rhs )
2927 {
2928  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2929 
2930  const size_t iend( (~rhs).size() & size_t(-2) );
2931  for( size_t i=0UL; i<iend; i+=2UL ) {
2932  matrix_(i ,col_) *= (~rhs)[i ];
2933  matrix_(i+1UL,col_) *= (~rhs)[i+1UL];
2934  }
2935  if( iend < (~rhs).size() )
2936  matrix_(iend,col_) *= (~rhs)[iend];
2937 }
2939 //*************************************************************************************************
2940 
2941 
2942 //*************************************************************************************************
2954 template< typename MT > // Type of the dense matrix
2955 template< typename VT > // Type of the right-hand side sparse vector
2956 inline void DenseColumn<MT,false>::multAssign( const SparseVector<VT,false>& rhs )
2957 {
2958  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2959 
2960  const ResultType tmp( *this );
2961 
2962  reset();
2963 
2964  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2965  matrix_(element->index(),col_) = tmp[element->index()] * element->value();
2966 }
2968 //*************************************************************************************************
2969 
2970 
2971 
2972 
2973 
2974 
2975 
2976 
2977 //=================================================================================================
2978 //
2979 // DENSECOLUMN OPERATORS
2980 //
2981 //=================================================================================================
2982 
2983 //*************************************************************************************************
2986 template< typename MT, bool SO >
2987 inline void reset( DenseColumn<MT,SO>& column );
2988 
2989 template< typename MT, bool SO >
2990 inline void clear( DenseColumn<MT,SO>& column );
2991 
2992 template< typename MT, bool SO >
2993 inline bool isDefault( const DenseColumn<MT,SO>& column );
2995 //*************************************************************************************************
2996 
2997 
2998 //*************************************************************************************************
3005 template< typename MT // Type of the dense matrix
3006  , bool SO > // Storage order
3008 {
3009  column.reset();
3010 }
3011 //*************************************************************************************************
3012 
3013 
3014 //*************************************************************************************************
3023 template< typename MT // Type of the dense matrix
3024  , bool SO > // Storage order
3026 {
3027  column.reset();
3028 }
3029 //*************************************************************************************************
3030 
3031 
3032 //*************************************************************************************************
3050 template< typename MT // Type of the dense matrix
3051  , bool SO > // Storage order
3052 inline bool isDefault( const DenseColumn<MT,SO>& column )
3053 {
3054  for( size_t i=0UL; i<column.size(); ++i )
3055  if( !isDefault( column[i] ) ) return false;
3056  return true;
3057 }
3058 //*************************************************************************************************
3059 
3060 
3061 
3062 
3063 //=================================================================================================
3064 //
3065 // SUBVECTORTRAIT SPECIALIZATIONS
3066 //
3067 //=================================================================================================
3068 
3069 //*************************************************************************************************
3071 template< typename MT, bool SO >
3072 struct SubvectorTrait< DenseColumn<MT,SO> >
3073 {
3074  typedef typename SubvectorTrait< typename DenseColumn<MT,SO>::ResultType >::Type Type;
3075 };
3077 //*************************************************************************************************
3078 
3079 } // namespace blaze
3080 
3081 #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:348
const ElementType * ConstPointer
Pointer to a constant row value.
Definition: DenseColumn.h:351
const size_t OPENMP_DVECASSIGN_THRESHOLD
OpenMP dense vector assignment threshold.This threshold specifies when an assignment of a plain dense...
Definition: Thresholds.h:200
void reset(DynamicMatrix< Type, SO > &m)
Resetting the given dense matrix.
Definition: DynamicMatrix.h:4579
#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:4075
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:151
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:1003
#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:4622
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:197
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i...
Definition: Computation.h:118
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:79
void smpMultAssign(DenseVector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:178
Header file for the IsSame and IsStrictlySame type traits.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DenseColumn.h:338
MT::ElementType ElementType
Type of the column elements.
Definition: DenseColumn.h:339
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:1260
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename ColumnExprTrait< MT >::Type >::Type column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:103
bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:366
Header file for the DenseVector base class.
bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:442
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DenseColumn.h:341
#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:357
void clear(DynamicMatrix< Type, SO > &m)
Clearing the given dense matrix.
Definition: DynamicMatrix.h:4595
Header file for the column base class.
size_t nonZeros() const
Returns the number of non-zero elements in the column.
Definition: DenseColumn.h:1034
SelectType< IsExpression< MT >::value, MT, MT & >::Type Operand
Composite data type of the dense matrix expression.
Definition: DenseColumn.h:317
DenseColumn & operator=(const ElementType &rhs)
Homogenous assignment to all column elements.
Definition: DenseColumn.h:768
Constraint on the data type.
void smpAddAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:121
Iterator end()
Returns an iterator just past the last element of the column.
Definition: DenseColumn.h:713
void store(size_t index, const IntrinsicType &value)
Aligned store of an intrinsic element of the dense column.
Definition: DenseColumn.h:1216
SelectType< useConst, ConstPointer, ElementType * >::Type Pointer
Pointer to a constant row value.
Definition: DenseColumn.h:354
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:697
Reference operator[](size_t index)
Subscript operator for the direct access to the column elements.
Definition: DenseColumn.h:600
Header file for the dense vector SMP implementation.
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:574
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2388
IT::Type IntrinsicType
Intrinsic type of the column elements.
Definition: DenseColumn.h:340
bool canAlias(const Other *alias) const
Returns whether the dense column can alias with the given address alias.
Definition: DenseColumn.h:1095
const size_t col_
The index of the column in the matrix.
Definition: DenseColumn.h:541
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:1173
MT::ConstReference ConstReference
Reference to a constant column value.
Definition: DenseColumn.h:345
Reference to a specific column of a dense matrix.The DenseColumn template represents a reference to a...
Definition: DenseColumn.h:311
Base class for all columns.The Column class serves as a tag for all columns (i.e. dense and sparse co...
Definition: Column.h:64
IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the dense column.
Definition: DenseColumn.h:1194
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:1238
Constraint on the data type.
Constraint on the data type.
size_t capacity() const
Returns the maximum capacity of the dense column.
Definition: DenseColumn.h:1017
#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:337
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2382
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 Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2386
System settings for streaming (non-temporal stores)
SelectType< useConst, ConstIterator, typename MT::Iterator >::Type Iterator
Iterator over non-constant elements.
Definition: DenseColumn.h:360
Header file for the EnableIf class template.
Operand matrix_
The dense matrix containing the column.
Definition: DenseColumn.h:540
bool isAligned() const
Returns whether the dense column is properly aligned in memory.
Definition: DenseColumn.h:1133
void smpAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:91
Header file for the IsNumeric type trait.
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename RowExprTrait< MT >::Type >::Type row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:103
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:2383
Header file for the IsConst type trait.
IntrinsicTrait< typename MT::ElementType > IT
Intrinsic trait for the column element type.
Definition: DenseColumn.h:320
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:748
Header file for run time assertion macros.
bool canSMPAssign() const
Returns whether the dense column can be used in SMP assignments.
Definition: DenseColumn.h:1152
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.
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:2387
DenseColumn< MT, SO > This
Type of this DenseColumn instance.
Definition: DenseColumn.h:336
Header file for the column trait.
Header file for the isDefault shim.
void reset()
Reset to the default initial values.
Definition: DenseColumn.h:1048
Pointer data()
Low-level data access to the column elements.
Definition: DenseColumn.h:633
#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:745
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
CompressedMatrix< Type,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:248
Iterator begin()
Returns an iterator to the first element of the column.
Definition: DenseColumn.h:665
Header file for the sparse vector SMP implementation.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:105
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:2379
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:2385
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:1115
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
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
Header file for the IsExpression type trait class.
const DenseColumn & CompositeType
Data type for composite expression templates.
Definition: DenseColumn.h:342
Header file for the FunctionTrace class.