35 #ifndef _BLAZE_MATH_DENSE_CUSTOMVECTOR_H_
36 #define _BLAZE_MATH_DENSE_CUSTOMVECTOR_H_
45 #include <boost/smart_ptr/shared_array.hpp>
419 template<
typename Type
448 template<
typename ET >
474 explicit inline CustomVector( Type* ptr,
size_t n,
size_t nn );
476 template<
typename Deleter,
typename = EnableIf_<IsClass<Deleter> > >
477 explicit inline CustomVector( Type* ptr,
size_t n, Deleter d );
479 template<
typename Deleter >
480 explicit inline CustomVector( Type* ptr,
size_t n,
size_t nn, Deleter d );
494 inline Reference operator[](
size_t index ) noexcept;
495 inline ConstReference operator[](
size_t index ) const noexcept;
496 inline Reference
at(
size_t index );
497 inline ConstReference
at(
size_t index ) const;
498 inline Pointer
data () noexcept;
499 inline ConstPointer
data () const noexcept;
500 inline Iterator
begin () noexcept;
501 inline ConstIterator
begin () const noexcept;
502 inline ConstIterator
cbegin() const noexcept;
503 inline Iterator
end () noexcept;
504 inline ConstIterator
end () const noexcept;
505 inline ConstIterator
cend () const noexcept;
513 inline
CustomVector& operator=( initializer_list<Type> list );
515 template< typename Other,
size_t N >
516 inline
CustomVector& operator=( const Other (&array)[N] );
521 template< typename VT > inline
CustomVector& operator= ( const Vector<VT,TF>& rhs );
522 template< typename VT > inline
CustomVector& operator+=( const Vector<VT,TF>& rhs );
523 template< typename VT > inline
CustomVector& operator-=( const Vector<VT,TF>& rhs );
524 template< typename VT > inline
CustomVector& operator*=( const Vector<VT,TF>& rhs );
525 template< typename VT > inline
CustomVector& operator/=( const DenseVector<VT,TF>& rhs );
527 template< typename Other >
530 template< typename Other >
538 inline
size_t size() const noexcept;
539 inline
size_t capacity() const noexcept;
543 template< typename Other > inline
CustomVector& scale( const Other& scalar );
551 inline
void reset( Type* ptr,
size_t n );
552 inline
void reset( Type* ptr,
size_t n,
size_t nn );
554 template< typename Deleter, typename =
EnableIf_<IsClass<Deleter> > >
555 inline
void reset( Type* ptr,
size_t n, Deleter d );
557 template< typename Deleter >
558 inline
void reset( Type* ptr,
size_t n,
size_t nn, Deleter d );
565 template< typename VT >
567 struct VectorizedAssign {
569 simdEnabled && VT::simdEnabled &&
570 AreSIMDCombinable< Type, ElementType_<VT> >::value };
577 template<
typename VT >
579 struct VectorizedAddAssign {
581 simdEnabled && VT::simdEnabled &&
582 AreSIMDCombinable< Type, ElementType_<VT> >::value &&
583 HasSIMDAdd< Type, ElementType_<VT> >::value };
590 template<
typename VT >
592 struct VectorizedSubAssign {
594 simdEnabled && VT::simdEnabled &&
595 AreSIMDCombinable< Type, ElementType_<VT> >::value &&
596 HasSIMDSub< Type, ElementType_<VT> >::value };
603 template<
typename VT >
605 struct VectorizedMultAssign {
607 simdEnabled && VT::simdEnabled &&
608 AreSIMDCombinable< Type, ElementType_<VT> >::value &&
609 HasSIMDMult< Type, ElementType_<VT> >::value };
616 template<
typename VT >
618 struct VectorizedDivAssign {
620 simdEnabled && VT::simdEnabled &&
621 AreSIMDCombinable< Type, ElementType_<VT> >::value &&
622 HasSIMDDiv< Type, ElementType_<VT> >::value };
636 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
637 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
651 template< typename VT >
652 inline
DisableIf_<VectorizedAssign<VT> > assign( const DenseVector<VT,TF>& rhs );
654 template< typename VT >
655 inline
EnableIf_<VectorizedAssign<VT> > assign( const DenseVector<VT,TF>& rhs );
657 template< typename VT > inline
void assign( const SparseVector<VT,TF>& rhs );
659 template< typename VT >
660 inline
DisableIf_<VectorizedAddAssign<VT> > addAssign( const DenseVector<VT,TF>& rhs );
662 template< typename VT >
663 inline
EnableIf_<VectorizedAddAssign<VT> > addAssign( const DenseVector<VT,TF>& rhs );
665 template< typename VT > inline
void addAssign( const SparseVector<VT,TF>& rhs );
667 template< typename VT >
668 inline
DisableIf_<VectorizedSubAssign<VT> > subAssign( const DenseVector<VT,TF>& rhs );
670 template< typename VT >
671 inline
EnableIf_<VectorizedSubAssign<VT> > subAssign( const DenseVector<VT,TF>& rhs );
673 template< typename VT > inline
void subAssign( const SparseVector<VT,TF>& rhs );
675 template< typename VT >
676 inline
DisableIf_<VectorizedMultAssign<VT> > multAssign( const DenseVector<VT,TF>& rhs );
678 template< typename VT >
679 inline
EnableIf_<VectorizedMultAssign<VT> > multAssign( const DenseVector<VT,TF>& rhs );
681 template< typename VT > inline
void multAssign( const SparseVector<VT,TF>& rhs );
683 template< typename VT >
684 inline
DisableIf_<VectorizedDivAssign<VT> > divAssign( const DenseVector<VT,TF>& rhs );
686 template< typename VT >
687 inline
EnableIf_<VectorizedDivAssign<VT> > divAssign( const DenseVector<VT,TF>& rhs );
696 boost::shared_array<Type>
v_;
728 template< typename Type
757 template<
typename Type
765 if( ptr ==
nullptr ) {
800 template<
typename Type
833 template<
typename Type
837 template<
typename Deleter
843 if( ptr ==
nullptr ) {
878 template<
typename Type
882 template<
typename Deleter >
901 template<
typename Type
917 template<
typename Type
923 , v_ (
std::move( v.v_ ) )
949 template<
typename Type
971 template<
typename Type
994 template<
typename Type
1001 if( index >= size_ ) {
1004 return (*
this)[index];
1019 template<
typename Type
1026 if( index >= size_ ) {
1029 return (*
this)[index];
1041 template<
typename Type
1060 template<
typename Type
1077 template<
typename Type
1094 template<
typename Type
1111 template<
typename Type
1128 template<
typename Type
1135 return Iterator( v_.get() + size_ );
1145 template<
typename Type
1162 template<
typename Type
1188 template<
typename Type
1194 for(
size_t i=0UL; i<size_; ++i )
1225 template<
typename Type
1231 if( list.size() > size_ ) {
1235 std::fill( std::copy( list.begin(), list.end(), v_.get() ), v_.get()+size_, Type() );
1269 template<
typename Type
1273 template<
typename Other
1281 for(
size_t i=0UL; i<N; ++i )
1299 template<
typename Type
1305 if( rhs.
size() != size_ ) {
1322 template<
typename Type
1330 v_ = std::move( rhs.v_ );
1351 template<
typename Type
1355 template<
typename VT >
1358 if( (~rhs).
size() != size_ ) {
1362 if( (~rhs).canAlias(
this ) ) {
1387 template<
typename Type
1391 template<
typename VT >
1394 if( (~rhs).
size() != size_ ) {
1398 if( (~rhs).canAlias(
this ) ) {
1422 template<
typename Type
1426 template<
typename VT >
1429 if( (~rhs).
size() != size_ ) {
1433 if( (~rhs).canAlias(
this ) ) {
1457 template<
typename Type
1461 template<
typename VT >
1472 if( (~rhs).
size() != size_ ) {
1477 const MultType tmp( *
this * (~rhs) );
1478 this->operator=( tmp );
1499 template<
typename Type
1503 template<
typename VT >
1515 if( (~rhs).
size() != size_ ) {
1519 if( (~rhs).canAlias(
this ) ) {
1520 const DivType tmp( *
this / (~rhs) );
1521 this->operator=( tmp );
1539 template<
typename Type
1543 template<
typename Other >
1562 template<
typename Type
1566 template<
typename Other >
1591 template<
typename Type
1607 template<
typename Type
1626 template<
typename Type
1632 size_t nonzeros( 0 );
1634 for(
size_t i=0UL; i<size_; ++i ) {
1649 template<
typename Type
1656 for(
size_t i=0UL; i<size_; ++i )
1670 template<
typename Type
1688 template<
typename Type
1692 template<
typename Other >
1695 for(
size_t i=0UL; i<size_; ++i )
1708 template<
typename Type
1716 swap( size_, v.size_ );
1752 template<
typename Type
1789 template<
typename Type
1824 template<
typename Type
1828 template<
typename Deleter
1863 template<
typename Type
1867 template<
typename Deleter >
1895 template<
typename Type
1899 template<
typename Other >
1902 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1917 template<
typename Type
1921 template<
typename Other >
1924 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1938 template<
typename Type
1959 template<
typename Type
1965 return (
size() > SMP_DVECASSIGN_THRESHOLD );
1982 template<
typename Type
1990 return loada( index );
1992 return loadu( index );
2010 template<
typename Type
2026 return loada( v_.get()+index );
2044 template<
typename Type
2058 return loadu( v_.get()+index );
2076 template<
typename Type
2103 template<
typename Type
2118 storea( v_.get()+index, value );
2136 template<
typename Type
2149 storeu( v_.get()+index, value );
2168 template<
typename Type
2183 stream( v_.get()+index, value );
2199 template<
typename Type
2203 template<
typename VT >
2209 const size_t ipos( size_ &
size_t(-2) );
2212 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2213 v_[i ] = (~rhs)[i ];
2214 v_[i+1UL] = (~rhs)[i+1UL];
2216 if( ipos < (~rhs).size() )
2217 v_[ipos] = (~rhs)[ipos];
2233 template<
typename Type
2237 template<
typename VT >
2245 const size_t ipos( size_ &
size_t(-SIMDSIZE) );
2248 if( AF &&
useStreaming && size_ > (
cacheSize/(
sizeof(Type) * 3UL ) ) && !(~rhs).isAliased(
this ) )
2252 for( ; i<ipos; i+=SIMDSIZE ) {
2253 stream( i, (~rhs).load(i) );
2255 for( ; i<size_; ++i ) {
2261 const size_t i4way( size_ &
size_t(-SIMDSIZE*4) );
2262 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
2268 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
2269 store( i , it.load() ); it += SIMDSIZE;
2270 store( i+SIMDSIZE , it.load() ); it += SIMDSIZE;
2271 store( i+SIMDSIZE*2UL, it.load() ); it += SIMDSIZE;
2272 store( i+SIMDSIZE*3UL, it.load() ); it += SIMDSIZE;
2274 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
2275 store( i, it.load() );
2277 for( ; i<size_; ++i, ++it ) {
2296 template<
typename Type
2300 template<
typename VT >
2306 v_[element->index()] = element->value();
2322 template<
typename Type
2326 template<
typename VT >
2332 const size_t ipos( size_ &
size_t(-2) );
2335 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2336 v_[i ] += (~rhs)[i ];
2337 v_[i+1UL] += (~rhs)[i+1UL];
2339 if( ipos < (~rhs).size() )
2340 v_[ipos] += (~rhs)[ipos];
2356 template<
typename Type
2360 template<
typename VT >
2368 const size_t ipos( size_ &
size_t(-SIMDSIZE) );
2371 const size_t i4way( size_ &
size_t(-SIMDSIZE*4) );
2372 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
2378 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
2379 store( i , load(i ) + it.load() ); it += SIMDSIZE;
2380 store( i+SIMDSIZE , load(i+SIMDSIZE ) + it.load() ); it += SIMDSIZE;
2381 store( i+SIMDSIZE*2UL, load(i+SIMDSIZE*2UL) + it.load() ); it += SIMDSIZE;
2382 store( i+SIMDSIZE*3UL, load(i+SIMDSIZE*3UL) + it.load() ); it += SIMDSIZE;
2384 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
2385 store( i, load(i) + it.load() );
2387 for( ; i<size_; ++i, ++it ) {
2405 template<
typename Type
2409 template<
typename VT >
2415 v_[element->index()] += element->value();
2431 template<
typename Type
2435 template<
typename VT >
2441 const size_t ipos( size_ &
size_t(-2) );
2444 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2445 v_[i ] -= (~rhs)[i ];
2446 v_[i+1UL] -= (~rhs)[i+1UL];
2448 if( ipos < (~rhs).size() )
2449 v_[ipos] -= (~rhs)[ipos];
2465 template<
typename Type
2469 template<
typename VT >
2477 const size_t ipos( size_ &
size_t(-SIMDSIZE) );
2480 const size_t i4way( size_ &
size_t(-SIMDSIZE*4) );
2481 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
2487 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
2488 store( i , load(i ) - it.load() ); it += SIMDSIZE;
2489 store( i+SIMDSIZE , load(i+SIMDSIZE ) - it.load() ); it += SIMDSIZE;
2490 store( i+SIMDSIZE*2UL, load(i+SIMDSIZE*2UL) - it.load() ); it += SIMDSIZE;
2491 store( i+SIMDSIZE*3UL, load(i+SIMDSIZE*3UL) - it.load() ); it += SIMDSIZE;
2493 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
2494 store( i, load(i) - it.load() );
2496 for( ; i<size_; ++i, ++it ) {
2514 template<
typename Type
2518 template<
typename VT >
2524 v_[element->index()] -= element->value();
2540 template<
typename Type
2544 template<
typename VT >
2550 const size_t ipos( size_ &
size_t(-2) );
2553 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2554 v_[i ] *= (~rhs)[i ];
2555 v_[i+1UL] *= (~rhs)[i+1UL];
2557 if( ipos < (~rhs).size() )
2558 v_[ipos] *= (~rhs)[ipos];
2574 template<
typename Type
2578 template<
typename VT >
2586 const size_t ipos( size_ &
size_t(-SIMDSIZE) );
2589 const size_t i4way( size_ &
size_t(-SIMDSIZE*4) );
2590 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
2596 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
2597 store( i , load(i ) * it.load() ); it += SIMDSIZE;
2598 store( i+SIMDSIZE , load(i+SIMDSIZE ) * it.load() ); it += SIMDSIZE;
2599 store( i+SIMDSIZE*2UL, load(i+SIMDSIZE*2UL) * it.load() ); it += SIMDSIZE;
2600 store( i+SIMDSIZE*3UL, load(i+SIMDSIZE*3UL) * it.load() ); it += SIMDSIZE;
2602 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
2603 store( i, load(i) * it.load() );
2605 for( ; i<size_; ++i, ++it ) {
2623 template<
typename Type
2627 template<
typename VT >
2637 v_[element->index()] = tmp[element->index()] * element->value();
2653 template<
typename Type
2657 template<
typename VT >
2663 const size_t ipos( size_ &
size_t(-2) );
2666 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2667 v_[i ] /= (~rhs)[i ];
2668 v_[i+1UL] /= (~rhs)[i+1UL];
2670 if( ipos < (~rhs).size() )
2671 v_[ipos] /= (~rhs)[ipos];
2687 template<
typename Type
2691 template<
typename VT >
2699 const size_t ipos( size_ &
size_t(-SIMDSIZE) );
2702 const size_t i4way( size_ &
size_t(-SIMDSIZE*4) );
2703 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
2709 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
2710 store( i , load(i ) / it.load() ); it += SIMDSIZE;
2711 store( i+SIMDSIZE , load(i+SIMDSIZE ) / it.load() ); it += SIMDSIZE;
2712 store( i+SIMDSIZE*2UL, load(i+SIMDSIZE*2UL) / it.load() ); it += SIMDSIZE;
2713 store( i+SIMDSIZE*3UL, load(i+SIMDSIZE*3UL) / it.load() ); it += SIMDSIZE;
2715 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
2716 store( i, load(i) / it.load() );
2718 for( ; i<size_; ++i, ++it ) {
2745 template<
typename Type
2749 :
public DenseVector< CustomVector<Type,AF,padded,TF>, TF >
2773 template<
typename ET >
2785 enum :
bool { simdEnabled = IsVectorizable<Type>::value };
2791 enum :
bool { smpAssignable = !IsSMPAssignable<Type>::value };
2798 explicit inline CustomVector( Type* ptr,
size_t n,
size_t nn );
2800 template<
typename Deleter >
2801 explicit inline CustomVector( Type* ptr,
size_t n,
size_t nn, Deleter d );
2815 inline Reference operator[](
size_t index ) noexcept;
2816 inline ConstReference operator[](
size_t index ) const noexcept;
2817 inline Reference
at(
size_t index );
2818 inline ConstReference
at(
size_t index ) const;
2819 inline Pointer
data () noexcept;
2820 inline ConstPointer
data () const noexcept;
2821 inline Iterator
begin () noexcept;
2822 inline ConstIterator
begin () const noexcept;
2823 inline ConstIterator
cbegin() const noexcept;
2824 inline Iterator
end () noexcept;
2825 inline ConstIterator
end () const noexcept;
2826 inline ConstIterator
cend () const noexcept;
2834 inline
CustomVector& operator=( initializer_list<Type> list );
2836 template< typename Other,
size_t N >
2837 inline
CustomVector& operator=( const Other (&array)[N] );
2842 template< typename VT > inline
CustomVector& operator= ( const Vector<VT,TF>& rhs );
2843 template< typename VT > inline
CustomVector& operator+=( const Vector<VT,TF>& rhs );
2844 template< typename VT > inline
CustomVector& operator-=( const Vector<VT,TF>& rhs );
2845 template< typename VT > inline
CustomVector& operator*=( const Vector<VT,TF>& rhs );
2846 template< typename VT > inline
CustomVector& operator/=( const DenseVector<VT,TF>& rhs );
2848 template< typename Other >
2851 template< typename Other >
2859 inline
size_t size() const noexcept;
2860 inline
size_t capacity() const noexcept;
2862 inline
void reset();
2863 inline
void clear();
2864 template< typename Other > inline
CustomVector& scale( const Other& scalar );
2872 inline
void reset( Type* ptr,
size_t n,
size_t nn );
2873 template< typename Deleter > inline
void reset( Type* ptr,
size_t n,
size_t nn, Deleter d );
2880 template< typename VT >
2881 struct VectorizedAssign {
2883 simdEnabled && VT::simdEnabled &&
2884 AreSIMDCombinable< Type, ElementType_<VT> >::value };
2890 template<
typename VT >
2891 struct VectorizedAddAssign {
2893 simdEnabled && VT::simdEnabled &&
2894 AreSIMDCombinable< Type, ElementType_<VT> >::value &&
2895 HasSIMDAdd< Type, ElementType_<VT> >::value };
2901 template<
typename VT >
2902 struct VectorizedSubAssign {
2904 simdEnabled && VT::simdEnabled &&
2905 AreSIMDCombinable< Type, ElementType_<VT> >::value &&
2906 HasSIMDSub< Type, ElementType_<VT> >::value };
2912 template<
typename VT >
2913 struct VectorizedMultAssign {
2915 simdEnabled && VT::simdEnabled &&
2916 AreSIMDCombinable< Type, ElementType_<VT> >::value &&
2917 HasSIMDMult< Type, ElementType_<VT> >::value };
2923 template<
typename VT >
2924 struct VectorizedDivAssign {
2926 simdEnabled && VT::simdEnabled &&
2927 AreSIMDCombinable< Type, ElementType_<VT> >::value &&
2928 HasSIMDDiv< Type, ElementType_<VT> >::value };
2941 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
2942 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
2944 inline bool isAligned () const noexcept;
2956 template< typename VT >
2957 inline
DisableIf_<VectorizedAssign<VT> > assign( const DenseVector<VT,TF>& rhs );
2959 template< typename VT >
2960 inline
EnableIf_<VectorizedAssign<VT> > assign( const DenseVector<VT,TF>& rhs );
2962 template< typename VT > inline
void assign( const SparseVector<VT,TF>& rhs );
2964 template< typename VT >
2965 inline
DisableIf_<VectorizedAddAssign<VT> > addAssign( const DenseVector<VT,TF>& rhs );
2967 template< typename VT >
2968 inline
EnableIf_<VectorizedAddAssign<VT> > addAssign( const DenseVector<VT,TF>& rhs );
2970 template< typename VT > inline
void addAssign( const SparseVector<VT,TF>& rhs );
2972 template< typename VT >
2973 inline
DisableIf_<VectorizedSubAssign<VT> > subAssign( const DenseVector<VT,TF>& rhs );
2975 template< typename VT >
2976 inline
EnableIf_<VectorizedSubAssign<VT> > subAssign( const DenseVector<VT,TF>& rhs );
2978 template< typename VT > inline
void subAssign( const SparseVector<VT,TF>& rhs );
2980 template< typename VT >
2981 inline
DisableIf_<VectorizedMultAssign<VT> > multAssign( const DenseVector<VT,TF>& rhs );
2983 template< typename VT >
2984 inline
EnableIf_<VectorizedMultAssign<VT> > multAssign( const DenseVector<VT,TF>& rhs );
2986 template< typename VT > inline
void multAssign( const SparseVector<VT,TF>& rhs );
2988 template< typename VT >
2989 inline
DisableIf_<VectorizedDivAssign<VT> > divAssign( const DenseVector<VT,TF>& rhs );
2991 template< typename VT >
2992 inline
EnableIf_<VectorizedDivAssign<VT> > divAssign( const DenseVector<VT,TF>& rhs );
3002 boost::shared_array<Type>
v_;
3034 template< typename Type
3068 template<
typename Type
3076 if( ptr ==
nullptr ) {
3084 if( IsVectorizable<Type>::value &&
capacity_ < nextMultiple<size_t>(
size_, SIMDSIZE ) ) {
3088 v_.reset( ptr, NoDelete() );
3090 if( IsVectorizable<Type>::value ) {
3120 template<
typename Type
3123 template<
typename Deleter >
3129 if( ptr ==
nullptr ) {
3137 if( IsVectorizable<Type>::value &&
capacity_ < nextMultiple<size_t>(
size_, SIMDSIZE ) ) {
3143 if( IsVectorizable<Type>::value ) {
3160 template<
typename Type
3178 template<
typename Type
3184 , v_ (
std::move( v.v_ ) )
3213 template<
typename Type
3236 template<
typename Type
3260 template<
typename Type
3266 if( index >= size_ ) {
3269 return (*
this)[index];
3286 template<
typename Type
3292 if( index >= size_ ) {
3295 return (*
this)[index];
3309 template<
typename Type
3312 inline typename CustomVector<Type,AF,padded,TF>::Pointer
3329 template<
typename Type
3332 inline typename CustomVector<Type,AF,padded,TF>::ConstPointer
3347 template<
typename Type
3365 template<
typename Type
3383 template<
typename Type
3401 template<
typename Type
3407 return Iterator( v_.get() + size_ );
3419 template<
typename Type
3437 template<
typename Type
3464 template<
typename Type
3467 inline CustomVector<Type,AF,padded,TF>&
3470 for(
size_t i=0UL; i<size_; ++i )
3503 template<
typename Type
3506 inline CustomVector<Type,AF,padded,TF>&
3509 if( list.size() > size_ ) {
3513 std::fill( std::copy( list.begin(), list.end(), v_.get() ), v_.get()+
capacity_, Type() );
3549 template<
typename Type
3552 template<
typename Other
3554 inline CustomVector<Type,AF,padded,TF>&
3561 for(
size_t i=0UL; i<N; ++i )
3581 template<
typename Type
3584 inline CustomVector<Type,AF,padded,TF>&
3587 if( rhs.size() != size_ ) {
3606 template<
typename Type
3609 inline CustomVector<Type,AF,padded,TF>&
3613 capacity_ = rhs.capacity_;
3614 v_ = std::move( rhs.v_ );
3617 rhs.capacity_ = 0UL;
3638 template<
typename Type
3641 template<
typename VT >
3642 inline CustomVector<Type,AF,padded,TF>&
3645 if( (~rhs).
size() != size_ ) {
3649 if( (~rhs).canAlias(
this ) ) {
3650 const ResultType_<VT> tmp( ~rhs );
3654 if( IsSparseVector<VT>::value )
3676 template<
typename Type
3679 template<
typename VT >
3680 inline CustomVector<Type,AF,padded,TF>&
3683 if( (~rhs).
size() != size_ ) {
3687 if( (~rhs).canAlias(
this ) ) {
3688 const ResultType_<VT> tmp( ~rhs );
3713 template<
typename Type
3716 template<
typename VT >
3717 inline CustomVector<Type,AF,padded,TF>&
3720 if( (~rhs).
size() != size_ ) {
3724 if( (~rhs).canAlias(
this ) ) {
3725 const ResultType_<VT> tmp( ~rhs );
3750 template<
typename Type
3753 template<
typename VT >
3754 inline CustomVector<Type,AF,padded,TF>&
3760 typedef MultTrait_< ResultType, ResultType_<VT> > MultType;
3765 if( (~rhs).
size() != size_ ) {
3769 if( IsSparseVector<VT>::value || (~rhs).canAlias(
this ) ) {
3770 const MultType tmp( *
this * (~rhs) );
3771 this->operator=( tmp );
3794 template<
typename Type
3797 template<
typename VT >
3798 inline CustomVector<Type,AF,padded,TF>&
3804 typedef DivTrait_< ResultType, ResultType_<VT> > DivType;
3809 if( (~rhs).
size() != size_ ) {
3813 if( (~rhs).canAlias(
this ) ) {
3814 const DivType tmp( *
this / (~rhs) );
3815 this->operator=( tmp );
3835 template<
typename Type
3838 template<
typename Other >
3839 inline EnableIf_<IsNumeric<Other>, CustomVector<Type,AF,padded,TF> >&
3859 template<
typename Type
3862 template<
typename Other >
3863 inline EnableIf_<IsNumeric<Other>, CustomVector<Type,AF,padded,TF> >&
3889 template<
typename Type
3906 template<
typename Type
3926 template<
typename Type
3931 size_t nonzeros( 0 );
3933 for(
size_t i=0UL; i<size_; ++i ) {
3950 template<
typename Type
3956 for(
size_t i=0UL; i<size_; ++i )
3972 template<
typename Type
3992 template<
typename Type
3995 template<
typename Other >
3996 inline CustomVector<Type,AF,padded,TF>&
3997 CustomVector<Type,AF,padded,TF>::scale(
const Other& scalar )
3999 for(
size_t i=0UL; i<size_; ++i )
4014 template<
typename Type
4021 swap( size_, v.size_ );
4022 swap( capacity_, v.capacity_ );
4060 template<
typename Type
4065 CustomVector tmp( ptr, n, nn );
4095 template<
typename Type
4098 template<
typename Deleter >
4101 CustomVector tmp( ptr, n, nn, d );
4127 template<
typename Type
4130 template<
typename Other >
4133 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
4150 template<
typename Type
4153 template<
typename Other >
4156 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
4172 template<
typename Type
4194 template<
typename Type
4199 return (
size() > SMP_DVECASSIGN_THRESHOLD );
4218 template<
typename Type
4225 return loada( index );
4227 return loadu( index );
4247 template<
typename Type
4262 return loada( v_.get()+index );
4282 template<
typename Type
4295 return loadu( v_.get()+index );
4315 template<
typename Type
4344 template<
typename Type
4359 storea( v_.get()+index, value );
4379 template<
typename Type
4392 storeu( v_.get()+index, value );
4413 template<
typename Type
4427 stream( v_.get()+index, value );
4445 template<
typename Type
4448 template<
typename VT >
4449 inline DisableIf_<typename CustomVector<Type,AF,padded,TF>::BLAZE_TEMPLATE VectorizedAssign<VT> >
4450 CustomVector<Type,AF,padded,TF>::assign(
const DenseVector<VT,TF>& rhs )
4454 const size_t ipos( size_ &
size_t(-2) );
4457 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4458 v_[i ] = (~rhs)[i ];
4459 v_[i+1UL] = (~rhs)[i+1UL];
4461 if( ipos < (~rhs).size() )
4462 v_[ipos] = (~rhs)[ipos];
4480 template<
typename Type
4483 template<
typename VT >
4484 inline EnableIf_<typename CustomVector<Type,AF,padded,TF>::BLAZE_TEMPLATE VectorizedAssign<VT> >
4485 CustomVector<Type,AF,padded,TF>::assign(
const DenseVector<VT,TF>& rhs )
4491 const bool remainder( !IsPadded<VT>::value );
4493 const size_t ipos( ( remainder )?( size_ &
size_t(-SIMDSIZE) ):( size_ ) );
4494 BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % SIMDSIZE ) ) == ipos,
"Invalid end calculation" );
4496 if( AF &&
useStreaming && size_ > (
cacheSize/(
sizeof(Type) * 3UL ) ) && !(~rhs).isAliased(
this ) )
4500 for( ; i<ipos; i+=SIMDSIZE ) {
4501 stream( i, (~rhs).load(i) );
4503 for( ; remainder && i<size_; ++i ) {
4509 const size_t i4way( size_ &
size_t(-SIMDSIZE*4) );
4510 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
4514 ConstIterator_<VT> it( (~rhs).
begin() );
4516 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
4517 store( i , it.load() ); it += SIMDSIZE;
4518 store( i+SIMDSIZE , it.load() ); it += SIMDSIZE;
4519 store( i+SIMDSIZE*2UL, it.load() ); it += SIMDSIZE;
4520 store( i+SIMDSIZE*3UL, it.load() ); it += SIMDSIZE;
4522 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
4523 store( i, it.load() );
4525 for( ; remainder && i<size_; ++i, ++it ) {
4546 template<
typename Type
4549 template<
typename VT >
4550 inline void CustomVector<Type,AF,padded,TF>::assign(
const SparseVector<VT,TF>& rhs )
4554 for( ConstIterator_<VT> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
4555 v_[element->index()] = element->value();
4573 template<
typename Type
4576 template<
typename VT >
4577 inline DisableIf_<typename CustomVector<Type,AF,padded,TF>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >
4578 CustomVector<Type,AF,padded,TF>::addAssign(
const DenseVector<VT,TF>& rhs )
4582 const size_t ipos( size_ &
size_t(-2) );
4585 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4586 v_[i ] += (~rhs)[i ];
4587 v_[i+1UL] += (~rhs)[i+1UL];
4589 if( ipos < (~rhs).size() )
4590 v_[ipos] += (~rhs)[ipos];
4608 template<
typename Type
4611 template<
typename VT >
4612 inline EnableIf_<typename CustomVector<Type,AF,padded,TF>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >
4613 CustomVector<Type,AF,padded,TF>::addAssign(
const DenseVector<VT,TF>& rhs )
4619 const bool remainder( !IsPadded<VT>::value );
4621 const size_t ipos( ( remainder )?( size_ &
size_t(-SIMDSIZE) ):( size_ ) );
4622 BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % SIMDSIZE ) ) == ipos,
"Invalid end calculation" );
4624 const size_t i4way( size_ &
size_t(-SIMDSIZE*4) );
4625 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
4629 ConstIterator_<VT> it( (~rhs).
begin() );
4631 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
4632 store( i , load(i ) + it.load() ); it += SIMDSIZE;
4633 store( i+SIMDSIZE , load(i+SIMDSIZE ) + it.load() ); it += SIMDSIZE;
4634 store( i+SIMDSIZE*2UL, load(i+SIMDSIZE*2UL) + it.load() ); it += SIMDSIZE;
4635 store( i+SIMDSIZE*3UL, load(i+SIMDSIZE*3UL) + it.load() ); it += SIMDSIZE;
4637 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
4638 store( i, load(i) + it.load() );
4640 for( ; remainder && i<size_; ++i, ++it ) {
4660 template<
typename Type
4663 template<
typename VT >
4664 inline void CustomVector<Type,AF,padded,TF>::addAssign(
const SparseVector<VT,TF>& rhs )
4668 for( ConstIterator_<VT> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
4669 v_[element->index()] += element->value();
4687 template<
typename Type
4690 template<
typename VT >
4691 inline DisableIf_<typename CustomVector<Type,AF,padded,TF>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >
4692 CustomVector<Type,AF,padded,TF>::subAssign(
const DenseVector<VT,TF>& rhs )
4696 const size_t ipos( size_ &
size_t(-2) );
4699 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4700 v_[i ] -= (~rhs)[i ];
4701 v_[i+1UL] -= (~rhs)[i+1UL];
4703 if( ipos < (~rhs).size() )
4704 v_[ipos] -= (~rhs)[ipos];
4722 template<
typename Type
4725 template<
typename VT >
4726 inline EnableIf_<typename CustomVector<Type,AF,padded,TF>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >
4727 CustomVector<Type,AF,padded,TF>::subAssign(
const DenseVector<VT,TF>& rhs )
4733 const bool remainder( !IsPadded<VT>::value );
4735 const size_t ipos( ( remainder )?( size_ &
size_t(-SIMDSIZE) ):( size_ ) );
4736 BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % SIMDSIZE ) ) == ipos,
"Invalid end calculation" );
4738 const size_t i4way( size_ &
size_t(-SIMDSIZE*4) );
4739 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
4743 ConstIterator_<VT> it( (~rhs).
begin() );
4745 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
4746 store( i , load(i ) - it.load() ); it += SIMDSIZE;
4747 store( i+SIMDSIZE , load(i+SIMDSIZE ) - it.load() ); it += SIMDSIZE;
4748 store( i+SIMDSIZE*2UL, load(i+SIMDSIZE*2UL) - it.load() ); it += SIMDSIZE;
4749 store( i+SIMDSIZE*3UL, load(i+SIMDSIZE*3UL) - it.load() ); it += SIMDSIZE;
4751 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
4752 store( i, load(i) - it.load() );
4754 for( ; remainder && i<size_; ++i, ++it ) {
4774 template<
typename Type
4777 template<
typename VT >
4778 inline void CustomVector<Type,AF,padded,TF>::subAssign(
const SparseVector<VT,TF>& rhs )
4782 for( ConstIterator_<VT> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
4783 v_[element->index()] -= element->value();
4801 template<
typename Type
4804 template<
typename VT >
4805 inline DisableIf_<typename CustomVector<Type,AF,padded,TF>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >
4806 CustomVector<Type,AF,padded,TF>::multAssign(
const DenseVector<VT,TF>& rhs )
4810 const size_t ipos( size_ &
size_t(-2) );
4813 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4814 v_[i ] *= (~rhs)[i ];
4815 v_[i+1UL] *= (~rhs)[i+1UL];
4817 if( ipos < (~rhs).size() )
4818 v_[ipos] *= (~rhs)[ipos];
4836 template<
typename Type
4839 template<
typename VT >
4840 inline EnableIf_<typename CustomVector<Type,AF,padded,TF>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >
4841 CustomVector<Type,AF,padded,TF>::multAssign(
const DenseVector<VT,TF>& rhs )
4847 const bool remainder( !IsPadded<VT>::value );
4849 const size_t ipos( ( remainder )?( size_ &
size_t(-SIMDSIZE) ):( size_ ) );
4850 BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % SIMDSIZE ) ) == ipos,
"Invalid end calculation" );
4852 const size_t i4way( size_ &
size_t(-SIMDSIZE*4) );
4853 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
4857 ConstIterator_<VT> it( (~rhs).
begin() );
4859 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
4860 store( i , load(i ) * it.load() ); it += SIMDSIZE;
4861 store( i+SIMDSIZE , load(i+SIMDSIZE ) * it.load() ); it += SIMDSIZE;
4862 store( i+SIMDSIZE*2UL, load(i+SIMDSIZE*2UL) * it.load() ); it += SIMDSIZE;
4863 store( i+SIMDSIZE*3UL, load(i+SIMDSIZE*3UL) * it.load() ); it += SIMDSIZE;
4865 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
4866 store( i, load(i) * it.load() );
4868 for( ; remainder && i<size_; ++i, ++it ) {
4888 template<
typename Type
4891 template<
typename VT >
4892 inline void CustomVector<Type,AF,padded,TF>::multAssign(
const SparseVector<VT,TF>& rhs )
4896 const DynamicVector<Type,TF> tmp(
serial( *
this ) );
4900 for( ConstIterator_<VT> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
4901 v_[element->index()] = tmp[element->index()] * element->value();
4919 template<
typename Type
4922 template<
typename VT >
4923 inline DisableIf_<typename CustomVector<Type,AF,padded,TF>::BLAZE_TEMPLATE VectorizedDivAssign<VT> >
4924 CustomVector<Type,AF,padded,TF>::divAssign(
const DenseVector<VT,TF>& rhs )
4928 const size_t ipos( size_ &
size_t(-2) );
4931 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4932 v_[i ] /= (~rhs)[i ];
4933 v_[i+1UL] /= (~rhs)[i+1UL];
4935 if( ipos < (~rhs).size() )
4936 v_[ipos] /= (~rhs)[ipos];
4954 template<
typename Type
4957 template<
typename VT >
4958 inline EnableIf_<typename CustomVector<Type,AF,padded,TF>::BLAZE_TEMPLATE VectorizedDivAssign<VT> >
4959 CustomVector<Type,AF,padded,TF>::divAssign(
const DenseVector<VT,TF>& rhs )
4965 const size_t ipos( size_ &
size_t(-SIMDSIZE) );
4968 const size_t i4way( size_ &
size_t(-SIMDSIZE*4) );
4969 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
4973 ConstIterator_<VT> it( (~rhs).
begin() );
4975 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
4976 store( i , load(i ) / it.load() ); it += SIMDSIZE;
4977 store( i+SIMDSIZE , load(i+SIMDSIZE ) / it.load() ); it += SIMDSIZE;
4978 store( i+SIMDSIZE*2UL, load(i+SIMDSIZE*2UL) / it.load() ); it += SIMDSIZE;
4979 store( i+SIMDSIZE*3UL, load(i+SIMDSIZE*3UL) / it.load() ); it += SIMDSIZE;
4981 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
4982 store( i, load(i) / it.load() );
4984 for( ; i<size_; ++i, ++it ) {
5007 template<
typename Type,
bool AF,
bool PF,
bool TF >
5008 inline void reset( CustomVector<Type,AF,PF,TF>& v );
5010 template<
typename Type,
bool AF,
bool PF,
bool TF >
5011 inline void clear( CustomVector<Type,AF,PF,TF>& v );
5013 template<
typename Type,
bool AF,
bool PF,
bool TF >
5014 inline bool isDefault(
const CustomVector<Type,AF,PF,TF>& v );
5016 template<
typename Type,
bool AF,
bool PF,
bool TF >
5017 inline bool isIntact(
const CustomVector<Type,AF,PF,TF>& v ) noexcept;
5019 template<
typename Type,
bool AF,
bool PF,
bool TF >
5020 inline void swap( CustomVector<Type,AF,PF,TF>& a, CustomVector<Type,AF,PF,TF>& b ) noexcept;
5032 template<
typename Type
5050 template<
typename Type
5082 template<
typename Type
5088 return ( v.
size() == 0UL );
5114 template<
typename Type
5120 return ( v.size() <= v.capacity() );
5133 template<
typename Type
5154 template<
typename T,
bool AF,
bool PF,
bool TF >
5155 struct HasConstDataAccess< CustomVector<T,AF,PF,TF> > :
public TrueType
5171 template<
typename T,
bool AF,
bool PF,
bool TF >
5172 struct HasMutableDataAccess< CustomVector<T,AF,PF,TF> > :
public TrueType
5188 template<
typename T,
bool AF,
bool PF,
bool TF >
5189 struct IsCustom< CustomVector<T,AF,PF,TF> > :
public TrueType
5205 template<
typename T,
bool PF,
bool TF >
5222 template<
typename T,
bool AF,
bool TF >
5223 struct IsPadded< CustomVector<T,AF,
padded,TF> > :
public TrueType
5239 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2,
size_t N >
5240 struct AddTrait< CustomVector<T1,AF,PF,TF>, StaticVector<T2,N,TF> >
5242 using Type = StaticVector< AddTrait_<T1,T2>, N, TF >;
5245 template<
typename T1,
size_t N,
bool TF,
typename T2,
bool AF,
bool PF >
5246 struct AddTrait< StaticVector<T1,N,TF>, CustomVector<T2,AF,PF,TF> >
5248 using Type = StaticVector< AddTrait_<T1,T2>, N, TF >;
5251 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2,
size_t N >
5252 struct AddTrait< CustomVector<T1,AF,PF,TF>, HybridVector<T2,N,TF> >
5254 using Type = HybridVector< AddTrait_<T1,T2>, N, TF >;
5257 template<
typename T1,
size_t N,
bool TF,
typename T2,
bool AF,
bool PF >
5258 struct AddTrait< HybridVector<T1,N,TF>, CustomVector<T2,AF,PF,TF> >
5260 using Type = HybridVector< AddTrait_<T1,T2>, N, TF >;
5263 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2 >
5264 struct AddTrait< CustomVector<T1,AF,PF,TF>, DynamicVector<T2,TF> >
5266 using Type = DynamicVector< AddTrait_<T1,T2>, TF >;
5269 template<
typename T1,
bool TF,
typename T2,
bool AF,
bool PF >
5270 struct AddTrait< DynamicVector<T1,TF>, CustomVector<T2,AF,PF,TF> >
5272 using Type = DynamicVector< AddTrait_<T1,T2>, TF >;
5275 template<
typename T1,
bool AF1,
bool PF1,
bool TF,
typename T2,
bool AF2,
bool PF2 >
5276 struct AddTrait< CustomVector<T1,AF1,PF1,TF>, CustomVector<T2,AF2,PF2,TF> >
5278 using Type = DynamicVector< AddTrait_<T1,T2>, TF >;
5294 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2,
size_t N >
5295 struct SubTrait< CustomVector<T1,AF,PF,TF>, StaticVector<T2,N,TF> >
5297 using Type = StaticVector< SubTrait_<T1,T2>, N, TF >;
5300 template<
typename T1,
size_t N,
bool TF,
typename T2,
bool AF,
bool PF >
5301 struct SubTrait< StaticVector<T1,N,TF>, CustomVector<T2,AF,PF,TF> >
5303 using Type = StaticVector< SubTrait_<T1,T2>, N, TF >;
5306 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2,
size_t N >
5307 struct SubTrait< CustomVector<T1,AF,PF,TF>, HybridVector<T2,N,TF> >
5309 using Type = HybridVector< SubTrait_<T1,T2>, N, TF >;
5312 template<
typename T1,
size_t N,
bool TF,
typename T2,
bool AF,
bool PF >
5313 struct SubTrait< HybridVector<T1,N,TF>, CustomVector<T2,AF,PF,TF> >
5315 using Type = HybridVector< SubTrait_<T1,T2>, N, TF >;
5318 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2 >
5319 struct SubTrait< CustomVector<T1,AF,PF,TF>, DynamicVector<T2,TF> >
5321 using Type = DynamicVector< SubTrait_<T1,T2>, TF >;
5324 template<
typename T1,
bool TF,
typename T2,
bool AF,
bool PF >
5325 struct SubTrait< DynamicVector<T1,TF>, CustomVector<T2,AF,PF,TF> >
5327 using Type = DynamicVector< SubTrait_<T1,T2>, TF >;
5330 template<
typename T1,
bool AF1,
bool PF1,
bool TF,
typename T2,
bool AF2,
bool PF2 >
5331 struct SubTrait< CustomVector<T1,AF1,PF1,TF>, CustomVector<T2,AF2,PF2,TF> >
5333 using Type = DynamicVector< SubTrait_<T1,T2>, TF >;
5349 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2 >
5350 struct MultTrait< CustomVector<T1,AF,PF,TF>, T2,
EnableIf_<IsNumeric<T2> > >
5352 using Type = DynamicVector< MultTrait_<T1,T2>, TF >;
5355 template<
typename T1,
typename T2,
bool AF,
bool PF,
bool TF >
5356 struct MultTrait< T1, CustomVector<T2,AF,PF,TF>,
EnableIf_<IsNumeric<T1> > >
5358 using Type = DynamicVector< MultTrait_<T1,T2>, TF >;
5361 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2,
size_t N >
5362 struct MultTrait< CustomVector<T1,AF,PF,TF>, StaticVector<T2,N,TF> >
5364 using Type = StaticVector< MultTrait_<T1,T2>, N, TF >;
5367 template<
typename T1,
bool AF,
bool PF,
typename T2,
size_t N >
5368 struct MultTrait< CustomVector<T1,AF,PF,false>, StaticVector<T2,N,true> >
5370 using Type = DynamicMatrix< MultTrait_<T1,T2>,
false >;
5373 template<
typename T1,
bool AF,
bool PF,
typename T2,
size_t N >
5374 struct MultTrait< CustomVector<T1,AF,PF,true>, StaticVector<T2,N,false> >
5376 using Type = MultTrait_<T1,T2>;
5379 template<
typename T1,
size_t N,
bool TF,
typename T2,
bool AF,
bool PF >
5380 struct MultTrait< StaticVector<T1,N,TF>, CustomVector<T2,AF,PF,TF> >
5382 using Type = StaticVector< MultTrait_<T1,T2>, N, TF >;
5385 template<
typename T1,
size_t N,
typename T2,
bool AF,
bool PF >
5386 struct MultTrait< StaticVector<T1,N,false>, CustomVector<T2,AF,PF,true> >
5388 using Type = DynamicMatrix< MultTrait_<T1,T2>,
false >;
5391 template<
typename T1,
size_t N,
typename T2,
bool AF,
bool PF >
5392 struct MultTrait< StaticVector<T1,N,true>, CustomVector<T2,AF,PF,false> >
5394 using Type = MultTrait_<T1,T2>;
5397 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2,
size_t N >
5398 struct MultTrait< CustomVector<T1,AF,PF,TF>, HybridVector<T2,N,TF> >
5400 using Type = HybridVector< MultTrait_<T1,T2>, N, TF >;
5403 template<
typename T1,
bool AF,
bool PF,
typename T2,
size_t N >
5404 struct MultTrait< CustomVector<T1,AF,PF,false>, HybridVector<T2,N,true> >
5406 using Type = DynamicMatrix< MultTrait_<T1,T2>,
false >;
5409 template<
typename T1,
bool AF,
bool PF,
typename T2,
size_t N >
5410 struct MultTrait< CustomVector<T1,AF,PF,true>, HybridVector<T2,N,false> >
5412 using Type = MultTrait_<T1,T2>;
5415 template<
typename T1,
size_t N,
bool TF,
typename T2,
bool AF,
bool PF >
5416 struct MultTrait< HybridVector<T1,N,TF>, CustomVector<T2,AF,PF,TF> >
5418 using Type = HybridVector< MultTrait_<T1,T2>, N, TF >;
5421 template<
typename T1,
size_t N,
typename T2,
bool AF,
bool PF >
5422 struct MultTrait< HybridVector<T1,N,false>, CustomVector<T2,AF,PF,true> >
5424 using Type = DynamicMatrix< MultTrait_<T1,T2>,
false >;
5427 template<
typename T1,
size_t N,
typename T2,
bool AF,
bool PF >
5428 struct MultTrait< HybridVector<T1,N,true>, CustomVector<T2,AF,PF,false> >
5430 using Type = MultTrait_<T1,T2>;
5433 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2 >
5434 struct MultTrait< CustomVector<T1,AF,PF,TF>, DynamicVector<T2,TF> >
5436 using Type = DynamicVector< MultTrait_<T1,T2>, TF >;
5439 template<
typename T1,
bool AF,
bool PF,
typename T2 >
5440 struct MultTrait< CustomVector<T1,AF,PF,false>, DynamicVector<T2,true> >
5442 using Type = DynamicMatrix< MultTrait_<T1,T2>,
false >;
5445 template<
typename T1,
bool AF,
bool PF,
typename T2 >
5446 struct MultTrait< CustomVector<T1,AF,PF,true>, DynamicVector<T2,false> >
5448 using Type = MultTrait_<T1,T2>;
5451 template<
typename T1,
bool TF,
typename T2,
bool AF,
bool PF >
5452 struct MultTrait< DynamicVector<T1,TF>, CustomVector<T2,AF,PF,TF> >
5454 using Type = DynamicVector< MultTrait_<T1,T2>, TF >;
5457 template<
typename T1,
typename T2,
bool AF,
bool PF >
5458 struct MultTrait< DynamicVector<T1,false>, CustomVector<T2,AF,PF,true> >
5460 using Type = DynamicMatrix< MultTrait_<T1,T2>,
false >;
5463 template<
typename T1,
typename T2,
bool AF,
bool PF >
5464 struct MultTrait< DynamicVector<T1,true>, CustomVector<T2,AF,PF,false> >
5466 using Type = MultTrait_<T1,T2>;
5469 template<
typename T1,
bool AF1,
bool PF1,
bool TF,
typename T2,
bool AF2,
bool PF2 >
5470 struct MultTrait< CustomVector<T1,AF1,PF1,TF>, CustomVector<T2,AF2,PF2,TF> >
5472 using Type = DynamicVector< MultTrait_<T1,T2>, TF >;
5475 template<
typename T1,
bool AF1,
bool PF1,
typename T2,
bool AF2,
bool PF2 >
5476 struct MultTrait< CustomVector<T1,AF1,PF1,false>, CustomVector<T2,AF2,PF2,true> >
5478 using Type = DynamicMatrix< MultTrait_<T1,T2>,
false >;
5481 template<
typename T1,
bool AF1,
bool PF1,
typename T2,
bool AF2,
bool PF2 >
5482 struct MultTrait< CustomVector<T1,AF1,PF1,true>, CustomVector<T2,AF2,PF2,false> >
5484 using Type = MultTrait_<T1,T2>;
5500 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2 >
5501 struct CrossTrait< CustomVector<T1,AF,PF,TF>, StaticVector<T2,3UL,TF> >
5504 using T = MultTrait_<T1,T2>;
5507 using Type = StaticVector< SubTrait_<T,T>, 3UL, TF >;
5510 template<
typename T1,
bool TF,
typename T2,
bool AF,
bool PF >
5511 struct CrossTrait< StaticVector<T1,3UL,TF>, CustomVector<T2,AF,PF,TF> >
5514 using T = MultTrait_<T1,T2>;
5517 using Type = StaticVector< SubTrait_<T,T>, 3UL, TF >;
5520 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2,
size_t N >
5521 struct CrossTrait< CustomVector<T1,AF,PF,TF>, HybridVector<T2,N,TF> >
5524 using T = MultTrait_<T1,T2>;
5527 using Type = StaticVector< SubTrait_<T,T>, 3UL, TF >;
5530 template<
typename T1,
size_t N,
bool TF,
typename T2,
bool AF,
bool PF >
5531 struct CrossTrait< HybridVector<T1,N,TF>, CustomVector<T2,AF,PF,TF> >
5534 using T = MultTrait_<T1,T2>;
5537 using Type = StaticVector< SubTrait_<T,T>, 3UL, TF >;
5540 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2 >
5541 struct CrossTrait< CustomVector<T1,AF,PF,TF>, DynamicVector<T2,TF> >
5544 using T = MultTrait_<T1,T2>;
5547 using Type = StaticVector< SubTrait_<T,T>, 3UL, TF >;
5550 template<
typename T1,
bool TF,
typename T2,
bool AF,
bool PF >
5551 struct CrossTrait< DynamicVector<T1,TF>, CustomVector<T2,AF,PF,TF> >
5554 using T = MultTrait_<T1,T2>;
5557 using Type = StaticVector< SubTrait_<T,T>, 3UL, TF >;
5560 template<
typename T1,
bool AF1,
bool PF1,
bool TF,
typename T2,
bool AF2,
bool PF2 >
5561 struct CrossTrait< CustomVector<T1,AF1,PF1,TF>, CustomVector<T2,AF2,PF2,TF> >
5564 using T = MultTrait_<T1,T2>;
5567 using Type = StaticVector< SubTrait_<T,T>, 3UL, TF >;
5583 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2 >
5584 struct DivTrait< CustomVector<T1,AF,PF,TF>, T2,
EnableIf_<IsNumeric<T2> > >
5586 using Type = DynamicVector< DivTrait_<T1,T2>, TF >;
5589 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2,
size_t N >
5590 struct DivTrait< CustomVector<T1,AF,PF,TF>, StaticVector<T2,N,TF> >
5592 using Type = StaticVector< DivTrait_<T1,T2>, N, TF >;
5595 template<
typename T1,
size_t N,
bool TF,
typename T2,
bool AF,
bool PF >
5596 struct DivTrait< StaticVector<T1,N,TF>, CustomVector<T2,AF,PF,TF> >
5598 using Type = StaticVector< DivTrait_<T1,T2>, N, TF >;
5601 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2,
size_t N >
5602 struct DivTrait< CustomVector<T1,AF,PF,TF>, HybridVector<T2,N,TF> >
5604 using Type = HybridVector< DivTrait_<T1,T2>, N, TF >;
5607 template<
typename T1,
size_t N,
bool TF,
typename T2,
bool AF,
bool PF >
5608 struct DivTrait< HybridVector<T1,N,TF>, CustomVector<T2,AF,PF,TF> >
5610 using Type = HybridVector< DivTrait_<T1,T2>, N, TF >;
5613 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2 >
5614 struct DivTrait< CustomVector<T1,AF,PF,TF>, DynamicVector<T2,TF> >
5616 using Type = DynamicVector< DivTrait_<T1,T2>, TF >;
5619 template<
typename T1,
bool TF,
typename T2,
bool AF,
bool PF >
5620 struct DivTrait< DynamicVector<T1,TF>, CustomVector<T2,AF,PF,TF> >
5622 using Type = DynamicVector< DivTrait_<T1,T2>, TF >;
5625 template<
typename T1,
bool AF1,
bool PF1,
bool TF,
typename T2,
bool AF2,
bool PF2 >
5626 struct DivTrait< CustomVector<T1,AF1,PF1,TF>, CustomVector<T2,AF2,PF2,TF> >
5628 using Type = DynamicVector< DivTrait_<T1,T2>, TF >;
5644 template<
typename T1,
bool AF,
bool PF,
bool TF >
5645 struct SubvectorTrait< CustomVector<T1,AF,PF,TF> >
5647 using Type = DynamicVector<T1,TF>;
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:133
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h:79
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
constexpr bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
DenseVector< This, TF > BaseType
Base type of this CustomVector instance.
Definition: CustomVector.h:428
#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 AlignmentOf type trait.
Header file for the alignment flag values.
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
CustomVector()
The default constructor for CustomVector.
Definition: CustomVector.h:732
Iterator begin() noexcept
Returns an iterator to the first element of the custom vector.
Definition: CustomVector.h:1082
Header file for basic type definitions.
No-delete policy class.
Definition: NoDelete.h:51
Header file for the SparseVector base class.
size_t size_
The size/dimension of the custom vector.
Definition: CustomVector.h:695
const Type & ReturnType
Return type for expression template evaluations.
Definition: CustomVector.h:433
const Type * ConstPointer
Pointer to a constant vector value.
Definition: CustomVector.h:439
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: CustomVector.h:1900
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:79
EnableIf_< IsDenseMatrix< MT1 > > 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
const Type & ConstReference
Reference to a constant vector value.
Definition: CustomVector.h:437
Header file for the serial shim.
ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the custom vector.
Definition: CustomVector.h:1116
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
constexpr 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 SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: CustomVector.h:2049
BLAZE_ALWAYS_INLINE T1 & operator/=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Division assignment operator for the division of two SIMD packs.
Definition: BasicTypes.h:1339
Iterator end() noexcept
Returns an iterator just past the last element of the custom vector.
Definition: CustomVector.h:1133
const bool aligned
Alignment flag for aligned vectors and matrices.Via this flag it is possible to specify subvectors...
Definition: AlignmentFlag.h:85
void swap(CustomVector &v) noexcept
Swapping the contents of two vectors.
Definition: CustomVector.h:1712
CustomVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: CustomVector.h:1192
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:188
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:315
bool canSMPAssign() const noexcept
Returns whether the vector can be used in SMP assignments.
Definition: CustomVector.h:1963
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
EnableIf_< IsDenseVector< VT1 > > 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:193
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
DynamicVector< Type,!TF > TransposeType
Transpose type for expression template evaluations.
Definition: CustomVector.h:430
Header file for the DenseVector base class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:245
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Efficient implementation of an arbitrary sized vector.The DynamicVector class template is the represe...
Definition: DynamicVector.h:176
System settings for performance optimizations.
BLAZE_ALWAYS_INLINE T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1321
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
BLAZE_ALWAYS_INLINE void storeu(size_t index, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the vector.
Definition: CustomVector.h:2140
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
EnableIf_< IsDenseMatrix< MT1 > > 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 implementation of an arbitrarily sized vector.
Header file for the NoDelete policy classes.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Constraint on the data type.
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: CustomVector.h:1922
size_t capacity_
The current capacity of the pointer array.
Definition: CompressedMatrix.h:2807
Header file for the std::initializer_list aliases.
bool isAligned() const noexcept
Returns whether the vector is properly aligned in memory.
Definition: CustomVector.h:1942
Header file for the DisableIf class template.
Header file for the IsCustom type trait.
Header file for the multiplication trait.
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for nested template disabiguation.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5148
constexpr bool useStreaming
Configuration of the streaming behavior.For large vectors and matrices non-temporal stores can provid...
Definition: Optimizations.h:68
constexpr bool defaultTransposeFlag
The default transpose flag for all vectors of the Blaze library.This value specifies the default tran...
Definition: TransposeFlag.h:56
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
Header file for the IsSMPAssignable type trait.
EnableIf_< IsDenseMatrix< MT1 > > 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
const bool padded
Padding flag for padded vectors and matrices.Via this flag it is possible to specify custom vectors a...
Definition: PaddingFlag.h:86
BLAZE_ALWAYS_INLINE void stream(size_t index, const SIMDType &value) noexcept
Aligned, non-temporal store of a SIMD element of the vector.
Definition: CustomVector.h:2172
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the HasSIMDAdd type trait.
Header file for the DenseIterator class template.
void clear()
Clearing the vector to its default state.
Definition: CustomVector.h:1674
Header file for the subvector trait.
Header file for all SIMD functionality.
DenseIterator< const Type, AF > ConstIterator
Iterator over constant elements.
Definition: CustomVector.h:442
Constraint on the data type.
boost::shared_array< Type > v_
The custom array of elements.
Definition: CustomVector.h:696
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:78
Constraint on the data type.
Efficient implementation of a customizable vector.
Definition: CustomVector.h:423
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:80
void reset()
Reset to the default initial values.
Definition: CustomVector.h:1653
#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:61
ConstIterator cend() const noexcept
Returns an iterator just past the last element of the custom vector.
Definition: CustomVector.h:1167
BLAZE_ALWAYS_INLINE void storea(size_t index, const SIMDType &value) noexcept
Aligned store of a SIMD element of the vector.
Definition: CustomVector.h:2107
size_t size() const noexcept
Returns the size/dimension of the vector.
Definition: CustomVector.h:1595
Header file for the exception macros of the math module.
Compile time check for data types.This type trait tests whether or not the given template parameter i...
Definition: IsSMPAssignable.h:119
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:254
DenseIterator< Type, AF > Iterator
Iterator over non-constant elements.
Definition: CustomVector.h:441
Constraint on the data type.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2645
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: CustomVector.h:1630
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
Header file for the IsPadded type trait.
DynamicVector< Type, TF > ResultType
Result type for expression template evaluations.
Definition: CustomVector.h:429
typename DivTrait< T1, T2 >::Type DivTrait_
Auxiliary alias declaration for the DivTrait class template.The DivTrait_ alias declaration provides ...
Definition: DivTrait.h:245
Header file for the IsVectorizable type trait.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
SIMDTrait_< ElementType > SIMDType
SIMD type of the vector elements.
Definition: CustomVector.h:432
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:75
Header file for the IsSparseVector type trait.
Header file for the HasSIMDMult type trait.
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: CustomVector.h:2015
Rebind mechanism to obtain a CustomVector with different data/element type.
Definition: CustomVector.h:449
Type * Pointer
Pointer to a non-constant vector value.
Definition: CustomVector.h:438
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1285
Header file for run time assertion macros.
Pointer data() noexcept
Low-level data access to the vector elements.
Definition: CustomVector.h:1046
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
Constraint on the data type.
EnableIf_< IsDenseVector< VT1 > > smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:222
Header file for the cache size of the target architecture.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2646
Reference at(size_t index)
Checked access to the vector elements.
Definition: CustomVector.h:999
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:258
Type & Reference
Reference to a non-constant vector value.
Definition: CustomVector.h:436
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: CustomVector.h:2080
Constraint on the data type.
Header file for the HasSIMDSub type trait.
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:81
Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: CustomVector.h:954
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
Header file for the padding flag values.
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:76
CustomVector< ET, AF, PF, TF > Other
The type of the other CustomVector.
Definition: CustomVector.h:450
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
Header file for the AreSIMDCombinable type trait.
Header file for the HasSIMDDiv type trait.
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:154
Header file for the default transpose flag for all vectors of the Blaze library.
Initializer list type of the Blaze library.
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:110
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
size_t capacity() const noexcept
Returns the maximum capacity of the vector.
Definition: CustomVector.h:1611
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2644
Rebind mechanism to obtain a CompressedMatrix with different data/element type.
Definition: CompressedMatrix.h:2654
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1303
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
Type ElementType
Type of the vector elements.
Definition: CustomVector.h:431
CustomVector< Type, AF, PF, TF > This
Type of this CustomVector instance.
Definition: CustomVector.h:427
System settings for the inline keywords.
const CustomVector & CompositeType
Data type for composite expression templates.
Definition: CustomVector.h:434
#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:63
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 SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: CustomVector.h:1987
Header file for the TrueType type/value trait base class.
Header file for the IsClass type trait.