35 #ifndef _BLAZE_MATH_VIEWS_DENSECOLUMN_H_
36 #define _BLAZE_MATH_VIEWS_DENSECOLUMN_H_
313 template<
typename MT
314 ,
bool SO = IsColumnMajorMatrix<MT>::value
315 ,
bool SF = IsSymmetric<MT>::value >
370 enum { vectorizable = MT::vectorizable };
373 enum { smpAssignable = MT::smpAssignable };
379 explicit inline DenseColumn( MT& matrix,
size_t index );
410 template<
typename VT >
inline DenseColumn& operator+=(
const Vector<VT,false>& rhs );
411 template<
typename VT >
inline DenseColumn& operator-=(
const Vector<VT,false>& rhs );
412 template<
typename VT >
inline DenseColumn& operator*=(
const Vector<VT,false>& rhs );
414 template<
typename Other >
415 inline typename EnableIf< IsNumeric<Other>,
DenseColumn >::Type&
416 operator*=( Other rhs );
418 template<
typename Other >
419 inline typename EnableIf< IsNumeric<Other>,
DenseColumn >::Type&
420 operator/=( Other rhs );
427 inline size_t size()
const;
431 template<
typename Other >
inline DenseColumn& scale(
const Other& scalar );
438 template<
typename VT >
440 struct VectorizedAssign {
441 enum { value = vectorizable && VT::vectorizable &&
442 IsSame<ElementType,typename VT::ElementType>::value };
449 template<
typename VT >
451 struct VectorizedAddAssign {
452 enum { value = vectorizable && VT::vectorizable &&
453 IsSame<ElementType,typename VT::ElementType>::value &&
454 IntrinsicTrait<ElementType>::addition };
461 template<
typename VT >
463 struct VectorizedSubAssign {
464 enum { value = vectorizable && VT::vectorizable &&
465 IsSame<ElementType,typename VT::ElementType>::value &&
466 IntrinsicTrait<ElementType>::subtraction };
473 template<
typename VT >
475 struct VectorizedMultAssign {
476 enum { value = vectorizable && VT::vectorizable &&
477 IsSame<ElementType,typename VT::ElementType>::value &&
478 IntrinsicTrait<ElementType>::multiplication };
487 template<
typename Other >
488 inline bool canAlias(
const Other* alias )
const;
490 template<
typename MT2,
bool SO2,
bool SF2 >
491 inline bool canAlias(
const DenseColumn<MT2,SO2,SF2>* alias )
const;
493 template<
typename Other >
494 inline bool isAliased(
const Other* alias )
const;
496 template<
typename MT2,
bool SO2,
bool SF2 >
497 inline bool isAliased(
const DenseColumn<MT2,SO2,SF2>* alias )
const;
508 template<
typename VT >
509 inline typename DisableIf< VectorizedAssign<VT> >::Type
510 assign(
const DenseVector<VT,false>& rhs );
512 template<
typename VT >
513 inline typename EnableIf< VectorizedAssign<VT> >::Type
514 assign(
const DenseVector<VT,false>& rhs );
516 template<
typename VT >
inline void assign(
const SparseVector<VT,false>& rhs );
518 template<
typename VT >
519 inline typename DisableIf< VectorizedAddAssign<VT> >::Type
520 addAssign(
const DenseVector<VT,false>& rhs );
522 template<
typename VT >
523 inline typename EnableIf< VectorizedAddAssign<VT> >::Type
524 addAssign(
const DenseVector<VT,false>& rhs );
526 template<
typename VT >
inline void addAssign(
const SparseVector<VT,false>& rhs );
528 template<
typename VT >
529 inline typename DisableIf< VectorizedSubAssign<VT> >::Type
530 subAssign(
const DenseVector<VT,false>& rhs );
532 template<
typename VT >
533 inline typename EnableIf< VectorizedSubAssign<VT> >::Type
534 subAssign(
const DenseVector<VT,false>& rhs );
536 template<
typename VT >
inline void subAssign(
const SparseVector<VT,false>& rhs );
538 template<
typename VT >
539 inline typename DisableIf< VectorizedMultAssign<VT> >::Type
540 multAssign(
const DenseVector<VT,false>& rhs );
542 template<
typename VT >
543 inline typename EnableIf< VectorizedMultAssign<VT> >::Type
544 multAssign(
const DenseVector<VT,false>& rhs );
546 template<
typename VT >
inline void multAssign(
const SparseVector<VT,false>& rhs );
561 template<
typename MT2,
bool SO2,
bool SF2 >
friend class DenseColumn;
563 template<
typename MT2,
bool SO2,
bool SF2 >
595 template<
typename MT
602 if(
matrix_.columns() <= index )
603 throw std::invalid_argument(
"Invalid column access index" );
622 template<
typename MT
628 return matrix_(index,col_);
639 template<
typename MT
646 return matrix_(index,col_);
658 template<
typename MT
663 return matrix_.data( col_ );
675 template<
typename MT
680 return matrix_.data( col_ );
692 template<
typename MT
697 return matrix_.begin( col_ );
709 template<
typename MT
714 return matrix_.cbegin( col_ );
726 template<
typename MT
731 return matrix_.cbegin( col_ );
743 template<
typename MT
748 return matrix_.end( col_ );
760 template<
typename MT
765 return matrix_.cend( col_ );
777 template<
typename MT
782 return matrix_.cend( col_ );
801 template<
typename MT
808 for(
size_t i=0UL; i<
rows; ++i )
809 matrix_(i,col_) = rhs;
826 template<
typename MT
831 if( &rhs ==
this )
return *
this;
834 throw std::invalid_argument(
"Column sizes do not match" );
838 for(
size_t i=0UL; i<
rows; ++i )
839 matrix_(i,col_) = rhs[i];
856 template<
typename MT
859 template<
typename VT >
866 throw std::invalid_argument(
"Vector sizes do not match" );
868 if( (~rhs).canAlias( &matrix_ ) ) {
893 template<
typename MT
896 template<
typename VT >
903 throw std::invalid_argument(
"Vector sizes do not match" );
905 if( (~rhs).canAlias( &matrix_ ) ) {
928 template<
typename MT
931 template<
typename VT >
938 throw std::invalid_argument(
"Vector sizes do not match" );
940 if( (~rhs).canAlias( &matrix_ ) ) {
964 template<
typename MT
967 template<
typename VT >
974 throw std::invalid_argument(
"Vector sizes do not match" );
996 template<
typename MT
999 template<
typename Other >
1003 return operator=( (*
this) * rhs );
1017 template<
typename MT
1020 template<
typename Other >
1026 return operator=( (*
this) / rhs );
1044 template<
typename MT
1049 return matrix_.rows();
1059 template<
typename MT
1064 return matrix_.capacity( col_ );
1077 template<
typename MT
1082 return matrix_.nonZeros( col_ );
1092 template<
typename MT
1097 matrix_.reset( col_ );
1108 template<
typename MT
1111 template<
typename Other >
1114 for(
size_t i=0UL; i<
size(); ++i ) {
1115 matrix_(i,col_) *= scalar;
1140 template<
typename MT
1143 template<
typename Other >
1146 return matrix_.isAliased( alias );
1161 template<
typename MT
1164 template<
typename MT2
1169 return matrix_.isAliased( alias->
matrix_ ) && ( col_ == alias->
col_ );
1184 template<
typename MT
1187 template<
typename Other >
1190 return matrix_.isAliased( alias );
1205 template<
typename MT
1208 template<
typename MT2
1213 return matrix_.isAliased( &alias->
matrix_ ) && ( col_ == alias->
col_ );
1227 template<
typename MT
1232 return matrix_.isAligned();
1247 template<
typename MT
1269 template<
typename MT
1274 return matrix_.load( index, col_ );
1291 template<
typename MT
1296 return matrix_.loadu( index, col_ );
1314 template<
typename MT
1319 matrix_.store( index, col_, value );
1337 template<
typename MT
1342 matrix_.storeu( index, col_, value );
1360 template<
typename MT
1365 matrix_.stream( index, col_, value );
1381 template<
typename MT
1384 template<
typename VT >
1390 const size_t iend( (~rhs).
size() &
size_t(-2) );
1391 for(
size_t i=0UL; i<iend; i+=2UL ) {
1392 matrix_(i ,col_) = (~rhs)[i ];
1393 matrix_(i+1UL,col_) = (~rhs)[i+1UL];
1395 if( iend < (~rhs).size() )
1396 matrix_(iend,col_) = (~rhs)[iend];
1412 template<
typename MT
1415 template<
typename VT >
1428 matrix_.stream( i, col_, (~rhs).
load(i) );
1433 const size_t iend( rows &
size_t(-
IT::size*4) );
1437 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
1438 matrix_.store( i , col_, it.load() ); it+=
IT::size;
1444 matrix_.store( i, col_, it.load() );
1462 template<
typename MT
1465 template<
typename VT >
1471 matrix_(element->index(),col_) = element->value();
1487 template<
typename MT
1490 template<
typename VT >
1496 const size_t iend( (~rhs).
size() &
size_t(-2) );
1497 for(
size_t i=0UL; i<iend; i+=2UL ) {
1498 matrix_(i ,col_) += (~rhs)[i ];
1499 matrix_(i+1UL,col_) += (~rhs)[i+1UL];
1501 if( iend < (~rhs).size() )
1502 matrix_(iend,col_) += (~rhs)[iend];
1518 template<
typename MT
1521 template<
typename VT >
1531 const size_t iend( rows &
size_t(-
IT::size*4) );
1535 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
1536 matrix_.store( i , col_, matrix_.load(i ,col_) + it.load() ); it +=
IT::size;
1542 matrix_.store( i, col_, matrix_.load(i,col_) + it.load() );
1559 template<
typename MT
1562 template<
typename VT >
1568 matrix_(element->index(),col_) += element->value();
1584 template<
typename MT
1587 template<
typename VT >
1593 const size_t iend( (~rhs).
size() &
size_t(-2) );
1594 for(
size_t i=0UL; i<iend; i+=2UL ) {
1595 matrix_(i ,col_) -= (~rhs)[i ];
1596 matrix_(i+1UL,col_) -= (~rhs)[i+1UL];
1598 if( iend < (~rhs).size() )
1599 matrix_(iend,col_) -= (~rhs)[iend];
1615 template<
typename MT
1618 template<
typename VT >
1628 const size_t iend( rows &
size_t(-
IT::size*4) );
1632 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
1633 matrix_.store( i , col_, matrix_.load(i ,col_) - it.load() ); it +=
IT::size;
1639 matrix_.store( i, col_, matrix_.load(i,col_) - it.load() );
1656 template<
typename MT
1659 template<
typename VT >
1665 matrix_(element->index(),col_) -= element->value();
1681 template<
typename MT
1684 template<
typename VT >
1690 const size_t iend( (~rhs).
size() &
size_t(-2) );
1691 for(
size_t i=0UL; i<iend; i+=2UL ) {
1692 matrix_(i ,col_) *= (~rhs)[i ];
1693 matrix_(i+1UL,col_) *= (~rhs)[i+1UL];
1695 if( iend < (~rhs).size() )
1696 matrix_(iend,col_) *= (~rhs)[iend];
1712 template<
typename MT
1715 template<
typename VT >
1725 const size_t iend( rows &
size_t(-
IT::size*4) );
1729 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
1730 matrix_.store( i , col_, matrix_.load(i ,col_) * it.load() ); it +=
IT::size;
1736 matrix_.store( i, col_, matrix_.load(i,col_) * it.load() );
1753 template<
typename MT
1756 template<
typename VT >
1766 matrix_(element->index(),col_) = tmp[element->index()] * element->value();
1791 template<
typename MT >
1814 typedef DenseColumn<MT,false,false>
This;
1815 typedef typename ColumnTrait<MT>::Type
ResultType;
1825 typedef typename SelectType< useConst, ConstReference, typename MT::Reference >::Type
Reference;
1831 template<
typename MatrixType >
1832 class ColumnIterator
1842 enum { returnConst = IsConst<MatrixType>::value };
1848 typedef typename SelectType< returnConst
1852 typedef std::random_access_iterator_tag IteratorCategory;
1853 typedef RemoveReference<Reference> ValueType;
1854 typedef ValueType* PointerType;
1856 typedef ptrdiff_t DifferenceType;
1859 typedef IteratorCategory iterator_category;
1860 typedef ValueType value_type;
1861 typedef PointerType pointer;
1862 typedef ReferenceType reference;
1863 typedef DifferenceType difference_type;
1869 inline ColumnIterator()
1883 inline ColumnIterator( MatrixType& matrix,
size_t row,
size_t column )
1895 template<
typename MatrixType2 >
1896 inline ColumnIterator(
const ColumnIterator<MatrixType2>& it )
1899 , column_( it.column_ )
1909 inline ColumnIterator& operator+=(
size_t inc ) {
1921 inline ColumnIterator& operator-=(
size_t dec ) {
1932 inline ColumnIterator& operator++() {
1943 inline const ColumnIterator operator++(
int ) {
1944 const ColumnIterator tmp( *
this );
1955 inline ColumnIterator& operator--() {
1966 inline const ColumnIterator operator--(
int ) {
1967 const ColumnIterator tmp( *
this );
1979 inline ReferenceType
operator[](
size_t index )
const {
1980 return (*
matrix_)(row_+index,column_);
1989 inline ReferenceType
operator*()
const {
1990 return (*
matrix_)(row_,column_);
1999 inline PointerType operator->()
const {
2000 return &(*matrix_)(row_,column_);
2010 template<
typename MatrixType2 >
2011 inline bool operator==(
const ColumnIterator<MatrixType2>& rhs )
const {
2012 return (
matrix_ == rhs.matrix_ ) && ( row_ == rhs.row_ ) && ( column_ == rhs.column_ );
2022 template<
typename MatrixType2 >
2023 inline bool operator!=(
const ColumnIterator<MatrixType2>& rhs )
const {
2024 return !( *
this == rhs );
2034 template<
typename MatrixType2 >
2035 inline bool operator<( const ColumnIterator<MatrixType2>& rhs )
const {
2036 return (
matrix_ == rhs.matrix_ ) && ( row_ < rhs.row_ ) && ( column_ == rhs.column_ );
2046 template<
typename MatrixType2 >
2047 inline bool operator>(
const ColumnIterator<MatrixType2>& rhs )
const {
2048 return (
matrix_ == rhs.matrix_ ) && ( row_ > rhs.row_ ) && ( column_ == rhs.column_ );
2058 template<
typename MatrixType2 >
2059 inline bool operator<=( const ColumnIterator<MatrixType2>& rhs )
const {
2060 return (
matrix_ == rhs.matrix_ ) && ( row_ <= rhs.row_ ) && ( column_ == rhs.column_ );
2070 template<
typename MatrixType2 >
2071 inline bool operator>=(
const ColumnIterator<MatrixType2>& rhs )
const {
2072 return (
matrix_ == rhs.matrix_ ) && ( row_ >= rhs.row_ ) && ( column_ == rhs.column_ );
2082 inline DifferenceType
operator-(
const ColumnIterator& rhs )
const {
2083 return row_ - rhs.row_;
2094 friend inline const ColumnIterator
operator+(
const ColumnIterator& it,
size_t inc ) {
2095 return ColumnIterator( *it.matrix_, it.row_+inc, it.column_ );
2106 friend inline const ColumnIterator
operator+(
size_t inc,
const ColumnIterator& it ) {
2107 return ColumnIterator( *it.matrix_, it.row_+inc, it.column_ );
2118 friend inline const ColumnIterator
operator-(
const ColumnIterator& it,
size_t dec ) {
2119 return ColumnIterator( *it.matrix_, it.row_-dec, it.column_ );
2131 template<
typename MatrixType2 >
friend class ColumnIterator;
2141 typedef typename SelectType< useConst, ConstIterator, ColumnIterator<MT> >::Type
Iterator;
2146 enum { vectorizable = 0 };
2149 enum { smpAssignable = MT::smpAssignable };
2155 explicit inline DenseColumn( MT& matrix,
size_t index );
2184 template<
typename VT >
inline DenseColumn& operator+=(
const Vector<VT,false>& rhs );
2185 template<
typename VT >
inline DenseColumn& operator-=(
const Vector<VT,false>& rhs );
2186 template<
typename VT >
inline DenseColumn& operator*=(
const Vector<VT,false>& rhs );
2188 template<
typename Other >
2189 inline typename EnableIf< IsNumeric<Other>,
DenseColumn >::Type&
2190 operator*=( Other rhs );
2192 template<
typename Other >
2193 inline typename EnableIf< IsNumeric<Other>,
DenseColumn >::Type&
2194 operator/=( Other rhs );
2201 inline size_t size()
const;
2204 inline void reset();
2205 template<
typename Other >
inline DenseColumn& scale(
const Other& scalar );
2213 template<
typename Other >
2214 inline bool canAlias (
const Other* alias )
const;
2216 template<
typename MT2,
bool SO2,
bool SF2 >
2217 inline bool canAlias (
const DenseColumn<MT2,SO2,SF2>* alias )
const;
2219 template<
typename Other >
2220 inline bool isAliased(
const Other* alias )
const;
2222 template<
typename MT2,
bool SO2,
bool SF2 >
2223 inline bool isAliased(
const DenseColumn<MT2,SO2,SF2>* alias )
const;
2228 template<
typename VT >
inline void assign (
const DenseVector <VT,false>& rhs );
2229 template<
typename VT >
inline void assign (
const SparseVector<VT,false>& rhs );
2230 template<
typename VT >
inline void addAssign (
const DenseVector <VT,false>& rhs );
2231 template<
typename VT >
inline void addAssign (
const SparseVector<VT,false>& rhs );
2232 template<
typename VT >
inline void subAssign (
const DenseVector <VT,false>& rhs );
2233 template<
typename VT >
inline void subAssign (
const SparseVector<VT,false>& rhs );
2234 template<
typename VT >
inline void multAssign(
const DenseVector <VT,false>& rhs );
2235 template<
typename VT >
inline void multAssign(
const SparseVector<VT,false>& rhs );
2249 template<
typename MT2,
bool SO2,
bool SF2 >
friend class DenseColumn;
2251 template<
typename MT2,
bool SO2,
bool SF2 >
2252 friend bool isSame(
const DenseColumn<MT2,SO2,SF2>& a,
const DenseColumn<MT2,SO2,SF2>& b );
2283 template<
typename MT >
2288 if(
matrix_.columns() <= index )
2289 throw std::invalid_argument(
"Invalid column access index" );
2310 template<
typename MT >
2315 return matrix_(index,col_);
2328 template<
typename MT >
2333 return matrix_(index,col_);
2347 template<
typename MT >
2350 return Iterator( matrix_, 0UL, col_ );
2364 template<
typename MT >
2382 template<
typename MT >
2400 template<
typename MT >
2417 template<
typename MT >
2435 template<
typename MT >
2460 template<
typename MT >
2461 inline DenseColumn<MT,false,false>&
2466 for(
size_t i=0UL; i<
rows; ++i )
2467 matrix_(i,col_) = rhs;
2486 template<
typename MT >
2487 inline DenseColumn<MT,false,false>&
2490 if( &rhs ==
this )
return *
this;
2492 if(
size() != rhs.size() )
2493 throw std::invalid_argument(
"Column sizes do not match" );
2497 for(
size_t i=0UL; i<
rows; ++i )
2498 matrix_(i,col_) = rhs[i];
2517 template<
typename MT >
2518 template<
typename VT >
2519 inline DenseColumn<MT,false,false>&
2527 throw std::invalid_argument(
"Vector sizes do not match" );
2529 if( (~rhs).canAlias( &matrix_ ) ) {
2534 if( IsSparseVector<VT>::value )
2556 template<
typename MT >
2557 template<
typename VT >
2558 inline DenseColumn<MT,false,false>&
2559 DenseColumn<MT,false,false>::operator+=(
const Vector<VT,false>& rhs )
2565 throw std::invalid_argument(
"Vector sizes do not match" );
2567 if( (~rhs).canAlias( &matrix_ ) ) {
2592 template<
typename MT >
2593 template<
typename VT >
2594 inline DenseColumn<MT,false,false>&
2595 DenseColumn<MT,false,false>::operator-=(
const Vector<VT,false>& rhs )
2601 throw std::invalid_argument(
"Vector sizes do not match" );
2603 if( (~rhs).canAlias( &matrix_ ) ) {
2629 template<
typename MT >
2630 template<
typename VT >
2631 inline DenseColumn<MT,false,false>&
2632 DenseColumn<MT,false,false>::operator*=(
const Vector<VT,false>& rhs )
2638 throw std::invalid_argument(
"Vector sizes do not match" );
2640 if( (~rhs).canAlias( &matrix_ ) || IsSparseVector<VT>::value ) {
2662 template<
typename MT >
2663 template<
typename Other >
2664 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false,false> >::Type&
2665 DenseColumn<MT,false,false>::operator*=( Other rhs )
2667 for(
size_t i=0UL; i<
size(); ++i )
2668 matrix_(i,col_) *= rhs;
2685 template<
typename MT >
2686 template<
typename Other >
2687 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false,false> >::Type&
2688 DenseColumn<MT,false,false>::operator/=( Other rhs )
2692 typedef typename DivTrait<ElementType,Other>::Type DT;
2693 typedef typename If< IsNumeric<DT>, DT, Other >::Type Tmp;
2697 if( IsNumeric<DT>::value && IsFloatingPoint<DT>::value ) {
2698 const Tmp tmp( Tmp(1)/static_cast<Tmp>( rhs ) );
2699 for(
size_t i=0UL; i<
size(); ++i )
2700 matrix_(i,col_) *= tmp;
2703 for(
size_t i=0UL; i<
size(); ++i )
2704 matrix_(i,col_) /= rhs;
2727 template<
typename MT >
2730 return matrix_.rows();
2742 template<
typename MT >
2745 return matrix_.rows();
2760 template<
typename MT >
2764 size_t nonzeros( 0UL );
2766 for(
size_t i=0UL; i<
rows; ++i )
2782 template<
typename MT >
2787 for(
size_t i=0UL; i<
rows; ++i )
2788 clear( matrix_(i,col_) );
2801 template<
typename MT >
2802 template<
typename Other >
2803 inline DenseColumn<MT,false,false>& DenseColumn<MT,false,false>::scale(
const Other& scalar )
2805 for(
size_t i=0UL; i<
size(); ++i ) {
2806 matrix_(i,col_) *= scalar;
2833 template<
typename MT >
2834 template<
typename Other >
2837 return matrix_.isAliased( alias );
2854 template<
typename MT >
2855 template<
typename MT2
2860 return matrix_.isAliased( &alias->matrix_ ) && ( col_ == alias->col_ );
2877 template<
typename MT >
2878 template<
typename Other >
2881 return matrix_.isAliased( alias );
2898 template<
typename MT >
2899 template<
typename MT2
2904 return matrix_.isAliased( &alias->matrix_ ) && ( col_ == alias->col_ );
2920 template<
typename MT >
2940 template<
typename MT >
2961 template<
typename MT >
2962 template<
typename VT >
2967 const size_t iend( (~rhs).
size() &
size_t(-2) );
2968 for(
size_t i=0UL; i<iend; i+=2UL ) {
2969 matrix_(i ,col_) = (~rhs)[i ];
2970 matrix_(i+1UL,col_) = (~rhs)[i+1UL];
2972 if( iend < (~rhs).size() )
2973 matrix_(iend,col_) = (~rhs)[iend];
2991 template<
typename MT >
2992 template<
typename VT >
2998 matrix_(element->index(),col_) = element->value();
3016 template<
typename MT >
3017 template<
typename VT >
3022 const size_t iend( (~rhs).
size() &
size_t(-2) );
3023 for(
size_t i=0UL; i<iend; i+=2UL ) {
3024 matrix_(i ,col_) += (~rhs)[i ];
3025 matrix_(i+1UL,col_) += (~rhs)[i+1UL];
3027 if( iend < (~rhs).size() )
3028 matrix_(iend,col_) += (~rhs)[iend];
3046 template<
typename MT >
3047 template<
typename VT >
3053 matrix_(element->index(),col_) += element->value();
3071 template<
typename MT >
3072 template<
typename VT >
3077 const size_t iend( (~rhs).
size() &
size_t(-2) );
3078 for(
size_t i=0UL; i<iend; i+=2UL ) {
3079 matrix_(i ,col_) -= (~rhs)[i ];
3080 matrix_(i+1UL,col_) -= (~rhs)[i+1UL];
3082 if( iend < (~rhs).size() )
3083 matrix_(iend,col_) -= (~rhs)[iend];
3101 template<
typename MT >
3102 template<
typename VT >
3108 matrix_(element->index(),col_) -= element->value();
3126 template<
typename MT >
3127 template<
typename VT >
3132 const size_t iend( (~rhs).
size() &
size_t(-2) );
3133 for(
size_t i=0UL; i<iend; i+=2UL ) {
3134 matrix_(i ,col_) *= (~rhs)[i ];
3135 matrix_(i+1UL,col_) *= (~rhs)[i+1UL];
3137 if( iend < (~rhs).size() )
3138 matrix_(iend,col_) *= (~rhs)[iend];
3156 template<
typename MT >
3157 template<
typename VT >
3167 matrix_(element->index(),col_) = tmp[element->index()] * element->value();
3193 template<
typename MT >
3194 class DenseColumn<MT,false,true> :
public DenseVector< DenseColumn<MT,false,true>, false >
3200 typedef typename SelectType< IsExpression<MT>::value, MT, MT& >::Type
Operand;
3203 typedef IntrinsicTrait<typename MT::ElementType>
IT;
3214 enum { useConst = IsConst<MT>::value };
3219 typedef DenseColumn<MT,false,true>
This;
3220 typedef typename ColumnTrait<MT>::Type
ResultType;
3231 typedef typename SelectType< useConst, ConstReference, typename MT::Reference >::Type
Reference;
3237 typedef typename SelectType< useConst, ConstPointer, ElementType* >::Type
Pointer;
3243 typedef typename SelectType< useConst, ConstIterator, typename MT::Iterator >::Type
Iterator;
3248 enum { vectorizable = MT::vectorizable };
3251 enum { smpAssignable = MT::smpAssignable };
3257 explicit inline DenseColumn( MT& matrix,
size_t index );
3288 template<
typename VT >
inline DenseColumn& operator+=(
const Vector<VT,false>& rhs );
3289 template<
typename VT >
inline DenseColumn& operator-=(
const Vector<VT,false>& rhs );
3290 template<
typename VT >
inline DenseColumn& operator*=(
const Vector<VT,false>& rhs );
3292 template<
typename Other >
3293 inline typename EnableIf< IsNumeric<Other>,
DenseColumn >::Type&
3294 operator*=( Other rhs );
3296 template<
typename Other >
3297 inline typename EnableIf< IsNumeric<Other>,
DenseColumn >::Type&
3298 operator/=( Other rhs );
3305 inline size_t size()
const;
3308 inline void reset();
3309 template<
typename Other >
inline DenseColumn& scale(
const Other& scalar );
3316 template<
typename VT >
3317 struct VectorizedAssign {
3318 enum { value = vectorizable && VT::vectorizable &&
3319 IsSame<ElementType,typename VT::ElementType>::value };
3325 template<
typename VT >
3326 struct VectorizedAddAssign {
3327 enum { value = vectorizable && VT::vectorizable &&
3328 IsSame<ElementType,typename VT::ElementType>::value &&
3329 IntrinsicTrait<ElementType>::addition };
3335 template<
typename VT >
3336 struct VectorizedSubAssign {
3337 enum { value = vectorizable && VT::vectorizable &&
3338 IsSame<ElementType,typename VT::ElementType>::value &&
3339 IntrinsicTrait<ElementType>::subtraction };
3345 template<
typename VT >
3346 struct VectorizedMultAssign {
3347 enum { value = vectorizable && VT::vectorizable &&
3348 IsSame<ElementType,typename VT::ElementType>::value &&
3349 IntrinsicTrait<ElementType>::multiplication };
3357 template<
typename Other >
3358 inline bool canAlias(
const Other* alias )
const;
3360 template<
typename MT2,
bool SO2,
bool SF2 >
3361 inline bool canAlias(
const DenseColumn<MT2,SO2,SF2>* alias )
const;
3363 template<
typename Other >
3364 inline bool isAliased(
const Other* alias )
const;
3366 template<
typename MT2,
bool SO2,
bool SF2 >
3367 inline bool isAliased(
const DenseColumn<MT2,SO2,SF2>* alias )
const;
3378 template<
typename VT >
3379 inline typename DisableIf< VectorizedAssign<VT> >::Type
3380 assign(
const DenseVector<VT,false>& rhs );
3382 template<
typename VT >
3383 inline typename EnableIf< VectorizedAssign<VT> >::Type
3384 assign(
const DenseVector<VT,false>& rhs );
3386 template<
typename VT >
inline void assign(
const SparseVector<VT,false>& rhs );
3388 template<
typename VT >
3389 inline typename DisableIf< VectorizedAddAssign<VT> >::Type
3390 addAssign(
const DenseVector<VT,false>& rhs );
3392 template<
typename VT >
3393 inline typename EnableIf< VectorizedAddAssign<VT> >::Type
3394 addAssign(
const DenseVector<VT,false>& rhs );
3396 template<
typename VT >
inline void addAssign(
const SparseVector<VT,false>& rhs );
3398 template<
typename VT >
3399 inline typename DisableIf< VectorizedSubAssign<VT> >::Type
3400 subAssign(
const DenseVector<VT,false>& rhs );
3402 template<
typename VT >
3403 inline typename EnableIf< VectorizedSubAssign<VT> >::Type
3404 subAssign(
const DenseVector<VT,false>& rhs );
3406 template<
typename VT >
inline void subAssign(
const SparseVector<VT,false>& rhs );
3408 template<
typename VT >
3409 inline typename DisableIf< VectorizedMultAssign<VT> >::Type
3410 multAssign(
const DenseVector<VT,false>& rhs );
3412 template<
typename VT >
3413 inline typename EnableIf< VectorizedMultAssign<VT> >::Type
3414 multAssign(
const DenseVector<VT,false>& rhs );
3416 template<
typename VT >
inline void multAssign(
const SparseVector<VT,false>& rhs );
3430 template<
typename MT2,
bool SO2,
bool SF2 >
friend class DenseColumn;
3432 template<
typename MT2,
bool SO2,
bool SF2 >
3433 friend bool isSame(
const DenseColumn<MT2,SO2,SF2>& a,
const DenseColumn<MT2,SO2,SF2>& b );
3464 template<
typename MT >
3469 if(
matrix_.columns() <= index )
3470 throw std::invalid_argument(
"Invalid column access index" );
3491 template<
typename MT >
3496 return matrix_(col_,index);
3509 template<
typename MT >
3514 return matrix_(col_,index);
3528 template<
typename MT >
3531 return matrix_.data( col_ );
3545 template<
typename MT >
3548 return matrix_.data( col_ );
3562 template<
typename MT >
3565 return matrix_.begin( col_ );
3579 template<
typename MT >
3582 return matrix_.cbegin( col_ );
3596 template<
typename MT >
3599 return matrix_.cbegin( col_ );
3613 template<
typename MT >
3616 return matrix_.end( col_ );
3630 template<
typename MT >
3633 return matrix_.cend( col_ );
3647 template<
typename MT >
3650 return matrix_.cend( col_ );
3671 template<
typename MT >
3676 for(
size_t j=0UL; j<
columns; ++j )
3677 matrix_(col_,j) = rhs;
3696 template<
typename MT >
3699 if( &rhs ==
this )
return *
this;
3701 if(
size() != rhs.size() )
3702 throw std::invalid_argument(
"Column sizes do not match" );
3706 for(
size_t j=0UL; j<
columns; ++j )
3707 matrix_(col_,j) = rhs[j];
3726 template<
typename MT >
3727 template<
typename VT >
3728 inline DenseColumn<MT,false,true>&
3735 throw std::invalid_argument(
"Vector sizes do not match" );
3737 if( (~rhs).canAlias( &matrix_ ) ) {
3742 if( IsSparseVector<VT>::value )
3764 template<
typename MT >
3765 template<
typename VT >
3766 inline DenseColumn<MT,false,true>&
3767 DenseColumn<MT,false,true>::operator+=(
const Vector<VT,false>& rhs )
3773 throw std::invalid_argument(
"Vector sizes do not match" );
3775 if( (~rhs).canAlias( &matrix_ ) ) {
3800 template<
typename MT >
3801 template<
typename VT >
3802 inline DenseColumn<MT,false,true>&
3803 DenseColumn<MT,false,true>::operator-=(
const Vector<VT,false>& rhs )
3809 throw std::invalid_argument(
"Vector sizes do not match" );
3811 if( (~rhs).canAlias( &matrix_ ) ) {
3837 template<
typename MT >
3838 template<
typename VT >
3839 inline DenseColumn<MT,false,true>&
3840 DenseColumn<MT,false,true>::operator*=(
const Vector<VT,false>& rhs )
3846 throw std::invalid_argument(
"Vector sizes do not match" );
3848 if( (~rhs).canAlias( &matrix_ ) || IsSparseVector<VT>::value ) {
3870 template<
typename MT >
3871 template<
typename Other >
3872 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false,true> >::Type&
3873 DenseColumn<MT,false,true>::operator*=( Other rhs )
3875 return operator=( (*
this) * rhs );
3891 template<
typename MT >
3892 template<
typename Other >
3893 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false,true> >::Type&
3894 DenseColumn<MT,false,true>::operator/=( Other rhs )
3898 return operator=( (*
this) / rhs );
3918 template<
typename MT >
3921 return matrix_.rows();
3933 template<
typename MT >
3936 return matrix_.capacity( col_ );
3951 template<
typename MT >
3954 return matrix_.nonZeros( col_ );
3966 template<
typename MT >
3969 matrix_.reset( col_ );
3982 template<
typename MT >
3983 template<
typename Other >
3984 inline DenseColumn<MT,false,true>& DenseColumn<MT,false,true>::scale(
const Other& scalar )
3986 for(
size_t j=0UL; j<
size(); ++j ) {
3987 matrix_(col_,j) *= scalar;
4014 template<
typename MT >
4015 template<
typename Other >
4018 return matrix_.isAliased( alias );
4035 template<
typename MT >
4036 template<
typename MT2
4041 return matrix_.isAliased( alias->matrix_ ) && ( col_ == alias->col_ );
4058 template<
typename MT >
4059 template<
typename Other >
4062 return matrix_.isAliased( alias );
4079 template<
typename MT >
4080 template<
typename MT2
4085 return matrix_.isAliased( &alias->matrix_ ) && ( col_ == alias->col_ );
4101 template<
typename MT >
4104 return matrix_.isAligned();
4121 template<
typename MT >
4143 template<
typename MT >
4144 inline typename DenseColumn<MT,false,true>::IntrinsicType
4147 return matrix_.load( col_, index );
4166 template<
typename MT >
4167 inline typename DenseColumn<MT,false,true>::IntrinsicType
4170 return matrix_.loadu( col_, index );
4190 template<
typename MT >
4193 matrix_.store( col_, index, value );
4213 template<
typename MT >
4216 matrix_.storeu( col_, index, value );
4236 template<
typename MT >
4239 matrix_.stream( col_, index, value );
4257 template<
typename MT >
4258 template<
typename VT >
4259 inline typename DisableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type
4264 const size_t jend( (~rhs).
size() &
size_t(-2) );
4265 for(
size_t j=0UL; j<jend; j+=2UL ) {
4266 matrix_(col_,j ) = (~rhs)[j ];
4267 matrix_(col_,j+1UL) = (~rhs)[j+1UL];
4269 if( jend < (~rhs).size() )
4270 matrix_(col_,jend) = (~rhs)[jend];
4288 template<
typename MT >
4289 template<
typename VT >
4290 inline typename EnableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type
4302 matrix_.stream( col_, j, (~rhs).
load(j) );
4307 const size_t jend( columns &
size_t(-
IT::size*4) );
4311 for(
size_t j=0UL; j<jend; j+=
IT::size*4UL ) {
4312 matrix_.store( col_, j , it.load() ); it+=
IT::size;
4318 matrix_.store( col_, j, it.load() );
4338 template<
typename MT >
4339 template<
typename VT >
4345 matrix_(col_,element->index()) = element->value();
4363 template<
typename MT >
4364 template<
typename VT >
4365 inline typename DisableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type
4370 const size_t jend( (~rhs).
size() &
size_t(-2) );
4371 for(
size_t j=0UL; j<jend; j+=2UL ) {
4372 matrix_(col_,j ) += (~rhs)[j ];
4373 matrix_(col_,j+1UL) += (~rhs)[j+1UL];
4375 if( jend < (~rhs).size() )
4376 matrix_(col_,jend) += (~rhs)[jend];
4394 template<
typename MT >
4395 template<
typename VT >
4396 inline typename EnableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type
4405 const size_t jend( columns &
size_t(-
IT::size*4) );
4409 for(
size_t j=0UL; j<jend; j+=
IT::size*4UL ) {
4410 matrix_.store( col_, j , matrix_.load(col_,j ) + it.load() ); it +=
IT::size;
4416 matrix_.store( col_, j, matrix_.load(col_,j) + it.load() );
4435 template<
typename MT >
4436 template<
typename VT >
4442 matrix_(col_,element->index()) += element->value();
4460 template<
typename MT >
4461 template<
typename VT >
4462 inline typename DisableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type
4467 const size_t jend( (~rhs).
size() &
size_t(-2) );
4468 for(
size_t j=0UL; j<jend; j+=2UL ) {
4469 matrix_(col_,j ) -= (~rhs)[j ];
4470 matrix_(col_,j+1UL) -= (~rhs)[j+1UL];
4472 if( jend < (~rhs).size() )
4473 matrix_(col_,jend) -= (~rhs)[jend];
4491 template<
typename MT >
4492 template<
typename VT >
4493 inline typename EnableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type
4502 const size_t jend( columns &
size_t(-
IT::size*4) );
4506 for(
size_t j=0UL; j<jend; j+=
IT::size*4UL ) {
4507 matrix_.store( col_, j , matrix_.load(col_,j ) - it.load() ); it +=
IT::size;
4513 matrix_.store( col_, j, matrix_.load(col_,j) - it.load() );
4532 template<
typename MT >
4533 template<
typename VT >
4539 matrix_(col_,element->index()) -= element->value();
4557 template<
typename MT >
4558 template<
typename VT >
4559 inline typename DisableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type
4564 const size_t jend( (~rhs).
size() &
size_t(-2) );
4565 for(
size_t j=0UL; j<jend; j+=2UL ) {
4566 matrix_(col_,j ) *= (~rhs)[j ];
4567 matrix_(col_,j+1UL) *= (~rhs)[j+1UL];
4569 if( jend < (~rhs).size() )
4570 matrix_(col_,jend) *= (~rhs)[jend];
4588 template<
typename MT >
4589 template<
typename VT >
4590 inline typename EnableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type
4599 const size_t jend( columns &
size_t(-
IT::size*4) );
4603 for(
size_t j=0UL; j<jend; j+=
IT::size*4UL ) {
4604 matrix_.store( col_, j , matrix_.load(col_,j ) * it.load() ); it +=
IT::size;
4610 matrix_.store( col_, j, matrix_.load(col_,j) * it.load() );
4629 template<
typename MT >
4630 template<
typename VT >
4640 matrix_(col_,element->index()) = tmp[element->index()] * element->value();
4661 template<
typename MT,
bool SO,
bool SF >
4662 inline void reset( DenseColumn<MT,SO,SF>&
column );
4664 template<
typename MT,
bool SO,
bool SF >
4665 inline void clear( DenseColumn<MT,SO,SF>&
column );
4667 template<
typename MT,
bool SO,
bool SF >
4670 template<
typename MT,
bool SO,
bool SF >
4671 inline bool isSame(
const DenseColumn<MT,SO,SF>& a,
const DenseColumn<MT,SO,SF>& b );
4683 template<
typename MT
4702 template<
typename MT
4730 template<
typename MT
4735 for(
size_t i=0UL; i<column.size(); ++i )
4736 if( !
isDefault( column[i] ) )
return false;
4754 template<
typename MT
4759 return (
isSame( a.matrix_, b.matrix_ ) && ( a.col_ == b.col_ ) );
4774 template<
typename MT,
bool SO >
4775 struct SubvectorTrait< DenseColumn<MT,SO> >
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:879
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:4838
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:258
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:115
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a column dense or sparse vector type...
Definition: TransposeFlag.h:159
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
IntrinsicTrait< typename MT::ElementType > IT
Intrinsic trait for the column element type.
Definition: DenseColumn.h:325
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i...
Definition: Computation.h:118
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:79
Pointer data()
Low-level data access to the column elements.
Definition: DenseColumn.h:661
BLAZE_ALWAYS_INLINE bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b)
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:946
Header file for the IsSame and IsStrictlySame type traits.
DenseColumn(MT &matrix, size_t index)
The constructor for DenseColumn.
Definition: DenseColumn.h:598
const bool useStreaming
Configuration of the streaming behavior.For large vectors and matrices non-temporal stores can provid...
Definition: Streaming.h:50
Header file for the IsColumnMajorMatrix type trait.
Iterator begin()
Returns an iterator to the first element of the column.
Definition: DenseColumn.h:695
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:316
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T >, Load< T, sizeof(T)> >::Type::Type load(const T *address)
Loads a vector of integral values.
Definition: Load.h:224
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename ColumnExprTrait< MT >::Type >::Type column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:103
bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:366
Header file for the DenseVector base class.
bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:442
bool canSMPAssign() const
Returns whether the dense column can be used in SMP assignments.
Definition: DenseColumn.h:1250
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:695
#define BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a symmetric matrix type...
Definition: Symmetric.h:78
void store(size_t index, const IntrinsicType &value)
Aligned store of an intrinsic element of the dense column.
Definition: DenseColumn.h:1317
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a transposition expression (i...
Definition: TransExpr.h:118
SelectType< useConst, ConstPointer, ElementType * >::Type Pointer
Pointer to a non-constant row value.
Definition: DenseColumn.h:359
Header file for the column base class.
MT::ConstReference ConstReference
Reference to a constant column value.
Definition: DenseColumn.h:350
Constraint on the data type.
const ElementType * ConstPointer
Pointer to a constant row value.
Definition: DenseColumn.h:356
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the DisableIf class template.
Header file for the IsSymmetric type trait.
Header file for the clear shim.
Header file for nested template disabiguation.
IT::Type IntrinsicType
Intrinsic type of the column elements.
Definition: DenseColumn.h:345
Header file for the IsFloatingPoint type trait.
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: StorageOrder.h:161
MT::ConstIterator ConstIterator
Iterator over constant elements.
Definition: DenseColumn.h:362
const DenseColumn & CompositeType
Data type for composite expression templates.
Definition: DenseColumn.h:347
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
Header file for the Or class template.
size_t capacity() const
Returns the maximum capacity of the dense column.
Definition: DenseColumn.h:1062
Reference to a specific column of a dense matrix.The DenseColumn template represents a reference to a...
Definition: DenseColumn.h:316
bool isAligned() const
Returns whether the dense column is properly aligned in memory.
Definition: DenseColumn.h:1230
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
Base class for all columns.The Column class serves as a tag for all columns (i.e. dense and sparse co...
Definition: Column.h:64
BLAZE_ALWAYS_INLINE void clear(const NonNumericProxy< MT > &proxy)
Clearing the represented element.
Definition: NonNumericProxy.h:854
Header file for the subvector trait.
SelectType< useConst, ConstIterator, typename MT::Iterator >::Type Iterator
Iterator over non-constant elements.
Definition: DenseColumn.h:365
const DenseIterator< Type > operator+(const DenseIterator< Type > &it, ptrdiff_t inc)
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:556
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Compile time check for sparse vector types.This type trait tests whether or not the given template pa...
Definition: IsSparseVector.h:103
void stream(size_t index, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the dense column.
Definition: DenseColumn.h:1363
Constraint on the data type.
Constraint on the data type.
DenseColumn & operator=(const ElementType &rhs)
Homogenous assignment to all column elements.
Definition: DenseColumn.h:804
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a vectorizable data type...
Definition: Vectorizable.h:79
Reference operator[](size_t index)
Subscript operator for the direct access to the column elements.
Definition: DenseColumn.h:625
Constraints on the storage order of matrix types.
Operand matrix_
The dense matrix containing the column.
Definition: DenseColumn.h:554
Constraint on the data type.
DenseColumn< MT, SO, SF > This
Type of this DenseColumn instance.
Definition: DenseColumn.h:341
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:195
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
Constraint on the data type.
ConstIterator cbegin() const
Returns an iterator to the first element of the column.
Definition: DenseColumn.h:729
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2480
System settings for streaming (non-temporal stores)
Header file for the EnableIf class template.
bool canAlias(const Other *alias) const
Returns whether the dense column can alias with the given address alias.
Definition: DenseColumn.h:1144
IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the dense column.
Definition: DenseColumn.h:1294
Header file for the IsNumeric type trait.
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename RowExprTrait< MT >::Type >::Type row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:103
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
size_t nonZeros() const
Returns the number of non-zero elements in the column.
Definition: DenseColumn.h:1080
Header file for the IsSparseVector type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:116
void storeu(size_t index, const IntrinsicType &value)
Unaligned store of an intrinsic element of the dense column.
Definition: DenseColumn.h:1340
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: StorageOrder.h:81
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2477
Header file for the IsConst type trait.
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:749
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
SelectType< IsExpression< MT >::value, MT, MT & >::Type Operand
Composite data type of the dense matrix expression.
Definition: DenseColumn.h:322
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DenseColumn.h:343
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
Header file for the division trait.
Iterator end()
Returns an iterator just past the last element of the column.
Definition: DenseColumn.h:746
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Header file for the cache size of the target architecture.
void reset()
Reset to the default initial values.
Definition: DenseColumn.h:1095
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2481
Header file for the column trait.
Header file for the isDefault shim.
BLAZE_ALWAYS_INLINE bool isDefault(const NonNumericProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: NonNumericProxy.h:874
Constraint on the data type.
BLAZE_ALWAYS_INLINE void reset(const NonNumericProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: NonNumericProxy.h:833
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
Header file for the RemoveReference type trait.
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
Compile time check for constant data types.The IsConst type trait tests whether or not the given temp...
Definition: IsConst.h:94
Header file for all intrinsic functionality.
bool isAliased(const Other *alias) const
Returns whether the dense column is aliased with the given address alias.
Definition: DenseColumn.h:1188
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:79
const size_t col_
The index of the column in the matrix.
Definition: DenseColumn.h:555
Header file for the IsRowMajorMatrix type trait.
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:151
CompressedMatrix< Type,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:256
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
size_t size() const
Returns the current size/dimension of the column.
Definition: DenseColumn.h:1047
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
MT::ElementType ElementType
Type of the column elements.
Definition: DenseColumn.h:344
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:332
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
Header file for basic type definitions.
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DenseColumn.h:346
IntrinsicType load(size_t index) const
Aligned load of an intrinsic element of the dense column.
Definition: DenseColumn.h:1272
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2479
const size_t SMP_DVECASSIGN_THRESHOLD
SMP dense vector assignment threshold.This threshold specifies when an assignment of a simple dense v...
Definition: Thresholds.h:207
ColumnTrait< MT >::Type ResultType
Result type for expression template evaluations.
Definition: DenseColumn.h:342
const size_t cacheSize
Cache size of the target architecture.This setting specifies the available cache size in Byte of the ...
Definition: CacheSize.h:48
SelectType< useConst, ConstReference, typename MT::Reference >::Type Reference
Reference to a non-constant column value.
Definition: DenseColumn.h:353
ConstIterator cend() const
Returns an iterator just past the last element of the column.
Definition: DenseColumn.h:780
EnableIf< IsDenseVector< VT1 > >::Type smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:189
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849
Header file for a safe C++ NULL pointer implementation.