35 #ifndef _BLAZE_MATH_VIEWS_DENSESUBVECTOR_H_
36 #define _BLAZE_MATH_VIEWS_DENSESUBVECTOR_H_
389 template<
typename VT
391 ,
bool TF = IsRowVector<VT>::value >
431 template<
typename IteratorType >
440 typedef typename std::iterator_traits<IteratorType>::value_type
ValueType;
443 typedef typename std::iterator_traits<IteratorType>::pointer
PointerType;
446 typedef typename std::iterator_traits<IteratorType>::reference
ReferenceType;
449 typedef typename std::iterator_traits<IteratorType>::difference_type
DifferenceType;
485 template<
typename IteratorType2 >
578 inline IntrinsicType
load()
const {
593 inline IntrinsicType
loada()
const {
608 inline IntrinsicType
loadu()
const {
736 inline IteratorType
base()
const {
769 enum { vectorizable = VT::vectorizable };
772 enum { smpAssignable = VT::smpAssignable };
778 explicit inline DenseSubvector( Operand vector,
size_t index,
size_t n );
791 inline ConstReference
operator[](
size_t index )
const;
792 inline Reference
at(
size_t index );
793 inline ConstReference
at(
size_t index )
const;
794 inline Pointer
data ();
795 inline ConstPointer
data ()
const;
796 inline Iterator
begin ();
797 inline ConstIterator
begin ()
const;
798 inline ConstIterator
cbegin()
const;
799 inline Iterator
end ();
800 inline ConstIterator
end ()
const;
801 inline ConstIterator
cend ()
const;
811 template<
typename VT2 >
inline DenseSubvector& operator+=(
const Vector<VT2,TF>& rhs );
812 template<
typename VT2 >
inline DenseSubvector& operator-=(
const Vector<VT2,TF>& rhs );
813 template<
typename VT2 >
inline DenseSubvector& operator*=(
const DenseVector<VT2,TF>& rhs );
814 template<
typename VT2 >
inline DenseSubvector& operator*=(
const SparseVector<VT2,TF>& rhs );
816 template<
typename Other >
817 inline typename EnableIf< IsNumeric<Other>,
DenseSubvector >::Type&
818 operator*=( Other rhs );
820 template<
typename Other >
821 inline typename EnableIf< IsNumeric<Other>,
DenseSubvector >::Type&
822 operator/=( Other rhs );
829 inline size_t size()
const;
833 template<
typename Other >
inline DenseSubvector& scale(
const Other& scalar );
840 template<
typename VT2 >
842 struct VectorizedAssign {
844 vectorizable && VT2::vectorizable &&
845 IsSame<ElementType,typename VT2::ElementType>::value };
852 template<
typename VT2 >
854 struct VectorizedAddAssign {
856 vectorizable && VT2::vectorizable &&
857 IsSame<ElementType,typename VT2::ElementType>::value &&
858 IntrinsicTrait<ElementType>::addition };
865 template<
typename VT2 >
867 struct VectorizedSubAssign {
869 vectorizable && VT2::vectorizable &&
870 IsSame<ElementType,typename VT2::ElementType>::value &&
871 IntrinsicTrait<ElementType>::subtraction };
878 template<
typename VT2 >
880 struct VectorizedMultAssign {
882 vectorizable && VT2::vectorizable &&
883 IsSame<ElementType,typename VT2::ElementType>::value &&
884 IntrinsicTrait<ElementType>::multiplication };
893 template<
typename Other >
894 inline bool canAlias(
const Other* alias )
const;
896 template<
typename VT2,
bool AF2,
bool TF2 >
897 inline bool canAlias(
const DenseSubvector<VT2,AF2,TF2>* alias )
const;
899 template<
typename Other >
900 inline bool isAliased(
const Other* alias )
const;
902 template<
typename VT2,
bool AF2,
bool TF2 >
903 inline bool isAliased(
const DenseSubvector<VT2,AF2,TF2>* alias )
const;
908 inline IntrinsicType
load (
size_t index )
const;
909 inline IntrinsicType
loada(
size_t index )
const;
910 inline IntrinsicType
loadu(
size_t index )
const;
912 inline void store (
size_t index,
const IntrinsicType& value );
913 inline void storea(
size_t index,
const IntrinsicType& value );
914 inline void storeu(
size_t index,
const IntrinsicType& value );
915 inline void stream(
size_t index,
const IntrinsicType& value );
917 template<
typename VT2 >
918 inline typename DisableIf< VectorizedAssign<VT2> >::Type
919 assign(
const DenseVector <VT2,TF>& rhs );
921 template<
typename VT2 >
922 inline typename EnableIf< VectorizedAssign<VT2> >::Type
923 assign(
const DenseVector <VT2,TF>& rhs );
925 template<
typename VT2 >
inline void assign(
const SparseVector<VT2,TF>& rhs );
927 template<
typename VT2 >
928 inline typename DisableIf< VectorizedAddAssign<VT2> >::Type
929 addAssign(
const DenseVector <VT2,TF>& rhs );
931 template<
typename VT2 >
932 inline typename EnableIf< VectorizedAddAssign<VT2> >::Type
933 addAssign (
const DenseVector <VT2,TF>& rhs );
935 template<
typename VT2 >
inline void addAssign(
const SparseVector<VT2,TF>& rhs );
937 template<
typename VT2 >
938 inline typename DisableIf< VectorizedSubAssign<VT2> >::Type
939 subAssign (
const DenseVector <VT2,TF>& rhs );
941 template<
typename VT2 >
942 inline typename EnableIf< VectorizedSubAssign<VT2> >::Type
943 subAssign(
const DenseVector <VT2,TF>& rhs );
945 template<
typename VT2 >
inline void subAssign(
const SparseVector<VT2,TF>& rhs );
947 template<
typename VT2 >
948 inline typename DisableIf< VectorizedMultAssign<VT2> >::Type
949 multAssign(
const DenseVector <VT2,TF>& rhs );
951 template<
typename VT2 >
952 inline typename EnableIf< VectorizedMultAssign<VT2> >::Type
953 multAssign(
const DenseVector <VT2,TF>& rhs );
955 template<
typename VT2 >
inline void multAssign(
const SparseVector<VT2,TF>& rhs );
978 template<
typename VT2,
bool AF2,
bool TF2 >
friend class DenseSubvector;
980 template<
bool AF1,
typename VT2,
bool AF2,
bool TF2 >
984 template<
typename VT2,
bool AF2,
bool TF2 >
987 template<
typename VT2,
bool AF2,
bool TF2 >
990 template<
typename VT2,
bool AF2,
bool TF2 >
993 template<
typename VT2,
bool AF2,
bool TF2 >
996 template<
typename VT2,
bool AF2,
bool TF2,
typename VT3 >
999 template<
typename VT2,
bool AF2,
bool TF2,
typename VT3 >
1002 template<
typename VT2,
bool AF2,
bool TF2,
typename VT3 >
1005 template<
typename VT2,
bool AF2,
bool TF2,
typename VT3 >
1008 template<
typename VT2,
bool AF2,
bool TF2 >
1047 template<
typename VT
1051 : vector_ ( vector )
1054 , isAligned_( vectorizable && vector.data() != NULL &&
checkAlignment( data() ) )
1056 if( index + n > vector.size() ) {
1080 template<
typename VT
1087 return vector_[offset_+index];
1101 template<
typename VT
1108 return const_cast<const VT&
>( vector_ )[offset_+index];
1123 template<
typename VT
1129 if( index >=
size() ) {
1132 return (*
this)[index];
1147 template<
typename VT
1153 if( index >=
size() ) {
1156 return (*
this)[index];
1168 template<
typename VT
1173 return vector_.data() + offset_;
1185 template<
typename VT
1190 return vector_.data() + offset_;
1202 template<
typename VT
1207 return Iterator( vector_.begin() + offset_, isAligned_ );
1219 template<
typename VT
1224 return ConstIterator( vector_.cbegin() + offset_, isAligned_ );
1236 template<
typename VT
1241 return ConstIterator( vector_.cbegin() + offset_, isAligned_ );
1253 template<
typename VT
1258 return Iterator( vector_.begin() + offset_ + size_, isAligned_ );
1270 template<
typename VT
1275 return ConstIterator( vector_.cbegin() + offset_ + size_, isAligned_ );
1287 template<
typename VT
1292 return ConstIterator( vector_.cbegin() + offset_ + size_, isAligned_ );
1311 template<
typename VT
1316 const size_t iend( offset_ + size_ );
1318 for(
size_t i=offset_; i<iend; ++i )
1337 template<
typename VT
1345 if( &rhs ==
this || ( &vector_ == &rhs.
vector_ && offset_ == rhs.
offset_ ) )
1352 if( !tryAssign( vector_, rhs, offset_ ) ) {
1384 template<
typename VT
1387 template<
typename VT2 >
1398 Right right( ~rhs );
1400 if( !tryAssign( vector_, right, offset_ ) ) {
1434 template<
typename VT
1437 template<
typename VT2 >
1448 Right right( ~rhs );
1450 if( !tryAddAssign( vector_, right, offset_ ) ) {
1482 template<
typename VT
1485 template<
typename VT2 >
1496 Right right( ~rhs );
1498 if( !trySubAssign( vector_, right, offset_ ) ) {
1531 template<
typename VT
1534 template<
typename VT2 >
1546 Right right( ~rhs );
1548 if( !tryMultAssign( vector_, right, offset_ ) ) {
1581 template<
typename VT
1584 template<
typename VT2 >
1597 if( !tryAssign( vector_, tmp, offset_ ) ) {
1619 template<
typename VT
1622 template<
typename Other >
1643 template<
typename VT
1646 template<
typename Other >
1673 template<
typename VT
1688 template<
typename VT
1693 return vector_.capacity() - offset_;
1706 template<
typename VT
1711 size_t nonzeros( 0 );
1713 const size_t iend( offset_ + size_ );
1714 for(
size_t i=offset_; i<iend; ++i ) {
1729 template<
typename VT
1736 const size_t iend( offset_ + size_ );
1737 for(
size_t i=offset_; i<iend; ++i )
1738 clear( vector_[i] );
1749 template<
typename VT
1752 template<
typename Other >
1755 const size_t iend( offset_ + size_ );
1756 for(
size_t i=offset_; i<iend; ++i )
1757 vector_[i] *= scalar;
1781 template<
typename VT
1784 template<
typename Other >
1787 return vector_.isAliased( alias );
1802 template<
typename VT
1805 template<
typename VT2
1810 return ( vector_.isAliased( &alias->
vector_ ) &&
1811 ( offset_ + size_ > alias->
offset_ ) && ( offset_ < alias->offset_ + alias->
size_ ) );
1826 template<
typename VT
1829 template<
typename Other >
1832 return vector_.isAliased( alias );
1847 template<
typename VT
1850 template<
typename VT2
1855 return ( vector_.isAliased( &alias->
vector_ ) &&
1856 ( offset_ + size_ > alias->
offset_ ) && ( offset_ < alias->offset_ + alias->
size_ ) );
1870 template<
typename VT
1890 template<
typename VT
1895 return (
size() > SMP_DVECASSIGN_THRESHOLD );
1913 template<
typename VT
1920 return loada( index );
1922 return loadu( index );
1940 template<
typename VT
1952 return vector_.loada( offset_+index );
1970 template<
typename VT
1982 return vector_.loadu( offset_+index );
2001 template<
typename VT
2028 template<
typename VT
2039 vector_.storea( offset_+index, value );
2058 template<
typename VT
2069 vector_.storeu( offset_+index, value );
2088 template<
typename VT
2100 vector_.stream( offset_+index, value );
2102 vector_.storeu( offset_+index, value );
2118 template<
typename VT
2121 template<
typename VT2 >
2127 const size_t ipos(
size() &
size_t(-2) );
2128 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2129 vector_[offset_+i ] = (~rhs)[i ];
2130 vector_[offset_+i+1UL] = (~rhs)[i+1UL];
2132 if( ipos <
size() ) {
2133 vector_[offset_+ipos] = (~rhs)[ipos];
2150 template<
typename VT
2153 template<
typename VT2 >
2161 const size_t ipos( size_ &
size_t(-
IT::size) );
2166 !(~rhs).isAliased( &vector_ ) )
2171 vector_.stream( offset_+i, (~rhs).load(i) );
2173 for( ; i<size_; ++i ) {
2174 vector_[offset_+i] = (~rhs)[i];
2183 store( i , it.load() ); it +=
IT::size;
2189 store( i, it.load() );
2191 for( ; i<size_; ++i, ++it ) {
2192 vector_[offset_+i] = *it;
2210 template<
typename VT
2213 template<
typename VT2 >
2219 vector_[offset_+element->index()] = element->value();
2235 template<
typename VT
2238 template<
typename VT2 >
2244 const size_t ipos(
size() &
size_t(-2) );
2245 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2246 vector_[offset_+i ] += (~rhs)[i ];
2247 vector_[offset_+i+1UL] += (~rhs)[i+1UL];
2249 if( ipos <
size() ) {
2250 vector_[offset_+ipos] += (~rhs)[ipos];
2267 template<
typename VT
2270 template<
typename VT2 >
2278 const size_t ipos( size_ &
size_t(-
IT::size) );
2285 store( i , load(i ) + it.load() ); it +=
IT::size;
2291 store( i, load(i) + it.load() );
2293 for( ; i<size_; ++i, ++it ) {
2294 vector_[offset_+i] += *it;
2311 template<
typename VT
2314 template<
typename VT2 >
2320 vector_[offset_+element->index()] += element->value();
2336 template<
typename VT
2339 template<
typename VT2 >
2345 const size_t ipos(
size() &
size_t(-2) );
2346 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2347 vector_[offset_+i ] -= (~rhs)[i ];
2348 vector_[offset_+i+1UL] -= (~rhs)[i+1UL];
2350 if( ipos <
size() ) {
2351 vector_[offset_+ipos] -= (~rhs)[ipos];
2368 template<
typename VT
2371 template<
typename VT2 >
2379 const size_t ipos( size_ &
size_t(-
IT::size) );
2386 store( i , load(i ) - it.load() ); it +=
IT::size;
2392 store( i, load(i) - it.load() );
2394 for( ; i<size_; ++i, ++it ) {
2395 vector_[offset_+i] -= *it;
2412 template<
typename VT
2415 template<
typename VT2 >
2421 vector_[offset_+element->index()] -= element->value();
2437 template<
typename VT
2440 template<
typename VT2 >
2446 const size_t ipos(
size() &
size_t(-2) );
2447 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2448 vector_[offset_+i ] *= (~rhs)[i ];
2449 vector_[offset_+i+1UL] *= (~rhs)[i+1UL];
2451 if( ipos <
size() ) {
2452 vector_[offset_+ipos] *= (~rhs)[ipos];
2469 template<
typename VT
2472 template<
typename VT2 >
2480 const size_t ipos( size_ &
size_t(-
IT::size) );
2487 store( i , load(i ) * it.load() ); it +=
IT::size;
2493 store( i, load(i) * it.load() );
2495 for( ; i<size_; ++i, ++it ) {
2496 vector_[offset_+i] *= *it;
2513 template<
typename VT
2516 template<
typename VT2 >
2526 vector_[offset_+element->index()] = tmp[element->index()] * element->value();
2551 template<
typename VT
2597 enum { vectorizable = VT::vectorizable };
2600 enum { smpAssignable = VT::smpAssignable };
2606 explicit inline DenseSubvector( Operand vector,
size_t index,
size_t n );
2619 inline ConstReference
operator[](
size_t index )
const;
2620 inline Reference
at(
size_t index );
2621 inline ConstReference
at(
size_t index )
const;
2622 inline Pointer
data ();
2623 inline ConstPointer
data ()
const;
2624 inline Iterator
begin ();
2625 inline ConstIterator
begin ()
const;
2626 inline ConstIterator
cbegin()
const;
2627 inline Iterator
end ();
2628 inline ConstIterator
end ()
const;
2629 inline ConstIterator
cend ()
const;
2639 template<
typename VT2 >
inline DenseSubvector& operator+=(
const Vector<VT2,TF>& rhs );
2640 template<
typename VT2 >
inline DenseSubvector& operator-=(
const Vector<VT2,TF>& rhs );
2641 template<
typename VT2 >
inline DenseSubvector& operator*=(
const DenseVector<VT2,TF>& rhs );
2642 template<
typename VT2 >
inline DenseSubvector& operator*=(
const SparseVector<VT2,TF>& rhs );
2644 template<
typename Other >
2645 inline typename EnableIf< IsNumeric<Other>,
DenseSubvector >::Type&
2646 operator*=( Other rhs );
2648 template<
typename Other >
2649 inline typename EnableIf< IsNumeric<Other>,
DenseSubvector >::Type&
2650 operator/=( Other rhs );
2657 inline size_t size()
const;
2660 inline void reset();
2661 template<
typename Other >
inline DenseSubvector& scale(
const Other& scalar );
2668 template<
typename VT2 >
2669 struct VectorizedAssign {
2671 vectorizable && VT2::vectorizable &&
2672 IsSame<ElementType,typename VT2::ElementType>::value };
2678 template<
typename VT2 >
2679 struct VectorizedAddAssign {
2681 vectorizable && VT2::vectorizable &&
2682 IsSame<ElementType,typename VT2::ElementType>::value &&
2683 IntrinsicTrait<ElementType>::addition };
2689 template<
typename VT2 >
2690 struct VectorizedSubAssign {
2692 vectorizable && VT2::vectorizable &&
2693 IsSame<ElementType,typename VT2::ElementType>::value &&
2694 IntrinsicTrait<ElementType>::subtraction };
2700 template<
typename VT2 >
2701 struct VectorizedMultAssign {
2703 vectorizable && VT2::vectorizable &&
2704 IsSame<ElementType,typename VT2::ElementType>::value &&
2705 IntrinsicTrait<ElementType>::multiplication };
2713 template<
typename Other >
2714 inline bool canAlias(
const Other* alias )
const;
2716 template<
typename VT2,
bool AF2,
bool TF2 >
2717 inline bool canAlias(
const DenseSubvector<VT2,AF2,TF2>* alias )
const;
2719 template<
typename Other >
2720 inline bool isAliased(
const Other* alias )
const;
2722 template<
typename VT2,
bool AF2,
bool TF2 >
2723 inline bool isAliased(
const DenseSubvector<VT2,AF2,TF2>* alias )
const;
2728 inline IntrinsicType
load (
size_t index )
const;
2729 inline IntrinsicType
loada(
size_t index )
const;
2730 inline IntrinsicType
loadu(
size_t index )
const;
2732 inline void store (
size_t index,
const IntrinsicType& value );
2733 inline void storea(
size_t index,
const IntrinsicType& value );
2734 inline void storeu(
size_t index,
const IntrinsicType& value );
2735 inline void stream(
size_t index,
const IntrinsicType& value );
2737 template<
typename VT2 >
2738 inline typename DisableIf< VectorizedAssign<VT2> >::Type
2739 assign(
const DenseVector <VT2,TF>& rhs );
2741 template<
typename VT2 >
2742 inline typename EnableIf< VectorizedAssign<VT2> >::Type
2743 assign(
const DenseVector <VT2,TF>& rhs );
2745 template<
typename VT2 >
inline void assign(
const SparseVector<VT2,TF>& rhs );
2747 template<
typename VT2 >
2748 inline typename DisableIf< VectorizedAddAssign<VT2> >::Type
2749 addAssign(
const DenseVector <VT2,TF>& rhs );
2751 template<
typename VT2 >
2752 inline typename EnableIf< VectorizedAddAssign<VT2> >::Type
2753 addAssign (
const DenseVector <VT2,TF>& rhs );
2755 template<
typename VT2 >
inline void addAssign(
const SparseVector<VT2,TF>& rhs );
2757 template<
typename VT2 >
2758 inline typename DisableIf< VectorizedSubAssign<VT2> >::Type
2759 subAssign (
const DenseVector <VT2,TF>& rhs );
2761 template<
typename VT2 >
2762 inline typename EnableIf< VectorizedSubAssign<VT2> >::Type
2763 subAssign(
const DenseVector <VT2,TF>& rhs );
2765 template<
typename VT2 >
inline void subAssign(
const SparseVector<VT2,TF>& rhs );
2767 template<
typename VT2 >
2768 inline typename DisableIf< VectorizedMultAssign<VT2> >::Type
2769 multAssign(
const DenseVector <VT2,TF>& rhs );
2771 template<
typename VT2 >
2772 inline typename EnableIf< VectorizedMultAssign<VT2> >::Type
2773 multAssign(
const DenseVector <VT2,TF>& rhs );
2775 template<
typename VT2 >
inline void multAssign(
const SparseVector<VT2,TF>& rhs );
2790 template<
typename VT2,
bool AF2,
bool TF2 >
friend class DenseSubvector;
2792 template<
bool AF1,
typename VT2,
bool AF2,
bool TF2 >
2793 friend const DenseSubvector<VT2,AF1,TF2>
2794 subvector(
const DenseSubvector<VT2,AF2,TF2>& dv,
size_t index,
size_t size );
2796 template<
typename VT2,
bool AF2,
bool TF2 >
2797 friend bool isIntact(
const DenseSubvector<VT2,AF2,TF2>& dv );
2799 template<
typename VT2,
bool AF2,
bool TF2 >
2800 friend bool isSame(
const DenseSubvector<VT2,AF2,TF2>& a,
const DenseVector<VT2,TF2>& b );
2802 template<
typename VT2,
bool AF2,
bool TF2 >
2803 friend bool isSame(
const DenseVector<VT2,TF2>& a,
const DenseSubvector<VT2,AF2,TF2>& b );
2805 template<
typename VT2,
bool AF2,
bool TF2 >
2806 friend bool isSame(
const DenseSubvector<VT2,AF2,TF2>& a,
const DenseSubvector<VT2,AF2,TF2>& b );
2808 template<
typename VT2,
bool AF2,
bool TF2,
typename VT3 >
2809 friend bool tryAssign(
const DenseSubvector<VT2,AF2,TF2>& lhs,
const Vector<VT3,TF2>& rhs,
size_t index );
2811 template<
typename VT2,
bool AF2,
bool TF2,
typename VT3 >
2812 friend bool tryAddAssign(
const DenseSubvector<VT2,AF2,TF2>& lhs,
const Vector<VT3,TF2>& rhs,
size_t index );
2814 template<
typename VT2,
bool AF2,
bool TF2,
typename VT3 >
2815 friend bool trySubAssign(
const DenseSubvector<VT2,AF2,TF2>& lhs,
const Vector<VT3,TF2>& rhs,
size_t index );
2817 template<
typename VT2,
bool AF2,
bool TF2,
typename VT3 >
2818 friend bool tryMultAssign(
const DenseSubvector<VT2,AF2,TF2>& lhs,
const Vector<VT3,TF2>& rhs,
size_t index );
2820 template<
typename VT2,
bool AF2,
bool TF2 >
2821 friend typename DerestrictTrait< DenseSubvector<VT2,AF2,TF2> >::Type
2822 derestrict( DenseSubvector<VT2,AF2,TF2>& dv );
2858 template<
typename VT
2865 if( index + n > vector.size() ) {
2892 template<
typename VT
2898 return vector_[offset_+index];
2911 template<
typename VT
2917 return const_cast<const VT&
>( vector_ )[offset_+index];
2934 template<
typename VT
2939 if( index >=
size() ) {
2942 return (*
this)[index];
2959 template<
typename VT
2964 if( index >=
size() ) {
2967 return (*
this)[index];
2981 template<
typename VT
2985 return vector_.data() + offset_;
2999 template<
typename VT
3003 return vector_.data() + offset_;
3017 template<
typename VT
3021 return ( vector_.begin() + offset_ );
3035 template<
typename VT
3040 return ( vector_.cbegin() + offset_ );
3054 template<
typename VT
3059 return ( vector_.cbegin() + offset_ );
3073 template<
typename VT
3077 return ( vector_.begin() + offset_ + size_ );
3091 template<
typename VT
3096 return ( vector_.cbegin() + offset_ + size_ );
3110 template<
typename VT
3115 return ( vector_.cbegin() + offset_ + size_ );
3136 template<
typename VT
3138 inline DenseSubvector<VT,aligned,TF>&
3141 const size_t iend( offset_ + size_ );
3143 for(
size_t i=offset_; i<iend; ++i )
3164 template<
typename VT
3166 inline DenseSubvector<VT,aligned,TF>&
3172 if( &rhs ==
this || ( &vector_ == &rhs.vector_ && offset_ == rhs.offset_ ) )
3175 if(
size() != rhs.size() ) {
3179 if( !tryAssign( vector_, rhs, offset_ ) ) {
3183 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3185 if( rhs.canAlias( &vector_ ) ) {
3213 template<
typename VT
3215 template<
typename VT2 >
3216 inline DenseSubvector<VT,aligned,TF>&
3226 typedef typename If< IsRestricted<VT>,
typename VT2::CompositeType,
const VT2& >::Type Right;
3227 Right right( ~rhs );
3229 if( !tryAssign( vector_, right, offset_ ) ) {
3233 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3235 if( IsReference<Right>::value && right.canAlias( &vector_ ) ) {
3240 if( IsSparseVector<VT2>::value )
3265 template<
typename VT
3267 template<
typename VT2 >
3268 inline DenseSubvector<VT,aligned,TF>&
3269 DenseSubvector<VT,aligned,TF>::operator+=(
const Vector<VT2,TF>& rhs )
3278 typedef typename If< IsRestricted<VT>,
typename VT2::CompositeType,
const VT2& >::Type Right;
3279 Right right( ~rhs );
3281 if( !tryAddAssign( vector_, right, offset_ ) ) {
3285 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3287 if( IsReference<Right>::value && right.canAlias( &vector_ ) ) {
3315 template<
typename VT
3317 template<
typename VT2 >
3318 inline DenseSubvector<VT,aligned,TF>&
3319 DenseSubvector<VT,aligned,TF>::operator-=(
const Vector<VT2,TF>& rhs )
3328 typedef typename If< IsRestricted<VT>,
typename VT2::CompositeType,
const VT2& >::Type Right;
3329 Right right( ~rhs );
3331 if( !trySubAssign( vector_, right, offset_ ) ) {
3335 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3337 if( IsReference<Right>::value && right.canAlias( &vector_ ) ) {
3366 template<
typename VT
3368 template<
typename VT2 >
3369 inline DenseSubvector<VT,aligned,TF>&
3370 DenseSubvector<VT,aligned,TF>::operator*=(
const DenseVector<VT2,TF>& rhs )
3379 typedef typename If< IsRestricted<VT>,
typename VT2::CompositeType,
const VT2& >::Type Right;
3380 Right right( ~rhs );
3382 if( !tryMultAssign( vector_, right, offset_ ) ) {
3386 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3388 if( IsReference<Right>::value && right.canAlias( &vector_ ) ) {
3417 template<
typename VT
3419 template<
typename VT2 >
3420 inline DenseSubvector<VT,aligned,TF>&
3421 DenseSubvector<VT,aligned,TF>::operator*=(
const SparseVector<VT2,TF>& rhs )
3432 if( !tryAssign( vector_, tmp, offset_ ) ) {
3436 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3456 template<
typename VT
3458 template<
typename Other >
3459 inline typename EnableIf< IsNumeric<Other>, DenseSubvector<VT,aligned,TF> >::Type&
3460 DenseSubvector<VT,aligned,TF>::operator*=( Other rhs )
3462 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3481 template<
typename VT
3483 template<
typename Other >
3484 inline typename EnableIf< IsNumeric<Other>, DenseSubvector<VT,aligned,TF> >::Type&
3485 DenseSubvector<VT,aligned,TF>::operator/=( Other rhs )
3489 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3512 template<
typename VT
3528 template<
typename VT
3532 return vector_.capacity() - offset_;
3547 template<
typename VT
3551 size_t nonzeros( 0 );
3553 const size_t iend( offset_ + size_ );
3554 for(
size_t i=offset_; i<iend; ++i ) {
3571 template<
typename VT
3577 const size_t iend( offset_ + size_ );
3578 for(
size_t i=offset_; i<iend; ++i )
3579 clear( vector_[i] );
3592 template<
typename VT
3594 template<
typename Other >
3595 inline DenseSubvector<VT,aligned,TF>& DenseSubvector<VT,aligned,TF>::scale(
const Other& scalar )
3597 const size_t iend( offset_ + size_ );
3598 for(
size_t i=offset_; i<iend; ++i )
3599 vector_[i] *= scalar;
3625 template<
typename VT
3627 template<
typename Other >
3630 return vector_.isAliased( alias );
3647 template<
typename VT
3649 template<
typename VT2
3654 return ( vector_.isAliased( &alias->vector_ ) &&
3655 ( offset_ + size_ > alias->offset_ ) && ( offset_ < alias->offset_ + alias->size_ ) );
3672 template<
typename VT
3674 template<
typename Other >
3677 return vector_.isAliased( alias );
3694 template<
typename VT
3696 template<
typename VT2
3701 return ( vector_.isAliased( &alias->vector_ ) &&
3702 ( offset_ + size_ > alias->offset_ ) && ( offset_ < alias->offset_ + alias->size_ ) );
3718 template<
typename VT
3739 template<
typename VT
3743 return (
size() > SMP_DVECASSIGN_THRESHOLD );
3763 template<
typename VT
3768 return loada( index );
3788 template<
typename VT
3799 return vector_.loada( offset_+index );
3819 template<
typename VT
3830 return vector_.loadu( offset_+index );
3851 template<
typename VT
3877 template<
typename VT
3888 vector_.storea( offset_+index, value );
3909 template<
typename VT
3920 vector_.storeu( offset_+index, value );
3941 template<
typename VT
3952 vector_.stream( offset_+index, value );
3970 template<
typename VT
3972 template<
typename VT2 >
3973 inline typename DisableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedAssign<VT2> >::Type
3974 DenseSubvector<VT,aligned,TF>::assign(
const DenseVector<VT2,TF>& rhs )
3978 const size_t ipos(
size() &
size_t(-2) );
3979 for(
size_t i=0UL; i<ipos; i+=2UL ) {
3980 vector_[offset_+i ] = (~rhs)[i ];
3981 vector_[offset_+i+1UL] = (~rhs)[i+1UL];
3983 if( ipos <
size() ) {
3984 vector_[offset_+ipos] = (~rhs)[ipos];
4003 template<
typename VT
4005 template<
typename VT2 >
4006 inline typename EnableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedAssign<VT2> >::Type
4007 DenseSubvector<VT,aligned,TF>::assign(
const DenseVector<VT2,TF>& rhs )
4013 const size_t ipos( size_ &
size_t(-
IT::size) );
4021 stream( i, (~rhs).load(i) );
4023 for( ; i<size_; ++i ) {
4024 vector_[offset_+i] = (~rhs)[i];
4033 store( i , it.load() ); it +=
IT::size;
4039 store( i, it.load() );
4041 for( ; i<size_; ++i, ++it ) {
4042 vector_[offset_+i] = *it;
4062 template<
typename VT
4064 template<
typename VT2 >
4065 inline void DenseSubvector<VT,aligned,TF>::assign(
const SparseVector<VT2,TF>& rhs )
4070 vector_[offset_+element->index()] = element->value();
4088 template<
typename VT
4090 template<
typename VT2 >
4091 inline typename DisableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedAddAssign<VT2> >::Type
4092 DenseSubvector<VT,aligned,TF>::addAssign(
const DenseVector<VT2,TF>& rhs )
4096 const size_t ipos(
size() &
size_t(-2) );
4097 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4098 vector_[offset_+i ] += (~rhs)[i ];
4099 vector_[offset_+i+1UL] += (~rhs)[i+1UL];
4101 if( ipos <
size() ) {
4102 vector_[offset_+ipos] += (~rhs)[ipos];
4121 template<
typename VT
4123 template<
typename VT2 >
4124 inline typename EnableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedAddAssign<VT2> >::Type
4125 DenseSubvector<VT,aligned,TF>::addAssign(
const DenseVector<VT2,TF>& rhs )
4131 const size_t ipos( size_ &
size_t(-
IT::size) );
4138 store( i , load(i ) + it.load() ); it +=
IT::size;
4144 store( i, load(i) + it.load() );
4146 for( ; i<size_; ++i, ++it ) {
4147 vector_[offset_+i] += *it;
4166 template<
typename VT
4168 template<
typename VT2 >
4169 inline void DenseSubvector<VT,aligned,TF>::addAssign(
const SparseVector<VT2,TF>& rhs )
4174 vector_[offset_+element->index()] += element->value();
4192 template<
typename VT
4194 template<
typename VT2 >
4195 inline typename DisableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedSubAssign<VT2> >::Type
4196 DenseSubvector<VT,aligned,TF>::subAssign(
const DenseVector<VT2,TF>& rhs )
4200 const size_t ipos(
size() &
size_t(-2) );
4201 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4202 vector_[offset_+i ] -= (~rhs)[i ];
4203 vector_[offset_+i+1UL] -= (~rhs)[i+1UL];
4205 if( ipos <
size() ) {
4206 vector_[offset_+ipos] -= (~rhs)[ipos];
4225 template<
typename VT
4227 template<
typename VT2 >
4228 inline typename EnableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedSubAssign<VT2> >::Type
4229 DenseSubvector<VT,aligned,TF>::subAssign(
const DenseVector<VT2,TF>& rhs )
4235 const size_t ipos( size_ &
size_t(-
IT::size) );
4242 store( i , load(i ) - it.load() ); it +=
IT::size;
4248 store( i, load(i) - it.load() );
4250 for( ; i<size_; ++i, ++it ) {
4251 vector_[offset_+i] -= *it;
4270 template<
typename VT
4272 template<
typename VT2 >
4273 inline void DenseSubvector<VT,aligned,TF>::subAssign(
const SparseVector<VT2,TF>& rhs )
4278 vector_[offset_+element->index()] -= element->value();
4296 template<
typename VT
4298 template<
typename VT2 >
4299 inline typename DisableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedMultAssign<VT2> >::Type
4300 DenseSubvector<VT,aligned,TF>::multAssign(
const DenseVector<VT2,TF>& rhs )
4304 const size_t ipos(
size() &
size_t(-2) );
4305 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4306 vector_[offset_+i ] *= (~rhs)[i ];
4307 vector_[offset_+i+1UL] *= (~rhs)[i+1UL];
4309 if( ipos <
size() ) {
4310 vector_[offset_+ipos] *= (~rhs)[ipos];
4329 template<
typename VT
4331 template<
typename VT2 >
4332 inline typename EnableIf< typename DenseSubvector<VT,aligned,TF>::BLAZE_TEMPLATE VectorizedMultAssign<VT2> >::Type
4333 DenseSubvector<VT,aligned,TF>::multAssign(
const DenseVector<VT2,TF>& rhs )
4339 const size_t ipos( size_ &
size_t(-
IT::size) );
4346 store( i , load(i ) * it.load() ); it +=
IT::size;
4352 store( i, load(i) * it.load() );
4354 for( ; i<size_; ++i, ++it ) {
4355 vector_[offset_+i] *= *it;
4374 template<
typename VT
4376 template<
typename VT2 >
4377 inline void DenseSubvector<VT,aligned,TF>::multAssign(
const SparseVector<VT2,TF>& rhs )
4386 vector_[offset_+element->index()] = tmp[element->index()] * element->value();
4412 template<
typename VT1
4414 class DenseSubvector< DVecDVecCrossExpr<VT1,VT2>,
unaligned, false >
4415 :
public DenseVector< DenseSubvector< DVecDVecCrossExpr<VT1,VT2>, unaligned, false >, false >
4420 typedef DVecDVecCrossExpr<VT1,VT2> CPE;
4426 typedef DenseSubvector<CPE,unaligned,false>
This;
4427 typedef typename SubvectorTrait<RT>::Type
ResultType;
4436 enum { vectorizable = 0 };
4439 enum { smpAssignable = 0 };
4449 explicit inline DenseSubvector(
const CPE& vector,
size_t index,
size_t n )
4462 inline ReturnType
operator[](
size_t index )
const {
4475 inline ReturnType
at(
size_t index )
const {
4476 if( index >=
size() ) {
4479 return (*
this)[index];
4488 inline size_t size()
const {
4499 template<
typename T >
4500 inline bool canAlias(
const T* alias )
const {
4501 return vector_.canAlias( alias );
4511 template<
typename T >
4512 inline bool isAliased(
const T* alias )
const {
4513 return vector_.isAliased( alias );
4528 template<
bool AF1,
typename VT,
bool AF2,
bool TF >
4529 friend const DenseSubvector<VT,AF1,TF>
4530 subvector(
const DenseSubvector<VT,AF2,TF>& dv,
size_t index,
size_t size );
4532 template<
typename VT3,
bool AF,
bool TF >
4533 friend bool isIntact(
const DenseSubvector<VT3,AF,TF>& dv );
4535 template<
typename VT3,
bool AF,
bool TF >
4536 friend bool isSame(
const DenseSubvector<VT3,AF,TF>& a,
const DenseVector<VT3,TF>& b );
4538 template<
typename VT3,
bool AF,
bool TF >
4539 friend bool isSame(
const DenseVector<VT3,TF>& a,
const DenseSubvector<VT3,AF,TF>& b );
4541 template<
typename VT3,
bool AF,
bool TF >
4542 friend bool isSame(
const DenseSubvector<VT3,AF,TF>& a,
const DenseSubvector<VT3,AF,TF>& b );
4544 template<
typename VT3,
bool AF,
bool TF,
typename VT4 >
4545 friend bool tryAssign(
const DenseSubvector<VT3,AF,TF>& lhs,
const Vector<VT4,TF>& rhs,
size_t index );
4547 template<
typename VT3,
bool AF,
bool TF,
typename VT4 >
4548 friend bool tryAddAssign(
const DenseSubvector<VT2,AF,TF>& lhs,
const Vector<VT3,TF>& rhs,
size_t index );
4550 template<
typename VT3,
bool AF,
bool TF,
typename VT4 >
4551 friend bool trySubAssign(
const DenseSubvector<VT2,AF,TF>& lhs,
const Vector<VT3,TF>& rhs,
size_t index );
4553 template<
typename VT3,
bool AF,
bool TF,
typename VT4 >
4554 friend bool tryMultAssign(
const DenseSubvector<VT3,AF,TF>& lhs,
const Vector<VT4,TF>& rhs,
size_t index );
4581 template<
typename VT1
4583 class DenseSubvector< DVecSVecCrossExpr<VT1,VT2>,
unaligned, false >
4584 :
public DenseVector< DenseSubvector< DVecSVecCrossExpr<VT1,VT2>, unaligned, false >, false >
4589 typedef DVecSVecCrossExpr<VT1,VT2> CPE;
4595 typedef DenseSubvector<CPE,unaligned,false>
This;
4596 typedef typename SubvectorTrait<RT>::Type
ResultType;
4605 enum { vectorizable = 0 };
4608 enum { smpAssignable = 0 };
4618 explicit inline DenseSubvector(
const CPE& vector,
size_t index,
size_t n )
4631 inline ReturnType
operator[](
size_t index )
const {
4644 inline ReturnType
at(
size_t index )
const {
4645 if( index >=
size() ) {
4648 return (*
this)[index];
4657 inline size_t size()
const {
4668 template<
typename T >
4669 inline bool canAlias(
const T* alias )
const {
4670 return vector_.canAlias( alias );
4680 template<
typename T >
4681 inline bool isAliased(
const T* alias )
const {
4682 return vector_.isAliased( alias );
4697 template<
bool AF1,
typename VT,
bool AF2,
bool TF >
4698 friend const DenseSubvector<VT,AF1,TF>
4699 subvector(
const DenseSubvector<VT,AF2,TF>& dv,
size_t index,
size_t size );
4701 template<
typename VT3,
bool AF,
bool TF >
4702 friend bool isIntact(
const DenseSubvector<VT3,AF,TF>& dv );
4704 template<
typename VT3,
bool AF,
bool TF >
4705 friend bool isSame(
const DenseSubvector<VT3,AF,TF>& a,
const DenseVector<VT3,TF>& b );
4707 template<
typename VT3,
bool AF,
bool TF >
4708 friend bool isSame(
const DenseVector<VT3,TF>& a,
const DenseSubvector<VT3,AF,TF>& b );
4710 template<
typename VT3,
bool AF,
bool TF >
4711 friend bool isSame(
const DenseSubvector<VT3,AF,TF>& a,
const DenseSubvector<VT3,AF,TF>& b );
4713 template<
typename VT3,
bool AF,
bool TF,
typename VT4 >
4714 friend bool tryAssign(
const DenseSubvector<VT3,AF,TF>& lhs,
const Vector<VT4,TF>& rhs,
size_t index );
4716 template<
typename VT3,
bool AF,
bool TF,
typename VT4 >
4717 friend bool tryAddAssign(
const DenseSubvector<VT2,AF,TF>& lhs,
const Vector<VT3,TF>& rhs,
size_t index );
4719 template<
typename VT3,
bool AF,
bool TF,
typename VT4 >
4720 friend bool trySubAssign(
const DenseSubvector<VT2,AF,TF>& lhs,
const Vector<VT3,TF>& rhs,
size_t index );
4722 template<
typename VT3,
bool AF,
bool TF,
typename VT4 >
4723 friend bool tryMultAssign(
const DenseSubvector<VT3,AF,TF>& lhs,
const Vector<VT4,TF>& rhs,
size_t index );
4750 template<
typename VT1
4752 class DenseSubvector< SVecDVecCrossExpr<VT1,VT2>,
unaligned, false >
4753 :
public DenseVector< DenseSubvector< SVecDVecCrossExpr<VT1,VT2>, unaligned, false >, false >
4758 typedef SVecDVecCrossExpr<VT1,VT2> CPE;
4764 typedef DenseSubvector<CPE,unaligned,false>
This;
4765 typedef typename SubvectorTrait<RT>::Type
ResultType;
4774 enum { vectorizable = 0 };
4777 enum { smpAssignable = 0 };
4787 explicit inline DenseSubvector(
const CPE& vector,
size_t index,
size_t n )
4800 inline ReturnType
operator[](
size_t index )
const {
4813 inline ReturnType
at(
size_t index )
const {
4814 if( index >=
size() ) {
4817 return (*
this)[index];
4826 inline size_t size()
const {
4837 template<
typename T >
4838 inline bool canAlias(
const T* alias )
const {
4839 return vector_.canAlias( alias );
4849 template<
typename T >
4850 inline bool isAliased(
const T* alias )
const {
4851 return vector_.isAliased( alias );
4866 template<
bool AF1,
typename VT,
bool AF2,
bool TF >
4867 friend const DenseSubvector<VT,AF1,TF>
4868 subvector(
const DenseSubvector<VT,AF2,TF>& dv,
size_t index,
size_t size );
4870 template<
typename VT3,
bool AF,
bool TF >
4871 friend bool isIntact(
const DenseSubvector<VT3,AF,TF>& dv );
4873 template<
typename VT3,
bool AF,
bool TF >
4874 friend bool isSame(
const DenseSubvector<VT3,AF,TF>& a,
const DenseVector<VT3,TF>& b );
4876 template<
typename VT3,
bool AF,
bool TF >
4877 friend bool isSame(
const DenseVector<VT3,TF>& a,
const DenseSubvector<VT3,AF,TF>& b );
4879 template<
typename VT3,
bool AF,
bool TF >
4880 friend bool isSame(
const DenseSubvector<VT3,AF,TF>& a,
const DenseSubvector<VT3,AF,TF>& b );
4882 template<
typename VT3,
bool AF,
bool TF,
typename VT4 >
4883 friend bool tryAssign(
const DenseSubvector<VT3,AF,TF>& lhs,
const Vector<VT4,TF>& rhs,
size_t index );
4885 template<
typename VT3,
bool AF,
bool TF,
typename VT4 >
4886 friend bool tryAddAssign(
const DenseSubvector<VT2,AF,TF>& lhs,
const Vector<VT3,TF>& rhs,
size_t index );
4888 template<
typename VT3,
bool AF,
bool TF,
typename VT4 >
4889 friend bool trySubAssign(
const DenseSubvector<VT2,AF,TF>& lhs,
const Vector<VT3,TF>& rhs,
size_t index );
4891 template<
typename VT3,
bool AF,
bool TF,
typename VT4 >
4892 friend bool tryMultAssign(
const DenseSubvector<VT3,AF,TF>& lhs,
const Vector<VT4,TF>& rhs,
size_t index );
4919 template<
typename VT1
4921 class DenseSubvector< SVecSVecCrossExpr<VT1,VT2>,
unaligned, false >
4922 :
public DenseVector< DenseSubvector< SVecSVecCrossExpr<VT1,VT2>, unaligned, false >, false >
4927 typedef SVecSVecCrossExpr<VT1,VT2> CPE;
4933 typedef DenseSubvector<CPE,unaligned,false>
This;
4934 typedef typename SubvectorTrait<RT>::Type
ResultType;
4943 enum { vectorizable = 0 };
4946 enum { smpAssignable = 0 };
4956 explicit inline DenseSubvector(
const CPE& vector,
size_t index,
size_t n )
4969 inline ReturnType
operator[](
size_t index )
const {
4982 inline ReturnType
at(
size_t index )
const {
4983 if( index >=
size() ) {
4986 return (*
this)[index];
4995 inline size_t size()
const {
5006 template<
typename T >
5007 inline bool canAlias(
const T* alias )
const {
5008 return vector_.canAlias( alias );
5018 template<
typename T >
5019 inline bool isAliased(
const T* alias )
const {
5020 return vector_.isAliased( alias );
5035 template<
bool AF1,
typename VT,
bool AF2,
bool TF >
5036 friend const DenseSubvector<VT,AF1,TF>
5037 subvector(
const DenseSubvector<VT,AF2,TF>& dv,
size_t index,
size_t size );
5039 template<
typename VT3,
bool AF,
bool TF >
5040 friend bool isIntact(
const DenseSubvector<VT3,AF,TF>& dv );
5042 template<
typename VT3,
bool AF,
bool TF >
5043 friend bool isSame(
const DenseSubvector<VT3,AF,TF>& a,
const DenseVector<VT3,TF>& b );
5045 template<
typename VT3,
bool AF,
bool TF >
5046 friend bool isSame(
const DenseVector<VT3,TF>& a,
const DenseSubvector<VT3,AF,TF>& b );
5048 template<
typename VT3,
bool AF,
bool TF >
5049 friend bool isSame(
const DenseSubvector<VT3,AF,TF>& a,
const DenseSubvector<VT3,AF,TF>& b );
5051 template<
typename VT3,
bool AF,
bool TF,
typename VT4 >
5052 friend bool tryAssign(
const DenseSubvector<VT3,AF,TF>& lhs,
const Vector<VT4,TF>& rhs,
size_t index );
5054 template<
typename VT3,
bool AF,
bool TF,
typename VT4 >
5055 friend bool tryAddAssign(
const DenseSubvector<VT2,AF,TF>& lhs,
const Vector<VT3,TF>& rhs,
size_t index );
5057 template<
typename VT3,
bool AF,
bool TF,
typename VT4 >
5058 friend bool trySubAssign(
const DenseSubvector<VT2,AF,TF>& lhs,
const Vector<VT3,TF>& rhs,
size_t index );
5060 template<
typename VT3,
bool AF,
bool TF,
typename VT4 >
5061 friend bool tryMultAssign(
const DenseSubvector<VT3,AF,TF>& lhs,
const Vector<VT4,TF>& rhs,
size_t index );
5083 template<
typename VT,
bool AF,
bool TF >
5084 inline void reset( DenseSubvector<VT,AF,TF>& dv );
5086 template<
typename VT,
bool AF,
bool TF >
5087 inline void clear( DenseSubvector<VT,AF,TF>& dv );
5089 template<
typename VT,
bool AF,
bool TF >
5090 inline bool isDefault(
const DenseSubvector<VT,AF,TF>& dv );
5092 template<
typename VT,
bool AF,
bool TF >
5093 inline bool isIntact(
const DenseSubvector<VT,AF,TF>& dv );
5095 template<
typename VT,
bool AF,
bool TF >
5096 inline bool isSame(
const DenseSubvector<VT,AF,TF>& a,
const DenseVector<VT,TF>& b );
5098 template<
typename VT,
bool AF,
bool TF >
5099 inline bool isSame(
const DenseVector<VT,TF>& a,
const DenseSubvector<VT,AF,TF>& b );
5101 template<
typename VT,
bool AF,
bool TF >
5102 inline bool isSame(
const DenseSubvector<VT,AF,TF>& a,
const DenseSubvector<VT,AF,TF>& b );
5114 template<
typename VT
5131 template<
typename VT
5160 template<
typename VT
5165 for(
size_t i=0UL; i<dv.size(); ++i )
5190 template<
typename VT
5195 return ( dv.offset_ + dv.size_ <= dv.vector_.size() &&
5213 template<
typename VT
5218 return (
isSame( a.vector_, ~b ) && ( a.size() == (~b).
size() ) );
5235 template<
typename VT
5240 return (
isSame( ~a, b.vector_ ) && ( (~a).size() == b.size() ) );
5257 template<
typename VT
5262 return (
isSame( a.vector_, b.vector_ ) && ( a.offset_ == b.offset_ ) && ( a.size_ == b.size_ ) );
5282 template<
typename VT1
5286 inline bool tryAssign(
const DenseSubvector<VT1,AF,TF>& lhs,
const Vector<VT2,TF>& rhs,
size_t index )
5291 return tryAssign( lhs.vector_, ~rhs, lhs.offset_ + index );
5312 template<
typename VT1
5316 inline bool tryAddAssign(
const DenseSubvector<VT1,AF,TF>& lhs,
const Vector<VT2,TF>& rhs,
size_t index )
5321 return tryAddAssign( lhs.vector_, ~rhs, lhs.offset_ + index );
5343 template<
typename VT1
5347 inline bool trySubAssign(
const DenseSubvector<VT1,AF,TF>& lhs,
const Vector<VT2,TF>& rhs,
size_t index )
5352 return trySubAssign( lhs.vector_, ~rhs, lhs.offset_ + index );
5374 template<
typename VT1
5378 inline bool tryMultAssign(
const DenseSubvector<VT1,AF,TF>& lhs,
const Vector<VT2,TF>& rhs,
size_t index )
5383 return tryMultAssign( lhs.vector_, ~rhs, lhs.offset_ + index );
5404 template<
typename VT
5407 inline typename DerestrictTrait< DenseSubvector<VT,AF,TF> >::Type
5408 derestrict( DenseSubvector<VT,AF,TF>& dv )
5410 typedef typename DerestrictTrait< DenseSubvector<VT,AF,TF> >::Type
ReturnType;
5411 return ReturnType( derestrict( dv.vector_ ), dv.offset_, dv.size_ );
5442 inline const DenseSubvector<VT,AF1,TF>
5443 subvector(
const DenseSubvector<VT,AF2,TF>& dv,
size_t index,
size_t size )
5447 if( index + size > dv.size() ) {
5451 return DenseSubvector<VT,AF1,TF>( dv.vector_, dv.offset_ + index,
size );
5467 template<
typename VT,
bool AF,
bool TF >
5468 struct IsRestricted< DenseSubvector<VT,AF,TF> > :
public IsTrue< IsRestricted<VT>::value >
5484 template<
typename VT,
bool AF,
bool TF >
5485 struct DerestrictTrait< DenseSubvector<VT,AF,TF> >
5487 typedef DenseSubvector< typename RemoveReference< typename DerestrictTrait<VT>::Type >::Type, AF, TF > Type;
5503 template<
typename VT,
bool AF,
bool TF >
5504 struct HasConstDataAccess< DenseSubvector<VT,AF,TF> >
5505 :
public IsTrue< HasConstDataAccess<VT>::value >
5521 template<
typename VT,
bool AF,
bool TF >
5522 struct HasMutableDataAccess< DenseSubvector<VT,AF,TF> >
5523 :
public IsTrue< HasMutableDataAccess<VT>::value >
5539 template<
typename VT,
bool TF >
5540 struct IsAligned< DenseSubvector<VT,
aligned,TF> > :
public IsTrue<true>
5556 template<
typename VT,
bool AF,
bool TF,
typename T >
5557 struct AddTrait< DenseSubvector<VT,AF,TF>, T >
5559 typedef typename AddTrait< typename SubvectorTrait<VT>::Type, T >::Type Type;
5562 template<
typename T,
typename VT,
bool AF,
bool TF >
5563 struct AddTrait< T, DenseSubvector<VT,AF,TF> >
5565 typedef typename AddTrait< T, typename SubvectorTrait<VT>::Type >::Type Type;
5581 template<
typename VT,
bool AF,
bool TF,
typename T >
5582 struct SubTrait< DenseSubvector<VT,AF,TF>, T >
5584 typedef typename SubTrait< typename SubvectorTrait<VT>::Type, T >::Type Type;
5587 template<
typename T,
typename VT,
bool AF,
bool TF >
5588 struct SubTrait< T, DenseSubvector<VT,AF,TF> >
5590 typedef typename SubTrait< T, typename SubvectorTrait<VT>::Type >::Type Type;
5606 template<
typename VT,
bool AF,
bool TF,
typename T >
5607 struct MultTrait< DenseSubvector<VT,AF,TF>, T >
5609 typedef typename MultTrait< typename SubvectorTrait<VT>::Type, T >::Type Type;
5612 template<
typename T,
typename VT,
bool AF,
bool TF >
5613 struct MultTrait< T, DenseSubvector<VT,AF,TF> >
5615 typedef typename MultTrait< T, typename SubvectorTrait<VT>::Type >::Type Type;
5631 template<
typename VT,
bool AF,
bool TF,
typename T >
5632 struct CrossTrait< DenseSubvector<VT,AF,TF>, T >
5634 typedef typename CrossTrait< typename SubvectorTrait<VT>::Type, T >::Type Type;
5637 template<
typename T,
typename VT,
bool AF,
bool TF >
5638 struct CrossTrait< T, DenseSubvector<VT,AF,TF> >
5640 typedef typename CrossTrait< T, typename SubvectorTrait<VT>::Type >::Type Type;
5656 template<
typename VT,
bool AF,
bool TF,
typename T >
5657 struct DivTrait< DenseSubvector<VT,AF,TF>, T >
5659 typedef typename DivTrait< typename SubvectorTrait<VT>::Type, T >::Type Type;
5662 template<
typename T,
typename VT,
bool AF,
bool TF >
5663 struct DivTrait< T, DenseSubvector<VT,AF,TF> >
5665 typedef typename DivTrait< T, typename SubvectorTrait<VT>::Type >::Type Type;
5681 template<
typename VT,
bool AF,
bool TF >
5682 struct SubvectorTrait< DenseSubvector<VT,AF,TF> >
5700 template<
typename VT,
bool AF1,
bool TF,
bool AF2 >
5701 struct SubvectorExprTrait< DenseSubvector<VT,AF1,TF>, AF2 >
5703 typedef DenseSubvector<VT,AF2,TF> Type;
5711 template<
typename VT,
bool AF1,
bool TF,
bool AF2 >
5712 struct SubvectorExprTrait< const DenseSubvector<VT,AF1,TF>, AF2 >
5714 typedef DenseSubvector<VT,AF2,TF> Type;
5722 template<
typename VT,
bool AF1,
bool TF,
bool AF2 >
5723 struct SubvectorExprTrait< volatile DenseSubvector<VT,AF1,TF>, AF2 >
5725 typedef DenseSubvector<VT,AF2,TF> Type;
5733 template<
typename VT,
bool AF1,
bool TF,
bool AF2 >
5734 struct SubvectorExprTrait< const volatile DenseSubvector<VT,AF1,TF>, AF2 >
5736 typedef DenseSubvector<VT,AF2,TF> Type;
5744 template<
typename VT1,
typename VT2,
bool AF >
5745 struct SubvectorExprTrait< DVecDVecCrossExpr<VT1,VT2>, AF >
5749 typedef DenseSubvector< DVecDVecCrossExpr<VT1,VT2>,
unaligned,
false > Type;
5758 template<
typename VT1,
typename VT2,
bool AF >
5759 struct SubvectorExprTrait< DVecSVecCrossExpr<VT1,VT2>, AF >
5763 typedef DenseSubvector< DVecSVecCrossExpr<VT1,VT2>,
unaligned,
false > Type;
5772 template<
typename VT1,
typename VT2,
bool AF >
5773 struct SubvectorExprTrait< SVecDVecCrossExpr<VT1,VT2>, AF >
5777 typedef DenseSubvector< SVecDVecCrossExpr<VT1,VT2>,
unaligned,
false > Type;
5786 template<
typename VT1,
typename VT2,
bool AF >
5787 struct SubvectorExprTrait< SVecSVecCrossExpr<VT1,VT2>, AF >
5791 typedef DenseSubvector< SVecSVecCrossExpr<VT1,VT2>,
unaligned,
false > Type;
const ElementType * ConstPointer
Pointer to a constant subvector value.
Definition: DenseSubvector.h:421
Constraint on the data type.
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
Constraint on the data type.
bool canAlias(const Other *alias) const
Returns whether the dense subvector can alias with the given address alias.
Definition: DenseSubvector.h:1785
#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 alignment flag values.
Compile time type selection.The If class template selects one of the two given types T2 and T3 depend...
Definition: If.h:112
Header file for the subtraction trait.
Header file for basic type definitions.
If< IsConst< VT >, ConstIterator, SubvectorIterator< typename VT::Iterator > >::Type Iterator
Iterator over non-constant elements.
Definition: DenseSubvector.h:764
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
SubvectorIterator()
Default constructor of the SubvectorIterator class.
Definition: DenseSubvector.h:462
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:250
IT::Type IntrinsicType
Intrinsic type of the subvector elements.
Definition: DenseSubvector.h:410
SubvectorIterator(IteratorType iterator, bool isMemoryAligned)
Constructor of the SubvectorIterator class.
Definition: DenseSubvector.h:474
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
#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:647
ReferenceType reference
Reference return type.
Definition: DenseSubvector.h:455
const bool aligned
Alignment flag for aligned vectors and matrices.Via this flag it is possible to specify subvectors...
Definition: AlignmentFlag.h:85
If< Or< IsConst< VT >, Not< HasMutableDataAccess< VT > > >, ConstPointer, ElementType * >::Type Pointer
Pointer to a non-constant subvector value.
Definition: DenseSubvector.h:425
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:1709
const bool useStreaming
Configuration of the streaming behavior.For large vectors and matrices non-temporal stores can provid...
Definition: Optimizations.h:68
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:507
bool isAligned_
Memory alignment flag.
Definition: DenseSubvector.h:754
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Header file for the IsRowVector type trait.
const DenseSubvector & CompositeType
Data type for composite expression templates.
Definition: DenseSubvector.h:412
Header file for the DenseVector base class.
IntrinsicType loada() const
Aligned load of an intrinsic element of the dense subvector.
Definition: DenseSubvector.h:593
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
SubvectorIterator(const SubvectorIterator< IteratorType2 > &it)
Conversion constructor from different SubvectorIterator instances.
Definition: DenseSubvector.h:486
Header file for the Computation base class.
IntrinsicType loadu() const
Unaligned load of an intrinsic element of the dense subvector.
Definition: DenseSubvector.h:608
#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:624
DenseSubvector(Operand vector, size_t index, size_t n)
The constructor for DenseSubvector.
Definition: DenseSubvector.h:1050
System settings for performance optimizations.
IntrinsicTrait< typename VT::ElementType > IT
Intrinsic trait for the vector element type.
Definition: DenseSubvector.h:401
const size_t offset_
The offset of the subvector within the dense vector.
Definition: DenseSubvector.h:964
Reference at(size_t index)
Checked access to the subvector elements.
Definition: DenseSubvector.h:1127
size_t capacity() const
Returns the maximum capacity of the dense subvector.
Definition: DenseSubvector.h:1691
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:547
Iterator begin()
Returns an iterator to the first element of the subvector.
Definition: DenseSubvector.h:1205
DenseSubvector & operator=(const ElementType &rhs)
Homogenous assignment to all subvector elements.
Definition: DenseSubvector.h:1314
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:2091
Constraint on the data type.
void reset()
Reset to the default initial values.
Definition: DenseSubvector.h:1732
Pointer data()
Low-level data access to the subvector elements.
Definition: DenseSubvector.h:1171
DifferenceType difference_type
Difference between two iterators.
Definition: DenseSubvector.h:456
SubvectorTrait< VT >::Type ResultType
Result type for expression template evaluations.
Definition: DenseSubvector.h:407
Header file for the DisableIf class template.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type loadu(const T *address)
Loads a vector of 2-byte integral values.
Definition: Loadu.h:74
Header file for the multiplication trait.
void store(size_t index, const IntrinsicType &value)
Aligned store of an intrinsic element of the subvector.
Definition: DenseSubvector.h:2004
Operand vector_
The dense vector containing the subvector.
Definition: DenseSubvector.h:963
const SubvectorIterator operator--(int)
Post-decrement operator.
Definition: DenseSubvector.h:553
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for nested template disabiguation.
Header file for the If class template.
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:1084
SubvectorIterator & operator++()
Pre-increment operator.
Definition: DenseSubvector.h:521
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type storeu(T *address, const simd_int16_t &value)
Unaligned store of a vector of 2-byte integral values.
Definition: Storeu.h:75
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
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:726
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
std::iterator_traits< IteratorType >::difference_type DifferenceType
Difference between two iterators.
Definition: DenseSubvector.h:449
ConstIterator cbegin() const
Returns an iterator to the first element of the subvector.
Definition: DenseSubvector.h:1239
Header file for the Not class template.
DifferenceType operator-(const SubvectorIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DenseSubvector.h:690
VT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DenseSubvector.h:411
Header file for the subvector trait.
DenseSubvector< VT, AF, TF > This
Type of this DenseSubvector instance.
Definition: DenseSubvector.h:406
friend const SubvectorIterator operator+(size_t inc, const SubvectorIterator &it)
Addition between an integral value and a SubvectorIterator.
Definition: DenseSubvector.h:714
bool operator!=(const SubvectorIterator &rhs) const
Inequality comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:635
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:542
Header file for the IsAligned type trait.
IteratorType iterator_
Iterator to the current subvector element.
Definition: DenseSubvector.h:753
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:736
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:187
size_t size() const
Returns the current size/dimension of the dense subvector.
Definition: DenseSubvector.h:1676
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
const bool unaligned
Alignment flag for unaligned vectors and matrices.Via this flag it is possible to specify subvectors...
Definition: AlignmentFlag.h:64
Constraint on the data type.
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:2590
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DenseSubvector.h:408
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:527
Header file for the IsPadded type trait.
Header file for the DerestrictTrait class template.
std::iterator_traits< IteratorType >::iterator_category IteratorCategory
The iterator category.
Definition: DenseSubvector.h:437
Header file for the CrossExpr base class.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type loada(const T *address)
Loads a vector of 2-byte integral values.
Definition: Loada.h:77
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:2587
Header file for the IsConst type trait.
Iterator end()
Returns an iterator just past the last element of the subvector.
Definition: DenseSubvector.h:1256
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
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
Header file for the addition trait.
Header file for the cross product trait.
Base class for all subvectors.The Subvector class serves as a tag for all subvectors (i...
Definition: Subvector.h:64
Header file for the division trait.
View on a specific subvector of a dense vector.The DenseSubvector template represents a view on a spe...
Definition: DenseSubvector.h:392
SubvectorIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DenseSubvector.h:498
bool operator>(const SubvectorIterator &rhs) const
Greater-than comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:657
bool isAligned() const
Returns whether the subvector is properly aligned in memory.
Definition: DenseSubvector.h:1873
std::iterator_traits< IteratorType >::pointer PointerType
Pointer return type.
Definition: DenseSubvector.h:443
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:143
const bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
ValueType value_type
Type of the underlying elements.
Definition: DenseSubvector.h:453
Header file for the cache size of the target architecture.
IntrinsicType loada(size_t index) const
Aligned load of an intrinsic element of the dense subvector.
Definition: DenseSubvector.h:1944
bool canSMPAssign() const
Returns whether the subvector can be used in SMP assignments.
Definition: DenseSubvector.h:1893
Compile time type negation.The Not class template negates the given compile time condition. In case the given condition would evaluate to true, the nested member enumeration is set to false and vice versa:
Definition: Not.h:70
bool isAligned() const
Access to the iterator's memory alignment flag.
Definition: DenseSubvector.h:746
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2591
Header file for the isDefault shim.
ReferenceType operator*() const
Direct access to the element at the current iterator position.
Definition: DenseSubvector.h:563
const size_t size_
The size of the subvector.
Definition: DenseSubvector.h:965
Header file for the HasMutableDataAccess type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
void storea(size_t index, const IntrinsicType &value)
Aligned store of an intrinsic element of the subvector.
Definition: DenseSubvector.h:2031
Evaluation of the return type of the derestrict function.Via this type trait it is possible to evalua...
Definition: DerestrictTrait.h:74
IntrinsicType load() const
Aligned load of an intrinsic element of the dense subvector.
Definition: DenseSubvector.h:578
const SubvectorIterator operator++(int)
Post-increment operator.
Definition: DenseSubvector.h:532
IteratorCategory iterator_category
The iterator category.
Definition: DenseSubvector.h:452
Header file for the RemoveReference type trait.
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
VT::ConstReference ConstReference
Reference to a constant subvector value.
Definition: DenseSubvector.h:415
SubvectorIterator< typename VT::ConstIterator > ConstIterator
Iterator over constant elements.
Definition: DenseSubvector.h:761
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:1974
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
friend const SubvectorIterator operator+(const SubvectorIterator &it, size_t inc)
Addition between a SubvectorIterator and an integral value.
Definition: DenseSubvector.h:702
If< IsConst< VT >, ConstReference, typename VT::Reference >::Type Reference
Reference to a non-constant subvector value.
Definition: DenseSubvector.h:418
bool isAliased(const Other *alias) const
Returns whether the dense subvector is aliased with the given address alias.
Definition: DenseSubvector.h:1830
#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:454
const bool isAligned_
Memory alignment flag.
Definition: DenseSubvector.h:966
If< IsExpression< VT >, VT, VT & >::Type Operand
Composite data type of the dense vector expression.
Definition: DenseSubvector.h:398
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:164
IntrinsicType load(size_t index) const
Aligned load of an intrinsic element of the dense subvector.
Definition: DenseSubvector.h:1917
CompressedMatrix< Type,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:258
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
Header file for the alignment check function.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:118
#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:679
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the IsTrue value trait.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type stream(T *address, const simd_int16_t &value)
Aligned, non-temporal store of a vector of 2-byte integral values.
Definition: Stream.h:74
ConstIterator cend() const
Returns an iterator just past the last element of the subvector.
Definition: DenseSubvector.h:1290
Compile time type check.This class tests whether the given template parameter T is a reference type (...
Definition: IsReference.h:94
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:237
Header file for the SubvectorExprTrait class template.
SubvectorIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DenseSubvector.h:510
Iterator over the elements of the sparse subvector.
Definition: DenseSubvector.h:432
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2589
Header file for exception macros.
std::iterator_traits< IteratorType >::value_type ValueType
Type of the underlying elements.
Definition: DenseSubvector.h:440
VT::ElementType ElementType
Type of the subvector elements.
Definition: DenseSubvector.h:409
void storeu(size_t index, const IntrinsicType &value)
Unaligned store of an intrinsic element of the subvector.
Definition: DenseSubvector.h:2061
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:646
Header file for the IsRestricted type trait.
System settings for the inline keywords.
EnableIf< IsDenseVector< VT1 > >::Type smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:189
bool operator<=(const SubvectorIterator &rhs) const
Less-than comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:668
#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:81
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
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type storea(T *address, const simd_int16_t &value)
Aligned store of a vector of 2-byte integral values.
Definition: Storea.h:78
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:446
Header file for a safe C++ NULL pointer implementation.