35 #ifndef _BLAZE_MATH_VIEWS_DENSESUBVECTOR_H_
36 #define _BLAZE_MATH_VIEWS_DENSESUBVECTOR_H_
374 template<
typename VT
376 ,
bool TF = IsRowVector<VT>::value >
426 template<
typename IteratorType >
435 typedef typename std::iterator_traits<IteratorType>::value_type
ValueType;
438 typedef typename std::iterator_traits<IteratorType>::pointer
PointerType;
441 typedef typename std::iterator_traits<IteratorType>::reference
ReferenceType;
444 typedef typename std::iterator_traits<IteratorType>::difference_type
DifferenceType;
580 for(
size_t j=0UL; j<
rest_; ++j )
720 enum { vectorizable = VT::vectorizable };
723 enum { smpAssignable = VT::smpAssignable };
760 template<
typename VT2 >
inline DenseSubvector& operator+=(
const Vector<VT2,TF>& rhs );
761 template<
typename VT2 >
inline DenseSubvector& operator-=(
const Vector<VT2,TF>& rhs );
762 template<
typename VT2 >
inline DenseSubvector& operator*=(
const Vector<VT2,TF>& rhs );
764 template<
typename Other >
765 inline typename EnableIf< IsNumeric<Other>,
DenseSubvector >::Type&
766 operator*=( Other rhs );
768 template<
typename Other >
769 inline typename EnableIf< IsNumeric<Other>,
DenseSubvector >::Type&
770 operator/=( Other rhs );
777 inline size_t size()
const;
781 template<
typename Other >
inline DenseSubvector& scale(
const Other& scalar );
788 template<
typename VT2 >
790 struct VectorizedAssign {
791 enum { value = vectorizable && VT2::vectorizable &&
792 IsSame<ElementType,typename VT2::ElementType>::value };
799 template<
typename VT2 >
801 struct VectorizedAddAssign {
802 enum { value = vectorizable && VT2::vectorizable &&
803 IsSame<ElementType,typename VT2::ElementType>::value &&
804 IntrinsicTrait<ElementType>::addition };
811 template<
typename VT2 >
813 struct VectorizedSubAssign {
814 enum { value = vectorizable && VT2::vectorizable &&
815 IsSame<ElementType,typename VT2::ElementType>::value &&
816 IntrinsicTrait<ElementType>::subtraction };
823 template<
typename VT2 >
825 struct VectorizedMultAssign {
826 enum { value = vectorizable && VT2::vectorizable &&
827 IsSame<ElementType,typename VT2::ElementType>::value &&
828 IntrinsicTrait<ElementType>::multiplication };
837 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
838 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
849 template<
typename VT2 >
850 inline typename DisableIf< VectorizedAssign<VT2> >::Type
851 assign(
const DenseVector <VT2,TF>& rhs );
853 template<
typename VT2 >
854 inline typename EnableIf< VectorizedAssign<VT2> >::Type
855 assign(
const DenseVector <VT2,TF>& rhs );
857 template<
typename VT2 >
inline void assign(
const SparseVector<VT2,TF>& rhs );
859 template<
typename VT2 >
860 inline typename DisableIf< VectorizedAddAssign<VT2> >::Type
861 addAssign(
const DenseVector <VT2,TF>& rhs );
863 template<
typename VT2 >
864 inline typename EnableIf< VectorizedAddAssign<VT2> >::Type
865 addAssign (
const DenseVector <VT2,TF>& rhs );
867 template<
typename VT2 >
inline void addAssign(
const SparseVector<VT2,TF>& rhs );
869 template<
typename VT2 >
870 inline typename DisableIf< VectorizedSubAssign<VT2> >::Type
871 subAssign (
const DenseVector <VT2,TF>& rhs );
873 template<
typename VT2 >
874 inline typename EnableIf< VectorizedSubAssign<VT2> >::Type
875 subAssign(
const DenseVector <VT2,TF>& rhs );
877 template<
typename VT2 >
inline void subAssign(
const SparseVector<VT2,TF>& rhs );
879 template<
typename VT2 >
880 inline typename DisableIf< VectorizedMultAssign<VT2> >::Type
881 multAssign(
const DenseVector <VT2,TF>& rhs );
883 template<
typename VT2 >
884 inline typename EnableIf< VectorizedMultAssign<VT2> >::Type
885 multAssign(
const DenseVector <VT2,TF>& rhs );
887 template<
typename VT2 >
inline void multAssign(
const SparseVector<VT2,TF>& rhs );
919 template<
bool AF1,
typename VT2,
bool AF2,
bool TF2 >
958 template<
typename VT
965 , rest_ ( n %
IT::size )
966 , final_ ( n - rest_ )
967 , isAligned_( ( index %
IT::size == 0UL ) &&
968 ( index + n == vector.size() || n %
IT::size == 0UL ) )
970 if( index + n > vector.size() )
971 throw std::invalid_argument(
"Invalid subvector specification" );
990 template<
typename VT
997 return vector_[offset_+index];
1008 template<
typename VT
1015 return const_cast<const VT&
>( vector_ )[offset_+index];
1027 template<
typename VT
1032 return vector_.data() + offset_;
1044 template<
typename VT
1049 return vector_.data() + offset_;
1061 template<
typename VT
1066 const typename VT::Iterator first( vector_.begin() + offset_ );
1067 return Iterator( first, first + final_, rest_, isAligned_ );
1079 template<
typename VT
1085 return ConstIterator( first, first + final_, rest_, isAligned_ );
1097 template<
typename VT
1103 return ConstIterator( first, first + final_, rest_, isAligned_ );
1115 template<
typename VT
1120 const typename VT::Iterator last( vector_.begin() + offset_ + size_ );
1121 return Iterator( last, last, rest_, isAligned_ );
1133 template<
typename VT
1151 template<
typename VT
1176 template<
typename VT
1181 const size_t iend( offset_ + size_ );
1183 for(
size_t i=offset_; i<iend; ++i )
1201 template<
typename VT
1209 if( &rhs ==
this || ( &vector_ == &rhs.
vector_ && offset_ == rhs.
offset_ ) )
1212 if( size() != rhs.
size() )
1213 throw std::invalid_argument(
"Subvector sizes do not match" );
1238 template<
typename VT
1241 template<
typename VT2 >
1247 if( size() != (~rhs).size() )
1248 throw std::invalid_argument(
"Vector sizes do not match" );
1250 if( (~rhs).canAlias( &vector_ ) ) {
1275 template<
typename VT
1278 template<
typename VT2 >
1284 if( size() != (~rhs).size() )
1285 throw std::invalid_argument(
"Vector sizes do not match" );
1287 if( (~rhs).canAlias( &vector_ ) ) {
1310 template<
typename VT
1313 template<
typename VT2 >
1319 if( size() != (~rhs).size() )
1320 throw std::invalid_argument(
"Vector sizes do not match" );
1322 if( (~rhs).canAlias( &vector_ ) ) {
1346 template<
typename VT
1349 template<
typename VT2 >
1355 if( size() != (~rhs).size() )
1356 throw std::invalid_argument(
"Vector sizes do not match" );
1378 template<
typename VT
1381 template<
typename Other >
1400 template<
typename VT
1403 template<
typename Other >
1428 template<
typename VT
1443 template<
typename VT
1448 return vector_.capacity() - offset_;
1461 template<
typename VT
1466 size_t nonzeros( 0 );
1468 const size_t iend( offset_ + size_ );
1469 for(
size_t i=offset_; i<iend; ++i ) {
1484 template<
typename VT
1491 const size_t iend( offset_ + size_ );
1492 for(
size_t i=offset_; i<iend; ++i )
1493 reset( vector_[i] );
1504 template<
typename VT
1507 template<
typename Other >
1510 const size_t iend( offset_ + size_ );
1511 for(
size_t i=offset_; i<iend; ++i )
1512 vector_[i] *= scalar;
1536 template<
typename VT
1539 template<
typename Other >
1542 return static_cast<const void*
>( &vector_ ) == static_cast<const void*>( alias );
1557 template<
typename VT
1560 template<
typename Other >
1563 return static_cast<const void*
>( &vector_ ) == static_cast<const void*>( alias );
1577 template<
typename VT
1597 template<
typename VT
1620 template<
typename VT
1626 return loadu( index );
1644 template<
typename VT
1655 if( isAligned_ || index != final_ ) {
1656 return vector_.loadu( offset_+index );
1660 for(
size_t j=0UL; j<rest_; ++j )
1661 value[j] = vector_[offset_+index+j];
1682 template<
typename VT
1706 template<
typename VT
1716 if( isAligned_ || index != final_ ) {
1717 vector_.storeu( offset_+index, value );
1720 for(
size_t j=0UL; j<rest_; ++j )
1721 vector_[offset_+index+j] = value[j];
1741 template<
typename VT
1762 template<
typename VT
1765 template<
typename VT2 >
1771 const size_t iend( size() &
size_t(-2) );
1772 for(
size_t i=0UL; i<iend; i+=2UL ) {
1773 vector_[i+offset_ ] = (~rhs)[i ];
1774 vector_[i+offset_+1UL] = (~rhs)[i+1UL];
1776 if( iend < size() ) {
1777 vector_[iend+offset_] = (~rhs)[iend];
1794 template<
typename VT
1797 template<
typename VT2 >
1807 !(~rhs).isAliased( &vector_ ) )
1809 for(
size_t i=0UL; i<size(); i+=IT::size ) {
1810 vector_.stream( offset_+i, (~rhs).
load(i) );
1815 const size_t iend( size_ &
size_t(-IT::size*4) );
1819 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1820 vector_.storeu( offset_+i , it.load() ); it += IT::size;
1821 vector_.storeu( offset_+i+IT::size , it.load() ); it += IT::size;
1822 vector_.storeu( offset_+i+IT::size*2UL, it.load() ); it += IT::size;
1823 vector_.storeu( offset_+i+IT::size*3UL, it.load() ); it += IT::size;
1825 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1844 template<
typename VT
1847 template<
typename VT2 >
1852 for(
typename VT2::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1853 vector_[element->index()+offset_] = element->value();
1869 template<
typename VT
1872 template<
typename VT2 >
1878 const size_t iend( size() &
size_t(-2) );
1879 for(
size_t i=0UL; i<iend; i+=2UL ) {
1880 vector_[i+offset_ ] += (~rhs)[i ];
1881 vector_[i+offset_+1UL] += (~rhs)[i+1UL];
1883 if( iend < size() ) {
1884 vector_[iend+offset_] += (~rhs)[iend];
1901 template<
typename VT
1904 template<
typename VT2 >
1912 const size_t iend( size_ &
size_t(-IT::size*4) );
1916 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1917 vector_.storeu( offset_+i ,
load(i ) + it.load() ); it += IT::size;
1918 vector_.storeu( offset_+i+IT::size ,
load(i+IT::size ) + it.load() ); it += IT::size;
1919 vector_.storeu( offset_+i+IT::size*2UL,
load(i+IT::size*2UL) + it.load() ); it += IT::size;
1920 vector_.storeu( offset_+i+IT::size*3UL,
load(i+IT::size*3UL) + it.load() ); it += IT::size;
1922 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1940 template<
typename VT
1943 template<
typename VT2 >
1948 for(
typename VT2::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1949 vector_[element->index()+offset_] += element->value();
1965 template<
typename VT
1968 template<
typename VT2 >
1974 const size_t iend( size() &
size_t(-2) );
1975 for(
size_t i=0UL; i<iend; i+=2UL ) {
1976 vector_[i+offset_ ] -= (~rhs)[i ];
1977 vector_[i+offset_+1UL] -= (~rhs)[i+1UL];
1979 if( iend < size() ) {
1980 vector_[iend+offset_] -= (~rhs)[iend];
1997 template<
typename VT
2000 template<
typename VT2 >
2008 const size_t iend( size_ &
size_t(-IT::size*4) );
2012 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
2013 vector_.storeu( offset_+i ,
load(i ) - it.load() ); it += IT::size;
2014 vector_.storeu( offset_+i+IT::size ,
load(i+IT::size ) - it.load() ); it += IT::size;
2015 vector_.storeu( offset_+i+IT::size*2UL,
load(i+IT::size*2UL) - it.load() ); it += IT::size;
2016 vector_.storeu( offset_+i+IT::size*3UL,
load(i+IT::size*3UL) - it.load() ); it += IT::size;
2018 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
2036 template<
typename VT
2039 template<
typename VT2 >
2044 for(
typename VT2::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2045 vector_[element->index()+offset_] -= element->value();
2061 template<
typename VT
2064 template<
typename VT2 >
2070 const size_t iend( size() &
size_t(-2) );
2071 for(
size_t i=0UL; i<iend; i+=2UL ) {
2072 vector_[i+offset_ ] *= (~rhs)[i ];
2073 vector_[i+offset_+1UL] *= (~rhs)[i+1UL];
2075 if( iend < size() ) {
2076 vector_[iend+offset_] *= (~rhs)[iend];
2093 template<
typename VT
2096 template<
typename VT2 >
2104 const size_t iend( size_ &
size_t(-IT::size*4) );
2108 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
2109 vector_.storeu( offset_+i ,
load(i ) * it.load() ); it += IT::size;
2110 vector_.storeu( offset_+i+IT::size ,
load(i+IT::size ) * it.load() ); it += IT::size;
2111 vector_.storeu( offset_+i+IT::size*2UL,
load(i+IT::size*2UL) * it.load() ); it += IT::size;
2112 vector_.storeu( offset_+i+IT::size*3UL,
load(i+IT::size*3UL) * it.load() ); it += IT::size;
2114 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
2132 template<
typename VT
2135 template<
typename VT2 >
2144 for(
typename VT2::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2145 vector_[element->index()+offset_] = tmp[element->index()] * element->value();
2170 template<
typename VT
2197 typedef DenseSubvector<VT,aligned,TF>
This;
2198 typedef typename SubvectorTrait<VT>::Type
ResultType;
2209 typedef typename SelectType< useConst, ConstReference, typename VT::Reference >::Type
Reference;
2215 typedef typename SelectType< useConst, ConstPointer, ElementType* >::Type
Pointer;
2221 typedef typename SelectType< useConst, ConstIterator, typename VT::Iterator >::Type
Iterator;
2226 enum { vectorizable = VT::vectorizable };
2229 enum { smpAssignable = VT::smpAssignable };
2266 template<
typename VT2 >
inline DenseSubvector& operator+=(
const Vector<VT2,TF>& rhs );
2267 template<
typename VT2 >
inline DenseSubvector& operator-=(
const Vector<VT2,TF>& rhs );
2268 template<
typename VT2 >
inline DenseSubvector& operator*=(
const Vector<VT2,TF>& rhs );
2270 template<
typename Other >
2271 inline typename EnableIf< IsNumeric<Other>,
DenseSubvector >::Type&
2272 operator*=( Other rhs );
2274 template<
typename Other >
2275 inline typename EnableIf< IsNumeric<Other>,
DenseSubvector >::Type&
2276 operator/=( Other rhs );
2283 inline size_t size()
const;
2286 inline void reset();
2287 template<
typename Other >
inline DenseSubvector& scale(
const Other& scalar );
2294 template<
typename VT2 >
2295 struct VectorizedAssign {
2296 enum { value = vectorizable && VT2::vectorizable &&
2297 IsSame<ElementType,typename VT2::ElementType>::value };
2303 template<
typename VT2 >
2304 struct VectorizedAddAssign {
2305 enum { value = vectorizable && VT2::vectorizable &&
2306 IsSame<ElementType,typename VT2::ElementType>::value &&
2307 IntrinsicTrait<ElementType>::addition };
2313 template<
typename VT2 >
2314 struct VectorizedSubAssign {
2315 enum { value = vectorizable && VT2::vectorizable &&
2316 IsSame<ElementType,typename VT2::ElementType>::value &&
2317 IntrinsicTrait<ElementType>::subtraction };
2323 template<
typename VT2 >
2324 struct VectorizedMultAssign {
2325 enum { value = vectorizable && VT2::vectorizable &&
2326 IsSame<ElementType,typename VT2::ElementType>::value &&
2327 IntrinsicTrait<ElementType>::multiplication };
2335 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
2336 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
2347 template<
typename VT2 >
2348 inline typename DisableIf< VectorizedAssign<VT2> >::Type
2349 assign(
const DenseVector <VT2,TF>& rhs );
2351 template<
typename VT2 >
2352 inline typename EnableIf< VectorizedAssign<VT2> >::Type
2353 assign(
const DenseVector <VT2,TF>& rhs );
2355 template<
typename VT2 >
inline void assign(
const SparseVector<VT2,TF>& rhs );
2357 template<
typename VT2 >
2358 inline typename DisableIf< VectorizedAddAssign<VT2> >::Type
2359 addAssign(
const DenseVector <VT2,TF>& rhs );
2361 template<
typename VT2 >
2362 inline typename EnableIf< VectorizedAddAssign<VT2> >::Type
2363 addAssign (
const DenseVector <VT2,TF>& rhs );
2365 template<
typename VT2 >
inline void addAssign(
const SparseVector<VT2,TF>& rhs );
2367 template<
typename VT2 >
2368 inline typename DisableIf< VectorizedSubAssign<VT2> >::Type
2369 subAssign (
const DenseVector <VT2,TF>& rhs );
2371 template<
typename VT2 >
2372 inline typename EnableIf< VectorizedSubAssign<VT2> >::Type
2373 subAssign(
const DenseVector <VT2,TF>& rhs );
2375 template<
typename VT2 >
inline void subAssign(
const SparseVector<VT2,TF>& rhs );
2377 template<
typename VT2 >
2378 inline typename DisableIf< VectorizedMultAssign<VT2> >::Type
2379 multAssign(
const DenseVector <VT2,TF>& rhs );
2381 template<
typename VT2 >
2382 inline typename EnableIf< VectorizedMultAssign<VT2> >::Type
2383 multAssign(
const DenseVector <VT2,TF>& rhs );
2385 template<
typename VT2 >
inline void multAssign(
const SparseVector<VT2,TF>& rhs );
2400 template<
bool AF1,
typename VT2,
bool AF2,
bool TF2 >
2401 friend const DenseSubvector<VT2,AF1,TF2>
2402 subvector(
const DenseSubvector<VT2,AF2,TF2>& dv,
size_t index,
size_t size );
2438 template<
typename VT
2445 if( index + n > vector.size() )
2446 throw std::invalid_argument(
"Invalid subvector specification" );
2449 throw std::invalid_argument(
"Invalid subvector alignment" );
2470 template<
typename VT
2476 return vector_[offset_+index];
2489 template<
typename VT
2495 return const_cast<const VT&
>( vector_ )[offset_+index];
2509 template<
typename VT
2513 return vector_.data() + offset_;
2527 template<
typename VT
2531 return vector_.data() + offset_;
2545 template<
typename VT
2549 return ( vector_.begin() + offset_ );
2563 template<
typename VT
2568 return ( vector_.cbegin() + offset_ );
2582 template<
typename VT
2587 return ( vector_.cbegin() + offset_ );
2601 template<
typename VT
2605 return ( vector_.begin() + offset_ + size_ );
2619 template<
typename VT
2624 return ( vector_.cbegin() + offset_ + size_ );
2638 template<
typename VT
2643 return ( vector_.cbegin() + offset_ + size_ );
2664 template<
typename VT
2666 inline DenseSubvector<VT,aligned,TF>&
2669 const size_t iend( offset_ + size_ );
2671 for(
size_t i=offset_; i<iend; ++i )
2691 template<
typename VT
2693 inline DenseSubvector<VT,aligned,TF>&
2699 if( &rhs ==
this || ( &vector_ == &rhs.vector_ && offset_ == rhs.offset_ ) )
2702 if( size() != rhs.size() )
2703 throw std::invalid_argument(
"Subvector sizes do not match" );
2705 if( rhs.canAlias( &vector_ ) ) {
2730 template<
typename VT
2732 template<
typename VT2 >
2733 inline DenseSubvector<VT,aligned,TF>&
2739 if( size() != (~rhs).size() )
2740 throw std::invalid_argument(
"Vector sizes do not match" );
2742 if( (~rhs).canAlias( &vector_ ) ) {
2747 if( IsSparseVector<VT2>::value )
2769 template<
typename VT
2771 template<
typename VT2 >
2772 inline DenseSubvector<VT,aligned,TF>&
2773 DenseSubvector<VT,aligned,TF>::operator+=(
const Vector<VT2,TF>& rhs )
2778 if( size() != (~rhs).size() )
2779 throw std::invalid_argument(
"Vector sizes do not match" );
2781 if( (~rhs).canAlias( &vector_ ) ) {
2806 template<
typename VT
2808 template<
typename VT2 >
2809 inline DenseSubvector<VT,aligned,TF>&
2810 DenseSubvector<VT,aligned,TF>::operator-=(
const Vector<VT2,TF>& rhs )
2815 if( size() != (~rhs).size() )
2816 throw std::invalid_argument(
"Vector sizes do not match" );
2818 if( (~rhs).canAlias( &vector_ ) ) {
2844 template<
typename VT
2846 template<
typename VT2 >
2847 inline DenseSubvector<VT,aligned,TF>&
2848 DenseSubvector<VT,aligned,TF>::operator*=(
const Vector<VT2,TF>& rhs )
2853 if( size() != (~rhs).size() )
2854 throw std::invalid_argument(
"Vector sizes do not match" );
2856 if( (~rhs).canAlias( &vector_ ) || IsSparseVector<VT2>::value ) {
2878 template<
typename VT
2880 template<
typename Other >
2881 inline typename EnableIf< IsNumeric<Other>, DenseSubvector<VT,aligned,TF> >::Type&
2882 DenseSubvector<VT,aligned,TF>::operator*=( Other rhs )
2901 template<
typename VT
2903 template<
typename Other >
2904 inline typename EnableIf< IsNumeric<Other>, DenseSubvector<VT,aligned,TF> >::Type&
2905 DenseSubvector<VT,aligned,TF>::operator/=( Other rhs )
2930 template<
typename VT
2946 template<
typename VT
2950 return vector_.capacity() - offset_;
2965 template<
typename VT
2969 size_t nonzeros( 0 );
2971 const size_t iend( offset_ + size_ );
2972 for(
size_t i=offset_; i<iend; ++i ) {
2989 template<
typename VT
2995 const size_t iend( offset_ + size_ );
2996 for(
size_t i=offset_; i<iend; ++i )
2997 reset( vector_[i] );
3010 template<
typename VT
3012 template<
typename Other >
3013 inline DenseSubvector<VT,aligned,TF>& DenseSubvector<VT,aligned,TF>::scale(
const Other& scalar )
3015 const size_t iend( offset_ + size_ );
3016 for(
size_t i=offset_; i<iend; ++i )
3017 vector_[i] *= scalar;
3043 template<
typename VT
3045 template<
typename Other >
3048 return static_cast<const void*
>( &vector_ ) == static_cast<const void*>( alias );
3065 template<
typename VT
3067 template<
typename Other >
3070 return static_cast<const void*
>( &vector_ ) == static_cast<const void*>( alias );
3086 template<
typename VT
3107 template<
typename VT
3131 template<
typename VT
3133 inline typename DenseSubvector<VT,aligned,TF>::IntrinsicType
3141 return vector_.load( offset_+index );
3161 template<
typename VT
3163 inline typename DenseSubvector<VT,aligned,TF>::IntrinsicType
3171 return vector_.loadu( offset_+index );
3192 template<
typename VT
3201 vector_.store( offset_+index, value );
3222 template<
typename VT
3231 vector_.storeu( offset_+index, value );
3252 template<
typename VT
3261 vector_.stream( offset_+index, value );
3279 template<
typename VT
3281 template<
typename VT2 >
3282 inline typename DisableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedAssign<VT2> >::Type
3287 const size_t iend( size() &
size_t(-2) );
3288 for(
size_t i=0UL; i<iend; i+=2UL ) {
3289 vector_[i+offset_ ] = (~rhs)[i ];
3290 vector_[i+offset_+1UL] = (~rhs)[i+1UL];
3292 if( iend < size() ) {
3293 vector_[iend+offset_] = (~rhs)[iend];
3312 template<
typename VT
3314 template<
typename VT2 >
3315 inline typename EnableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedAssign<VT2> >::Type
3324 for(
size_t i=0UL; i<size(); i+=IT::size ) {
3325 vector_.stream( offset_+i, (~rhs).
load(i) );
3330 const size_t iend( size_ &
size_t(-IT::size*4) );
3334 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
3335 store( i , it.load() ); it += IT::size;
3336 store( i+IT::size , it.load() ); it += IT::size;
3337 store( i+IT::size*2UL, it.load() ); it += IT::size;
3338 store( i+IT::size*3UL, it.load() ); it += IT::size;
3340 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
3341 store( i, it.load() );
3361 template<
typename VT
3363 template<
typename VT2 >
3368 for(
typename VT2::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
3369 vector_[element->index()+offset_] = element->value();
3387 template<
typename VT
3389 template<
typename VT2 >
3390 inline typename DisableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedAddAssign<VT2> >::Type
3395 const size_t iend( size() &
size_t(-2) );
3396 for(
size_t i=0UL; i<iend; i+=2UL ) {
3397 vector_[i+offset_ ] += (~rhs)[i ];
3398 vector_[i+offset_+1UL] += (~rhs)[i+1UL];
3400 if( iend < size() ) {
3401 vector_[iend+offset_] += (~rhs)[iend];
3420 template<
typename VT
3422 template<
typename VT2 >
3423 inline typename EnableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedAddAssign<VT2> >::Type
3430 const size_t iend( size_ &
size_t(-IT::size*4) );
3434 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
3435 store( i ,
load(i ) + it.load() ); it += IT::size;
3436 store( i+IT::size ,
load(i+IT::size ) + it.load() ); it += IT::size;
3437 store( i+IT::size*2UL,
load(i+IT::size*2UL) + it.load() ); it += IT::size;
3438 store( i+IT::size*3UL,
load(i+IT::size*3UL) + it.load() ); it += IT::size;
3440 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
3460 template<
typename VT
3462 template<
typename VT2 >
3467 for(
typename VT2::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
3468 vector_[element->index()+offset_] += element->value();
3486 template<
typename VT
3488 template<
typename VT2 >
3489 inline typename DisableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedSubAssign<VT2> >::Type
3494 const size_t iend( size() &
size_t(-2) );
3495 for(
size_t i=0UL; i<iend; i+=2UL ) {
3496 vector_[i+offset_ ] -= (~rhs)[i ];
3497 vector_[i+offset_+1UL] -= (~rhs)[i+1UL];
3499 if( iend < size() ) {
3500 vector_[iend+offset_] -= (~rhs)[iend];
3519 template<
typename VT
3521 template<
typename VT2 >
3522 inline typename EnableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedSubAssign<VT2> >::Type
3529 const size_t iend( size_ &
size_t(-IT::size*4) );
3533 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
3534 store( i ,
load(i ) - it.load() ); it += IT::size;
3535 store( i+IT::size ,
load(i+IT::size ) - it.load() ); it += IT::size;
3536 store( i+IT::size*2UL,
load(i+IT::size*2UL) - it.load() ); it += IT::size;
3537 store( i+IT::size*3UL,
load(i+IT::size*3UL) - it.load() ); it += IT::size;
3539 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
3559 template<
typename VT
3561 template<
typename VT2 >
3566 for(
typename VT2::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
3567 vector_[element->index()+offset_] -= element->value();
3585 template<
typename VT
3587 template<
typename VT2 >
3588 inline typename DisableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedMultAssign<VT2> >::Type
3593 const size_t iend( size() &
size_t(-2) );
3594 for(
size_t i=0UL; i<iend; i+=2UL ) {
3595 vector_[i+offset_ ] *= (~rhs)[i ];
3596 vector_[i+offset_+1UL] *= (~rhs)[i+1UL];
3598 if( iend < size() ) {
3599 vector_[iend+offset_] *= (~rhs)[iend];
3618 template<
typename VT
3620 template<
typename VT2 >
3621 inline typename EnableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedMultAssign<VT2> >::Type
3628 const size_t iend( size_ &
size_t(-IT::size*4) );
3632 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
3633 store( i ,
load(i ) * it.load() ); it += IT::size;
3634 store( i+IT::size ,
load(i+IT::size ) * it.load() ); it += IT::size;
3635 store( i+IT::size*2UL,
load(i+IT::size*2UL) * it.load() ); it += IT::size;
3636 store( i+IT::size*3UL,
load(i+IT::size*3UL) * it.load() ); it += IT::size;
3638 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
3658 template<
typename VT
3660 template<
typename VT2 >
3669 for(
typename VT2::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
3670 vector_[element->index()+offset_] = tmp[element->index()] * element->value();
3696 template<
typename VT1
3698 class DenseSubvector< DVecDVecCrossExpr<VT1,VT2>,
unaligned, false >
3699 :
public DenseVector< DenseSubvector< DVecDVecCrossExpr<VT1,VT2>, unaligned, false >, false >
3704 typedef DVecDVecCrossExpr<VT1,VT2> CPE;
3710 typedef DenseSubvector<CPE,unaligned,false>
This;
3711 typedef typename SubvectorTrait<RT>::Type
ResultType;
3720 enum { vectorizable = 0 };
3723 enum { smpAssignable = 0 };
3733 explicit inline DenseSubvector(
const CPE& vector,
size_t index,
size_t n )
3757 inline size_t size()
const {
3768 template<
typename T >
3769 inline bool canAlias(
const T* alias )
const {
3770 return vector_.canAlias( alias );
3780 template<
typename T >
3781 inline bool isAliased(
const T* alias )
const {
3782 return vector_.isAliased( alias );
3797 template<
bool AF1,
typename VT,
bool AF2,
bool TF >
3798 friend const DenseSubvector<VT,AF1,TF>
3799 subvector(
const DenseSubvector<VT,AF2,TF>& dv,
size_t index,
size_t size );
3826 template<
typename VT1
3828 class DenseSubvector< DVecSVecCrossExpr<VT1,VT2>,
unaligned, false >
3829 :
public DenseVector< DenseSubvector< DVecSVecCrossExpr<VT1,VT2>, unaligned, false >, false >
3834 typedef DVecSVecCrossExpr<VT1,VT2> CPE;
3840 typedef DenseSubvector<CPE,unaligned,false>
This;
3841 typedef typename SubvectorTrait<RT>::Type
ResultType;
3850 enum { vectorizable = 0 };
3853 enum { smpAssignable = 0 };
3863 explicit inline DenseSubvector(
const CPE& vector,
size_t index,
size_t n )
3887 inline size_t size()
const {
3898 template<
typename T >
3899 inline bool canAlias(
const T* alias )
const {
3900 return vector_.canAlias( alias );
3910 template<
typename T >
3911 inline bool isAliased(
const T* alias )
const {
3912 return vector_.isAliased( alias );
3927 template<
bool AF1,
typename VT,
bool AF2,
bool TF >
3928 friend const DenseSubvector<VT,AF1,TF>
3929 subvector(
const DenseSubvector<VT,AF2,TF>& dv,
size_t index,
size_t size );
3956 template<
typename VT1
3958 class DenseSubvector< SVecDVecCrossExpr<VT1,VT2>,
unaligned, false >
3959 :
public DenseVector< DenseSubvector< SVecDVecCrossExpr<VT1,VT2>, unaligned, false >, false >
3964 typedef SVecDVecCrossExpr<VT1,VT2> CPE;
3970 typedef DenseSubvector<CPE,unaligned,false>
This;
3971 typedef typename SubvectorTrait<RT>::Type
ResultType;
3980 enum { vectorizable = 0 };
3983 enum { smpAssignable = 0 };
3993 explicit inline DenseSubvector(
const CPE& vector,
size_t index,
size_t n )
4017 inline size_t size()
const {
4028 template<
typename T >
4029 inline bool canAlias(
const T* alias )
const {
4030 return vector_.canAlias( alias );
4040 template<
typename T >
4041 inline bool isAliased(
const T* alias )
const {
4042 return vector_.isAliased( alias );
4057 template<
bool AF1,
typename VT,
bool AF2,
bool TF >
4058 friend const DenseSubvector<VT,AF1,TF>
4059 subvector(
const DenseSubvector<VT,AF2,TF>& dv,
size_t index,
size_t size );
4086 template<
typename VT1
4088 class DenseSubvector< SVecSVecCrossExpr<VT1,VT2>,
unaligned, false >
4089 :
public DenseVector< DenseSubvector< SVecSVecCrossExpr<VT1,VT2>, unaligned, false >, false >
4094 typedef SVecSVecCrossExpr<VT1,VT2> CPE;
4100 typedef DenseSubvector<CPE,unaligned,false>
This;
4101 typedef typename SubvectorTrait<RT>::Type
ResultType;
4110 enum { vectorizable = 0 };
4113 enum { smpAssignable = 0 };
4123 explicit inline DenseSubvector(
const CPE& vector,
size_t index,
size_t n )
4147 inline size_t size()
const {
4158 template<
typename T >
4159 inline bool canAlias(
const T* alias )
const {
4160 return vector_.canAlias( alias );
4170 template<
typename T >
4171 inline bool isAliased(
const T* alias )
const {
4172 return vector_.isAliased( alias );
4187 template<
bool AF1,
typename VT,
bool AF2,
bool TF >
4188 friend const DenseSubvector<VT,AF1,TF>
4189 subvector(
const DenseSubvector<VT,AF2,TF>& dv,
size_t index,
size_t size );
4211 template<
typename VT,
bool AF,
bool TF >
4212 inline void reset( DenseSubvector<VT,AF,TF>& dv );
4214 template<
typename VT,
bool AF,
bool TF >
4215 inline void clear( DenseSubvector<VT,AF,TF>& dv );
4217 template<
typename VT,
bool AF,
bool TF >
4218 inline bool isDefault(
const DenseSubvector<VT,AF,TF>& dv );
4230 template<
typename VT
4247 template<
typename VT
4276 template<
typename VT
4281 for(
size_t i=0UL; i<dv.size(); ++i )
4313 inline const DenseSubvector<VT,AF1,TF>
4314 subvector(
const DenseSubvector<VT,AF2,TF>& dv,
size_t index,
size_t size )
4318 if( index + size > dv.size() )
4319 throw std::invalid_argument(
"Invalid subvector specification" );
4321 return DenseSubvector<VT,AF1,TF>( dv.vector_, dv.offset_ + index, size );
4337 template<
typename VT,
bool AF,
bool TF >
4338 struct SubvectorTrait< DenseSubvector<VT,AF,TF> >
4356 template<
typename VT,
bool AF1,
bool TF,
bool AF2 >
4357 struct SubvectorExprTrait< DenseSubvector<VT,AF1,TF>, AF2 >
4359 typedef DenseSubvector<VT,AF2,TF> Type;
4367 template<
typename VT,
bool AF1,
bool TF,
bool AF2 >
4368 struct SubvectorExprTrait< const DenseSubvector<VT,AF1,TF>, AF2 >
4370 typedef DenseSubvector<VT,AF2,TF> Type;
4378 template<
typename VT,
bool AF1,
bool TF,
bool AF2 >
4379 struct SubvectorExprTrait< volatile DenseSubvector<VT,AF1,TF>, AF2 >
4381 typedef DenseSubvector<VT,AF2,TF> Type;
4389 template<
typename VT,
bool AF1,
bool TF,
bool AF2 >
4390 struct SubvectorExprTrait< const volatile DenseSubvector<VT,AF1,TF>, AF2 >
4392 typedef DenseSubvector<VT,AF2,TF> Type;
4400 template<
typename VT1,
typename VT2,
bool AF >
4401 struct SubvectorExprTrait< DVecDVecCrossExpr<VT1,VT2>, AF >
4405 typedef DenseSubvector< DVecDVecCrossExpr<VT1,VT2>,
unaligned,
false > Type;
4414 template<
typename VT1,
typename VT2,
bool AF >
4415 struct SubvectorExprTrait< DVecSVecCrossExpr<VT1,VT2>, AF >
4419 typedef DenseSubvector< DVecSVecCrossExpr<VT1,VT2>,
unaligned,
false > Type;
4428 template<
typename VT1,
typename VT2,
bool AF >
4429 struct SubvectorExprTrait< SVecDVecCrossExpr<VT1,VT2>, AF >
4433 typedef DenseSubvector< SVecDVecCrossExpr<VT1,VT2>,
unaligned,
false > Type;
4442 template<
typename VT1,
typename VT2,
bool AF >
4443 struct SubvectorExprTrait< SVecSVecCrossExpr<VT1,VT2>, AF >
4447 typedef DenseSubvector< SVecSVecCrossExpr<VT1,VT2>,
unaligned,
false > Type;
const ElementType * ConstPointer
Pointer to a constant subvector value.
Definition: DenseSubvector.h:417
Constraint on the data type.
const size_t final_
The final index for unaligned intrinsic operations.
Definition: DenseSubvector.h:899
Constraint on the data type.
const size_t OPENMP_DVECASSIGN_THRESHOLD
OpenMP dense vector assignment threshold.This threshold specifies when an assignment of a plain dense...
Definition: Thresholds.h:200
bool canAlias(const Other *alias) const
Returns whether the dense subvector can alias with the given address alias.
Definition: DenseSubvector.h:1540
void reset(DynamicMatrix< Type, SO > &m)
Resetting the given dense matrix.
Definition: DynamicMatrix.h:4579
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
EnableIf< IsIntegral< T >, Load< T, sizeof(T)> >::Type::Type load(const T *address)
Loads a vector of integral values.
Definition: Load.h:222
Header file for the subvector/submatrix alignment flag values.
const size_t rest_
The number of remaining elements in an unaligned intrinsic operation.
Definition: DenseSubvector.h:898
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:151
IT::Type IntrinsicType
Intrinsic type of the subvector elements.
Definition: DenseSubvector.h:406
bool isDefault(const DynamicMatrix< Type, SO > &m)
Returns whether the given dense matrix is in default state.
Definition: DynamicMatrix.h:4622
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:197
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i...
Definition: Computation.h:118
void smpMultAssign(DenseVector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:178
ReferenceType reference
Reference return type.
Definition: DenseSubvector.h:450
EnableIf< IsIntegral< T >, Loadu< T, sizeof(T)> >::Type::Type loadu(const T *address)
Loads a vector of integral values.
Definition: Loadu.h:219
Header file for the IsSame and IsStrictlySame type traits.
size_t nonZeros() const
Returns the number of non-zero elements in the subvector.
Definition: DenseSubvector.h:1464
const bool useStreaming
Configuration of the streaming behavior.For large vectors and matrices non-temporal stores can provid...
Definition: Streaming.h:50
bool isAligned_
Memory alignment flag.
Definition: DenseSubvector.h:705
Header file for the IsRowVector type trait.
const DenseSubvector & CompositeType
Data type for composite expression templates.
Definition: DenseSubvector.h:408
void storeu(float *address, const sse_float_t &value)
Unaligned store of a vector of 'float' values.
Definition: Storeu.h:234
Header file for the DenseVector base class.
SelectType< useConst, ConstReference, typename VT::Reference >::Type Reference
Reference to a non-constant subvector value.
Definition: DenseSubvector.h:414
Header file for the Computation base class.
IntrinsicType loadu() const
Unaligned load of an intrinsic element of the dense subvector.
Definition: DenseSubvector.h:571
#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
bool operator==(const SubvectorIterator &rhs) const
Equality comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:593
DenseSubvector(Operand vector, size_t index, size_t n)
The constructor for DenseSubvector.
Definition: DenseSubvector.h:961
IntrinsicTrait< typename VT::ElementType > IT
Intrinsic trait for the vector element type.
Definition: DenseSubvector.h:386
void clear(DynamicMatrix< Type, SO > &m)
Clearing the given dense matrix.
Definition: DynamicMatrix.h:4595
const size_t offset_
The offset of the subvector within the dense vector.
Definition: DenseSubvector.h:896
size_t capacity() const
Returns the maximum capacity of the dense subvector.
Definition: DenseSubvector.h:1446
SubvectorIterator(IteratorType iterator, IteratorType final, size_t rest, bool isAligned)
Constructor for the SubvectorIterator class.
Definition: DenseSubvector.h:462
Iterator begin()
Returns an iterator to the first element of the subvector.
Definition: DenseSubvector.h:1064
DenseSubvector & operator=(const ElementType &rhs)
Homogenous assignment to all subvector elements.
Definition: DenseSubvector.h:1179
const bool aligned
Alignment flag for aligned subvectors and submatrices.
Definition: AlignmentFlag.h:83
Base template for the SubvectorTrait class.
Definition: SubvectorTrait.h:122
void stream(size_t index, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the subvector.
Definition: DenseSubvector.h:1744
Constraint on the data type.
void reset()
Reset to the default initial values.
Definition: DenseSubvector.h:1487
Pointer data()
Low-level data access to the subvector elements.
Definition: DenseSubvector.h:1030
DifferenceType difference_type
Difference between two iterators.
Definition: DenseSubvector.h:451
void smpAddAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:121
SubvectorTrait< VT >::Type ResultType
Result type for expression template evaluations.
Definition: DenseSubvector.h:403
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.
void store(size_t index, const IntrinsicType &value)
Aligned store of an intrinsic element of the subvector.
Definition: DenseSubvector.h:1685
Operand vector_
The dense vector containing the subvector.
Definition: DenseSubvector.h:895
const SubvectorIterator operator--(int)
Post-decrement operator.
Definition: DenseSubvector.h:531
Header file for the dense vector SMP implementation.
Header file for nested template disabiguation.
Header file for the Subvector base class.
Reference operator[](size_t index)
Subscript operator for the direct access to the subvector elements.
Definition: DenseSubvector.h:994
SubvectorIterator & operator++()
Pre-increment operator.
Definition: DenseSubvector.h:499
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2388
Header file for the Or class template.
friend const SubvectorIterator operator-(const SubvectorIterator &it, size_t dec)
Subtraction between a SubvectorIterator and an integral value.
Definition: DenseSubvector.h:695
std::iterator_traits< IteratorType >::difference_type DifferenceType
Difference between two iterators.
Definition: DenseSubvector.h:444
ConstIterator cbegin() const
Returns an iterator to the first element of the subvector.
Definition: DenseSubvector.h:1100
DifferenceType operator-(const SubvectorIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DenseSubvector.h:659
VT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DenseSubvector.h:407
Header file for the subvector trait.
DenseSubvector< VT, AF, TF > This
Type of this DenseSubvector instance.
Definition: DenseSubvector.h:402
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:179
friend const SubvectorIterator operator+(size_t inc, const SubvectorIterator &it)
Addition between an integral value and a SubvectorIterator.
Definition: DenseSubvector.h:683
bool operator!=(const SubvectorIterator &rhs) const
Inequality comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:604
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
SubvectorIterator & operator--()
Pre-decrement operator.
Definition: DenseSubvector.h:520
IteratorType iterator_
Iterator to the current subvector element.
Definition: DenseSubvector.h:702
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
Constraint on the data type.
size_t size() const
Returns the current size/dimension of the dense subvector.
Definition: DenseSubvector.h:1431
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2382
void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:269
Constraint on the data type.
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2386
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DenseSubvector.h:404
SelectType< useConst, ConstPointer, ElementType * >::Type Pointer
Pointer to a constant subvector value.
Definition: DenseSubvector.h:420
System settings for streaming (non-temporal stores)
Header file for the EnableIf class template.
const bool unaligned
Alignment flag for unaligned subvectors and submatrices.
Definition: AlignmentFlag.h:63
std::iterator_traits< IteratorType >::iterator_category IteratorCategory
The iterator category.
Definition: DenseSubvector.h:432
Header file for the CrossExpr base class.
void smpAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:91
Header file for the IsNumeric type trait.
size_t rest_
The number of remaining elements beyond the final iterator.
Definition: DenseSubvector.h:704
SelectType< useConst, ConstIterator, SubvectorIterator< typename VT::Iterator > >::Type Iterator
Iterator over non-constant elements.
Definition: DenseSubvector.h:715
Header file for the IsSparseVector type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2383
Header file for the IsConst type trait.
Iterator end()
Returns an iterator just past the last element of the subvector.
Definition: DenseSubvector.h:1118
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:748
Header file for run time assertion macros.
Base class for all subvectors.The Subvector class serves as a tag for all subvectors (i...
Definition: Subvector.h:64
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:209
View on a specific subvector of a dense vector.The DenseSubvector template represents a view on a spe...
Definition: DenseSubvector.h:377
SubvectorIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DenseSubvector.h:476
bool operator>(const SubvectorIterator &rhs) const
Greater-than comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:626
bool isAligned() const
Returns whether the subvector is properly aligned in memory.
Definition: DenseSubvector.h:1580
std::iterator_traits< IteratorType >::pointer PointerType
Pointer return type.
Definition: DenseSubvector.h:438
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
SubvectorExprTrait< VT, unaligned >::Type subvector(Vector< VT, TF > &vector, size_t index, size_t size)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:133
Header file for the reset shim.
ValueType value_type
Type of the underlying elements.
Definition: DenseSubvector.h:448
Header file for the cache size of the target architecture.
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:239
bool canSMPAssign() const
Returns whether the subvector can be used in SMP assignments.
Definition: DenseSubvector.h:1600
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2387
Header file for the isDefault shim.
ReferenceType operator*() const
Direct access to the element at the current iterator position.
Definition: DenseSubvector.h:541
const size_t size_
The size of the subvector.
Definition: DenseSubvector.h:897
#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
IntrinsicType load() const
Aligned load of an intrinsic element of the dense subvector.
Definition: DenseSubvector.h:556
const SubvectorIterator operator++(int)
Post-increment operator.
Definition: DenseSubvector.h:510
IteratorCategory iterator_category
The iterator category.
Definition: DenseSubvector.h:447
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
VT::ConstReference ConstReference
Reference to a constant subvector value.
Definition: DenseSubvector.h:411
SubvectorIterator< typename VT::ConstIterator > ConstIterator
Iterator over constant elements.
Definition: DenseSubvector.h:712
Header file for all intrinsic functionality.
IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the dense subvector.
Definition: DenseSubvector.h:1648
friend const SubvectorIterator operator+(const SubvectorIterator &it, size_t inc)
Addition between a SubvectorIterator and an integral value.
Definition: DenseSubvector.h:671
bool isAliased(const Other *alias) const
Returns whether the dense subvector is aliased with the given address alias.
Definition: DenseSubvector.h:1561
#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
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SUBVECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is a subvector type (i.e. a dense or sparse subvector), a compilation error is created.
Definition: Subvector.h:118
PointerType pointer
Pointer return type.
Definition: DenseSubvector.h:449
const bool isAligned_
Memory alignment flag.
Definition: DenseSubvector.h:904
IteratorType final_
The final iterator for intrinsic operations.
Definition: DenseSubvector.h:703
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:147
IntrinsicType load(size_t index) const
Aligned load of an intrinsic element of the dense subvector.
Definition: DenseSubvector.h:1624
CompressedMatrix< Type,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:248
Header file for the sparse vector SMP implementation.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:105
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
bool operator>=(const SubvectorIterator &rhs) const
Greater-than comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:648
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2379
ConstIterator cend() const
Returns an iterator just past the last element of the subvector.
Definition: DenseSubvector.h:1154
Header file for basic type definitions.
Header file for the SubvectorExprTrait class template.
SubvectorIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DenseSubvector.h:488
Iterator over the elements of the sparse subvector.
Definition: DenseSubvector.h:427
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2385
std::iterator_traits< IteratorType >::value_type ValueType
Type of the underlying elements.
Definition: DenseSubvector.h:435
VT::ElementType ElementType
Type of the subvector elements.
Definition: DenseSubvector.h:405
void storeu(size_t index, const IntrinsicType &value)
Unaligned store of an intrinsic element of the subvector.
Definition: DenseSubvector.h:1709
SelectType< IsExpression< VT >::value, VT, VT & >::Type Operand
Composite data type of the dense vector expression.
Definition: DenseSubvector.h:383
const size_t cacheSize
Cache size of the target architecture.This setting specifies the available cache size in Byte of the ...
Definition: CacheSize.h:48
bool operator<(const SubvectorIterator &rhs) const
Less-than comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:615
bool operator<=(const SubvectorIterator &rhs) const
Less-than comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:637
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:238
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
void store(float *address, const sse_float_t &value)
Aligned store of a vector of 'float' values.
Definition: Store.h:242
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
std::iterator_traits< IteratorType >::reference ReferenceType
Reference return type.
Definition: DenseSubvector.h:441