35 #ifndef _BLAZE_MATH_VIEWS_DENSECOLUMN_H_
36 #define _BLAZE_MATH_VIEWS_DENSECOLUMN_H_
335 template<
typename MT
336 ,
bool SO = IsColumnMajorMatrix<MT>::value
337 ,
bool SF = IsSymmetric<MT>::value >
392 enum { vectorizable = MT::vectorizable };
395 enum { smpAssignable = MT::smpAssignable };
401 explicit inline DenseColumn( MT& matrix,
size_t index );
414 inline ConstReference
operator[](
size_t index )
const;
415 inline Pointer
data ();
416 inline ConstPointer
data ()
const;
417 inline Iterator
begin ();
418 inline ConstIterator
begin ()
const;
419 inline ConstIterator
cbegin()
const;
420 inline Iterator
end ();
421 inline ConstIterator
end ()
const;
422 inline ConstIterator
cend ()
const;
433 template<
typename VT >
inline DenseColumn& operator+=(
const Vector<VT,false>& rhs );
434 template<
typename VT >
inline DenseColumn& operator-=(
const Vector<VT,false>& rhs );
435 template<
typename VT >
inline DenseColumn& operator*=(
const Vector<VT,false>& rhs );
437 template<
typename Other >
438 inline typename EnableIf< IsNumeric<Other>,
DenseColumn >::Type&
439 operator*=( Other rhs );
441 template<
typename Other >
442 inline typename EnableIf< IsNumeric<Other>,
DenseColumn >::Type&
443 operator/=( Other rhs );
450 inline size_t size()
const;
454 template<
typename Other >
inline DenseColumn& scale(
const Other& scalar );
461 template<
typename VT >
463 struct VectorizedAssign {
464 enum { value = vectorizable && VT::vectorizable &&
465 IsSame<ElementType,typename VT::ElementType>::value };
472 template<
typename VT >
474 struct VectorizedAddAssign {
475 enum { value = vectorizable && VT::vectorizable &&
476 IsSame<ElementType,typename VT::ElementType>::value &&
477 IntrinsicTrait<ElementType>::addition };
484 template<
typename VT >
486 struct VectorizedSubAssign {
487 enum { value = vectorizable && VT::vectorizable &&
488 IsSame<ElementType,typename VT::ElementType>::value &&
489 IntrinsicTrait<ElementType>::subtraction };
496 template<
typename VT >
498 struct VectorizedMultAssign {
499 enum { value = vectorizable && VT::vectorizable &&
500 IsSame<ElementType,typename VT::ElementType>::value &&
501 IntrinsicTrait<ElementType>::multiplication };
510 template<
typename Other >
511 inline bool canAlias(
const Other* alias )
const;
513 template<
typename MT2,
bool SO2,
bool SF2 >
514 inline bool canAlias(
const DenseColumn<MT2,SO2,SF2>* alias )
const;
516 template<
typename Other >
517 inline bool isAliased(
const Other* alias )
const;
519 template<
typename MT2,
bool SO2,
bool SF2 >
520 inline bool isAliased(
const DenseColumn<MT2,SO2,SF2>* alias )
const;
532 template<
typename VT >
533 inline typename DisableIf< VectorizedAssign<VT> >::Type
534 assign(
const DenseVector<VT,false>& rhs );
536 template<
typename VT >
537 inline typename EnableIf< VectorizedAssign<VT> >::Type
538 assign(
const DenseVector<VT,false>& rhs );
540 template<
typename VT >
inline void assign(
const SparseVector<VT,false>& rhs );
542 template<
typename VT >
543 inline typename DisableIf< VectorizedAddAssign<VT> >::Type
544 addAssign(
const DenseVector<VT,false>& rhs );
546 template<
typename VT >
547 inline typename EnableIf< VectorizedAddAssign<VT> >::Type
548 addAssign(
const DenseVector<VT,false>& rhs );
550 template<
typename VT >
inline void addAssign(
const SparseVector<VT,false>& rhs );
552 template<
typename VT >
553 inline typename DisableIf< VectorizedSubAssign<VT> >::Type
554 subAssign(
const DenseVector<VT,false>& rhs );
556 template<
typename VT >
557 inline typename EnableIf< VectorizedSubAssign<VT> >::Type
558 subAssign(
const DenseVector<VT,false>& rhs );
560 template<
typename VT >
inline void subAssign(
const SparseVector<VT,false>& rhs );
562 template<
typename VT >
563 inline typename DisableIf< VectorizedMultAssign<VT> >::Type
564 multAssign(
const DenseVector<VT,false>& rhs );
566 template<
typename VT >
567 inline typename EnableIf< VectorizedMultAssign<VT> >::Type
568 multAssign(
const DenseVector<VT,false>& rhs );
570 template<
typename VT >
inline void multAssign(
const SparseVector<VT,false>& rhs );
578 template<
typename MT2,
bool SO2,
typename VT >
579 inline typename EnableIf< Not< IsRestricted<MT2> >,
bool >::Type
580 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const Vector<VT,false>& rhs );
582 template<
typename MT2,
bool SO2,
typename VT >
583 inline typename EnableIf< And< IsLower<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
584 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const DenseVector<VT,false>& rhs );
586 template<
typename MT2,
bool SO2,
typename VT >
587 inline typename EnableIf< And< IsLower<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
588 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const SparseVector<VT,false>& rhs );
590 template<
typename MT2,
bool SO2,
typename VT >
591 inline typename EnableIf< And< IsUpper<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
592 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const DenseVector<VT,false>& rhs );
594 template<
typename MT2,
bool SO2,
typename VT >
595 inline typename EnableIf< And< IsUpper<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
596 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const SparseVector<VT,false>& rhs );
598 template<
typename MT2,
bool SO2,
typename VT >
599 inline typename EnableIf< IsDiagonal<MT2>,
bool >::Type
600 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const DenseVector<VT,false>& rhs );
602 template<
typename MT2,
bool SO2,
typename VT >
603 inline typename EnableIf< IsDiagonal<MT2>,
bool >::Type
604 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const SparseVector<VT,false>& rhs );
618 template<
typename MT2,
bool SO2,
bool SF2 >
friend class DenseColumn;
620 template<
typename MT2,
bool SO2,
bool SF2 >
623 template<
typename MT2,
bool SO2,
bool SF2 >
659 template<
typename MT
666 if(
matrix_.columns() <= index )
667 throw std::invalid_argument(
"Invalid column access index" );
686 template<
typename MT
692 return matrix_(index,col_);
703 template<
typename MT
710 return matrix_(index,col_);
722 template<
typename MT
727 return matrix_.data( col_ );
739 template<
typename MT
744 return matrix_.data( col_ );
756 template<
typename MT
761 return matrix_.begin( col_ );
773 template<
typename MT
778 return matrix_.cbegin( col_ );
790 template<
typename MT
795 return matrix_.cbegin( col_ );
807 template<
typename MT
812 return matrix_.end( col_ );
824 template<
typename MT
829 return matrix_.cend( col_ );
841 template<
typename MT
846 return matrix_.cend( col_ );
869 template<
typename MT
885 for(
size_t i=ibegin; i<iend; ++i )
886 matrix_(i,col_) = rhs;
906 template<
typename MT
911 if( &rhs ==
this )
return *
this;
914 throw std::invalid_argument(
"Column sizes do not match" );
916 if( !preservesInvariant( matrix_, rhs ) )
917 throw std::invalid_argument(
"Invalid assignment to restricted matrix" );
944 template<
typename MT
947 template<
typename VT >
954 throw std::invalid_argument(
"Vector sizes do not match" );
959 if( !preservesInvariant( matrix_, right ) )
960 throw std::invalid_argument(
"Invalid assignment to restricted matrix" );
996 template<
typename MT
999 template<
typename VT >
1006 throw std::invalid_argument(
"Vector sizes do not match" );
1009 Right right( ~rhs );
1011 if( !preservesInvariant( matrix_, right ) )
1012 throw std::invalid_argument(
"Invalid assignment to restricted matrix" );
1045 template<
typename MT
1048 template<
typename VT >
1055 throw std::invalid_argument(
"Vector sizes do not match" );
1058 Right right( ~rhs );
1060 if( !preservesInvariant( matrix_, right ) )
1061 throw std::invalid_argument(
"Invalid assignment to restricted matrix" );
1092 template<
typename MT
1095 template<
typename VT >
1102 throw std::invalid_argument(
"Vector sizes do not match" );
1132 template<
typename MT
1135 template<
typename Other >
1141 return operator=( (*
this) * rhs );
1158 template<
typename MT
1161 template<
typename Other >
1169 return operator=( (*
this) / rhs );
1187 template<
typename MT
1192 return matrix_.rows();
1202 template<
typename MT
1207 return matrix_.capacity( col_ );
1220 template<
typename MT
1225 return matrix_.nonZeros( col_ );
1235 template<
typename MT
1240 matrix_.reset( col_ );
1255 template<
typename MT
1258 template<
typename Other >
1274 for(
size_t i=ibegin; i<iend; ++i ) {
1275 matrix_(i,col_) *= scalar;
1294 template<
typename MT
1297 template<
typename MT2
1321 template<
typename MT
1324 template<
typename MT2
1336 for(
size_t i=0UL; i<iend; ++i ) {
1360 template<
typename MT
1363 template<
typename MT2
1366 inline typename EnableIf< And< IsLower<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
1380 for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
1401 template<
typename MT
1404 template<
typename MT2
1419 for(
size_t i=ibegin; i<
size(); ++i ) {
1440 template<
typename MT
1443 template<
typename MT2
1446 inline typename EnableIf< And< IsUpper<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
1456 const RhsIterator last( (~rhs).
end() );
1457 RhsIterator element( (~rhs).lowerBound( ( checkDiagonal )?( col_ ):( col_+1UL ) ) );
1460 if( element == last || element->index() != col_ || !
isOne( element->value() ) )
1465 for( ; element!=last; ++element ) {
1486 template<
typename MT
1489 template<
typename MT2
1499 for(
size_t i=0UL; i<col_; ++i ) {
1504 for(
size_t i=col_+1UL; i<
size(); ++i ) {
1525 template<
typename MT
1528 template<
typename MT2
1531 inline typename EnableIf< IsDiagonal<MT2>,
bool >::Type
1540 for( RhsIterator element=(~rhs).
begin(); element!=(~rhs).
end(); ++element ) {
1541 if( element->index() != col_ && !
isDefault( element->value() ) )
1568 template<
typename MT
1571 template<
typename Other >
1574 return matrix_.isAliased( alias );
1589 template<
typename MT
1592 template<
typename MT2
1597 return matrix_.isAliased( alias->
matrix_ ) && ( col_ == alias->
col_ );
1612 template<
typename MT
1615 template<
typename Other >
1618 return matrix_.isAliased( alias );
1633 template<
typename MT
1636 template<
typename MT2
1641 return matrix_.isAliased( &alias->
matrix_ ) && ( col_ == alias->
col_ );
1655 template<
typename MT
1660 return matrix_.isAligned();
1675 template<
typename MT
1697 template<
typename MT
1703 return matrix_.load( index, col_ );
1720 template<
typename MT
1726 return matrix_.loadu( index, col_ );
1744 template<
typename MT
1749 matrix_.store( index, col_, value );
1767 template<
typename MT
1772 matrix_.storeu( index, col_, value );
1790 template<
typename MT
1795 matrix_.stream( index, col_, value );
1811 template<
typename MT
1814 template<
typename VT >
1822 const size_t ipos( (~rhs).
size() &
size_t(-2) );
1823 for(
size_t i=0UL; i<ipos; i+=2UL ) {
1824 matrix_(i ,col_) = (~rhs)[i ];
1825 matrix_(i+1UL,col_) = (~rhs)[i+1UL];
1827 if( ipos < (~rhs).size() )
1828 matrix_(ipos,col_) = (~rhs)[ipos];
1844 template<
typename MT
1847 template<
typename VT >
1861 matrix_.stream( i, col_, (~rhs).
load(i) );
1866 const size_t ipos( rows &
size_t(-
IT::size*4) );
1870 for(
size_t i=0UL; i<ipos; i+=
IT::size*4UL ) {
1871 matrix_.store( i , col_, it.load() ); it+=
IT::size;
1877 matrix_.store( i, col_, it.load() );
1895 template<
typename MT
1898 template<
typename VT >
1906 matrix_(element->index(),col_) = element->value();
1922 template<
typename MT
1925 template<
typename VT >
1933 const size_t ipos( (~rhs).
size() &
size_t(-2) );
1934 for(
size_t i=0UL; i<ipos; i+=2UL ) {
1935 matrix_(i ,col_) += (~rhs)[i ];
1936 matrix_(i+1UL,col_) += (~rhs)[i+1UL];
1938 if( ipos < (~rhs).size() )
1939 matrix_(ipos,col_) += (~rhs)[ipos];
1955 template<
typename MT
1958 template<
typename VT >
1969 const size_t ipos( rows &
size_t(-
IT::size*4) );
1973 for(
size_t i=0UL; i<ipos; i+=
IT::size*4UL ) {
1974 matrix_.store( i , col_, matrix_.load(i ,col_) + it.load() ); it +=
IT::size;
1980 matrix_.store( i, col_, matrix_.load(i,col_) + it.load() );
1997 template<
typename MT
2000 template<
typename VT >
2008 matrix_(element->index(),col_) += element->value();
2024 template<
typename MT
2027 template<
typename VT >
2035 const size_t ipos( (~rhs).
size() &
size_t(-2) );
2036 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2037 matrix_(i ,col_) -= (~rhs)[i ];
2038 matrix_(i+1UL,col_) -= (~rhs)[i+1UL];
2040 if( ipos < (~rhs).size() )
2041 matrix_(ipos,col_) -= (~rhs)[ipos];
2057 template<
typename MT
2060 template<
typename VT >
2071 const size_t ipos( rows &
size_t(-
IT::size*4) );
2075 for(
size_t i=0UL; i<ipos; i+=
IT::size*4UL ) {
2076 matrix_.store( i , col_, matrix_.load(i ,col_) - it.load() ); it +=
IT::size;
2082 matrix_.store( i, col_, matrix_.load(i,col_) - it.load() );
2099 template<
typename MT
2102 template<
typename VT >
2110 matrix_(element->index(),col_) -= element->value();
2126 template<
typename MT
2129 template<
typename VT >
2137 const size_t ipos( (~rhs).
size() &
size_t(-2) );
2138 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2139 matrix_(i ,col_) *= (~rhs)[i ];
2140 matrix_(i+1UL,col_) *= (~rhs)[i+1UL];
2142 if( ipos < (~rhs).size() )
2143 matrix_(ipos,col_) *= (~rhs)[ipos];
2159 template<
typename MT
2162 template<
typename VT >
2173 const size_t ipos( rows &
size_t(-
IT::size*4) );
2177 for(
size_t i=0UL; i<ipos; i+=
IT::size*4UL ) {
2178 matrix_.store( i , col_, matrix_.load(i ,col_) * it.load() ); it +=
IT::size;
2184 matrix_.store( i, col_, matrix_.load(i,col_) * it.load() );
2201 template<
typename MT
2204 template<
typename VT >
2216 matrix_(element->index(),col_) = tmp[element->index()] * element->value();
2241 template<
typename MT >
2264 typedef DenseColumn<MT,false,false>
This;
2265 typedef typename ColumnTrait<MT>::Type
ResultType;
2275 typedef typename IfTrue< useConst, ConstReference, typename MT::Reference >::Type
Reference;
2281 template<
typename MatrixType >
2282 class ColumnIterator
2292 enum { returnConst = IsConst<MatrixType>::value };
2298 typedef typename IfTrue< returnConst
2302 typedef std::random_access_iterator_tag IteratorCategory;
2303 typedef RemoveReference<Reference> ValueType;
2304 typedef ValueType* PointerType;
2305 typedef Reference ReferenceType;
2306 typedef ptrdiff_t DifferenceType;
2309 typedef IteratorCategory iterator_category;
2310 typedef ValueType value_type;
2311 typedef PointerType pointer;
2312 typedef ReferenceType reference;
2313 typedef DifferenceType difference_type;
2319 inline ColumnIterator()
2333 inline ColumnIterator( MatrixType& matrix,
size_t row,
size_t column )
2345 template<
typename MatrixType2 >
2346 inline ColumnIterator(
const ColumnIterator<MatrixType2>& it )
2349 , column_( it.column_ )
2359 inline ColumnIterator& operator+=(
size_t inc ) {
2371 inline ColumnIterator& operator-=(
size_t dec ) {
2382 inline ColumnIterator& operator++() {
2393 inline const ColumnIterator operator++(
int ) {
2394 const ColumnIterator tmp( *
this );
2405 inline ColumnIterator& operator--() {
2416 inline const ColumnIterator operator--(
int ) {
2417 const ColumnIterator tmp( *
this );
2429 inline ReferenceType
operator[](
size_t index )
const {
2430 return (*
matrix_)(row_+index,column_);
2439 inline ReferenceType
operator*()
const {
2440 return (*
matrix_)(row_,column_);
2449 inline PointerType operator->()
const {
2450 return &(*matrix_)(row_,column_);
2460 template<
typename MatrixType2 >
2461 inline bool operator==(
const ColumnIterator<MatrixType2>& rhs )
const {
2462 return (
matrix_ == rhs.matrix_ ) && ( row_ == rhs.row_ ) && ( column_ == rhs.column_ );
2472 template<
typename MatrixType2 >
2473 inline bool operator!=(
const ColumnIterator<MatrixType2>& rhs )
const {
2474 return !( *
this == rhs );
2484 template<
typename MatrixType2 >
2485 inline bool operator<( const ColumnIterator<MatrixType2>& rhs )
const {
2486 return (
matrix_ == rhs.matrix_ ) && ( row_ < rhs.row_ ) && ( column_ == rhs.column_ );
2496 template<
typename MatrixType2 >
2497 inline bool operator>(
const ColumnIterator<MatrixType2>& rhs )
const {
2498 return (
matrix_ == rhs.matrix_ ) && ( row_ > rhs.row_ ) && ( column_ == rhs.column_ );
2508 template<
typename MatrixType2 >
2509 inline bool operator<=( const ColumnIterator<MatrixType2>& rhs )
const {
2510 return (
matrix_ == rhs.matrix_ ) && ( row_ <= rhs.row_ ) && ( column_ == rhs.column_ );
2520 template<
typename MatrixType2 >
2521 inline bool operator>=(
const ColumnIterator<MatrixType2>& rhs )
const {
2522 return (
matrix_ == rhs.matrix_ ) && ( row_ >= rhs.row_ ) && ( column_ == rhs.column_ );
2532 inline DifferenceType
operator-(
const ColumnIterator& rhs )
const {
2533 return row_ - rhs.row_;
2544 friend inline const ColumnIterator
operator+(
const ColumnIterator& it,
size_t inc ) {
2545 return ColumnIterator( *it.matrix_, it.row_+inc, it.column_ );
2556 friend inline const ColumnIterator
operator+(
size_t inc,
const ColumnIterator& it ) {
2557 return ColumnIterator( *it.matrix_, it.row_+inc, it.column_ );
2568 friend inline const ColumnIterator
operator-(
const ColumnIterator& it,
size_t dec ) {
2569 return ColumnIterator( *it.matrix_, it.row_-dec, it.column_ );
2581 template<
typename MatrixType2 >
friend class ColumnIterator;
2591 typedef typename IfTrue< useConst, ConstIterator, ColumnIterator<MT> >::Type
Iterator;
2596 enum { vectorizable = 0 };
2599 enum { smpAssignable = MT::smpAssignable };
2605 explicit inline DenseColumn( MT& matrix,
size_t index );
2618 inline ConstReference
operator[](
size_t index )
const;
2619 inline Iterator
begin ();
2620 inline ConstIterator
begin ()
const;
2621 inline ConstIterator
cbegin()
const;
2622 inline Iterator
end ();
2623 inline ConstIterator
end ()
const;
2624 inline ConstIterator
cend ()
const;
2635 template<
typename VT >
inline DenseColumn& operator+=(
const Vector<VT,false>& rhs );
2636 template<
typename VT >
inline DenseColumn& operator-=(
const Vector<VT,false>& rhs );
2637 template<
typename VT >
inline DenseColumn& operator*=(
const Vector<VT,false>& rhs );
2639 template<
typename Other >
2640 inline typename EnableIf< IsNumeric<Other>,
DenseColumn >::Type&
2641 operator*=( Other rhs );
2643 template<
typename Other >
2644 inline typename EnableIf< IsNumeric<Other>,
DenseColumn >::Type&
2645 operator/=( Other rhs );
2652 inline size_t size()
const;
2655 inline void reset();
2656 template<
typename Other >
inline DenseColumn& scale(
const Other& scalar );
2664 template<
typename Other >
2665 inline bool canAlias (
const Other* alias )
const;
2667 template<
typename MT2,
bool SO2,
bool SF2 >
2668 inline bool canAlias (
const DenseColumn<MT2,SO2,SF2>* alias )
const;
2670 template<
typename Other >
2671 inline bool isAliased(
const Other* alias )
const;
2673 template<
typename MT2,
bool SO2,
bool SF2 >
2674 inline bool isAliased(
const DenseColumn<MT2,SO2,SF2>* alias )
const;
2679 template<
typename VT >
inline void assign (
const DenseVector <VT,false>& rhs );
2680 template<
typename VT >
inline void assign (
const SparseVector<VT,false>& rhs );
2681 template<
typename VT >
inline void addAssign (
const DenseVector <VT,false>& rhs );
2682 template<
typename VT >
inline void addAssign (
const SparseVector<VT,false>& rhs );
2683 template<
typename VT >
inline void subAssign (
const DenseVector <VT,false>& rhs );
2684 template<
typename VT >
inline void subAssign (
const SparseVector<VT,false>& rhs );
2685 template<
typename VT >
inline void multAssign(
const DenseVector <VT,false>& rhs );
2686 template<
typename VT >
inline void multAssign(
const SparseVector<VT,false>& rhs );
2694 template<
typename MT2,
bool SO2,
typename VT >
2695 inline typename EnableIf< Not< IsRestricted<MT2> >,
bool >::Type
2696 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const Vector<VT,false>& rhs );
2698 template<
typename MT2,
bool SO2,
typename VT >
2699 inline typename EnableIf< And< IsLower<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
2700 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const DenseVector<VT,false>& rhs );
2702 template<
typename MT2,
bool SO2,
typename VT >
2703 inline typename EnableIf< And< IsLower<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
2704 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const SparseVector<VT,false>& rhs );
2706 template<
typename MT2,
bool SO2,
typename VT >
2707 inline typename EnableIf< And< IsUpper<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
2708 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const DenseVector<VT,false>& rhs );
2710 template<
typename MT2,
bool SO2,
typename VT >
2711 inline typename EnableIf< And< IsUpper<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
2712 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const SparseVector<VT,false>& rhs );
2714 template<
typename MT2,
bool SO2,
typename VT >
2715 inline typename EnableIf< IsDiagonal<MT2>,
bool >::Type
2716 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const DenseVector<VT,false>& rhs );
2718 template<
typename MT2,
bool SO2,
typename VT >
2719 inline typename EnableIf< IsDiagonal<MT2>,
bool >::Type
2720 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const SparseVector<VT,false>& rhs );
2733 template<
typename MT2,
bool SO2,
bool SF2 >
friend class DenseColumn;
2735 template<
typename MT2,
bool SO2,
bool SF2 >
2736 friend bool isSame(
const DenseColumn<MT2,SO2,SF2>& a,
const DenseColumn<MT2,SO2,SF2>& b );
2738 template<
typename MT2,
bool SO2,
bool SF2 >
2739 friend typename DerestrictTrait< DenseColumn<MT2,SO2,SF2> >::Type
2740 derestrict( DenseColumn<MT2,SO2,SF2>& dm );
2751 BLAZE_STATIC_ASSERT( !IsRestricted<MT>::value || IsLower<MT>::value || IsUpper<MT>::value );
2774 template<
typename MT >
2779 if(
matrix_.columns() <= index )
2780 throw std::invalid_argument(
"Invalid column access index" );
2801 template<
typename MT >
2806 return matrix_(index,col_);
2819 template<
typename MT >
2824 return matrix_(index,col_);
2838 template<
typename MT >
2841 return Iterator( matrix_, 0UL, col_ );
2855 template<
typename MT >
2873 template<
typename MT >
2891 template<
typename MT >
2908 template<
typename MT >
2926 template<
typename MT >
2955 template<
typename MT >
2956 inline DenseColumn<MT,false,false>&
2959 const size_t ibegin( ( IsLower<MT>::value )
2960 ?( ( IsUniLower<MT>::value || IsStrictlyLower<MT>::value )
2964 const size_t iend ( ( IsUpper<MT>::value )
2965 ?( ( IsUniUpper<MT>::value || IsStrictlyUpper<MT>::value )
2970 for(
size_t i=ibegin; i<iend; ++i )
2971 matrix_(i,col_) = rhs;
2993 template<
typename MT >
2994 inline DenseColumn<MT,false,false>&
2997 if( &rhs ==
this )
return *
this;
2999 if(
size() != rhs.size() )
3000 throw std::invalid_argument(
"Column sizes do not match" );
3002 if( !preservesInvariant( matrix_, rhs ) )
3003 throw std::invalid_argument(
"Invalid assignment to restricted matrix" );
3005 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3032 template<
typename MT >
3033 template<
typename VT >
3034 inline DenseColumn<MT,false,false>&
3042 throw std::invalid_argument(
"Vector sizes do not match" );
3044 typedef typename If< IsRestricted<MT>,
typename VT::CompositeType,
const VT& >::Type Right;
3045 Right right( ~rhs );
3047 if( !preservesInvariant( matrix_, right ) )
3048 throw std::invalid_argument(
"Invalid assignment to restricted matrix" );
3050 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3052 if( IsReference<Right>::value && right.canAlias( &matrix_ ) ) {
3053 const ResultType tmp( right );
3057 if( IsSparseVector<VT>::value )
3085 template<
typename MT >
3086 template<
typename VT >
3087 inline DenseColumn<MT,false,false>&
3088 DenseColumn<MT,false,false>::operator+=(
const Vector<VT,false>& rhs )
3094 throw std::invalid_argument(
"Vector sizes do not match" );
3096 typedef typename If< IsRestricted<MT>,
typename VT::CompositeType,
const VT& >::Type Right;
3097 Right right( ~rhs );
3099 if( !preservesInvariant( matrix_, right ) )
3100 throw std::invalid_argument(
"Invalid assignment to restricted matrix" );
3102 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3104 if( IsReference<Right>::value && right.canAlias( &matrix_ ) ) {
3135 template<
typename MT >
3136 template<
typename VT >
3137 inline DenseColumn<MT,false,false>&
3138 DenseColumn<MT,false,false>::operator-=(
const Vector<VT,false>& rhs )
3144 throw std::invalid_argument(
"Vector sizes do not match" );
3146 typedef typename If< IsRestricted<MT>,
typename VT::CompositeType,
const VT& >::Type Right;
3147 Right right( ~rhs );
3149 if( !preservesInvariant( matrix_, right ) )
3150 throw std::invalid_argument(
"Invalid assignment to restricted matrix" );
3152 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3154 if( IsReference<Right>::value && right.canAlias( &matrix_ ) ) {
3183 template<
typename MT >
3184 template<
typename VT >
3185 inline DenseColumn<MT,false,false>&
3186 DenseColumn<MT,false,false>::operator*=(
const Vector<VT,false>& rhs )
3192 throw std::invalid_argument(
"Vector sizes do not match" );
3194 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3196 if( (~rhs).canAlias( &matrix_ ) || IsSparseVector<VT>::value ) {
3197 const ResultType tmp( *
this * (~rhs) );
3224 template<
typename MT >
3225 template<
typename Other >
3226 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false,false> >::Type&
3227 DenseColumn<MT,false,false>::operator*=( Other rhs )
3231 return operator=( (*
this) * rhs );
3250 template<
typename MT >
3251 template<
typename Other >
3252 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false,false> >::Type&
3253 DenseColumn<MT,false,false>::operator/=( Other rhs )
3259 return operator=( (*
this) / rhs );
3279 template<
typename MT >
3282 return matrix_.rows();
3294 template<
typename MT >
3297 return matrix_.rows();
3312 template<
typename MT >
3316 size_t nonzeros( 0UL );
3318 for(
size_t i=0UL; i<
rows; ++i )
3334 template<
typename MT >
3339 const size_t ibegin( ( IsLower<MT>::value )
3340 ?( ( IsUniLower<MT>::value || IsStrictlyLower<MT>::value )
3344 const size_t iend ( ( IsUpper<MT>::value )
3345 ?( ( IsUniUpper<MT>::value || IsStrictlyUpper<MT>::value )
3350 for(
size_t i=ibegin; i<iend; ++i )
3351 clear( matrix_(i,col_) );
3368 template<
typename MT >
3369 template<
typename Other >
3370 inline DenseColumn<MT,false,false>& DenseColumn<MT,false,false>::scale(
const Other& scalar )
3374 const size_t ibegin( ( IsLower<MT>::value )
3375 ?( ( IsStrictlyLower<MT>::value )
3379 const size_t iend ( ( IsUpper<MT>::value )
3380 ?( ( IsStrictlyUpper<MT>::value )
3385 for(
size_t i=ibegin; i<iend; ++i ) {
3386 matrix_(i,col_) *= scalar;
3407 template<
typename MT >
3408 template<
typename MT2
3411 inline typename EnableIf< Not< IsRestricted<MT2> >,
bool >::Type
3412 DenseColumn<MT,false,false>::preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const Vector<VT,false>& rhs )
3434 template<
typename MT >
3435 template<
typename MT2
3438 inline typename EnableIf< And< IsLower<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
3439 DenseColumn<MT,false,false>::preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const DenseVector<VT,false>& rhs )
3445 const size_t iend( ( IsStrictlyLower<MT2>::value )?( col_+1UL ):( col_ ) );
3447 for(
size_t i=0UL; i<iend; ++i ) {
3452 if( IsUniLower<MT2>::value && !
isOne( (~rhs)[col_] ) )
3473 template<
typename MT >
3474 template<
typename MT2
3477 inline typename EnableIf< And< IsLower<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
3478 DenseColumn<MT,false,false>::preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const SparseVector<VT,false>& rhs )
3486 const RhsIterator last( (~rhs).lowerBound( ( IsStrictlyLower<MT2>::value )?( col_+1UL ):( col_ ) ) );
3488 if( IsUniLower<MT2>::value && ( last == (~rhs).
end() || last->index() != col_ || !
isOne( last->value() ) ) )
3491 for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
3514 template<
typename MT >
3515 template<
typename MT2
3518 inline typename EnableIf< And< IsUpper<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
3519 DenseColumn<MT,false,false>::preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const DenseVector<VT,false>& rhs )
3525 if( IsUniUpper<MT2>::value && !
isOne( (~rhs)[col_] ) )
3528 const size_t ibegin( ( IsStrictlyUpper<MT2>::value )?( col_ ):( col_+1UL ) );
3530 for(
size_t i=ibegin; i<
size(); ++i ) {
3553 template<
typename MT >
3554 template<
typename MT2
3557 inline typename EnableIf< And< IsUpper<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
3558 DenseColumn<MT,false,false>::preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const SparseVector<VT,false>& rhs )
3566 const bool checkDiagonal( IsUniUpper<MT2>::value || IsStrictlyUpper<MT2>::value );
3567 const RhsIterator last( (~rhs).
end() );
3568 RhsIterator element( (~rhs).lowerBound( ( checkDiagonal )?( col_ ):( col_+1UL ) ) );
3570 if( IsUniUpper<MT2>::value ) {
3571 if( element == last || element->index() != col_ || !
isOne( element->value() ) )
3576 for( ; element!=last; ++element ) {
3599 template<
typename MT >
3600 template<
typename MT2
3603 inline typename EnableIf< IsDiagonal<MT2>,
bool >::Type
3604 DenseColumn<MT,false,false>::preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const DenseVector<VT,false>& rhs )
3610 for(
size_t i=0UL; i<col_; ++i ) {
3615 for(
size_t i=col_+1UL; i<
size(); ++i ) {
3638 template<
typename MT >
3639 template<
typename MT2
3642 inline typename EnableIf< IsDiagonal<MT2>,
bool >::Type
3643 DenseColumn<MT,false,false>::preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const SparseVector<VT,false>& rhs )
3651 for( RhsIterator element=(~rhs).
begin(); element!=(~rhs).
end(); ++element ) {
3652 if( element->index() != col_ && !
isDefault( element->value() ) )
3681 template<
typename MT >
3682 template<
typename Other >
3685 return matrix_.isAliased( alias );
3702 template<
typename MT >
3703 template<
typename MT2
3708 return matrix_.isAliased( &alias->matrix_ ) && ( col_ == alias->col_ );
3725 template<
typename MT >
3726 template<
typename Other >
3729 return matrix_.isAliased( alias );
3746 template<
typename MT >
3747 template<
typename MT2
3752 return matrix_.isAliased( &alias->matrix_ ) && ( col_ == alias->col_ );
3768 template<
typename MT >
3788 template<
typename MT >
3809 template<
typename MT >
3810 template<
typename VT >
3817 const size_t ipos( (~rhs).
size() &
size_t(-2) );
3818 for(
size_t i=0UL; i<ipos; i+=2UL ) {
3819 matrix_(i ,col_) = (~rhs)[i ];
3820 matrix_(i+1UL,col_) = (~rhs)[i+1UL];
3822 if( ipos < (~rhs).size() )
3823 matrix_(ipos,col_) = (~rhs)[ipos];
3841 template<
typename MT >
3842 template<
typename VT >
3850 matrix_(element->index(),col_) = element->value();
3868 template<
typename MT >
3869 template<
typename VT >
3876 const size_t ipos( (~rhs).
size() &
size_t(-2) );
3877 for(
size_t i=0UL; i<ipos; i+=2UL ) {
3878 matrix_(i ,col_) += (~rhs)[i ];
3879 matrix_(i+1UL,col_) += (~rhs)[i+1UL];
3881 if( ipos < (~rhs).size() )
3882 matrix_(ipos,col_) += (~rhs)[ipos];
3900 template<
typename MT >
3901 template<
typename VT >
3909 matrix_(element->index(),col_) += element->value();
3927 template<
typename MT >
3928 template<
typename VT >
3935 const size_t ipos( (~rhs).
size() &
size_t(-2) );
3936 for(
size_t i=0UL; i<ipos; i+=2UL ) {
3937 matrix_(i ,col_) -= (~rhs)[i ];
3938 matrix_(i+1UL,col_) -= (~rhs)[i+1UL];
3940 if( ipos < (~rhs).size() )
3941 matrix_(ipos,col_) -= (~rhs)[ipos];
3959 template<
typename MT >
3960 template<
typename VT >
3968 matrix_(element->index(),col_) -= element->value();
3986 template<
typename MT >
3987 template<
typename VT >
3994 const size_t ipos( (~rhs).
size() &
size_t(-2) );
3995 for(
size_t i=0UL; i<ipos; i+=2UL ) {
3996 matrix_(i ,col_) *= (~rhs)[i ];
3997 matrix_(i+1UL,col_) *= (~rhs)[i+1UL];
3999 if( ipos < (~rhs).size() )
4000 matrix_(ipos,col_) *= (~rhs)[ipos];
4018 template<
typename MT >
4019 template<
typename VT >
4026 const ResultType tmp(
serial( *
this ) );
4031 matrix_(element->index(),col_) = tmp[element->index()] * element->value();
4057 template<
typename MT >
4058 class DenseColumn<MT,false,true> :
public DenseVector< DenseColumn<MT,false,true>, false >
4064 typedef typename If< IsExpression<MT>, MT, MT& >::Type
Operand;
4067 typedef IntrinsicTrait<typename MT::ElementType>
IT;
4078 enum { useConst = IsConst<MT>::value };
4083 typedef DenseColumn<MT,false,true>
This;
4084 typedef typename ColumnTrait<MT>::Type
ResultType;
4095 typedef typename IfTrue< useConst, ConstReference, typename MT::Reference >::Type
Reference;
4101 typedef typename IfTrue< useConst, ConstPointer, ElementType* >::Type
Pointer;
4107 typedef typename IfTrue< useConst, ConstIterator, typename MT::Iterator >::Type
Iterator;
4112 enum { vectorizable = MT::vectorizable };
4115 enum { smpAssignable = MT::smpAssignable };
4121 explicit inline DenseColumn( MT& matrix,
size_t index );
4134 inline ConstReference
operator[](
size_t index )
const;
4135 inline Pointer
data ();
4136 inline ConstPointer
data ()
const;
4137 inline Iterator
begin ();
4138 inline ConstIterator
begin ()
const;
4139 inline ConstIterator
cbegin()
const;
4140 inline Iterator
end ();
4141 inline ConstIterator
end ()
const;
4142 inline ConstIterator
cend ()
const;
4153 template<
typename VT >
inline DenseColumn& operator+=(
const Vector<VT,false>& rhs );
4154 template<
typename VT >
inline DenseColumn& operator-=(
const Vector<VT,false>& rhs );
4155 template<
typename VT >
inline DenseColumn& operator*=(
const Vector<VT,false>& rhs );
4157 template<
typename Other >
4158 inline typename EnableIf< IsNumeric<Other>,
DenseColumn >::Type&
4159 operator*=( Other rhs );
4161 template<
typename Other >
4162 inline typename EnableIf< IsNumeric<Other>,
DenseColumn >::Type&
4163 operator/=( Other rhs );
4170 inline size_t size()
const;
4173 inline void reset();
4174 template<
typename Other >
inline DenseColumn& scale(
const Other& scalar );
4181 template<
typename VT >
4182 struct VectorizedAssign {
4183 enum { value = vectorizable && VT::vectorizable &&
4184 IsSame<ElementType,typename VT::ElementType>::value };
4190 template<
typename VT >
4191 struct VectorizedAddAssign {
4192 enum { value = vectorizable && VT::vectorizable &&
4193 IsSame<ElementType,typename VT::ElementType>::value &&
4194 IntrinsicTrait<ElementType>::addition };
4200 template<
typename VT >
4201 struct VectorizedSubAssign {
4202 enum { value = vectorizable && VT::vectorizable &&
4203 IsSame<ElementType,typename VT::ElementType>::value &&
4204 IntrinsicTrait<ElementType>::subtraction };
4210 template<
typename VT >
4211 struct VectorizedMultAssign {
4212 enum { value = vectorizable && VT::vectorizable &&
4213 IsSame<ElementType,typename VT::ElementType>::value &&
4214 IntrinsicTrait<ElementType>::multiplication };
4222 template<
typename Other >
4223 inline bool canAlias(
const Other* alias )
const;
4225 template<
typename MT2,
bool SO2,
bool SF2 >
4226 inline bool canAlias(
const DenseColumn<MT2,SO2,SF2>* alias )
const;
4228 template<
typename Other >
4229 inline bool isAliased(
const Other* alias )
const;
4231 template<
typename MT2,
bool SO2,
bool SF2 >
4232 inline bool isAliased(
const DenseColumn<MT2,SO2,SF2>* alias )
const;
4244 template<
typename VT >
4245 inline typename DisableIf< VectorizedAssign<VT> >::Type
4246 assign(
const DenseVector<VT,false>& rhs );
4248 template<
typename VT >
4249 inline typename EnableIf< VectorizedAssign<VT> >::Type
4250 assign(
const DenseVector<VT,false>& rhs );
4252 template<
typename VT >
inline void assign(
const SparseVector<VT,false>& rhs );
4254 template<
typename VT >
4255 inline typename DisableIf< VectorizedAddAssign<VT> >::Type
4256 addAssign(
const DenseVector<VT,false>& rhs );
4258 template<
typename VT >
4259 inline typename EnableIf< VectorizedAddAssign<VT> >::Type
4260 addAssign(
const DenseVector<VT,false>& rhs );
4262 template<
typename VT >
inline void addAssign(
const SparseVector<VT,false>& rhs );
4264 template<
typename VT >
4265 inline typename DisableIf< VectorizedSubAssign<VT> >::Type
4266 subAssign(
const DenseVector<VT,false>& rhs );
4268 template<
typename VT >
4269 inline typename EnableIf< VectorizedSubAssign<VT> >::Type
4270 subAssign(
const DenseVector<VT,false>& rhs );
4272 template<
typename VT >
inline void subAssign(
const SparseVector<VT,false>& rhs );
4274 template<
typename VT >
4275 inline typename DisableIf< VectorizedMultAssign<VT> >::Type
4276 multAssign(
const DenseVector<VT,false>& rhs );
4278 template<
typename VT >
4279 inline typename EnableIf< VectorizedMultAssign<VT> >::Type
4280 multAssign(
const DenseVector<VT,false>& rhs );
4282 template<
typename VT >
inline void multAssign(
const SparseVector<VT,false>& rhs );
4290 template<
typename MT2,
bool SO2,
typename VT >
4291 inline typename EnableIf< Not< IsRestricted<MT2> >,
bool >::Type
4292 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const Vector<VT,false>& rhs );
4294 template<
typename MT2,
bool SO2,
typename VT >
4295 inline typename EnableIf< And< IsLower<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
4296 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const DenseVector<VT,false>& rhs );
4298 template<
typename MT2,
bool SO2,
typename VT >
4299 inline typename EnableIf< And< IsLower<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
4300 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const SparseVector<VT,false>& rhs );
4302 template<
typename MT2,
bool SO2,
typename VT >
4303 inline typename EnableIf< And< IsUpper<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
4304 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const DenseVector<VT,false>& rhs );
4306 template<
typename MT2,
bool SO2,
typename VT >
4307 inline typename EnableIf< And< IsUpper<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
4308 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const SparseVector<VT,false>& rhs );
4310 template<
typename MT2,
bool SO2,
typename VT >
4311 inline typename EnableIf< IsDiagonal<MT2>,
bool >::Type
4312 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const DenseVector<VT,false>& rhs );
4314 template<
typename MT2,
bool SO2,
typename VT >
4315 inline typename EnableIf< IsDiagonal<MT2>,
bool >::Type
4316 preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const SparseVector<VT,false>& rhs );
4329 template<
typename MT2,
bool SO2,
bool SF2 >
friend class DenseColumn;
4331 template<
typename MT2,
bool SO2,
bool SF2 >
4332 friend bool isSame(
const DenseColumn<MT2,SO2,SF2>& a,
const DenseColumn<MT2,SO2,SF2>& b );
4334 template<
typename MT2,
bool SO2,
bool SF2 >
4335 friend typename DerestrictTrait< DenseColumn<MT2,SO2,SF2> >::Type
4336 derestrict( DenseColumn<MT2,SO2,SF2>& dm );
4347 BLAZE_STATIC_ASSERT( !IsRestricted<MT>::value || IsLower<MT>::value || IsUpper<MT>::value );
4370 template<
typename MT >
4375 if(
matrix_.columns() <= index )
4376 throw std::invalid_argument(
"Invalid column access index" );
4397 template<
typename MT >
4402 return matrix_(col_,index);
4415 template<
typename MT >
4420 return matrix_(col_,index);
4434 template<
typename MT >
4437 return matrix_.data( col_ );
4451 template<
typename MT >
4454 return matrix_.data( col_ );
4468 template<
typename MT >
4471 return matrix_.begin( col_ );
4485 template<
typename MT >
4488 return matrix_.cbegin( col_ );
4502 template<
typename MT >
4505 return matrix_.cbegin( col_ );
4519 template<
typename MT >
4522 return matrix_.end( col_ );
4536 template<
typename MT >
4539 return matrix_.cend( col_ );
4553 template<
typename MT >
4556 return matrix_.cend( col_ );
4577 template<
typename MT >
4580 const size_t jbegin( ( IsUpper<MT>::value )
4581 ?( ( IsUniUpper<MT>::value || IsStrictlyUpper<MT>::value )
4585 const size_t jend ( ( IsLower<MT>::value )
4586 ?( ( IsUniLower<MT>::value || IsStrictlyLower<MT>::value )
4591 for(
size_t j=jbegin; j<jend; ++j )
4592 matrix_(col_,j) = rhs;
4614 template<
typename MT >
4617 if( &rhs ==
this )
return *
this;
4619 if(
size() != rhs.size() )
4620 throw std::invalid_argument(
"Column sizes do not match" );
4622 if( !preservesInvariant( matrix_, rhs ) )
4623 throw std::invalid_argument(
"Invalid assignment to restricted matrix" );
4625 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
4652 template<
typename MT >
4653 template<
typename VT >
4654 inline DenseColumn<MT,false,true>&
4661 throw std::invalid_argument(
"Vector sizes do not match" );
4663 typedef typename If< IsRestricted<MT>,
typename VT::CompositeType,
const VT& >::Type Right;
4664 Right right( ~rhs );
4666 if( !preservesInvariant( matrix_, right ) )
4667 throw std::invalid_argument(
"Invalid assignment to restricted matrix" );
4669 if( IsSparseVector<VT>::value )
4672 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
4674 if( IsReference<Right>::value && right.canAlias( &matrix_ ) ) {
4705 template<
typename MT >
4706 template<
typename VT >
4707 inline DenseColumn<MT,false,true>&
4708 DenseColumn<MT,false,true>::operator+=(
const Vector<VT,false>& rhs )
4714 throw std::invalid_argument(
"Vector sizes do not match" );
4716 typedef typename If< IsRestricted<MT>,
typename VT::CompositeType,
const VT& >::Type Right;
4717 Right right( ~rhs );
4719 if( !preservesInvariant( matrix_, right ) )
4720 throw std::invalid_argument(
"Invalid assignment to restricted matrix" );
4722 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
4724 if( IsReference<Right>::value && right.canAlias( &matrix_ ) ) {
4755 template<
typename MT >
4756 template<
typename VT >
4757 inline DenseColumn<MT,false,true>&
4758 DenseColumn<MT,false,true>::operator-=(
const Vector<VT,false>& rhs )
4764 throw std::invalid_argument(
"Vector sizes do not match" );
4766 typedef typename If< IsRestricted<MT>,
typename VT::CompositeType,
const VT& >::Type Right;
4767 Right right( ~rhs );
4769 if( !preservesInvariant( matrix_, right ) )
4770 throw std::invalid_argument(
"Invalid assignment to restricted matrix" );
4772 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
4774 if( IsReference<Right>::value && right.canAlias( &matrix_ ) ) {
4803 template<
typename MT >
4804 template<
typename VT >
4805 inline DenseColumn<MT,false,true>&
4806 DenseColumn<MT,false,true>::operator*=(
const Vector<VT,false>& rhs )
4812 throw std::invalid_argument(
"Vector sizes do not match" );
4814 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
4816 if( (~rhs).canAlias( &matrix_ ) || IsSparseVector<VT>::value ) {
4817 const ResultType tmp( *
this * (~rhs) );
4844 template<
typename MT >
4845 template<
typename Other >
4846 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false,true> >::Type&
4847 DenseColumn<MT,false,true>::operator*=( Other rhs )
4851 return operator=( (*
this) * rhs );
4870 template<
typename MT >
4871 template<
typename Other >
4872 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false,true> >::Type&
4873 DenseColumn<MT,false,true>::operator/=( Other rhs )
4879 return operator=( (*
this) / rhs );
4899 template<
typename MT >
4902 return matrix_.rows();
4914 template<
typename MT >
4917 return matrix_.capacity( col_ );
4932 template<
typename MT >
4935 return matrix_.nonZeros( col_ );
4947 template<
typename MT >
4950 matrix_.reset( col_ );
4967 template<
typename MT >
4968 template<
typename Other >
4969 inline DenseColumn<MT,false,true>& DenseColumn<MT,false,true>::scale(
const Other& scalar )
4973 const size_t jbegin( ( IsUpper<MT>::value )
4974 ?( ( IsStrictlyUpper<MT>::value )
4978 const size_t jend ( ( IsLower<MT>::value )
4979 ?( ( IsStrictlyLower<MT>::value )
4984 for(
size_t j=jbegin; j<jend; ++j ) {
4985 matrix_(col_,j) *= scalar;
5006 template<
typename MT >
5007 template<
typename MT2
5010 inline typename EnableIf< Not< IsRestricted<MT2> >,
bool >::Type
5011 DenseColumn<MT,false,true>::preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const Vector<VT,false>& rhs )
5033 template<
typename MT >
5034 template<
typename MT2
5037 inline typename EnableIf< And< IsLower<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
5038 DenseColumn<MT,false,true>::preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const DenseVector<VT,false>& rhs )
5044 const size_t iend( ( IsStrictlyLower<MT2>::value )?( col_+1UL ):( col_ ) );
5046 for(
size_t i=0UL; i<iend; ++i ) {
5051 if( IsUniLower<MT2>::value && !
isOne( (~rhs)[col_] ) )
5072 template<
typename MT >
5073 template<
typename MT2
5076 inline typename EnableIf< And< IsLower<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
5077 DenseColumn<MT,false,true>::preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const SparseVector<VT,false>& rhs )
5085 const RhsIterator last( (~rhs).lowerBound( ( IsStrictlyLower<MT2>::value )?( col_+1UL ):( col_ ) ) );
5087 if( IsUniLower<MT2>::value && ( last == (~rhs).
end() || last->index() != col_ || !
isOne( last->value() ) ) )
5090 for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
5113 template<
typename MT >
5114 template<
typename MT2
5117 inline typename EnableIf< And< IsUpper<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
5118 DenseColumn<MT,false,true>::preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const DenseVector<VT,false>& rhs )
5124 if( IsUniUpper<MT2>::value && !
isOne( (~rhs)[col_] ) )
5127 const size_t ibegin( ( IsStrictlyUpper<MT2>::value )?( col_ ):( col_+1UL ) );
5129 for(
size_t i=ibegin; i<
size(); ++i ) {
5152 template<
typename MT >
5153 template<
typename MT2
5156 inline typename EnableIf< And< IsUpper<MT2>, Not< IsDiagonal<MT2> > >,
bool >::Type
5157 DenseColumn<MT,false,true>::preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const SparseVector<VT,false>& rhs )
5165 const bool checkDiagonal( IsUniUpper<MT2>::value || IsStrictlyUpper<MT2>::value );
5166 const RhsIterator last( (~rhs).
end() );
5167 RhsIterator element( (~rhs).lowerBound( ( checkDiagonal )?( col_ ):( col_+1UL ) ) );
5169 if( IsUniUpper<MT2>::value ) {
5170 if( element == last || element->index() != col_ || !
isOne( element->value() ) )
5175 for( ; element!=last; ++element ) {
5198 template<
typename MT >
5199 template<
typename MT2
5202 inline typename EnableIf< IsDiagonal<MT2>,
bool >::Type
5203 DenseColumn<MT,false,true>::preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const DenseVector<VT,false>& rhs )
5209 for(
size_t i=0UL; i<col_; ++i ) {
5214 for(
size_t i=col_+1UL; i<
size(); ++i ) {
5237 template<
typename MT >
5238 template<
typename MT2
5241 inline typename EnableIf< IsDiagonal<MT2>,
bool >::Type
5242 DenseColumn<MT,false,true>::preservesInvariant(
const DenseMatrix<MT2,SO2>& lhs,
const SparseVector<VT,false>& rhs )
5250 for( RhsIterator element=(~rhs).
begin(); element!=(~rhs).
end(); ++element ) {
5251 if( element->index() != col_ && !
isDefault( element->value() ) )
5280 template<
typename MT >
5281 template<
typename Other >
5284 return matrix_.isAliased( alias );
5301 template<
typename MT >
5302 template<
typename MT2
5307 return matrix_.isAliased( alias->matrix_ ) && ( col_ == alias->col_ );
5324 template<
typename MT >
5325 template<
typename Other >
5328 return matrix_.isAliased( alias );
5345 template<
typename MT >
5346 template<
typename MT2
5351 return matrix_.isAliased( &alias->matrix_ ) && ( col_ == alias->col_ );
5367 template<
typename MT >
5370 return matrix_.isAligned();
5387 template<
typename MT >
5409 template<
typename MT >
5413 return matrix_.load( col_, index );
5432 template<
typename MT >
5436 return matrix_.loadu( col_, index );
5456 template<
typename MT >
5459 matrix_.store( col_, index, value );
5479 template<
typename MT >
5482 matrix_.storeu( col_, index, value );
5502 template<
typename MT >
5505 matrix_.stream( col_, index, value );
5523 template<
typename MT >
5524 template<
typename VT >
5525 inline typename DisableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type
5532 const size_t jpos( (~rhs).
size() &
size_t(-2) );
5533 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5534 matrix_(col_,j ) = (~rhs)[j ];
5535 matrix_(col_,j+1UL) = (~rhs)[j+1UL];
5537 if( jpos < (~rhs).size() )
5538 matrix_(col_,jpos) = (~rhs)[jpos];
5556 template<
typename MT >
5557 template<
typename VT >
5558 inline typename EnableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type
5571 matrix_.stream( col_, j, (~rhs).
load(j) );
5576 const size_t jpos( columns &
size_t(-
IT::size*4) );
5580 for(
size_t j=0UL; j<jpos; j+=
IT::size*4UL ) {
5581 matrix_.store( col_, j , it.load() ); it+=
IT::size;
5587 matrix_.store( col_, j, it.load() );
5607 template<
typename MT >
5608 template<
typename VT >
5616 matrix_(col_,element->index()) = element->value();
5634 template<
typename MT >
5635 template<
typename VT >
5636 inline typename DisableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type
5643 const size_t jpos( (~rhs).
size() &
size_t(-2) );
5644 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5645 matrix_(col_,j ) += (~rhs)[j ];
5646 matrix_(col_,j+1UL) += (~rhs)[j+1UL];
5648 if( jpos < (~rhs).size() )
5649 matrix_(col_,jpos) += (~rhs)[jpos];
5667 template<
typename MT >
5668 template<
typename VT >
5669 inline typename EnableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type
5679 const size_t jpos( columns &
size_t(-
IT::size*4) );
5683 for(
size_t j=0UL; j<jpos; j+=
IT::size*4UL ) {
5684 matrix_.store( col_, j , matrix_.load(col_,j ) + it.load() ); it +=
IT::size;
5690 matrix_.store( col_, j, matrix_.load(col_,j) + it.load() );
5709 template<
typename MT >
5710 template<
typename VT >
5718 matrix_(col_,element->index()) += element->value();
5736 template<
typename MT >
5737 template<
typename VT >
5738 inline typename DisableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type
5745 const size_t jpos( (~rhs).
size() &
size_t(-2) );
5746 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5747 matrix_(col_,j ) -= (~rhs)[j ];
5748 matrix_(col_,j+1UL) -= (~rhs)[j+1UL];
5750 if( jpos < (~rhs).size() )
5751 matrix_(col_,jpos) -= (~rhs)[jpos];
5769 template<
typename MT >
5770 template<
typename VT >
5771 inline typename EnableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type
5781 const size_t jpos( columns &
size_t(-
IT::size*4) );
5785 for(
size_t j=0UL; j<jpos; j+=
IT::size*4UL ) {
5786 matrix_.store( col_, j , matrix_.load(col_,j ) - it.load() ); it +=
IT::size;
5792 matrix_.store( col_, j, matrix_.load(col_,j) - it.load() );
5811 template<
typename MT >
5812 template<
typename VT >
5820 matrix_(col_,element->index()) -= element->value();
5838 template<
typename MT >
5839 template<
typename VT >
5840 inline typename DisableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type
5847 const size_t jpos( (~rhs).
size() &
size_t(-2) );
5848 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5849 matrix_(col_,j ) *= (~rhs)[j ];
5850 matrix_(col_,j+1UL) *= (~rhs)[j+1UL];
5852 if( jpos < (~rhs).size() )
5853 matrix_(col_,jpos) *= (~rhs)[jpos];
5871 template<
typename MT >
5872 template<
typename VT >
5873 inline typename EnableIf< typename DenseColumn<MT,false,true>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type
5883 const size_t jpos( columns &
size_t(-
IT::size*4) );
5887 for(
size_t j=0UL; j<jpos; j+=
IT::size*4UL ) {
5888 matrix_.store( col_, j , matrix_.load(col_,j ) * it.load() ); it +=
IT::size;
5894 matrix_.store( col_, j, matrix_.load(col_,j) * it.load() );
5913 template<
typename MT >
5914 template<
typename VT >
5921 const ResultType tmp(
serial( *
this ) );
5926 matrix_(col_,element->index()) = tmp[element->index()] * element->value();
5947 template<
typename MT,
bool SO,
bool SF >
5948 inline void reset( DenseColumn<MT,SO,SF>&
column );
5950 template<
typename MT,
bool SO,
bool SF >
5951 inline void clear( DenseColumn<MT,SO,SF>&
column );
5953 template<
typename MT,
bool SO,
bool SF >
5956 template<
typename MT,
bool SO,
bool SF >
5957 inline bool isSame(
const DenseColumn<MT,SO,SF>& a,
const DenseColumn<MT,SO,SF>& b );
5969 template<
typename MT
5988 template<
typename MT
6016 template<
typename MT
6021 for(
size_t i=0UL; i<column.size(); ++i )
6022 if( !
isDefault( column[i] ) )
return false;
6040 template<
typename MT
6045 return (
isSame( a.matrix_, b.matrix_ ) && ( a.col_ == b.col_ ) );
6065 template<
typename MT
6068 inline typename DerestrictTrait< DenseColumn<MT,SO,SF> >::Type
6069 derestrict( DenseColumn<MT,SO,SF>&
column )
6071 typedef typename DerestrictTrait< DenseColumn<MT,SO,SF> >::Type
ReturnType;
6072 return ReturnType( derestrict( column.matrix_ ), column.col_ );
6088 template<
typename MT,
bool SO,
bool SF >
6089 struct IsRestricted< DenseColumn<MT,SO,SF> > :
public If< IsRestricted<MT>, TrueType, FalseType >::Type
6091 enum { value = IsRestricted<MT>::value };
6108 template<
typename MT,
bool SO,
bool SF >
6109 struct DerestrictTrait< DenseColumn<MT,SO,SF> >
6111 typedef DenseColumn< typename RemoveReference< typename DerestrictTrait<MT>::Type >::Type > Type;
6127 template<
typename MT,
bool SO,
bool SF >
6128 struct HasConstDataAccess< DenseColumn<MT,SO,SF> >
6129 :
public If< HasConstDataAccess<MT>, TrueType, FalseType >::Type
6131 enum { value = HasConstDataAccess<MT>::value };
6148 template<
typename MT,
bool SO,
bool SF >
6149 struct HasMutableDataAccess< DenseColumn<MT,SO,SF> >
6150 :
public If< HasMutableDataAccess<MT>, TrueType, FalseType >::Type
6152 enum { value = HasMutableDataAccess<MT>::value };
6153 typedef typename If< HasMutableDataAccess<MT>,
TrueType,
FalseType >::Type Type;
6169 template<
typename MT,
bool SO,
bool SF >
6170 struct SubvectorTrait< DenseColumn<MT,SO,SF> >
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
Header file for the UNUSED_PARAMETER function template.
Header file for the IsUniUpper type trait.
Compile time type selection.The If class template selects one of the two given types T2 and T3 depend...
Definition: If.h:112
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:8247
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:264
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:209
Header file for the IsDiagonal type trait.
IntrinsicTrait< typename MT::ElementType > IT
Intrinsic trait for the column element type.
Definition: DenseColumn.h:347
#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:725
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:662
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 reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:821
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2507
Iterator begin()
Returns an iterator to the first element of the column.
Definition: DenseColumn.h:759
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:316
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
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the And class template.
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.
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:90
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower or upper unitriangular matrix ty...
Definition: UniTriangular.h:118
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:1678
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:699
#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
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:90
#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
Header file for the RequiresEvaluation type trait.
BLAZE_ALWAYS_INLINE void store(size_t index, const IntrinsicType &value)
Aligned store of an intrinsic element of the dense column.
Definition: DenseColumn.h:1747
Header file for the IsUniLower type trait.
bool isLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a lower triangular matrix.
Definition: DenseMatrix.h:964
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:861
Constraint on the data type.
Header file for the column base class.
Compile time check for data types with restricted data access.This type trait tests whether the given...
Definition: IsRestricted.h:82
MT::ConstReference ConstReference
Reference to a constant column value.
Definition: DenseColumn.h:372
Constraint on the data type.
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:85
const ElementType * ConstPointer
Pointer to a constant row value.
Definition: DenseColumn.h:378
Header file for the DisableIf class template.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for nested template disabiguation.
Header file for the If class template.
IT::Type IntrinsicType
Intrinsic type of the column elements.
Definition: DenseColumn.h:367
Constraint on the data type.
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:384
const DenseColumn & CompositeType
Data type for composite expression templates.
Definition: DenseColumn.h:369
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:116
If< IsExpression< MT >, MT, MT & >::Type Operand
Composite data type of the dense matrix expression.
Definition: DenseColumn.h:344
Header file for the Or class template.
size_t capacity() const
Returns the maximum capacity of the dense column.
Definition: DenseColumn.h:1205
Reference to a specific column of a dense matrix.The DenseColumn template represents a reference to a...
Definition: DenseColumn.h:338
bool isAligned() const
Returns whether the dense column is properly aligned in memory.
Definition: DenseColumn.h:1658
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
Header file for the subvector trait.
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
BLAZE_ALWAYS_INLINE void stream(size_t index, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the dense column.
Definition: DenseColumn.h:1793
Header file for the IsLower type trait.
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t index) const
Aligned load of an intrinsic element of the dense column.
Definition: DenseColumn.h:1701
Constraint on the data type.
Constraint on the data type.
DenseColumn & operator=(const ElementType &rhs)
Homogenous assignment to all column elements.
Definition: DenseColumn.h:872
#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
IfTrue< useConst, ConstReference, typename MT::Reference >::Type Reference
Reference to a non-constant column value.
Definition: DenseColumn.h:375
Reference operator[](size_t index)
Subscript operator for the direct access to the column elements.
Definition: DenseColumn.h:689
bool isUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper triangular matrix.
Definition: DenseMatrix.h:1197
Constraints on the storage order of matrix types.
Operand matrix_
The dense matrix containing the column.
Definition: DenseColumn.h:611
Constraint on the data type.
DenseColumn< MT, SO, SF > This
Type of this DenseColumn instance.
Definition: DenseColumn.h:363
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
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2505
Constraint on the data type.
ConstIterator cbegin() const
Returns an iterator to the first element of the column.
Definition: DenseColumn.h:793
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2509
System settings for streaming (non-temporal stores)
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:841
bool canAlias(const Other *alias) const
Returns whether the dense column can alias with the given address alias.
Definition: DenseColumn.h:1572
Header file for the isOne shim.
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:85
Header file for the DerestrictTrait class template.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, sse_int16_t >::Type load(const T *address)
Loads a vector of 2-byte integral values.
Definition: Load.h:79
Constraint on the data type.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess 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
BLAZE_ALWAYS_INLINE void storeu(size_t index, const IntrinsicType &value)
Unaligned store of an intrinsic element of the dense column.
Definition: DenseColumn.h:1770
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:1223
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
#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:2506
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
IfTrue< useConst, ConstIterator, typename MT::Iterator >::Type Iterator
Iterator over non-constant elements.
Definition: DenseColumn.h:387
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DenseColumn.h:365
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.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_RESTRICTED(T)
Constraint on the data type.In case the given data type T does have a restricted data access...
Definition: Restricted.h:118
Iterator end()
Returns an iterator just past the last element of the column.
Definition: DenseColumn.h:810
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
BLAZE_ALWAYS_INLINE IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the dense column.
Definition: DenseColumn.h:1724
Header file for the cache size of the target architecture.
Compile time type negation.The Not class template negates the given compile time condition. In case the given condition would evaluate to true, the nested member enumeration is set to false and vice versa:
Definition: Not.h:70
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:116
IfTrue< useConst, ConstPointer, ElementType * >::Type Pointer
Pointer to a non-constant row value.
Definition: DenseColumn.h:381
void reset()
Reset to the default initial values.
Definition: DenseColumn.h:1238
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2510
Header file for the column trait.
Header file for the isDefault shim.
Constraint on the data type.
Constraint on the data type.
Header file for the HasMutableDataAccess type trait.
#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
Evaluation of the return type of the derestrict function.Via this type trait it is possible to evalua...
Definition: DerestrictTrait.h:74
Header file for the IsReference type trait.
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:1616
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
#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:612
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:151
boost::false_type FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: FalseType.h:61
CompressedMatrix< Type,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:260
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:1190
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:2502
MT::ElementType ElementType
Type of the column elements.
Definition: DenseColumn.h:366
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
Compile time type check.This class tests whether the given template parameter T is a reference type (...
Definition: IsReference.h:94
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DenseColumn.h:368
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2508
Header file for the IsUpper type trait.
boost::true_type TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
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
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:143
ColumnTrait< MT >::Type ResultType
Result type for expression template evaluations.
Definition: DenseColumn.h:364
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
EnableIf< IsNumeric< Type >, bool >::Type isOne(const Type &v)
Returns whether the given value/object represents the numeric value 1.
Definition: IsOne.h:80
Header file for the IsRestricted type trait.
ConstIterator cend() const
Returns an iterator just past the last element of the column.
Definition: DenseColumn.h:844
System settings for the inline keywords.
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
Compile time type selection.The IfTrue class template selects one of the two given types T1 and T2 de...
Definition: If.h:59
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.