35 #ifndef _BLAZE_MATH_VIEWS_DENSEROW_H_
36 #define _BLAZE_MATH_VIEWS_DENSEROW_H_
312 template<
typename MT
313 ,
bool SO = IsRowMajorMatrix<MT>::value
314 ,
bool SF = IsSymmetric<MT>::value >
369 enum { vectorizable = MT::vectorizable };
372 enum { smpAssignable = MT::smpAssignable };
378 explicit inline DenseRow( MT& matrix,
size_t index );
408 template<
typename VT >
inline DenseRow&
operator= (
const Vector<VT,true>& rhs );
409 template<
typename VT >
inline DenseRow& operator+=(
const Vector<VT,true>& rhs );
410 template<
typename VT >
inline DenseRow& operator-=(
const Vector<VT,true>& rhs );
411 template<
typename VT >
inline DenseRow& operator*=(
const Vector<VT,true>& rhs );
413 template<
typename Other >
414 inline typename EnableIf< IsNumeric<Other>,
DenseRow >::Type&
415 operator*=( Other rhs );
417 template<
typename Other >
418 inline typename EnableIf< IsNumeric<Other>,
DenseRow >::Type&
419 operator/=( Other rhs );
426 inline size_t size()
const;
430 template<
typename Other >
inline DenseRow& scale(
const Other& scalar );
437 template<
typename VT >
439 struct VectorizedAssign {
440 enum { value = vectorizable && VT::vectorizable &&
441 IsSame<ElementType,typename VT::ElementType>::value };
448 template<
typename VT >
450 struct VectorizedAddAssign {
451 enum { value = vectorizable && VT::vectorizable &&
452 IsSame<ElementType,typename VT::ElementType>::value &&
453 IntrinsicTrait<ElementType>::addition };
460 template<
typename VT >
462 struct VectorizedSubAssign {
463 enum { value = vectorizable && VT::vectorizable &&
464 IsSame<ElementType,typename VT::ElementType>::value &&
465 IntrinsicTrait<ElementType>::subtraction };
472 template<
typename VT >
474 struct VectorizedMultAssign {
475 enum { value = vectorizable && VT::vectorizable &&
476 IsSame<ElementType,typename VT::ElementType>::value &&
477 IntrinsicTrait<ElementType>::multiplication };
486 template<
typename Other >
487 inline bool canAlias(
const Other* alias )
const;
489 template<
typename MT2,
bool SO2,
bool SF2 >
490 inline bool canAlias(
const DenseRow<MT2,SO2,SF2>* alias )
const;
492 template<
typename Other >
493 inline bool isAliased(
const Other* alias )
const;
495 template<
typename MT2,
bool SO2,
bool SF2 >
496 inline bool isAliased(
const DenseRow<MT2,SO2,SF2>* alias )
const;
507 template<
typename VT >
508 inline typename DisableIf< VectorizedAssign<VT> >::Type
509 assign(
const DenseVector<VT,true>& rhs );
511 template<
typename VT >
512 inline typename EnableIf< VectorizedAssign<VT> >::Type
513 assign(
const DenseVector<VT,true>& rhs );
515 template<
typename VT >
inline void assign(
const SparseVector<VT,true>& rhs );
517 template<
typename VT >
518 inline typename DisableIf< VectorizedAddAssign<VT> >::Type
519 addAssign(
const DenseVector<VT,true>& rhs );
521 template<
typename VT >
522 inline typename EnableIf< VectorizedAddAssign<VT> >::Type
523 addAssign(
const DenseVector<VT,true>& rhs );
525 template<
typename VT >
inline void addAssign(
const SparseVector<VT,true>& rhs );
527 template<
typename VT >
528 inline typename DisableIf< VectorizedSubAssign<VT> >::Type
529 subAssign(
const DenseVector<VT,true>& rhs );
531 template<
typename VT >
532 inline typename EnableIf< VectorizedSubAssign<VT> >::Type
533 subAssign(
const DenseVector<VT,true>& rhs );
535 template<
typename VT >
inline void subAssign(
const SparseVector<VT,true>& rhs );
537 template<
typename VT >
538 inline typename DisableIf< VectorizedMultAssign<VT> >::Type
539 multAssign(
const DenseVector<VT,true>& rhs );
541 template<
typename VT >
542 inline typename EnableIf< VectorizedMultAssign<VT> >::Type
543 multAssign(
const DenseVector<VT,true>& rhs );
545 template<
typename VT >
inline void multAssign(
const SparseVector<VT,true>& rhs );
560 template<
typename MT2,
bool SO2,
bool SF2 >
friend class DenseRow;
562 template<
typename MT2,
bool SO2,
bool SF2 >
594 template<
typename MT
602 throw std::invalid_argument(
"Invalid row access index" );
621 template<
typename MT
627 return matrix_(row_,index);
638 template<
typename MT
645 return matrix_(row_,index);
657 template<
typename MT
662 return matrix_.data( row_ );
674 template<
typename MT
679 return matrix_.data( row_ );
691 template<
typename MT
696 return matrix_.begin( row_ );
708 template<
typename MT
713 return matrix_.cbegin( row_ );
725 template<
typename MT
730 return matrix_.cbegin( row_ );
742 template<
typename MT
747 return matrix_.end( row_ );
759 template<
typename MT
764 return matrix_.cend( row_ );
776 template<
typename MT
781 return matrix_.cend( row_ );
800 template<
typename MT
807 for(
size_t j=0UL; j<
columns; ++j )
808 matrix_(row_,j) = rhs;
825 template<
typename MT
830 if( &rhs ==
this )
return *
this;
833 throw std::invalid_argument(
"Row sizes do not match" );
837 for(
size_t j=0UL; j<
columns; ++j )
838 matrix_(row_,j) = rhs[j];
855 template<
typename MT
858 template<
typename VT >
865 throw std::invalid_argument(
"Vector sizes do not match" );
867 if( (~rhs).canAlias( &matrix_ ) ) {
892 template<
typename MT
895 template<
typename VT >
902 throw std::invalid_argument(
"Vector sizes do not match" );
904 if( (~rhs).canAlias( &matrix_ ) ) {
927 template<
typename MT
930 template<
typename VT >
937 throw std::invalid_argument(
"Vector sizes do not match" );
939 if( (~rhs).canAlias( &matrix_ ) ) {
963 template<
typename MT
966 template<
typename VT >
973 throw std::invalid_argument(
"Vector sizes do not match" );
995 template<
typename MT
998 template<
typename Other >
1002 return operator=( (*
this) * rhs );
1016 template<
typename MT
1019 template<
typename Other >
1025 return operator=( (*
this) / rhs );
1043 template<
typename MT
1048 return matrix_.columns();
1058 template<
typename MT
1063 return matrix_.capacity( row_ );
1076 template<
typename MT
1081 return matrix_.nonZeros( row_ );
1091 template<
typename MT
1096 matrix_.reset( row_ );
1107 template<
typename MT
1110 template<
typename Other >
1113 for(
size_t j=0UL; j<
size(); ++j ) {
1114 matrix_(row_,j) *= scalar;
1139 template<
typename MT
1142 template<
typename Other >
1145 return matrix_.isAliased( alias );
1160 template<
typename MT
1163 template<
typename MT2
1168 return matrix_.isAliased( &alias->
matrix_ ) && ( row_ == alias->
row_ );
1183 template<
typename MT
1186 template<
typename Other >
1189 return matrix_.isAliased( alias );
1204 template<
typename MT
1207 template<
typename MT2
1212 return matrix_.isAliased( &alias->
matrix_ ) && ( row_ == alias->
row_ );
1226 template<
typename MT
1231 return matrix_.isAligned();
1246 template<
typename MT
1268 template<
typename MT
1273 return matrix_.load( row_, index );
1290 template<
typename MT
1295 return matrix_.loadu( row_, index );
1313 template<
typename MT
1318 matrix_.store( row_, index, value );
1336 template<
typename MT
1341 matrix_.storeu( row_, index, value );
1359 template<
typename MT
1364 matrix_.stream( row_, index, value );
1380 template<
typename MT
1383 template<
typename VT >
1389 const size_t jend( (~rhs).
size() &
size_t(-2) );
1390 for(
size_t j=0UL; j<jend; j+=2UL ) {
1391 matrix_(row_,j ) = (~rhs)[j ];
1392 matrix_(row_,j+1UL) = (~rhs)[j+1UL];
1394 if( jend < (~rhs).size() )
1395 matrix_(row_,jend) = (~rhs)[jend];
1411 template<
typename MT
1414 template<
typename VT >
1427 matrix_.stream( row_, j, (~rhs).
load(j) );
1432 const size_t jend( columns &
size_t(-
IT::size*4) );
1436 for(
size_t j=0UL; j<jend; j+=
IT::size*4UL ) {
1437 matrix_.store( row_, j , it.load() ); it +=
IT::size;
1443 matrix_.store( row_, j, it.load() );
1461 template<
typename MT
1464 template<
typename VT >
1470 matrix_(row_,element->index()) = element->value();
1486 template<
typename MT
1489 template<
typename VT >
1495 const size_t jend( (~rhs).
size() &
size_t(-2) );
1496 for(
size_t j=0UL; j<jend; j+=2UL ) {
1497 matrix_(row_,j ) += (~rhs)[j ];
1498 matrix_(row_,j+1UL) += (~rhs)[j+1UL];
1500 if( jend < (~rhs).size() )
1501 matrix_(row_,jend) += (~rhs)[jend];
1517 template<
typename MT
1520 template<
typename VT >
1530 const size_t jend( columns &
size_t(-
IT::size*4) );
1534 for(
size_t j=0UL; j<jend; j+=
IT::size*4UL ) {
1535 matrix_.store( row_, j , matrix_.load(row_,j ) + it.load() ); it +=
IT::size;
1541 matrix_.store( row_, j, matrix_.load(row_,j) + it.load() );
1558 template<
typename MT
1561 template<
typename VT >
1567 matrix_(row_,element->index()) += element->value();
1583 template<
typename MT
1586 template<
typename VT >
1592 const size_t jend( (~rhs).
size() &
size_t(-2) );
1593 for(
size_t j=0UL; j<jend; j+=2UL ) {
1594 matrix_(row_,j ) -= (~rhs)[j ];
1595 matrix_(row_,j+1UL) -= (~rhs)[j+1UL];
1597 if( jend < (~rhs).size() )
1598 matrix_(row_,jend) -= (~rhs)[jend];
1614 template<
typename MT
1617 template<
typename VT >
1627 const size_t jend( columns &
size_t(-
IT::size*4) );
1631 for(
size_t j=0UL; j<jend; j+=
IT::size*4UL ) {
1632 matrix_.store( row_, j , matrix_.load(row_,j ) - it.load() ); it +=
IT::size;
1638 matrix_.store( row_, j, matrix_.load(row_,j) - it.load() );
1655 template<
typename MT
1658 template<
typename VT >
1664 matrix_(row_,element->index()) -= element->value();
1680 template<
typename MT
1683 template<
typename VT >
1689 const size_t jend( (~rhs).
size() &
size_t(-2) );
1690 for(
size_t j=0UL; j<jend; j+=2UL ) {
1691 matrix_(row_,j ) *= (~rhs)[j ];
1692 matrix_(row_,j+1UL) *= (~rhs)[j+1UL];
1694 if( jend < (~rhs).size() )
1695 matrix_(row_,jend) *= (~rhs)[jend];
1711 template<
typename MT
1714 template<
typename VT >
1724 const size_t jend( columns &
size_t(-
IT::size*4) );
1728 for(
size_t j=0UL; j<jend; j+=
IT::size*4UL ) {
1729 matrix_.store( row_, j , matrix_.load(row_,j ) * it.load() ); it +=
IT::size;
1735 matrix_.store( row_, j, matrix_.load(row_,j) * it.load() );
1752 template<
typename MT
1755 template<
typename VT >
1765 matrix_(row_,element->index()) = tmp[element->index()] * element->value();
1790 template<
typename MT >
1813 typedef DenseRow<MT,false,false>
This;
1814 typedef typename RowTrait<MT>::Type
ResultType;
1824 typedef typename SelectType< useConst, ConstReference, typename MT::Reference >::Type
Reference;
1830 template<
typename MatrixType >
1841 enum { returnConst = IsConst<MatrixType>::value };
1847 typedef typename SelectType< returnConst
1851 typedef std::random_access_iterator_tag IteratorCategory;
1852 typedef RemoveReference<Reference> ValueType;
1853 typedef ValueType* PointerType;
1855 typedef ptrdiff_t DifferenceType;
1858 typedef IteratorCategory iterator_category;
1859 typedef ValueType value_type;
1860 typedef PointerType pointer;
1861 typedef ReferenceType reference;
1862 typedef DifferenceType difference_type;
1868 inline RowIterator()
1882 inline RowIterator( MatrixType& matrix,
size_t row,
size_t column )
1894 template<
typename MatrixType2 >
1895 inline RowIterator(
const RowIterator<MatrixType2>& it )
1898 , column_( it.column_ )
1908 inline RowIterator& operator+=(
size_t inc ) {
1920 inline RowIterator& operator-=(
size_t dec ) {
1931 inline RowIterator& operator++() {
1942 inline const RowIterator operator++(
int ) {
1943 const RowIterator tmp( *
this );
1954 inline RowIterator& operator--() {
1965 inline const RowIterator operator--(
int ) {
1966 const RowIterator tmp( *
this );
1978 inline ReferenceType
operator[](
size_t index )
const {
1988 inline ReferenceType
operator*()
const {
1998 inline PointerType operator->()
const {
1999 return &(*matrix_)(
row_,column_);
2009 template<
typename MatrixType2 >
2010 inline bool operator==(
const RowIterator<MatrixType2>& rhs )
const {
2011 return (
matrix_ == rhs.matrix_ ) && (
row_ == rhs.row_ ) && ( column_ == rhs.column_ );
2021 template<
typename MatrixType2 >
2022 inline bool operator!=(
const RowIterator<MatrixType2>& rhs )
const {
2023 return !( *
this == rhs );
2033 template<
typename MatrixType2 >
2034 inline bool operator<( const RowIterator<MatrixType2>& rhs )
const {
2035 return (
matrix_ == rhs.matrix_ ) && (
row_ == rhs.row_ ) && ( column_ < rhs.column_ );
2045 template<
typename MatrixType2 >
2046 inline bool operator>(
const RowIterator<MatrixType2>& rhs )
const {
2047 return (
matrix_ == rhs.matrix_ ) && (
row_ == rhs.row_ ) && ( column_ > rhs.column_ );
2057 template<
typename MatrixType2 >
2058 inline bool operator<=( const RowIterator<MatrixType2>& rhs )
const {
2059 return (
matrix_ == rhs.matrix_ ) && (
row_ == rhs.row_ ) && ( column_ <= rhs.column_ );
2069 template<
typename MatrixType2 >
2070 inline bool operator>=(
const RowIterator<MatrixType2>& rhs )
const {
2071 return (
matrix_ == rhs.matrix_ ) && (
row_ == rhs.row_ ) && ( column_ >= rhs.column_ );
2081 inline DifferenceType
operator-(
const RowIterator& rhs )
const {
2082 return column_ - rhs.column_;
2093 friend inline const RowIterator
operator+(
const RowIterator& it,
size_t inc ) {
2094 return RowIterator( *it.matrix_, it.row_, it.column_+inc );
2105 friend inline const RowIterator
operator+(
size_t inc,
const RowIterator& it ) {
2106 return RowIterator( *it.matrix_, it.row_, it.column_+inc );
2117 friend inline const RowIterator
operator-(
const RowIterator& it,
size_t dec ) {
2118 return RowIterator( *it.matrix_, it.row_, it.column_-dec );
2130 template<
typename MatrixType2 >
friend class RowIterator;
2140 typedef typename SelectType< useConst, ConstIterator, RowIterator<MT> >::Type
Iterator;
2145 enum { vectorizable = 0 };
2148 enum { smpAssignable = MT::smpAssignable };
2154 explicit inline DenseRow( MT& matrix,
size_t index );
2182 template<
typename VT >
inline DenseRow&
operator= (
const Vector<VT,true>& rhs );
2183 template<
typename VT >
inline DenseRow& operator+=(
const Vector<VT,true>& rhs );
2184 template<
typename VT >
inline DenseRow& operator-=(
const Vector<VT,true>& rhs );
2185 template<
typename VT >
inline DenseRow& operator*=(
const Vector<VT,true>& rhs );
2187 template<
typename Other >
2188 inline typename EnableIf< IsNumeric<Other>,
DenseRow >::Type&
2189 operator*=( Other rhs );
2191 template<
typename Other >
2192 inline typename EnableIf< IsNumeric<Other>,
DenseRow >::Type&
2193 operator/=( Other rhs );
2200 inline size_t size()
const;
2203 inline void reset();
2204 template<
typename Other >
inline DenseRow& scale(
const Other& scalar );
2212 template<
typename Other >
2213 inline bool canAlias(
const Other* alias )
const;
2215 template<
typename MT2,
bool SO2,
bool SF2 >
2216 inline bool canAlias(
const DenseRow<MT2,SO2,SF2>* alias )
const;
2218 template<
typename Other >
2219 inline bool isAliased(
const Other* alias )
const;
2221 template<
typename MT2,
bool SO2,
bool SF2 >
2222 inline bool isAliased(
const DenseRow<MT2,SO2,SF2>* alias )
const;
2227 template<
typename VT >
inline void assign (
const DenseVector <VT,true>& rhs );
2228 template<
typename VT >
inline void assign (
const SparseVector<VT,true>& rhs );
2229 template<
typename VT >
inline void addAssign (
const DenseVector <VT,true>& rhs );
2230 template<
typename VT >
inline void addAssign (
const SparseVector<VT,true>& rhs );
2231 template<
typename VT >
inline void subAssign (
const DenseVector <VT,true>& rhs );
2232 template<
typename VT >
inline void subAssign (
const SparseVector<VT,true>& rhs );
2233 template<
typename VT >
inline void multAssign(
const DenseVector <VT,true>& rhs );
2234 template<
typename VT >
inline void multAssign(
const SparseVector<VT,true>& rhs );
2248 template<
typename MT2,
bool SO2,
bool SF2 >
friend class DenseRow;
2250 template<
typename MT2,
bool SO2,
bool SF2 >
2251 friend bool isSame(
const DenseRow<MT2,SO2,SF2>& a,
const DenseRow<MT2,SO2,SF2>& b );
2282 template<
typename MT >
2288 throw std::invalid_argument(
"Invalid row access index" );
2309 template<
typename MT >
2314 return matrix_(row_,index);
2327 template<
typename MT >
2332 return matrix_(row_,index);
2346 template<
typename MT >
2349 return Iterator( matrix_, row_, 0UL );
2363 template<
typename MT >
2380 template<
typename MT >
2397 template<
typename MT >
2414 template<
typename MT >
2431 template<
typename MT >
2455 template<
typename MT >
2460 for(
size_t j=0UL; j<
columns; ++j )
2461 matrix_(row_,j) = rhs;
2480 template<
typename MT >
2483 if( &rhs ==
this )
return *
this;
2485 if(
size() != rhs.size() )
2486 throw std::invalid_argument(
"Row sizes do not match" );
2490 for(
size_t j=0UL; j<
columns; ++j )
2491 matrix_(row_,j) = rhs[j];
2510 template<
typename MT >
2511 template<
typename VT >
2519 throw std::invalid_argument(
"Vector sizes do not match" );
2521 if( (~rhs).canAlias( &matrix_ ) ) {
2526 if( IsSparseVector<VT>::value )
2548 template<
typename MT >
2549 template<
typename VT >
2550 inline DenseRow<MT,false,false>& DenseRow<MT,false,false>::operator+=(
const Vector<VT,true>& rhs )
2556 throw std::invalid_argument(
"Vector sizes do not match" );
2558 if( (~rhs).canAlias( &matrix_ ) ) {
2583 template<
typename MT >
2584 template<
typename VT >
2585 inline DenseRow<MT,false,false>& DenseRow<MT,false,false>::operator-=(
const Vector<VT,true>& rhs )
2591 throw std::invalid_argument(
"Vector sizes do not match" );
2593 if( (~rhs).canAlias( &matrix_ ) ) {
2619 template<
typename MT >
2620 template<
typename VT >
2621 inline DenseRow<MT,false,false>& DenseRow<MT,false,false>::operator*=(
const Vector<VT,true>& rhs )
2627 throw std::invalid_argument(
"Vector sizes do not match" );
2629 if( (~rhs).canAlias( &matrix_ ) || IsSparseVector<VT>::value ) {
2651 template<
typename MT >
2652 template<
typename Other >
2653 inline typename EnableIf< IsNumeric<Other>, DenseRow<MT,false,false> >::Type&
2654 DenseRow<MT,false,false>::operator*=( Other rhs )
2656 for(
size_t j=0UL; j<
size(); ++j )
2657 matrix_(row_,j) *= rhs;
2674 template<
typename MT >
2675 template<
typename Other >
2676 inline typename EnableIf< IsNumeric<Other>, DenseRow<MT,false,false> >::Type&
2677 DenseRow<MT,false,false>::operator/=( Other rhs )
2681 typedef typename DivTrait<ElementType,Other>::Type DT;
2682 typedef typename If< IsNumeric<DT>, DT, Other >::Type Tmp;
2686 if( IsNumeric<DT>::value && IsFloatingPoint<DT>::value ) {
2687 const Tmp tmp( Tmp(1)/static_cast<Tmp>( rhs ) );
2688 for(
size_t j=0UL; j<
size(); ++j )
2689 matrix_(row_,j) *= tmp;
2692 for(
size_t j=0UL; j<
size(); ++j )
2693 matrix_(row_,j) /= rhs;
2716 template<
typename MT >
2719 return matrix_.columns();
2731 template<
typename MT >
2734 return matrix_.columns();
2749 template<
typename MT >
2753 size_t nonzeros( 0UL );
2755 for(
size_t j=0UL; j<
columns; ++j )
2771 template<
typename MT >
2776 for(
size_t j=0UL; j<
columns; ++j )
2777 clear( matrix_(row_,j) );
2790 template<
typename MT >
2791 template<
typename Other >
2792 inline DenseRow<MT,false,false>& DenseRow<MT,false,false>::scale(
const Other& scalar )
2794 for(
size_t j=0UL; j<
size(); ++j ) {
2795 matrix_(row_,j) *= scalar;
2822 template<
typename MT >
2823 template<
typename Other >
2826 return matrix_.isAliased( alias );
2843 template<
typename MT >
2844 template<
typename MT2
2849 return matrix_.isAliased( &alias->matrix_ ) && ( row_ == alias->row_ );
2866 template<
typename MT >
2867 template<
typename Other >
2870 return matrix_.isAliased( alias );
2887 template<
typename MT >
2888 template<
typename MT2
2893 return matrix_.isAliased( &alias->matrix_ ) && ( row_ == alias->row_ );
2909 template<
typename MT >
2929 template<
typename MT >
2950 template<
typename MT >
2951 template<
typename VT >
2956 const size_t jend( (~rhs).
size() &
size_t(-2) );
2957 for(
size_t j=0UL; j<jend; j+=2UL ) {
2958 matrix_(row_,j ) = (~rhs)[j ];
2959 matrix_(row_,j+1UL) = (~rhs)[j+1UL];
2961 if( jend < (~rhs).size() )
2962 matrix_(row_,jend) = (~rhs)[jend];
2980 template<
typename MT >
2981 template<
typename VT >
2987 matrix_(row_,element->index()) = element->value();
3005 template<
typename MT >
3006 template<
typename VT >
3011 const size_t jend( (~rhs).
size() &
size_t(-2) );
3012 for(
size_t j=0UL; j<jend; j+=2UL ) {
3013 matrix_(row_,j ) += (~rhs)[j ];
3014 matrix_(row_,j+1UL) += (~rhs)[j+1UL];
3016 if( jend < (~rhs).size() )
3017 matrix_(row_,jend) += (~rhs)[jend];
3035 template<
typename MT >
3036 template<
typename VT >
3042 matrix_(row_,element->index()) += element->value();
3060 template<
typename MT >
3061 template<
typename VT >
3066 const size_t jend( (~rhs).
size() &
size_t(-2) );
3067 for(
size_t j=0UL; j<jend; j+=2UL ) {
3068 matrix_(row_,j ) -= (~rhs)[j ];
3069 matrix_(row_,j+1UL) -= (~rhs)[j+1UL];
3071 if( jend < (~rhs).size() )
3072 matrix_(row_,jend) -= (~rhs)[jend];
3090 template<
typename MT >
3091 template<
typename VT >
3097 matrix_(row_,element->index()) -= element->value();
3115 template<
typename MT >
3116 template<
typename VT >
3121 const size_t jend( (~rhs).
size() &
size_t(-2) );
3122 for(
size_t j=0UL; j<jend; j+=2UL ) {
3123 matrix_(row_,j ) *= (~rhs)[j ];
3124 matrix_(row_,j+1UL) *= (~rhs)[j+1UL];
3126 if( jend < (~rhs).size() )
3127 matrix_(row_,jend) *= (~rhs)[jend];
3145 template<
typename MT >
3146 template<
typename VT >
3156 matrix_(row_,element->index()) = tmp[element->index()] * element->value();
3182 template<
typename MT >
3183 class DenseRow<MT,false,true> :
public DenseVector< DenseRow<MT,false,true>, true >
3189 typedef typename SelectType< IsExpression<MT>::value, MT, MT& >::Type
Operand;
3192 typedef IntrinsicTrait<typename MT::ElementType>
IT;
3203 enum { useConst = IsConst<MT>::value };
3208 typedef DenseRow<MT,false,true>
This;
3209 typedef typename RowTrait<MT>::Type
ResultType;
3220 typedef typename SelectType< useConst, ConstReference, typename MT::Reference >::Type
Reference;
3226 typedef typename SelectType< useConst, ConstPointer, ElementType* >::Type
Pointer;
3232 typedef typename SelectType< useConst, ConstIterator, typename MT::Iterator >::Type
Iterator;
3237 enum { vectorizable = MT::vectorizable };
3240 enum { smpAssignable = MT::smpAssignable };
3246 explicit inline DenseRow( MT& matrix,
size_t index );
3276 template<
typename VT >
inline DenseRow&
operator= (
const Vector<VT,true>& rhs );
3277 template<
typename VT >
inline DenseRow& operator+=(
const Vector<VT,true>& rhs );
3278 template<
typename VT >
inline DenseRow& operator-=(
const Vector<VT,true>& rhs );
3279 template<
typename VT >
inline DenseRow& operator*=(
const Vector<VT,true>& rhs );
3281 template<
typename Other >
3282 inline typename EnableIf< IsNumeric<Other>,
DenseRow >::Type&
3283 operator*=( Other rhs );
3285 template<
typename Other >
3286 inline typename EnableIf< IsNumeric<Other>,
DenseRow >::Type&
3287 operator/=( Other rhs );
3294 inline size_t size()
const;
3297 inline void reset();
3298 template<
typename Other >
inline DenseRow& scale(
const Other& scalar );
3305 template<
typename VT >
3306 struct VectorizedAssign {
3307 enum { value = vectorizable && VT::vectorizable &&
3308 IsSame<ElementType,typename VT::ElementType>::value };
3314 template<
typename VT >
3315 struct VectorizedAddAssign {
3316 enum { value = vectorizable && VT::vectorizable &&
3317 IsSame<ElementType,typename VT::ElementType>::value &&
3318 IntrinsicTrait<ElementType>::addition };
3324 template<
typename VT >
3325 struct VectorizedSubAssign {
3326 enum { value = vectorizable && VT::vectorizable &&
3327 IsSame<ElementType,typename VT::ElementType>::value &&
3328 IntrinsicTrait<ElementType>::subtraction };
3334 template<
typename VT >
3335 struct VectorizedMultAssign {
3336 enum { value = vectorizable && VT::vectorizable &&
3337 IsSame<ElementType,typename VT::ElementType>::value &&
3338 IntrinsicTrait<ElementType>::multiplication };
3346 template<
typename Other >
3347 inline bool canAlias(
const Other* alias )
const;
3349 template<
typename MT2,
bool SO2,
bool SF2 >
3350 inline bool canAlias(
const DenseRow<MT2,SO2,SF2>* alias )
const;
3352 template<
typename Other >
3353 inline bool isAliased(
const Other* alias )
const;
3355 template<
typename MT2,
bool SO2,
bool SF2 >
3356 inline bool isAliased(
const DenseRow<MT2,SO2,SF2>* alias )
const;
3367 template<
typename VT >
3368 inline typename DisableIf< VectorizedAssign<VT> >::Type
3369 assign(
const DenseVector<VT,true>& rhs );
3371 template<
typename VT >
3372 inline typename EnableIf< VectorizedAssign<VT> >::Type
3373 assign(
const DenseVector<VT,true>& rhs );
3375 template<
typename VT >
inline void assign(
const SparseVector<VT,true>& rhs );
3377 template<
typename VT >
3378 inline typename DisableIf< VectorizedAddAssign<VT> >::Type
3379 addAssign(
const DenseVector<VT,true>& rhs );
3381 template<
typename VT >
3382 inline typename EnableIf< VectorizedAddAssign<VT> >::Type
3383 addAssign(
const DenseVector<VT,true>& rhs );
3385 template<
typename VT >
inline void addAssign(
const SparseVector<VT,true>& rhs );
3387 template<
typename VT >
3388 inline typename DisableIf< VectorizedSubAssign<VT> >::Type
3389 subAssign(
const DenseVector<VT,true>& rhs );
3391 template<
typename VT >
3392 inline typename EnableIf< VectorizedSubAssign<VT> >::Type
3393 subAssign(
const DenseVector<VT,true>& rhs );
3395 template<
typename VT >
inline void subAssign(
const SparseVector<VT,true>& rhs );
3397 template<
typename VT >
3398 inline typename DisableIf< VectorizedMultAssign<VT> >::Type
3399 multAssign(
const DenseVector<VT,true>& rhs );
3401 template<
typename VT >
3402 inline typename EnableIf< VectorizedMultAssign<VT> >::Type
3403 multAssign(
const DenseVector<VT,true>& rhs );
3405 template<
typename VT >
inline void multAssign(
const SparseVector<VT,true>& rhs );
3419 template<
typename MT2,
bool SO2,
bool SF2 >
friend class DenseRow;
3421 template<
typename MT2,
bool SO2,
bool SF2 >
3422 friend bool isSame(
const DenseRow<MT2,SO2,SF2>& a,
const DenseRow<MT2,SO2,SF2>& b );
3453 template<
typename MT >
3459 throw std::invalid_argument(
"Invalid row access index" );
3480 template<
typename MT >
3485 return matrix_(index,row_);
3498 template<
typename MT >
3503 return matrix_(index,row_);
3517 template<
typename MT >
3520 return matrix_.data( row_ );
3534 template<
typename MT >
3537 return matrix_.data( row_ );
3551 template<
typename MT >
3554 return matrix_.begin( row_ );
3568 template<
typename MT >
3571 return matrix_.cbegin( row_ );
3585 template<
typename MT >
3588 return matrix_.cbegin( row_ );
3602 template<
typename MT >
3605 return matrix_.end( row_ );
3619 template<
typename MT >
3622 return matrix_.cend( row_ );
3636 template<
typename MT >
3639 return matrix_.cend( row_ );
3660 template<
typename MT >
3665 for(
size_t i=0UL; i<
rows; ++i )
3666 matrix_(i,row_) = rhs;
3685 template<
typename MT >
3688 if( &rhs ==
this )
return *
this;
3690 if(
size() != rhs.size() )
3691 throw std::invalid_argument(
"Row sizes do not match" );
3695 for(
size_t i=0UL; i<
rows; ++i )
3696 matrix_(i,row_) = rhs[i];
3715 template<
typename MT >
3716 template<
typename VT >
3723 throw std::invalid_argument(
"Vector sizes do not match" );
3725 if( (~rhs).canAlias( &matrix_ ) ) {
3730 if( IsSparseVector<VT>::value )
3752 template<
typename MT >
3753 template<
typename VT >
3754 inline DenseRow<MT,false,true>& DenseRow<MT,false,true>::operator+=(
const Vector<VT,true>& rhs )
3760 throw std::invalid_argument(
"Vector sizes do not match" );
3762 if( (~rhs).canAlias( &matrix_ ) ) {
3787 template<
typename MT >
3788 template<
typename VT >
3789 inline DenseRow<MT,false,true>& DenseRow<MT,false,true>::operator-=(
const Vector<VT,true>& rhs )
3795 throw std::invalid_argument(
"Vector sizes do not match" );
3797 if( (~rhs).canAlias( &matrix_ ) ) {
3823 template<
typename MT >
3824 template<
typename VT >
3825 inline DenseRow<MT,false,true>& DenseRow<MT,false,true>::operator*=(
const Vector<VT,true>& rhs )
3831 throw std::invalid_argument(
"Vector sizes do not match" );
3833 if( (~rhs).canAlias( &matrix_ ) || IsSparseVector<VT>::value ) {
3855 template<
typename MT >
3856 template<
typename Other >
3857 inline typename EnableIf< IsNumeric<Other>, DenseRow<MT,false,true> >::Type&
3858 DenseRow<MT,false,true>::operator*=( Other rhs )
3860 return operator=( (*
this) * rhs );
3876 template<
typename MT >
3877 template<
typename Other >
3878 inline typename EnableIf< IsNumeric<Other>, DenseRow<MT,false,true> >::Type&
3879 DenseRow<MT,false,true>::operator/=( Other rhs )
3883 return operator=( (*
this) / rhs );
3903 template<
typename MT >
3906 return matrix_.columns();
3918 template<
typename MT >
3921 return matrix_.capacity( row_ );
3936 template<
typename MT >
3939 return matrix_.nonZeros( row_ );
3951 template<
typename MT >
3954 matrix_.reset( row_ );
3967 template<
typename MT >
3968 template<
typename Other >
3969 inline DenseRow<MT,false,true>& DenseRow<MT,false,true>::scale(
const Other& scalar )
3971 for(
size_t i=0UL; i<
size(); ++i ) {
3972 matrix_(i,row_) *= scalar;
3999 template<
typename MT >
4000 template<
typename Other >
4003 return matrix_.isAliased( alias );
4020 template<
typename MT >
4021 template<
typename MT2
4026 return matrix_.isAliased( &alias->matrix_ ) && ( row_ == alias->row_ );
4043 template<
typename MT >
4044 template<
typename Other >
4047 return matrix_.isAliased( alias );
4064 template<
typename MT >
4065 template<
typename MT2
4070 return matrix_.isAliased( &alias->matrix_ ) && ( row_ == alias->row_ );
4086 template<
typename MT >
4089 return matrix_.isAligned();
4106 template<
typename MT >
4128 template<
typename MT >
4129 inline typename DenseRow<MT,false,true>::IntrinsicType
4132 return matrix_.load( index, row_ );
4151 template<
typename MT >
4152 inline typename DenseRow<MT,false,true>::IntrinsicType
4155 return matrix_.loadu( index, row_ );
4175 template<
typename MT >
4178 matrix_.store( index, row_, value );
4198 template<
typename MT >
4201 matrix_.storeu( index, row_, value );
4221 template<
typename MT >
4224 matrix_.stream( index, row_, value );
4242 template<
typename MT >
4243 template<
typename VT >
4244 inline typename DisableIf< typename DenseRow<MT,false,true>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type
4249 const size_t iend( (~rhs).
size() &
size_t(-2) );
4250 for(
size_t i=0UL; i<iend; i+=2UL ) {
4251 matrix_(i ,row_) = (~rhs)[i ];
4252 matrix_(i+1UL,row_) = (~rhs)[i+1UL];
4254 if( iend < (~rhs).size() )
4255 matrix_(iend,row_) = (~rhs)[iend];
4273 template<
typename MT >
4274 template<
typename VT >
4275 inline typename EnableIf< typename DenseRow<MT,false,true>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type
4287 matrix_.stream( i, row_, (~rhs).
load(i) );
4292 const size_t iend( rows &
size_t(-
IT::size*4) );
4296 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
4297 matrix_.store( i , row_, it.load() ); it +=
IT::size;
4303 matrix_.store( i, row_, it.load() );
4323 template<
typename MT >
4324 template<
typename VT >
4330 matrix_(element->index(),row_) = element->value();
4348 template<
typename MT >
4349 template<
typename VT >
4350 inline typename DisableIf< typename DenseRow<MT,false,true>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type
4355 const size_t iend( (~rhs).
size() &
size_t(-2) );
4356 for(
size_t i=0UL; i<iend; i+=2UL ) {
4357 matrix_(i ,row_) += (~rhs)[i ];
4358 matrix_(i+1UL,row_) += (~rhs)[i+1UL];
4360 if( iend < (~rhs).size() )
4361 matrix_(iend,row_) += (~rhs)[iend];
4379 template<
typename MT >
4380 template<
typename VT >
4381 inline typename EnableIf< typename DenseRow<MT,false,true>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type
4390 const size_t iend( rows &
size_t(-
IT::size*4) );
4394 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
4395 matrix_.store( i , row_, matrix_.load(i ,row_) + it.load() ); it +=
IT::size;
4401 matrix_.store( i, row_, matrix_.load(i,row_) + it.load() );
4420 template<
typename MT >
4421 template<
typename VT >
4427 matrix_(element->index(),row_) += element->value();
4445 template<
typename MT >
4446 template<
typename VT >
4447 inline typename DisableIf< typename DenseRow<MT,false,true>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type
4452 const size_t iend( (~rhs).
size() &
size_t(-2) );
4453 for(
size_t i=0UL; i<iend; i+=2UL ) {
4454 matrix_(i ,row_) -= (~rhs)[i ];
4455 matrix_(i+1UL,row_) -= (~rhs)[i+1UL];
4457 if( iend < (~rhs).size() )
4458 matrix_(iend,row_) -= (~rhs)[iend];
4476 template<
typename MT >
4477 template<
typename VT >
4478 inline typename EnableIf< typename DenseRow<MT,false,true>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type
4487 const size_t iend( rows &
size_t(-
IT::size*4) );
4491 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
4492 matrix_.store( i , row_, matrix_.load(i ,row_) - it.load() ); it +=
IT::size;
4498 matrix_.store( i, row_, matrix_.load(i,row_) - it.load() );
4517 template<
typename MT >
4518 template<
typename VT >
4524 matrix_(element->index(),row_) -= element->value();
4542 template<
typename MT >
4543 template<
typename VT >
4544 inline typename DisableIf< typename DenseRow<MT,false,true>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type
4549 const size_t iend( (~rhs).
size() &
size_t(-2) );
4550 for(
size_t i=0UL; i<iend; i+=2UL ) {
4551 matrix_(i ,row_) *= (~rhs)[i ];
4552 matrix_(i+1UL,row_) *= (~rhs)[i+1UL];
4554 if( iend < (~rhs).size() )
4555 matrix_(iend,row_) *= (~rhs)[iend];
4573 template<
typename MT >
4574 template<
typename VT >
4575 inline typename EnableIf< typename DenseRow<MT,false,true>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type
4584 const size_t iend( rows &
size_t(-
IT::size*4) );
4588 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
4589 matrix_.store( i , row_, matrix_.load(i ,row_) * it.load() ); it +=
IT::size;
4595 matrix_.store( i, row_, matrix_.load(i,row_) * it.load() );
4614 template<
typename MT >
4615 template<
typename VT >
4625 matrix_(element->index(),row_) = tmp[element->index()] * element->value();
4646 template<
typename MT,
bool SO,
bool SF >
4647 inline void reset( DenseRow<MT,SO,SF>&
row );
4649 template<
typename MT,
bool SO,
bool SF >
4650 inline void clear( DenseRow<MT,SO,SF>&
row );
4652 template<
typename MT,
bool SO,
bool SF >
4653 inline bool isDefault(
const DenseRow<MT,SO,SF>&
row );
4655 template<
typename MT,
bool SO,
bool SF >
4656 inline bool isSame(
const DenseRow<MT,SO,SF>& a,
const DenseRow<MT,SO,SF>& b );
4668 template<
typename MT
4687 template<
typename MT
4715 template<
typename MT
4720 for(
size_t i=0UL; i<row.size(); ++i )
4721 if( !
isDefault( row[i] ) )
return false;
4739 template<
typename MT
4744 return (
isSame( a.matrix_, b.matrix_ ) && ( a.row_ == b.row_ ) );
4759 template<
typename MT,
bool SO,
bool SF >
4760 struct SubvectorTrait< DenseRow<MT,SO,SF> >
Pointer data()
Low-level data access to the row elements.
Definition: DenseRow.h:660
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
ConstIterator cend() const
Returns an iterator just past the last element of the row.
Definition: DenseRow.h:779
IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the dense row.
Definition: DenseRow.h:1293
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
Operand matrix_
The dense matrix containing the row.
Definition: DenseRow.h:553
Header file for the row trait.
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
ConstIterator cbegin() const
Returns an iterator to the first element of the row.
Definition: DenseRow.h:728
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
Header file for the row base class.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DenseRow.h:342
#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
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.
const bool useStreaming
Configuration of the streaming behavior.For large vectors and matrices non-temporal stores can provid...
Definition: Streaming.h:50
size_t nonZeros() const
Returns the number of non-zero elements in the row.
Definition: DenseRow.h:1079
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:316
Reference operator[](size_t index)
Subscript operator for the direct access to the row elements.
Definition: DenseRow.h:624
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
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
size_t size() const
Returns the current size/dimension of the row.
Definition: DenseRow.h:1046
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a transposition expression (i...
Definition: TransExpr.h:118
MT::ElementType ElementType
Type of the row elements.
Definition: DenseRow.h:343
void reset()
Reset to the default initial values.
Definition: DenseRow.h:1094
SelectType< useConst, ConstIterator, typename MT::Iterator >::Type Iterator
Iterator over non-constant elements.
Definition: DenseRow.h:364
bool canAlias(const Other *alias) const
Returns whether the dense row can alias with the given address alias.
Definition: DenseRow.h:1143
SelectType< useConst, ConstReference, typename MT::Reference >::Type Reference
Reference to a non-constant row value.
Definition: DenseRow.h:352
Constraint on the data type.
Base template for the RowTrait class.
Definition: RowTrait.h:115
SelectType< useConst, ConstPointer, ElementType * >::Type Pointer
Pointer to a non-constant row value.
Definition: DenseRow.h:358
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.
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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
Header file for the Or class template.
bool isAligned() const
Returns whether the dense row is properly aligned in memory.
Definition: DenseRow.h:1229
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
BLAZE_ALWAYS_INLINE void clear(const NonNumericProxy< MT > &proxy)
Clearing the represented element.
Definition: NonNumericProxy.h:854
Header file for the subvector trait.
MT::ConstIterator ConstIterator
Iterator over constant elements.
Definition: DenseRow.h:361
const ElementType * ConstPointer
Pointer to a constant row value.
Definition: DenseRow.h:355
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
Iterator begin()
Returns an iterator to the first element of the row.
Definition: DenseRow.h:694
IT::Type IntrinsicType
Intrinsic type of the row elements.
Definition: DenseRow.h:344
Constraint on the data type.
Constraint on the data type.
#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
const size_t row_
The index of the row in the matrix.
Definition: DenseRow.h:554
Constraints on the storage order of matrix types.
Constraint on the data type.
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
void store(size_t index, const IntrinsicType &value)
Aligned store of an intrinsic element of the dense row.
Definition: DenseRow.h:1316
Constraint on the data type.
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.
Header file for the IsNumeric type trait.
DenseRow & operator=(const ElementType &rhs)
Homogenous assignment to all row elements.
Definition: DenseRow.h:803
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
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:2477
Header file for the IsConst type trait.
RowTrait< MT >::Type ResultType
Result type for expression template evaluations.
Definition: DenseRow.h:341
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:749
Base class for all rows.The Row class serves as a tag for all rows (i.e. dense and sparse rows)...
Definition: Row.h:63
Header file for run time assertion macros.
bool canSMPAssign() const
Returns whether the dense row can be used in SMP assignments.
Definition: DenseRow.h:1249
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
IntrinsicTrait< typename MT::ElementType > IT
Intrinsic trait for the row element type.
Definition: DenseRow.h:324
const DenseRow & CompositeType
Data type for composite expression templates.
Definition: DenseRow.h:346
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.
DenseRow< MT, SO, SF > This
Type of this DenseRow instance.
Definition: DenseRow.h:340
DenseRow(MT &matrix, size_t index)
The constructor for DenseRow.
Definition: DenseRow.h:597
bool isAliased(const Other *alias) const
Returns whether the dense row is aliased with the given address alias.
Definition: DenseRow.h:1187
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
Reference to a specific row of a dense matrix.The DenseRow template represents a reference to a speci...
Definition: DenseRow.h:315
Header file for the cache size of the target architecture.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2481
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
Iterator end()
Returns an iterator just past the last element of the row.
Definition: DenseRow.h:745
#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
SelectType< IsExpression< MT >::value, MT, MT & >::Type Operand
Composite data type of the dense matrix expression.
Definition: DenseRow.h:321
Header file for the RemoveReference type trait.
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
Compile time check for constant data types.The IsConst type trait tests whether or not the given temp...
Definition: IsConst.h:94
Header file for all intrinsic functionality.
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:79
void stream(size_t index, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the dense row.
Definition: DenseRow.h:1362
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
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
size_t capacity() const
Returns the maximum capacity of the dense row.
Definition: DenseRow.h:1061
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
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.
#define BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a row dense or sparse vector type (i...
Definition: TransposeFlag.h:81
IntrinsicType load(size_t index) const
Aligned load of an intrinsic element of the dense row.
Definition: DenseRow.h:1271
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2479
MT::ConstReference ConstReference
Reference to a constant row value.
Definition: DenseRow.h:349
void storeu(size_t index, const IntrinsicType &value)
Unligned store of an intrinsic element of the dense row.
Definition: DenseRow.h:1339
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
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< 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
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DenseRow.h:345
Header file for a safe C++ NULL pointer implementation.