35 #ifndef _BLAZE_MATH_VIEWS_DENSESUBVECTOR_H_
36 #define _BLAZE_MATH_VIEWS_DENSESUBVECTOR_H_
373 template<
typename VT
375 ,
bool TF = IsRowVector<VT>::value >
425 template<
typename IteratorType >
434 typedef typename std::iterator_traits<IteratorType>::value_type
ValueType;
437 typedef typename std::iterator_traits<IteratorType>::pointer
PointerType;
440 typedef typename std::iterator_traits<IteratorType>::reference
ReferenceType;
443 typedef typename std::iterator_traits<IteratorType>::difference_type
DifferenceType;
473 size_t remainingElements,
bool isMemoryAligned )
475 ,
final_ ( finalIterator )
476 ,
rest_ ( remainingElements )
486 template<
typename IteratorType2 >
605 for(
size_t i=0UL; i<
rest_; ++i )
607 for(
size_t i=rest_; i<
IT::size; ++i )
732 inline IteratorType
base()
const {
742 inline IteratorType
final()
const {
787 enum { vectorizable = VT::vectorizable };
790 enum { smpAssignable = VT::smpAssignable };
827 template<
typename VT2 >
inline DenseSubvector& operator+=(
const Vector<VT2,TF>& rhs );
828 template<
typename VT2 >
inline DenseSubvector& operator-=(
const Vector<VT2,TF>& rhs );
829 template<
typename VT2 >
inline DenseSubvector& operator*=(
const Vector<VT2,TF>& rhs );
831 template<
typename Other >
832 inline typename EnableIf< IsNumeric<Other>,
DenseSubvector >::Type&
833 operator*=( Other rhs );
835 template<
typename Other >
836 inline typename EnableIf< IsNumeric<Other>,
DenseSubvector >::Type&
837 operator/=( Other rhs );
844 inline size_t size()
const;
848 template<
typename Other >
inline DenseSubvector& scale(
const Other& scalar );
855 template<
typename VT2 >
857 struct VectorizedAssign {
858 enum { value = vectorizable && VT2::vectorizable &&
859 IsSame<ElementType,typename VT2::ElementType>::value };
866 template<
typename VT2 >
868 struct VectorizedAddAssign {
869 enum { value = vectorizable && VT2::vectorizable &&
870 IsSame<ElementType,typename VT2::ElementType>::value &&
871 IntrinsicTrait<ElementType>::addition };
878 template<
typename VT2 >
880 struct VectorizedSubAssign {
881 enum { value = vectorizable && VT2::vectorizable &&
882 IsSame<ElementType,typename VT2::ElementType>::value &&
883 IntrinsicTrait<ElementType>::subtraction };
890 template<
typename VT2 >
892 struct VectorizedMultAssign {
893 enum { value = vectorizable && VT2::vectorizable &&
894 IsSame<ElementType,typename VT2::ElementType>::value &&
895 IntrinsicTrait<ElementType>::multiplication };
904 template<
typename Other >
905 inline bool canAlias(
const Other* alias )
const;
907 template<
typename VT2,
bool AF2,
bool TF2 >
908 inline bool canAlias(
const DenseSubvector<VT2,AF2,TF2>* alias )
const;
910 template<
typename Other >
911 inline bool isAliased(
const Other* alias )
const;
913 template<
typename VT2,
bool AF2,
bool TF2 >
914 inline bool isAliased(
const DenseSubvector<VT2,AF2,TF2>* alias )
const;
925 template<
typename VT2 >
926 inline typename DisableIf< VectorizedAssign<VT2> >::Type
927 assign(
const DenseVector <VT2,TF>& rhs );
929 template<
typename VT2 >
930 inline typename EnableIf< VectorizedAssign<VT2> >::Type
931 assign(
const DenseVector <VT2,TF>& rhs );
933 template<
typename VT2 >
inline void assign(
const SparseVector<VT2,TF>& rhs );
935 template<
typename VT2 >
936 inline typename DisableIf< VectorizedAddAssign<VT2> >::Type
937 addAssign(
const DenseVector <VT2,TF>& rhs );
939 template<
typename VT2 >
940 inline typename EnableIf< VectorizedAddAssign<VT2> >::Type
941 addAssign (
const DenseVector <VT2,TF>& rhs );
943 template<
typename VT2 >
inline void addAssign(
const SparseVector<VT2,TF>& rhs );
945 template<
typename VT2 >
946 inline typename DisableIf< VectorizedSubAssign<VT2> >::Type
947 subAssign (
const DenseVector <VT2,TF>& rhs );
949 template<
typename VT2 >
950 inline typename EnableIf< VectorizedSubAssign<VT2> >::Type
951 subAssign(
const DenseVector <VT2,TF>& rhs );
953 template<
typename VT2 >
inline void subAssign(
const SparseVector<VT2,TF>& rhs );
955 template<
typename VT2 >
956 inline typename DisableIf< VectorizedMultAssign<VT2> >::Type
957 multAssign(
const DenseVector <VT2,TF>& rhs );
959 template<
typename VT2 >
960 inline typename EnableIf< VectorizedMultAssign<VT2> >::Type
961 multAssign(
const DenseVector <VT2,TF>& rhs );
963 template<
typename VT2 >
inline void multAssign(
const SparseVector<VT2,TF>& rhs );
995 template<
typename VT2,
bool AF2,
bool TF2 >
friend class DenseSubvector;
997 template<
bool AF1,
typename VT2,
bool AF2,
bool TF2 >
1001 template<
typename VT2,
bool AF2,
bool TF2 >
1004 template<
typename VT2,
bool AF2,
bool TF2 >
1007 template<
typename VT2,
bool AF2,
bool TF2 >
1045 template<
typename VT
1049 : vector_ ( vector )
1053 , final_ ( n - rest_ )
1054 , isAligned_( ( index %
IT::
size == 0UL ) &&
1055 ( index + n == vector.
size() || n %
IT::
size == 0UL ) )
1057 if( index + n > vector.size() )
1058 throw std::invalid_argument(
"Invalid subvector specification" );
1077 template<
typename VT
1084 return vector_[offset_+index];
1095 template<
typename VT
1102 return const_cast<const VT&
>( vector_ )[offset_+index];
1114 template<
typename VT
1119 return vector_.data() + offset_;
1131 template<
typename VT
1136 return vector_.data() + offset_;
1148 template<
typename VT
1153 const typename VT::Iterator first( vector_.begin() + offset_ );
1154 return Iterator( first, first + final_, rest_, isAligned_ );
1166 template<
typename VT
1172 return ConstIterator( first, first + final_, rest_, isAligned_ );
1184 template<
typename VT
1190 return ConstIterator( first, first + final_, rest_, isAligned_ );
1202 template<
typename VT
1207 const typename VT::Iterator last( vector_.begin() + offset_ + size_ );
1208 return Iterator( last, last, rest_, isAligned_ );
1220 template<
typename VT
1238 template<
typename VT
1263 template<
typename VT
1268 const size_t iend( offset_ + size_ );
1270 for(
size_t i=offset_; i<iend; ++i )
1288 template<
typename VT
1296 if( &rhs ==
this || ( &vector_ == &rhs.
vector_ && offset_ == rhs.
offset_ ) )
1300 throw std::invalid_argument(
"Subvector sizes do not match" );
1325 template<
typename VT
1328 template<
typename VT2 >
1335 throw std::invalid_argument(
"Vector sizes do not match" );
1337 if( (~rhs).canAlias( &vector_ ) ) {
1362 template<
typename VT
1365 template<
typename VT2 >
1372 throw std::invalid_argument(
"Vector sizes do not match" );
1374 if( (~rhs).canAlias( &vector_ ) ) {
1397 template<
typename VT
1400 template<
typename VT2 >
1407 throw std::invalid_argument(
"Vector sizes do not match" );
1409 if( (~rhs).canAlias( &vector_ ) ) {
1433 template<
typename VT
1436 template<
typename VT2 >
1443 throw std::invalid_argument(
"Vector sizes do not match" );
1465 template<
typename VT
1468 template<
typename Other >
1487 template<
typename VT
1490 template<
typename Other >
1515 template<
typename VT
1530 template<
typename VT
1535 return vector_.capacity() - offset_;
1548 template<
typename VT
1553 size_t nonzeros( 0 );
1555 const size_t iend( offset_ + size_ );
1556 for(
size_t i=offset_; i<iend; ++i ) {
1571 template<
typename VT
1578 const size_t iend( offset_ + size_ );
1579 for(
size_t i=offset_; i<iend; ++i )
1580 clear( vector_[i] );
1591 template<
typename VT
1594 template<
typename Other >
1597 const size_t iend( offset_ + size_ );
1598 for(
size_t i=offset_; i<iend; ++i )
1599 vector_[i] *= scalar;
1623 template<
typename VT
1626 template<
typename Other >
1629 return vector_.isAliased( alias );
1644 template<
typename VT
1647 template<
typename VT2
1652 return ( vector_.isAliased( &alias->
vector_ ) &&
1653 ( offset_ + size_ > alias->
offset_ ) && ( offset_ < alias->offset_ + alias->
size_ ) );
1668 template<
typename VT
1671 template<
typename Other >
1674 return vector_.isAliased( alias );
1689 template<
typename VT
1692 template<
typename VT2
1697 return ( vector_.isAliased( &alias->
vector_ ) &&
1698 ( offset_ + size_ > alias->
offset_ ) && ( offset_ < alias->offset_ + alias->
size_ ) );
1712 template<
typename VT
1732 template<
typename VT
1755 template<
typename VT
1761 return loadu( index );
1779 template<
typename VT
1793 return vector_.load( offset_+index );
1795 else if( index != final_ ) {
1796 return vector_.loadu( offset_+index );
1800 for(
size_t i=0UL; i<rest_; ++i )
1801 array[i] = vector_[offset_+index+i];
1802 for(
size_t i=rest_; i<
IT::size; ++i )
1824 template<
typename VT
1848 template<
typename VT
1861 vector_.store( offset_+index, value );
1863 else if( index != final_ ) {
1864 vector_.storeu( offset_+index, value );
1869 for(
size_t i=0UL; i<rest_; ++i )
1870 vector_[offset_+index+i] = array[i];
1890 template<
typename VT
1911 template<
typename VT
1914 template<
typename VT2 >
1920 const size_t iend(
size() &
size_t(-2) );
1921 for(
size_t i=0UL; i<iend; i+=2UL ) {
1922 vector_[i+offset_ ] = (~rhs)[i ];
1923 vector_[i+offset_+1UL] = (~rhs)[i+1UL];
1925 if( iend <
size() ) {
1926 vector_[iend+offset_] = (~rhs)[iend];
1943 template<
typename VT
1946 template<
typename VT2 >
1956 !(~rhs).isAliased( &vector_ ) )
1959 vector_.stream( offset_+i, (~rhs).
load(i) );
1964 const size_t iend( size_ &
size_t(-
IT::size*4) );
1968 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
1969 vector_.storeu( offset_+i , it.load() ); it +=
IT::size;
1993 template<
typename VT
1996 template<
typename VT2 >
2002 vector_[element->index()+offset_] = element->value();
2018 template<
typename VT
2021 template<
typename VT2 >
2027 const size_t iend(
size() &
size_t(-2) );
2028 for(
size_t i=0UL; i<iend; i+=2UL ) {
2029 vector_[i+offset_ ] += (~rhs)[i ];
2030 vector_[i+offset_+1UL] += (~rhs)[i+1UL];
2032 if( iend <
size() ) {
2033 vector_[iend+offset_] += (~rhs)[iend];
2050 template<
typename VT
2053 template<
typename VT2 >
2061 const size_t iend( size_ &
size_t(-
IT::size*4) );
2065 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
2066 vector_.storeu( offset_+i ,
load(i ) + it.load() ); it +=
IT::size;
2089 template<
typename VT
2092 template<
typename VT2 >
2098 vector_[element->index()+offset_] += element->value();
2114 template<
typename VT
2117 template<
typename VT2 >
2123 const size_t iend(
size() &
size_t(-2) );
2124 for(
size_t i=0UL; i<iend; i+=2UL ) {
2125 vector_[i+offset_ ] -= (~rhs)[i ];
2126 vector_[i+offset_+1UL] -= (~rhs)[i+1UL];
2128 if( iend <
size() ) {
2129 vector_[iend+offset_] -= (~rhs)[iend];
2146 template<
typename VT
2149 template<
typename VT2 >
2157 const size_t iend( size_ &
size_t(-
IT::size*4) );
2161 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
2162 vector_.storeu( offset_+i ,
load(i ) - it.load() ); it +=
IT::size;
2185 template<
typename VT
2188 template<
typename VT2 >
2194 vector_[element->index()+offset_] -= element->value();
2210 template<
typename VT
2213 template<
typename VT2 >
2219 const size_t iend(
size() &
size_t(-2) );
2220 for(
size_t i=0UL; i<iend; i+=2UL ) {
2221 vector_[i+offset_ ] *= (~rhs)[i ];
2222 vector_[i+offset_+1UL] *= (~rhs)[i+1UL];
2224 if( iend <
size() ) {
2225 vector_[iend+offset_] *= (~rhs)[iend];
2242 template<
typename VT
2245 template<
typename VT2 >
2253 const size_t iend( size_ &
size_t(-
IT::size*4) );
2257 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
2258 vector_.storeu( offset_+i ,
load(i ) * it.load() ); it +=
IT::size;
2281 template<
typename VT
2284 template<
typename VT2 >
2294 vector_[element->index()+offset_] = tmp[element->index()] * element->value();
2319 template<
typename VT
2346 typedef DenseSubvector<VT,aligned,TF>
This;
2347 typedef typename SubvectorTrait<VT>::Type
ResultType;
2358 typedef typename SelectType< useConst, ConstReference, typename VT::Reference >::Type
Reference;
2364 typedef typename SelectType< useConst, ConstPointer, ElementType* >::Type
Pointer;
2370 typedef typename SelectType< useConst, ConstIterator, typename VT::Iterator >::Type
Iterator;
2375 enum { vectorizable = VT::vectorizable };
2378 enum { smpAssignable = VT::smpAssignable };
2415 template<
typename VT2 >
inline DenseSubvector& operator+=(
const Vector<VT2,TF>& rhs );
2416 template<
typename VT2 >
inline DenseSubvector& operator-=(
const Vector<VT2,TF>& rhs );
2417 template<
typename VT2 >
inline DenseSubvector& operator*=(
const Vector<VT2,TF>& rhs );
2419 template<
typename Other >
2420 inline typename EnableIf< IsNumeric<Other>,
DenseSubvector >::Type&
2421 operator*=( Other rhs );
2423 template<
typename Other >
2424 inline typename EnableIf< IsNumeric<Other>,
DenseSubvector >::Type&
2425 operator/=( Other rhs );
2432 inline size_t size()
const;
2435 inline void reset();
2436 template<
typename Other >
inline DenseSubvector& scale(
const Other& scalar );
2443 template<
typename VT2 >
2444 struct VectorizedAssign {
2445 enum { value = vectorizable && VT2::vectorizable &&
2446 IsSame<ElementType,typename VT2::ElementType>::value };
2452 template<
typename VT2 >
2453 struct VectorizedAddAssign {
2454 enum { value = vectorizable && VT2::vectorizable &&
2455 IsSame<ElementType,typename VT2::ElementType>::value &&
2456 IntrinsicTrait<ElementType>::addition };
2462 template<
typename VT2 >
2463 struct VectorizedSubAssign {
2464 enum { value = vectorizable && VT2::vectorizable &&
2465 IsSame<ElementType,typename VT2::ElementType>::value &&
2466 IntrinsicTrait<ElementType>::subtraction };
2472 template<
typename VT2 >
2473 struct VectorizedMultAssign {
2474 enum { value = vectorizable && VT2::vectorizable &&
2475 IsSame<ElementType,typename VT2::ElementType>::value &&
2476 IntrinsicTrait<ElementType>::multiplication };
2484 template<
typename Other >
2485 inline bool canAlias(
const Other* alias )
const;
2487 template<
typename VT2,
bool AF2,
bool TF2 >
2488 inline bool canAlias(
const DenseSubvector<VT2,AF2,TF2>* alias )
const;
2490 template<
typename Other >
2491 inline bool isAliased(
const Other* alias )
const;
2493 template<
typename VT2,
bool AF2,
bool TF2 >
2494 inline bool isAliased(
const DenseSubvector<VT2,AF2,TF2>* alias )
const;
2505 template<
typename VT2 >
2506 inline typename DisableIf< VectorizedAssign<VT2> >::Type
2507 assign(
const DenseVector <VT2,TF>& rhs );
2509 template<
typename VT2 >
2510 inline typename EnableIf< VectorizedAssign<VT2> >::Type
2511 assign(
const DenseVector <VT2,TF>& rhs );
2513 template<
typename VT2 >
inline void assign(
const SparseVector<VT2,TF>& rhs );
2515 template<
typename VT2 >
2516 inline typename DisableIf< VectorizedAddAssign<VT2> >::Type
2517 addAssign(
const DenseVector <VT2,TF>& rhs );
2519 template<
typename VT2 >
2520 inline typename EnableIf< VectorizedAddAssign<VT2> >::Type
2521 addAssign (
const DenseVector <VT2,TF>& rhs );
2523 template<
typename VT2 >
inline void addAssign(
const SparseVector<VT2,TF>& rhs );
2525 template<
typename VT2 >
2526 inline typename DisableIf< VectorizedSubAssign<VT2> >::Type
2527 subAssign (
const DenseVector <VT2,TF>& rhs );
2529 template<
typename VT2 >
2530 inline typename EnableIf< VectorizedSubAssign<VT2> >::Type
2531 subAssign(
const DenseVector <VT2,TF>& rhs );
2533 template<
typename VT2 >
inline void subAssign(
const SparseVector<VT2,TF>& rhs );
2535 template<
typename VT2 >
2536 inline typename DisableIf< VectorizedMultAssign<VT2> >::Type
2537 multAssign(
const DenseVector <VT2,TF>& rhs );
2539 template<
typename VT2 >
2540 inline typename EnableIf< VectorizedMultAssign<VT2> >::Type
2541 multAssign(
const DenseVector <VT2,TF>& rhs );
2543 template<
typename VT2 >
inline void multAssign(
const SparseVector<VT2,TF>& rhs );
2558 template<
typename VT2,
bool AF2,
bool TF2 >
friend class DenseSubvector;
2560 template<
bool AF1,
typename VT2,
bool AF2,
bool TF2 >
2561 friend const DenseSubvector<VT2,AF1,TF2>
2562 subvector(
const DenseSubvector<VT2,AF2,TF2>& dv,
size_t index,
size_t size );
2564 template<
typename VT2,
bool AF2,
bool TF2 >
2565 friend bool isSame(
const DenseSubvector<VT2,AF2,TF2>& a,
const DenseVector<VT2,TF2>& b );
2567 template<
typename VT2,
bool AF2,
bool TF2 >
2568 friend bool isSame(
const DenseVector<VT2,TF2>& a,
const DenseSubvector<VT2,AF2,TF2>& b );
2570 template<
typename VT2,
bool AF2,
bool TF2 >
2571 friend bool isSame(
const DenseSubvector<VT2,AF2,TF2>& a,
const DenseSubvector<VT2,AF2,TF2>& b );
2607 template<
typename VT
2614 if( index + n > vector.size() )
2615 throw std::invalid_argument(
"Invalid subvector specification" );
2618 throw std::invalid_argument(
"Invalid subvector alignment" );
2639 template<
typename VT
2645 return vector_[offset_+index];
2658 template<
typename VT
2664 return const_cast<const VT&
>( vector_ )[offset_+index];
2678 template<
typename VT
2682 return vector_.data() + offset_;
2696 template<
typename VT
2700 return vector_.data() + offset_;
2714 template<
typename VT
2718 return ( vector_.begin() + offset_ );
2732 template<
typename VT
2737 return ( vector_.cbegin() + offset_ );
2751 template<
typename VT
2756 return ( vector_.cbegin() + offset_ );
2770 template<
typename VT
2774 return ( vector_.begin() + offset_ + size_ );
2788 template<
typename VT
2793 return ( vector_.cbegin() + offset_ + size_ );
2807 template<
typename VT
2812 return ( vector_.cbegin() + offset_ + size_ );
2833 template<
typename VT
2835 inline DenseSubvector<VT,aligned,TF>&
2838 const size_t iend( offset_ + size_ );
2840 for(
size_t i=offset_; i<iend; ++i )
2860 template<
typename VT
2862 inline DenseSubvector<VT,aligned,TF>&
2868 if( &rhs ==
this || ( &vector_ == &rhs.vector_ && offset_ == rhs.offset_ ) )
2871 if(
size() != rhs.size() )
2872 throw std::invalid_argument(
"Subvector sizes do not match" );
2874 if( rhs.canAlias( &vector_ ) ) {
2899 template<
typename VT
2901 template<
typename VT2 >
2902 inline DenseSubvector<VT,aligned,TF>&
2909 throw std::invalid_argument(
"Vector sizes do not match" );
2911 if( (~rhs).canAlias( &vector_ ) ) {
2916 if( IsSparseVector<VT2>::value )
2938 template<
typename VT
2940 template<
typename VT2 >
2941 inline DenseSubvector<VT,aligned,TF>&
2942 DenseSubvector<VT,aligned,TF>::operator+=(
const Vector<VT2,TF>& rhs )
2948 throw std::invalid_argument(
"Vector sizes do not match" );
2950 if( (~rhs).canAlias( &vector_ ) ) {
2975 template<
typename VT
2977 template<
typename VT2 >
2978 inline DenseSubvector<VT,aligned,TF>&
2979 DenseSubvector<VT,aligned,TF>::operator-=(
const Vector<VT2,TF>& rhs )
2985 throw std::invalid_argument(
"Vector sizes do not match" );
2987 if( (~rhs).canAlias( &vector_ ) ) {
3013 template<
typename VT
3015 template<
typename VT2 >
3016 inline DenseSubvector<VT,aligned,TF>&
3017 DenseSubvector<VT,aligned,TF>::operator*=(
const Vector<VT2,TF>& rhs )
3023 throw std::invalid_argument(
"Vector sizes do not match" );
3025 if( (~rhs).canAlias( &vector_ ) || IsSparseVector<VT2>::value ) {
3047 template<
typename VT
3049 template<
typename Other >
3050 inline typename EnableIf< IsNumeric<Other>, DenseSubvector<VT,aligned,TF> >::Type&
3051 DenseSubvector<VT,aligned,TF>::operator*=( Other rhs )
3070 template<
typename VT
3072 template<
typename Other >
3073 inline typename EnableIf< IsNumeric<Other>, DenseSubvector<VT,aligned,TF> >::Type&
3074 DenseSubvector<VT,aligned,TF>::operator/=( Other rhs )
3099 template<
typename VT
3115 template<
typename VT
3119 return vector_.capacity() - offset_;
3134 template<
typename VT
3138 size_t nonzeros( 0 );
3140 const size_t iend( offset_ + size_ );
3141 for(
size_t i=offset_; i<iend; ++i ) {
3158 template<
typename VT
3164 const size_t iend( offset_ + size_ );
3165 for(
size_t i=offset_; i<iend; ++i )
3166 clear( vector_[i] );
3179 template<
typename VT
3181 template<
typename Other >
3182 inline DenseSubvector<VT,aligned,TF>& DenseSubvector<VT,aligned,TF>::scale(
const Other& scalar )
3184 const size_t iend( offset_ + size_ );
3185 for(
size_t i=offset_; i<iend; ++i )
3186 vector_[i] *= scalar;
3212 template<
typename VT
3214 template<
typename Other >
3217 return vector_.isAliased( alias );
3234 template<
typename VT
3236 template<
typename VT2
3241 return ( vector_.isAliased( &alias->vector_ ) &&
3242 ( offset_ + size_ > alias->offset_ ) && ( offset_ < alias->offset_ + alias->size_ ) );
3259 template<
typename VT
3261 template<
typename Other >
3264 return vector_.isAliased( alias );
3281 template<
typename VT
3283 template<
typename VT2
3288 return ( vector_.isAliased( &alias->vector_ ) &&
3289 ( offset_ + size_ > alias->offset_ ) && ( offset_ < alias->offset_ + alias->size_ ) );
3305 template<
typename VT
3326 template<
typename VT
3350 template<
typename VT
3352 inline typename DenseSubvector<VT,aligned,TF>::IntrinsicType
3360 return vector_.load( offset_+index );
3380 template<
typename VT
3382 inline typename DenseSubvector<VT,aligned,TF>::IntrinsicType
3390 return vector_.loadu( offset_+index );
3411 template<
typename VT
3420 vector_.store( offset_+index, value );
3441 template<
typename VT
3450 vector_.storeu( offset_+index, value );
3471 template<
typename VT
3480 vector_.stream( offset_+index, value );
3498 template<
typename VT
3500 template<
typename VT2 >
3501 inline typename DisableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedAssign<VT2> >::Type
3506 const size_t iend(
size() &
size_t(-2) );
3507 for(
size_t i=0UL; i<iend; i+=2UL ) {
3508 vector_[i+offset_ ] = (~rhs)[i ];
3509 vector_[i+offset_+1UL] = (~rhs)[i+1UL];
3511 if( iend <
size() ) {
3512 vector_[iend+offset_] = (~rhs)[iend];
3531 template<
typename VT
3533 template<
typename VT2 >
3534 inline typename EnableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedAssign<VT2> >::Type
3544 vector_.stream( offset_+i, (~rhs).
load(i) );
3549 const size_t iend( size_ &
size_t(-
IT::size*4) );
3553 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
3560 store( i, it.load() );
3580 template<
typename VT
3582 template<
typename VT2 >
3588 vector_[element->index()+offset_] = element->value();
3606 template<
typename VT
3608 template<
typename VT2 >
3609 inline typename DisableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedAddAssign<VT2> >::Type
3614 const size_t iend(
size() &
size_t(-2) );
3615 for(
size_t i=0UL; i<iend; i+=2UL ) {
3616 vector_[i+offset_ ] += (~rhs)[i ];
3617 vector_[i+offset_+1UL] += (~rhs)[i+1UL];
3619 if( iend <
size() ) {
3620 vector_[iend+offset_] += (~rhs)[iend];
3639 template<
typename VT
3641 template<
typename VT2 >
3642 inline typename EnableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedAddAssign<VT2> >::Type
3649 const size_t iend( size_ &
size_t(-
IT::size*4) );
3653 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
3679 template<
typename VT
3681 template<
typename VT2 >
3687 vector_[element->index()+offset_] += element->value();
3705 template<
typename VT
3707 template<
typename VT2 >
3708 inline typename DisableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedSubAssign<VT2> >::Type
3713 const size_t iend(
size() &
size_t(-2) );
3714 for(
size_t i=0UL; i<iend; i+=2UL ) {
3715 vector_[i+offset_ ] -= (~rhs)[i ];
3716 vector_[i+offset_+1UL] -= (~rhs)[i+1UL];
3718 if( iend <
size() ) {
3719 vector_[iend+offset_] -= (~rhs)[iend];
3738 template<
typename VT
3740 template<
typename VT2 >
3741 inline typename EnableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedSubAssign<VT2> >::Type
3748 const size_t iend( size_ &
size_t(-
IT::size*4) );
3752 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
3778 template<
typename VT
3780 template<
typename VT2 >
3786 vector_[element->index()+offset_] -= element->value();
3804 template<
typename VT
3806 template<
typename VT2 >
3807 inline typename DisableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedMultAssign<VT2> >::Type
3812 const size_t iend(
size() &
size_t(-2) );
3813 for(
size_t i=0UL; i<iend; i+=2UL ) {
3814 vector_[i+offset_ ] *= (~rhs)[i ];
3815 vector_[i+offset_+1UL] *= (~rhs)[i+1UL];
3817 if( iend <
size() ) {
3818 vector_[iend+offset_] *= (~rhs)[iend];
3837 template<
typename VT
3839 template<
typename VT2 >
3840 inline typename EnableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedMultAssign<VT2> >::Type
3847 const size_t iend( size_ &
size_t(-
IT::size*4) );
3851 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
3877 template<
typename VT
3879 template<
typename VT2 >
3889 vector_[element->index()+offset_] = tmp[element->index()] * element->value();
3915 template<
typename VT1
3917 class DenseSubvector< DVecDVecCrossExpr<VT1,VT2>,
unaligned, false >
3918 :
public DenseVector< DenseSubvector< DVecDVecCrossExpr<VT1,VT2>, unaligned, false >, false >
3923 typedef DVecDVecCrossExpr<VT1,VT2> CPE;
3929 typedef DenseSubvector<CPE,unaligned,false>
This;
3930 typedef typename SubvectorTrait<RT>::Type
ResultType;
3939 enum { vectorizable = 0 };
3942 enum { smpAssignable = 0 };
3952 explicit inline DenseSubvector(
const CPE& vector,
size_t index,
size_t n )
3976 inline size_t size()
const {
3987 template<
typename T >
3988 inline bool canAlias(
const T* alias )
const {
3989 return vector_.canAlias( alias );
3999 template<
typename T >
4000 inline bool isAliased(
const T* alias )
const {
4001 return vector_.isAliased( alias );
4016 template<
bool AF1,
typename VT,
bool AF2,
bool TF >
4017 friend const DenseSubvector<VT,AF1,TF>
4018 subvector(
const DenseSubvector<VT,AF2,TF>& dv,
size_t index,
size_t size );
4020 template<
typename VT3,
bool AF3,
bool TF3 >
4021 friend bool isSame(
const DenseSubvector<VT3,AF3,TF3>& a,
const DenseVector<VT3,TF3>& b );
4023 template<
typename VT3,
bool AF3,
bool TF3 >
4024 friend bool isSame(
const DenseVector<VT3,TF3>& a,
const DenseSubvector<VT3,AF3,TF3>& b );
4026 template<
typename VT3,
bool AF3,
bool TF3 >
4027 friend bool isSame(
const DenseSubvector<VT3,AF3,TF3>& a,
const DenseSubvector<VT3,AF3,TF3>& b );
4054 template<
typename VT1
4056 class DenseSubvector< DVecSVecCrossExpr<VT1,VT2>,
unaligned, false >
4057 :
public DenseVector< DenseSubvector< DVecSVecCrossExpr<VT1,VT2>, unaligned, false >, false >
4062 typedef DVecSVecCrossExpr<VT1,VT2> CPE;
4068 typedef DenseSubvector<CPE,unaligned,false>
This;
4069 typedef typename SubvectorTrait<RT>::Type
ResultType;
4078 enum { vectorizable = 0 };
4081 enum { smpAssignable = 0 };
4091 explicit inline DenseSubvector(
const CPE& vector,
size_t index,
size_t n )
4115 inline size_t size()
const {
4126 template<
typename T >
4127 inline bool canAlias(
const T* alias )
const {
4128 return vector_.canAlias( alias );
4138 template<
typename T >
4139 inline bool isAliased(
const T* alias )
const {
4140 return vector_.isAliased( alias );
4155 template<
bool AF1,
typename VT,
bool AF2,
bool TF >
4156 friend const DenseSubvector<VT,AF1,TF>
4157 subvector(
const DenseSubvector<VT,AF2,TF>& dv,
size_t index,
size_t size );
4159 template<
typename VT3,
bool AF3,
bool TF3 >
4160 friend bool isSame(
const DenseSubvector<VT3,AF3,TF3>& a,
const DenseVector<VT3,TF3>& b );
4162 template<
typename VT3,
bool AF3,
bool TF3 >
4163 friend bool isSame(
const DenseVector<VT3,TF3>& a,
const DenseSubvector<VT3,AF3,TF3>& b );
4165 template<
typename VT3,
bool AF3,
bool TF3 >
4166 friend bool isSame(
const DenseSubvector<VT3,AF3,TF3>& a,
const DenseSubvector<VT3,AF3,TF3>& b );
4193 template<
typename VT1
4195 class DenseSubvector< SVecDVecCrossExpr<VT1,VT2>,
unaligned, false >
4196 :
public DenseVector< DenseSubvector< SVecDVecCrossExpr<VT1,VT2>, unaligned, false >, false >
4201 typedef SVecDVecCrossExpr<VT1,VT2> CPE;
4207 typedef DenseSubvector<CPE,unaligned,false>
This;
4208 typedef typename SubvectorTrait<RT>::Type
ResultType;
4217 enum { vectorizable = 0 };
4220 enum { smpAssignable = 0 };
4230 explicit inline DenseSubvector(
const CPE& vector,
size_t index,
size_t n )
4254 inline size_t size()
const {
4265 template<
typename T >
4266 inline bool canAlias(
const T* alias )
const {
4267 return vector_.canAlias( alias );
4277 template<
typename T >
4278 inline bool isAliased(
const T* alias )
const {
4279 return vector_.isAliased( alias );
4294 template<
bool AF1,
typename VT,
bool AF2,
bool TF >
4295 friend const DenseSubvector<VT,AF1,TF>
4296 subvector(
const DenseSubvector<VT,AF2,TF>& dv,
size_t index,
size_t size );
4298 template<
typename VT3,
bool AF3,
bool TF3 >
4299 friend bool isSame(
const DenseSubvector<VT3,AF3,TF3>& a,
const DenseVector<VT3,TF3>& b );
4301 template<
typename VT3,
bool AF3,
bool TF3 >
4302 friend bool isSame(
const DenseVector<VT3,TF3>& a,
const DenseSubvector<VT3,AF3,TF3>& b );
4304 template<
typename VT3,
bool AF3,
bool TF3 >
4305 friend bool isSame(
const DenseSubvector<VT3,AF3,TF3>& a,
const DenseSubvector<VT3,AF3,TF3>& b );
4332 template<
typename VT1
4334 class DenseSubvector< SVecSVecCrossExpr<VT1,VT2>,
unaligned, false >
4335 :
public DenseVector< DenseSubvector< SVecSVecCrossExpr<VT1,VT2>, unaligned, false >, false >
4340 typedef SVecSVecCrossExpr<VT1,VT2> CPE;
4346 typedef DenseSubvector<CPE,unaligned,false>
This;
4347 typedef typename SubvectorTrait<RT>::Type
ResultType;
4356 enum { vectorizable = 0 };
4359 enum { smpAssignable = 0 };
4369 explicit inline DenseSubvector(
const CPE& vector,
size_t index,
size_t n )
4393 inline size_t size()
const {
4404 template<
typename T >
4405 inline bool canAlias(
const T* alias )
const {
4406 return vector_.canAlias( alias );
4416 template<
typename T >
4417 inline bool isAliased(
const T* alias )
const {
4418 return vector_.isAliased( alias );
4433 template<
bool AF1,
typename VT,
bool AF2,
bool TF >
4434 friend const DenseSubvector<VT,AF1,TF>
4435 subvector(
const DenseSubvector<VT,AF2,TF>& dv,
size_t index,
size_t size );
4437 template<
typename VT3,
bool AF3,
bool TF3 >
4438 friend bool isSame(
const DenseSubvector<VT3,AF3,TF3>& a,
const DenseVector<VT3,TF3>& b );
4440 template<
typename VT3,
bool AF3,
bool TF3 >
4441 friend bool isSame(
const DenseVector<VT3,TF3>& a,
const DenseSubvector<VT3,AF3,TF3>& b );
4443 template<
typename VT3,
bool AF3,
bool TF3 >
4444 friend bool isSame(
const DenseSubvector<VT3,AF3,TF3>& a,
const DenseSubvector<VT3,AF3,TF3>& b );
4466 template<
typename VT,
bool AF,
bool TF >
4467 inline void reset( DenseSubvector<VT,AF,TF>& dv );
4469 template<
typename VT,
bool AF,
bool TF >
4470 inline void clear( DenseSubvector<VT,AF,TF>& dv );
4472 template<
typename VT,
bool AF,
bool TF >
4473 inline bool isDefault(
const DenseSubvector<VT,AF,TF>& dv );
4475 template<
typename VT,
bool AF,
bool TF >
4476 inline bool isSame(
const DenseSubvector<VT,AF,TF>& a,
const DenseVector<VT,TF>& b );
4478 template<
typename VT,
bool AF,
bool TF >
4479 inline bool isSame(
const DenseVector<VT,TF>& a,
const DenseSubvector<VT,AF,TF>& b );
4481 template<
typename VT,
bool AF,
bool TF >
4482 inline bool isSame(
const DenseSubvector<VT,AF,TF>& a,
const DenseSubvector<VT,AF,TF>& b );
4494 template<
typename VT
4511 template<
typename VT
4540 template<
typename VT
4545 for(
size_t i=0UL; i<dv.size(); ++i )
4564 template<
typename VT,
bool AF,
bool TF >
4567 return (
isSame( a.vector_, ~b ) && ( a.size() == (~b).
size() ) );
4584 template<
typename VT,
bool AF,
bool TF >
4587 return (
isSame( ~a, b.vector_ ) && ( (~a).size() == b.size() ) );
4604 template<
typename VT,
bool AF,
bool TF >
4607 return (
isSame( a.vector_, b.vector_ ) && ( a.offset_ == b.offset_ ) && ( a.size_ == b.size_ ) );
4637 inline const DenseSubvector<VT,AF1,TF>
4638 subvector(
const DenseSubvector<VT,AF2,TF>& dv,
size_t index,
size_t size )
4642 if( index + size > dv.size() )
4643 throw std::invalid_argument(
"Invalid subvector specification" );
4645 return DenseSubvector<VT,AF1,TF>( dv.vector_, dv.offset_ + index,
size );
4661 template<
typename VT,
bool AF,
bool TF >
4662 struct SubvectorTrait< DenseSubvector<VT,AF,TF> >
4680 template<
typename VT,
bool AF1,
bool TF,
bool AF2 >
4681 struct SubvectorExprTrait< DenseSubvector<VT,AF1,TF>, AF2 >
4683 typedef DenseSubvector<VT,AF2,TF> Type;
4691 template<
typename VT,
bool AF1,
bool TF,
bool AF2 >
4692 struct SubvectorExprTrait< const DenseSubvector<VT,AF1,TF>, AF2 >
4694 typedef DenseSubvector<VT,AF2,TF> Type;
4702 template<
typename VT,
bool AF1,
bool TF,
bool AF2 >
4703 struct SubvectorExprTrait< volatile DenseSubvector<VT,AF1,TF>, AF2 >
4705 typedef DenseSubvector<VT,AF2,TF> Type;
4713 template<
typename VT,
bool AF1,
bool TF,
bool AF2 >
4714 struct SubvectorExprTrait< const volatile DenseSubvector<VT,AF1,TF>, AF2 >
4716 typedef DenseSubvector<VT,AF2,TF> Type;
4724 template<
typename VT1,
typename VT2,
bool AF >
4725 struct SubvectorExprTrait< DVecDVecCrossExpr<VT1,VT2>, AF >
4729 typedef DenseSubvector< DVecDVecCrossExpr<VT1,VT2>,
unaligned,
false > Type;
4738 template<
typename VT1,
typename VT2,
bool AF >
4739 struct SubvectorExprTrait< DVecSVecCrossExpr<VT1,VT2>, AF >
4743 typedef DenseSubvector< DVecSVecCrossExpr<VT1,VT2>,
unaligned,
false > Type;
4752 template<
typename VT1,
typename VT2,
bool AF >
4753 struct SubvectorExprTrait< SVecDVecCrossExpr<VT1,VT2>, AF >
4757 typedef DenseSubvector< SVecDVecCrossExpr<VT1,VT2>,
unaligned,
false > Type;
4766 template<
typename VT1,
typename VT2,
bool AF >
4767 struct SubvectorExprTrait< SVecSVecCrossExpr<VT1,VT2>, AF >
4771 typedef DenseSubvector< SVecSVecCrossExpr<VT1,VT2>,
unaligned,
false > Type;
const ElementType * ConstPointer
Pointer to a constant subvector value.
Definition: DenseSubvector.h:416
Constraint on the data type.
const size_t final_
The final index for unaligned intrinsic operations.
Definition: DenseSubvector.h:975
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
bool canAlias(const Other *alias) const
Returns whether the dense subvector can alias with the given address alias.
Definition: DenseSubvector.h:1627
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the subvector/submatrix alignment flag values.
const size_t rest_
The number of remaining elements in an unaligned intrinsic operation.
Definition: DenseSubvector.h:974
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
SubvectorIterator(IteratorType iterator, IteratorType finalIterator, size_t remainingElements, bool isMemoryAligned)
Constructor of the SubvectorIterator class.
Definition: DenseSubvector.h:472
SubvectorIterator()
Default constructor of the SubvectorIterator class.
Definition: DenseSubvector.h:456
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
IT::Type IntrinsicType
Intrinsic type of the subvector elements.
Definition: DenseSubvector.h:405
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
#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
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
ReferenceType reference
Reference return type.
Definition: DenseSubvector.h:449
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:1551
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:772
Header file for the IsRowVector type trait.
const DenseSubvector & CompositeType
Data type for composite expression templates.
Definition: DenseSubvector.h:407
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
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:413
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
SubvectorIterator(const SubvectorIterator< IteratorType2 > &it)
Conversion constructor from different SubvectorIterator instances.
Definition: DenseSubvector.h:487
Header file for the Computation base class.
IntrinsicType loadu() const
Unaligned load of an intrinsic element of the dense subvector.
Definition: DenseSubvector.h:596
#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:620
DenseSubvector(Operand vector, size_t index, size_t n)
The constructor for DenseSubvector.
Definition: DenseSubvector.h:1048
IntrinsicTrait< typename VT::ElementType > IT
Intrinsic trait for the vector element type.
Definition: DenseSubvector.h:385
const size_t offset_
The offset of the subvector within the dense vector.
Definition: DenseSubvector.h:972
size_t capacity() const
Returns the maximum capacity of the dense subvector.
Definition: DenseSubvector.h:1533
Iterator begin()
Returns an iterator to the first element of the subvector.
Definition: DenseSubvector.h:1151
DenseSubvector & operator=(const ElementType &rhs)
Homogenous assignment to all subvector elements.
Definition: DenseSubvector.h:1266
const bool aligned
Alignment flag for aligned subvectors and submatrices.
Definition: AlignmentFlag.h:83
Base template for the SubvectorTrait class.
Definition: SubvectorTrait.h:123
void stream(size_t index, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the subvector.
Definition: DenseSubvector.h:1893
Constraint on the data type.
void reset()
Reset to the default initial values.
Definition: DenseSubvector.h:1574
Pointer data()
Low-level data access to the subvector elements.
Definition: DenseSubvector.h:1117
DifferenceType difference_type
Difference between two iterators.
Definition: DenseSubvector.h:450
Pointer data()
Low-level data access to the array elements.
Definition: AlignedArray.h:441
SubvectorTrait< VT >::Type ResultType
Result type for expression template evaluations.
Definition: DenseSubvector.h:402
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:1827
Operand vector_
The dense vector containing the subvector.
Definition: DenseSubvector.h:971
const SubvectorIterator operator--(int)
Post-decrement operator.
Definition: DenseSubvector.h:556
Header file for the clear shim.
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:1081
SubvectorIterator & operator++()
Pre-increment operator.
Definition: DenseSubvector.h:524
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
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:722
std::iterator_traits< IteratorType >::difference_type DifferenceType
Difference between two iterators.
Definition: DenseSubvector.h:443
ConstIterator cbegin() const
Returns an iterator to the first element of the subvector.
Definition: DenseSubvector.h:1187
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
DifferenceType operator-(const SubvectorIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DenseSubvector.h:686
VT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DenseSubvector.h:406
Header file for the subvector trait.
DenseSubvector< VT, AF, TF > This
Type of this DenseSubvector instance.
Definition: DenseSubvector.h:401
friend const SubvectorIterator operator+(size_t inc, const SubvectorIterator &it)
Addition between an integral value and a SubvectorIterator.
Definition: DenseSubvector.h:710
bool operator!=(const SubvectorIterator &rhs) const
Inequality comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:631
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:545
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T >, Loadu< T, sizeof(T)> >::Type::Type loadu(const T *address)
Loads a vector of integral values.
Definition: Loadu.h:221
IteratorType iterator_
Iterator to the current subvector element.
Definition: DenseSubvector.h:769
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
IteratorType base() const
Access to the current position of the subvector iterator.
Definition: DenseSubvector.h:732
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
size_t size() const
Returns the current size/dimension of the dense subvector.
Definition: DenseSubvector.h:1518
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
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:2480
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DenseSubvector.h:403
SelectType< useConst, ConstPointer, ElementType * >::Type Pointer
Pointer to a non-constant subvector value.
Definition: DenseSubvector.h:419
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:431
Header file for the CrossExpr base class.
Header file for the IsNumeric type trait.
size_t rest_
The number of remaining elements beyond the final iterator.
Definition: DenseSubvector.h:771
SelectType< useConst, ConstIterator, SubvectorIterator< typename VT::Iterator > >::Type Iterator
Iterator over non-constant elements.
Definition: DenseSubvector.h:782
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.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2477
Header file for the IsConst type trait.
Iterator end()
Returns an iterator just past the last element of the subvector.
Definition: DenseSubvector.h:1205
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:749
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
Base class for all subvectors.The Subvector class serves as a tag for all subvectors (i...
Definition: Subvector.h:64
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
View on a specific subvector of a dense vector.The DenseSubvector template represents a view on a spe...
Definition: DenseSubvector.h:376
SubvectorIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DenseSubvector.h:501
bool operator>(const SubvectorIterator &rhs) const
Greater-than comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:653
bool isAligned() const
Returns whether the subvector is properly aligned in memory.
Definition: DenseSubvector.h:1715
std::iterator_traits< IteratorType >::pointer PointerType
Pointer return type.
Definition: DenseSubvector.h:437
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:135
ValueType value_type
Type of the underlying elements.
Definition: DenseSubvector.h:447
Header file for the AlignedArray implementation.
Header file for the cache size of the target architecture.
bool canSMPAssign() const
Returns whether the subvector can be used in SMP assignments.
Definition: DenseSubvector.h:1735
bool isAligned() const
Access to the iterator's memory alignment flag.
Definition: DenseSubvector.h:762
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2481
Header file for the isDefault shim.
ReferenceType operator*() const
Direct access to the element at the current iterator position.
Definition: DenseSubvector.h:566
IteratorType final() const
Access to the final position of the subvector iterator.
Definition: DenseSubvector.h:742
BLAZE_ALWAYS_INLINE bool isDefault(const NonNumericProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: NonNumericProxy.h:874
const size_t size_
The size of the subvector.
Definition: DenseSubvector.h:973
BLAZE_ALWAYS_INLINE void reset(const NonNumericProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: NonNumericProxy.h:833
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
IntrinsicType load() const
Aligned load of an intrinsic element of the dense subvector.
Definition: DenseSubvector.h:581
const SubvectorIterator operator++(int)
Post-increment operator.
Definition: DenseSubvector.h:535
IteratorCategory iterator_category
The iterator category.
Definition: DenseSubvector.h:446
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
size_t rest() const
Access to the number of remaining elements beyond the final iterator.
Definition: DenseSubvector.h:752
VT::ConstReference ConstReference
Reference to a constant subvector value.
Definition: DenseSubvector.h:410
SubvectorIterator< typename VT::ConstIterator > ConstIterator
Iterator over constant elements.
Definition: DenseSubvector.h:779
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:1783
friend const SubvectorIterator operator+(const SubvectorIterator &it, size_t inc)
Addition between a SubvectorIterator and an integral value.
Definition: DenseSubvector.h:698
bool isAliased(const Other *alias) const
Returns whether the dense subvector is aliased with the given address alias.
Definition: DenseSubvector.h:1672
#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:448
const bool isAligned_
Memory alignment flag.
Definition: DenseSubvector.h:980
IteratorType final_
The final iterator for intrinsic operations.
Definition: DenseSubvector.h:770
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:151
IntrinsicType load(size_t index) const
Aligned load of an intrinsic element of the dense subvector.
Definition: DenseSubvector.h:1759
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
#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:675
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
ConstIterator cend() const
Returns an iterator just past the last element of the subvector.
Definition: DenseSubvector.h:1241
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T > >::Type storeu(T *address, const typename Storeu< T, sizeof(T)>::Type &value)
Unaligned store of a vector of integral values.
Definition: Storeu.h:218
Header file for the SubvectorExprTrait class template.
SubvectorIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DenseSubvector.h:513
Implementation of a static array with a fixed alignment.The AlignedArray class template represents a ...
Definition: AlignedArray.h:264
Iterator over the elements of the sparse subvector.
Definition: DenseSubvector.h:426
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2479
std::iterator_traits< IteratorType >::value_type ValueType
Type of the underlying elements.
Definition: DenseSubvector.h:434
VT::ElementType ElementType
Type of the subvector elements.
Definition: DenseSubvector.h:404
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
void storeu(size_t index, const IntrinsicType &value)
Unaligned store of an intrinsic element of the subvector.
Definition: DenseSubvector.h:1851
SelectType< IsExpression< VT >::value, VT, VT & >::Type Operand
Composite data type of the dense vector expression.
Definition: DenseSubvector.h:382
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
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T > >::Type store(T *address, const typename Store< T, sizeof(T)>::Type &value)
Aligned store of a vector of integral values.
Definition: Store.h:225
bool operator<(const SubvectorIterator &rhs) const
Less-than comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:642
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
bool operator<=(const SubvectorIterator &rhs) const
Less-than comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:664
#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
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:440
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