35 #ifndef _BLAZE_MATH_DENSE_CUSTOMVECTOR_H_ 36 #define _BLAZE_MATH_DENSE_CUSTOMVECTOR_H_ 388 template<
typename Type
391 ,
bool TF = defaultTransposeFlag
392 ,
typename RT = DynamicVector<RemoveConst_t<Type>,TF> >
394 :
public DenseVector< CustomVector<Type,AF,PF,TF,RT>, TF >
424 template<
typename NewType >
434 template<
size_t NewN >
461 explicit inline CustomVector( Type* ptr,
size_t n,
size_t nn );
499 template< typename Other,
size_t Dim >
500 inline
CustomVector& operator=( const Other (&array)[Dim] );
517 inline
size_t size() const noexcept;
518 inline
size_t spacing() const noexcept;
519 inline
size_t capacity() const noexcept;
530 template< typename Other > inline
CustomVector& scale( const Other& scalar );
537 inline
void reset( Type* ptr,
size_t n );
538 inline
void reset( Type* ptr,
size_t n,
size_t nn );
545 template< typename VT >
547 static constexpr
bool VectorizedAssign_v =
548 ( useOptimizedKernels &&
556 template< typename VT >
558 static constexpr
bool VectorizedAddAssign_v =
559 ( useOptimizedKernels &&
568 template< typename VT >
570 static constexpr
bool VectorizedSubAssign_v =
571 ( useOptimizedKernels &&
580 template< typename VT >
582 static constexpr
bool VectorizedMultAssign_v =
583 ( useOptimizedKernels &&
592 template< typename VT >
594 static constexpr
bool VectorizedDivAssign_v =
595 ( useOptimizedKernels &&
611 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
612 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
626 template< typename VT >
629 template< typename VT >
634 template< typename VT >
637 template< typename VT >
642 template< typename VT >
645 template< typename VT >
650 template< typename VT >
653 template< typename VT >
658 template< typename VT >
661 template< typename VT >
704 template< typename Type
734 template<
typename Type
743 if( ptr ==
nullptr ) {
776 template<
typename Type
799 template<
typename Type
816 template<
typename Type
850 template<
typename Type
873 template<
typename Type
897 template<
typename Type
905 if( index >= size_ ) {
908 return (*
this)[index];
923 template<
typename Type
931 if( index >= size_ ) {
934 return (*
this)[index];
946 template<
typename Type
966 template<
typename Type
984 template<
typename Type
1002 template<
typename Type
1020 template<
typename Type
1038 template<
typename Type
1056 template<
typename Type
1074 template<
typename Type
1101 template<
typename Type
1108 for(
size_t i=0UL; i<size_; ++i )
1139 template<
typename Type
1147 if( list.size() > size_ ) {
1151 std::fill( std::copy( list.begin(), list.end(), v_ ), v_+size_, Type() );
1185 template<
typename Type
1190 template<
typename Other
1195 if( size_ != Dim ) {
1199 for(
size_t i=0UL; i<Dim; ++i )
1217 template<
typename Type
1225 if( rhs.
size() != size_ ) {
1242 template<
typename Type
1273 template<
typename Type
1278 template<
typename VT >
1282 if( (~rhs).
size() != size_ ) {
1286 if( (~rhs).canAlias(
this ) ) {
1291 if( IsSparseVector_v<VT> )
1311 template<
typename Type
1316 template<
typename VT >
1320 if( (~rhs).
size() != size_ ) {
1324 if( (~rhs).canAlias(
this ) ) {
1348 template<
typename Type
1353 template<
typename VT >
1357 if( (~rhs).
size() != size_ ) {
1361 if( (~rhs).canAlias(
this ) ) {
1385 template<
typename Type
1390 template<
typename VT >
1402 if( (~rhs).
size() != size_ ) {
1406 if( IsSparseVector_v<VT> || (~rhs).canAlias(
this ) ) {
1407 const MultType tmp( *
this * (~rhs) );
1408 if( IsSparseVector_v<MultType> )
1431 template<
typename Type
1436 template<
typename VT >
1449 if( (~rhs).
size() != size_ ) {
1453 if( (~rhs).canAlias(
this ) ) {
1454 const DivType tmp( *
this / (~rhs) );
1477 template<
typename Type
1482 template<
typename VT >
1486 using blaze::assign;
1497 if( size_ != 3UL || (~rhs).
size() != 3UL ) {
1501 const CrossType tmp( *
this % (~rhs) );
1502 assign( *
this, tmp );
1522 template<
typename Type
1542 template<
typename Type
1559 template<
typename Type
1579 template<
typename Type
1586 size_t nonzeros( 0 );
1588 for(
size_t i=0UL; i<size_; ++i ) {
1603 template<
typename Type
1611 for(
size_t i=0UL; i<size_; ++i )
1625 template<
typename Type
1644 template<
typename Type
1653 swap( size_, v.size_ );
1688 template<
typename Type
1693 template<
typename Other >
1696 for(
size_t i=0UL; i<size_; ++i )
1733 template<
typename Type
1771 template<
typename Type
1803 template<
typename Type
1808 template<
typename Other >
1811 return static_cast<const void*>(
this ) == static_cast<const void*>( alias );
1826 template<
typename Type
1831 template<
typename Other >
1834 return static_cast<const void*>(
this ) == static_cast<const void*>( alias );
1848 template<
typename Type
1870 template<
typename Type
1877 return (
size() > SMP_DVECASSIGN_THRESHOLD );
1894 template<
typename Type
1903 return loada( index );
1905 return loadu( index );
1923 template<
typename Type
1940 return loada( v_+index );
1958 template<
typename Type
1973 return loadu( v_+index );
1991 template<
typename Type
2020 template<
typename Type
2037 storea( v_+index, value );
2055 template<
typename Type
2070 storeu( v_+index, value );
2089 template<
typename Type
2106 stream( v_+index, value );
2122 template<
typename Type
2127 template<
typename VT >
2133 const size_t ipos( size_ &
size_t(-2) );
2136 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2137 v_[i ] = (~rhs)[i ];
2138 v_[i+1UL] = (~rhs)[i+1UL];
2140 if( ipos < (~rhs).size() )
2141 v_[ipos] = (~rhs)[ipos];
2157 template<
typename Type
2162 template<
typename VT >
2170 const size_t ipos( size_ &
size_t(-SIMDSIZE) );
2173 if( AF && useStreaming && size_ > ( cacheSize/(
sizeof(Type) * 3UL ) ) && !(~rhs).isAliased(
this ) )
2177 for( ; i<ipos; i+=SIMDSIZE ) {
2178 stream( i, (~rhs).load(i) );
2180 for( ; i<size_; ++i ) {
2186 const size_t i4way( size_ &
size_t( -(SIMDSIZE*4UL) ) );
2187 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
2191 ConstIterator_t<VT> it( (~rhs).
begin() );
2193 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
2194 store( i , it.load() ); it += SIMDSIZE;
2195 store( i+SIMDSIZE , it.load() ); it += SIMDSIZE;
2196 store( i+SIMDSIZE*2UL, it.load() ); it += SIMDSIZE;
2197 store( i+SIMDSIZE*3UL, it.load() ); it += SIMDSIZE;
2199 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
2200 store( i, it.load() );
2202 for( ; i<size_; ++i, ++it ) {
2221 template<
typename Type
2226 template<
typename VT >
2231 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2232 v_[element->index()] = element->value();
2248 template<
typename Type
2253 template<
typename VT >
2259 const size_t ipos( size_ &
size_t(-2) );
2262 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2263 v_[i ] += (~rhs)[i ];
2264 v_[i+1UL] += (~rhs)[i+1UL];
2266 if( ipos < (~rhs).size() )
2267 v_[ipos] += (~rhs)[ipos];
2283 template<
typename Type
2288 template<
typename VT >
2296 const size_t ipos( size_ &
size_t(-SIMDSIZE) );
2299 const size_t i4way( size_ &
size_t( -(SIMDSIZE*4UL) ) );
2300 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
2306 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
2307 store( i , load(i ) + it.load() ); it += SIMDSIZE;
2308 store( i+SIMDSIZE , load(i+SIMDSIZE ) + it.load() ); it += SIMDSIZE;
2309 store( i+SIMDSIZE*2UL, load(i+SIMDSIZE*2UL) + it.load() ); it += SIMDSIZE;
2310 store( i+SIMDSIZE*3UL, load(i+SIMDSIZE*3UL) + it.load() ); it += SIMDSIZE;
2312 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
2313 store( i, load(i) + it.load() );
2315 for( ; i<size_; ++i, ++it ) {
2333 template<
typename Type
2338 template<
typename VT >
2343 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2344 v_[element->index()] += element->value();
2360 template<
typename Type
2365 template<
typename VT >
2371 const size_t ipos( size_ &
size_t(-2) );
2374 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2375 v_[i ] -= (~rhs)[i ];
2376 v_[i+1UL] -= (~rhs)[i+1UL];
2378 if( ipos < (~rhs).size() )
2379 v_[ipos] -= (~rhs)[ipos];
2395 template<
typename Type
2400 template<
typename VT >
2408 const size_t ipos( size_ &
size_t(-SIMDSIZE) );
2411 const size_t i4way( size_ &
size_t( -(SIMDSIZE*4UL) ) );
2412 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
2418 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
2419 store( i , load(i ) - it.load() ); it += SIMDSIZE;
2420 store( i+SIMDSIZE , load(i+SIMDSIZE ) - it.load() ); it += SIMDSIZE;
2421 store( i+SIMDSIZE*2UL, load(i+SIMDSIZE*2UL) - it.load() ); it += SIMDSIZE;
2422 store( i+SIMDSIZE*3UL, load(i+SIMDSIZE*3UL) - it.load() ); it += SIMDSIZE;
2424 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
2425 store( i, load(i) - it.load() );
2427 for( ; i<size_; ++i, ++it ) {
2445 template<
typename Type
2450 template<
typename VT >
2455 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2456 v_[element->index()] -= element->value();
2472 template<
typename Type
2477 template<
typename VT >
2483 const size_t ipos( size_ &
size_t(-2) );
2486 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2487 v_[i ] *= (~rhs)[i ];
2488 v_[i+1UL] *= (~rhs)[i+1UL];
2490 if( ipos < (~rhs).size() )
2491 v_[ipos] *= (~rhs)[ipos];
2507 template<
typename Type
2512 template<
typename VT >
2520 const size_t ipos( size_ &
size_t(-SIMDSIZE) );
2523 const size_t i4way( size_ &
size_t( -(SIMDSIZE*4UL) ) );
2524 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
2530 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
2531 store( i , load(i ) * it.load() ); it += SIMDSIZE;
2532 store( i+SIMDSIZE , load(i+SIMDSIZE ) * it.load() ); it += SIMDSIZE;
2533 store( i+SIMDSIZE*2UL, load(i+SIMDSIZE*2UL) * it.load() ); it += SIMDSIZE;
2534 store( i+SIMDSIZE*3UL, load(i+SIMDSIZE*3UL) * it.load() ); it += SIMDSIZE;
2536 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
2537 store( i, load(i) * it.load() );
2539 for( ; i<size_; ++i, ++it ) {
2557 template<
typename Type
2562 template<
typename VT >
2571 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2572 v_[element->index()] = tmp[element->index()] * element->value();
2588 template<
typename Type
2593 template<
typename VT >
2599 const size_t ipos( size_ &
size_t(-2) );
2602 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2603 v_[i ] /= (~rhs)[i ];
2604 v_[i+1UL] /= (~rhs)[i+1UL];
2606 if( ipos < (~rhs).size() )
2607 v_[ipos] /= (~rhs)[ipos];
2623 template<
typename Type
2628 template<
typename VT >
2636 const size_t ipos( size_ &
size_t(-SIMDSIZE) );
2639 const size_t i4way( size_ &
size_t( -(SIMDSIZE*4UL) ) );
2640 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
2646 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
2647 store( i , load(i ) / it.load() ); it += SIMDSIZE;
2648 store( i+SIMDSIZE , load(i+SIMDSIZE ) / it.load() ); it += SIMDSIZE;
2649 store( i+SIMDSIZE*2UL, load(i+SIMDSIZE*2UL) / it.load() ); it += SIMDSIZE;
2650 store( i+SIMDSIZE*3UL, load(i+SIMDSIZE*3UL) / it.load() ); it += SIMDSIZE;
2652 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
2653 store( i, load(i) / it.load() );
2655 for( ; i<size_; ++i, ++it ) {
2682 template<
typename Type
2686 class CustomVector<Type,AF,
padded,TF,RT>
2687 :
public DenseVector< CustomVector<Type,AF,padded,TF,RT>, TF >
2691 using This = CustomVector<Type,AF,padded,TF,RT>;
2692 using BaseType = DenseVector<This,TF>;
2701 using SIMDType = SIMDTrait_t<ElementType>;
2710 using Iterator = DenseIterator<Type,AF>;
2717 template<
typename NewType >
2719 using RRT = Rebind_t< RT, RemoveConst_t<NewType> >;
2720 using Other = CustomVector<NewType,AF,padded,TF,RRT>;
2727 template<
size_t NewN >
2729 using RRT = Resize_t<RT,NewN>;
2730 using Other = CustomVector<Type,AF,padded,TF,RRT>;
2740 static constexpr
bool simdEnabled = IsVectorizable_v<Type>;
2746 static constexpr
bool smpAssignable = !IsSMPAssignable_v<Type>;
2753 explicit inline CustomVector( Type* ptr,
size_t n,
size_t nn );
2789 inline
CustomVector& operator=( initializer_list<Type> list );
2791 template< typename Other,
size_t N >
2792 inline
CustomVector& operator=( const Other (&array)[N] );
2797 template< typename VT > inline
CustomVector& operator= ( const Vector<VT,TF>& rhs );
2798 template< typename VT > inline
CustomVector& operator+=( const Vector<VT,TF>& rhs );
2799 template< typename VT > inline
CustomVector& operator-=( const Vector<VT,TF>& rhs );
2800 template< typename VT > inline
CustomVector& operator*=( const Vector<VT,TF>& rhs );
2801 template< typename VT > inline
CustomVector& operator/=( const DenseVector<VT,TF>& rhs );
2802 template< typename VT > inline
CustomVector& operator%=( const Vector<VT,TF>& rhs );
2809 inline
size_t size() const noexcept;
2810 inline
size_t spacing() const noexcept;
2811 inline
size_t capacity() const noexcept;
2813 inline
void reset();
2814 inline
void clear();
2822 template< typename Other > inline
CustomVector& scale( const Other& scalar );
2829 inline
void reset( Type* ptr,
size_t n,
size_t nn );
2836 template< typename VT >
2837 static constexpr
bool VectorizedAssign_v =
2838 ( useOptimizedKernels &&
2845 template< typename VT >
2846 static constexpr
bool VectorizedAddAssign_v =
2847 ( useOptimizedKernels &&
2855 template< typename VT >
2856 static constexpr
bool VectorizedSubAssign_v =
2857 ( useOptimizedKernels &&
2865 template< typename VT >
2866 static constexpr
bool VectorizedMultAssign_v =
2867 ( useOptimizedKernels &&
2875 template< typename VT >
2876 static constexpr
bool VectorizedDivAssign_v =
2877 ( useOptimizedKernels &&
2892 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
2893 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
2895 inline
bool isAligned () const noexcept;
2907 template< typename VT >
2908 inline auto
assign( const DenseVector<VT,TF>& rhs ) ->
DisableIf_t< VectorizedAssign_v<VT> >;
2910 template< typename VT >
2911 inline auto
assign( const DenseVector<VT,TF>& rhs ) ->
EnableIf_t< VectorizedAssign_v<VT> >;
2913 template< typename VT > inline
void assign( const SparseVector<VT,TF>& rhs );
2915 template< typename VT >
2916 inline auto
addAssign( const DenseVector<VT,TF>& rhs ) ->
DisableIf_t< VectorizedAddAssign_v<VT> >;
2918 template< typename VT >
2919 inline auto
addAssign( const DenseVector<VT,TF>& rhs ) ->
EnableIf_t< VectorizedAddAssign_v<VT> >;
2921 template< typename VT > inline
void addAssign( const SparseVector<VT,TF>& rhs );
2923 template< typename VT >
2924 inline auto
subAssign( const DenseVector<VT,TF>& rhs ) ->
DisableIf_t< VectorizedSubAssign_v<VT> >;
2926 template< typename VT >
2927 inline auto
subAssign( const DenseVector<VT,TF>& rhs ) ->
EnableIf_t< VectorizedSubAssign_v<VT> >;
2929 template< typename VT > inline
void subAssign( const SparseVector<VT,TF>& rhs );
2931 template< typename VT >
2932 inline auto
multAssign( const DenseVector<VT,TF>& rhs ) ->
DisableIf_t< VectorizedMultAssign_v<VT> >;
2934 template< typename VT >
2935 inline auto
multAssign( const DenseVector<VT,TF>& rhs ) ->
EnableIf_t< VectorizedMultAssign_v<VT> >;
2937 template< typename VT > inline
void multAssign( const SparseVector<VT,TF>& rhs );
2939 template< typename VT >
2940 inline auto
divAssign( const DenseVector<VT,TF>& rhs ) ->
DisableIf_t< VectorizedDivAssign_v<VT> >;
2942 template< typename VT >
2943 inline auto
divAssign( const DenseVector<VT,TF>& rhs ) ->
EnableIf_t< VectorizedDivAssign_v<VT> >;
2986 template< typename Type
3021 template<
typename Type
3032 if( ptr ==
nullptr ) {
3040 if( IsVectorizable_v<Type> && capacity_ < nextMultiple<size_t>(
size_,
SIMDSIZE ) ) {
3044 if( IsVectorizable_v<Type> ) {
3045 for(
size_t i=
size_; i<capacity_; ++i )
3061 template<
typename Type
3067 , capacity_( v.capacity_ )
3080 template<
typename Type
3086 , capacity_( v.capacity_ )
3117 template<
typename Type
3141 template<
typename Type
3166 template<
typename Type
3173 if( index >= size_ ) {
3176 return (*
this)[index];
3193 template<
typename Type
3200 if( index >= size_ ) {
3203 return (*
this)[index];
3217 template<
typename Type
3238 template<
typename Type
3257 template<
typename Type
3264 return Iterator( v_ );
3276 template<
typename Type
3283 return ConstIterator( v_ );
3295 template<
typename Type
3302 return ConstIterator( v_ );
3314 template<
typename Type
3321 return Iterator( v_+size_ );
3333 template<
typename Type
3340 return ConstIterator( v_+size_ );
3352 template<
typename Type
3359 return ConstIterator( v_+size_ );
3380 template<
typename Type
3384 inline CustomVector<Type,AF,padded,TF,RT>&
3387 for(
size_t i=0UL; i<size_; ++i )
3420 template<
typename Type
3424 inline CustomVector<Type,AF,padded,TF,RT>&
3427 if( list.size() > size_ ) {
3431 std::fill( std::copy( list.begin(), list.end(), v_ ), v_+capacity_, Type() );
3467 template<
typename Type
3471 template<
typename Other
3473 inline CustomVector<Type,AF,padded,TF,RT>&
3480 for(
size_t i=0UL; i<N; ++i )
3500 template<
typename Type
3504 inline CustomVector<Type,AF,padded,TF,RT>&
3507 if( rhs.size() != size_ ) {
3526 template<
typename Type
3530 inline CustomVector<Type,AF,padded,TF,RT>&
3534 capacity_ = rhs.capacity_;
3538 rhs.capacity_ = 0UL;
3560 template<
typename Type
3564 template<
typename VT >
3565 inline CustomVector<Type,AF,padded,TF,RT>&
3568 if( (~rhs).
size() != size_ ) {
3572 if( (~rhs).canAlias(
this ) ) {
3573 const ResultType_t<VT> tmp( ~rhs );
3577 if( IsSparseVector_v<VT> )
3599 template<
typename Type
3603 template<
typename VT >
3604 inline CustomVector<Type,AF,padded,TF,RT>&
3605 CustomVector<Type,AF,padded,TF,RT>::operator+=(
const Vector<VT,TF>& rhs )
3607 if( (~rhs).
size() != size_ ) {
3611 if( (~rhs).canAlias(
this ) ) {
3612 const ResultType_t<VT> tmp( ~rhs );
3637 template<
typename Type
3641 template<
typename VT >
3642 inline CustomVector<Type,AF,padded,TF,RT>&
3643 CustomVector<Type,AF,padded,TF,RT>::operator-=(
const Vector<VT,TF>& rhs )
3645 if( (~rhs).
size() != size_ ) {
3649 if( (~rhs).canAlias(
this ) ) {
3650 const ResultType_t<VT> tmp( ~rhs );
3675 template<
typename Type
3679 template<
typename VT >
3680 inline CustomVector<Type,AF,padded,TF,RT>&
3681 CustomVector<Type,AF,padded,TF,RT>::operator*=(
const Vector<VT,TF>& rhs )
3686 using MultType = MultTrait_t< ResultType, ResultType_t<VT> >;
3691 if( (~rhs).
size() != size_ ) {
3695 if( IsSparseVector_v<VT> || (~rhs).canAlias(
this ) ) {
3696 const MultType tmp( *
this * (~rhs) );
3697 if( IsSparseVector_v<MultType> )
3722 template<
typename Type
3726 template<
typename VT >
3727 inline CustomVector<Type,AF,padded,TF,RT>&
3728 CustomVector<Type,AF,padded,TF,RT>::operator/=(
const DenseVector<VT,TF>& rhs )
3733 using DivType = DivTrait_t< ResultType, ResultType_t<VT> >;
3739 if( (~rhs).
size() != size_ ) {
3743 if( (~rhs).canAlias(
this ) ) {
3744 const DivType tmp( *
this / (~rhs) );
3769 template<
typename Type
3773 template<
typename VT >
3774 inline CustomVector<Type,AF,padded,TF,RT>&
3775 CustomVector<Type,AF,padded,TF,RT>::operator%=(
const Vector<VT,TF>& rhs )
3777 using blaze::assign;
3782 using CrossType = CrossTrait_t< ResultType, ResultType_t<VT> >;
3788 if( size_ != 3UL || (~rhs).
size() != 3UL ) {
3792 const CrossType tmp( *
this % (~rhs) );
3793 assign( *
this, tmp );
3815 template<
typename Type
3836 template<
typename Type
3854 template<
typename Type
3875 template<
typename Type
3881 size_t nonzeros( 0 );
3883 for(
size_t i=0UL; i<size_; ++i ) {
3900 template<
typename Type
3907 for(
size_t i=0UL; i<size_; ++i )
3923 template<
typename Type
3944 template<
typename Type
3952 swap( size_, v.size_ );
3953 swap( capacity_, v.capacity_ );
3990 template<
typename Type
3994 template<
typename Other >
3995 inline CustomVector<Type,AF,padded,TF,RT>&
3996 CustomVector<Type,AF,padded,TF,RT>::scale(
const Other& scalar )
3998 for(
size_t i=0UL; i<size_; ++i )
4037 template<
typename Type
4043 CustomVector tmp( ptr, n, nn );
4069 template<
typename Type
4073 template<
typename Other >
4076 return static_cast<const void*>(
this ) == static_cast<const void*>( alias );
4093 template<
typename Type
4097 template<
typename Other >
4100 return static_cast<const void*>(
this ) == static_cast<const void*>( alias );
4116 template<
typename Type
4139 template<
typename Type
4145 return (
size() > SMP_DVECASSIGN_THRESHOLD );
4164 template<
typename Type
4172 return loada( index );
4174 return loadu( index );
4194 template<
typename Type
4210 return loada( v_+index );
4230 template<
typename Type
4244 return loadu( v_+index );
4264 template<
typename Type
4294 template<
typename Type
4310 storea( v_+index, value );
4330 template<
typename Type
4344 storeu( v_+index, value );
4365 template<
typename Type
4380 stream( v_+index, value );
4398 template<
typename Type
4402 template<
typename VT >
4404 -> DisableIf_t< VectorizedAssign_v<VT> >
4408 const size_t ipos( size_ &
size_t(-2) );
4411 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4412 v_[i ] = (~rhs)[i ];
4413 v_[i+1UL] = (~rhs)[i+1UL];
4415 if( ipos < (~rhs).size() )
4416 v_[ipos] = (~rhs)[ipos];
4434 template<
typename Type
4438 template<
typename VT >
4440 -> EnableIf_t< VectorizedAssign_v<VT> >
4446 constexpr
bool remainder( !IsPadded_v<VT> );
4448 const size_t ipos( ( remainder )?( size_ &
size_t(-SIMDSIZE) ):( size_ ) );
4449 BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % SIMDSIZE ) ) == ipos,
"Invalid end calculation" );
4451 if( AF && useStreaming && size_ > ( cacheSize/(
sizeof(Type) * 3UL ) ) && !(~rhs).isAliased(
this ) )
4455 for( ; i<ipos; i+=SIMDSIZE ) {
4456 stream( i, (~rhs).load(i) );
4458 for( ; remainder && i<size_; ++i ) {
4464 const size_t i4way( size_ &
size_t( -(SIMDSIZE*4UL) ) );
4465 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
4469 ConstIterator_t<VT> it( (~rhs).
begin() );
4471 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
4472 store( i , it.load() ); it += SIMDSIZE;
4473 store( i+SIMDSIZE , it.load() ); it += SIMDSIZE;
4474 store( i+SIMDSIZE*2UL, it.load() ); it += SIMDSIZE;
4475 store( i+SIMDSIZE*3UL, it.load() ); it += SIMDSIZE;
4477 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
4478 store( i, it.load() );
4480 for( ; remainder && i<size_; ++i, ++it ) {
4501 template<
typename Type
4505 template<
typename VT >
4510 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
4511 v_[element->index()] = element->value();
4529 template<
typename Type
4533 template<
typename VT >
4535 -> DisableIf_t< VectorizedAddAssign_v<VT> >
4539 const size_t ipos( size_ &
size_t(-2) );
4542 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4543 v_[i ] += (~rhs)[i ];
4544 v_[i+1UL] += (~rhs)[i+1UL];
4546 if( ipos < (~rhs).size() )
4547 v_[ipos] += (~rhs)[ipos];
4565 template<
typename Type
4569 template<
typename VT >
4571 -> EnableIf_t< VectorizedAddAssign_v<VT> >
4577 constexpr
bool remainder( !IsPadded_v<VT> );
4579 const size_t ipos( ( remainder )?( size_ &
size_t(-SIMDSIZE) ):( size_ ) );
4580 BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % SIMDSIZE ) ) == ipos,
"Invalid end calculation" );
4582 const size_t i4way( size_ &
size_t( -(SIMDSIZE*4UL) ) );
4583 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
4587 ConstIterator_t<VT> it( (~rhs).
begin() );
4589 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
4590 store( i , load(i ) + it.load() ); it += SIMDSIZE;
4591 store( i+SIMDSIZE , load(i+SIMDSIZE ) + it.load() ); it += SIMDSIZE;
4592 store( i+SIMDSIZE*2UL, load(i+SIMDSIZE*2UL) + it.load() ); it += SIMDSIZE;
4593 store( i+SIMDSIZE*3UL, load(i+SIMDSIZE*3UL) + it.load() ); it += SIMDSIZE;
4595 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
4596 store( i, load(i) + it.load() );
4598 for( ; remainder && i<size_; ++i, ++it ) {
4618 template<
typename Type
4622 template<
typename VT >
4627 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
4628 v_[element->index()] += element->value();
4646 template<
typename Type
4650 template<
typename VT >
4652 -> DisableIf_t< VectorizedSubAssign_v<VT> >
4656 const size_t ipos( size_ &
size_t(-2) );
4659 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4660 v_[i ] -= (~rhs)[i ];
4661 v_[i+1UL] -= (~rhs)[i+1UL];
4663 if( ipos < (~rhs).size() )
4664 v_[ipos] -= (~rhs)[ipos];
4682 template<
typename Type
4686 template<
typename VT >
4688 -> EnableIf_t< VectorizedSubAssign_v<VT> >
4694 constexpr
bool remainder( !IsPadded_v<VT> );
4696 const size_t ipos( ( remainder )?( size_ &
size_t(-SIMDSIZE) ):( size_ ) );
4697 BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % SIMDSIZE ) ) == ipos,
"Invalid end calculation" );
4699 const size_t i4way( size_ &
size_t( -(SIMDSIZE*4UL) ) );
4700 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
4704 ConstIterator_t<VT> it( (~rhs).
begin() );
4706 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
4707 store( i , load(i ) - it.load() ); it += SIMDSIZE;
4708 store( i+SIMDSIZE , load(i+SIMDSIZE ) - it.load() ); it += SIMDSIZE;
4709 store( i+SIMDSIZE*2UL, load(i+SIMDSIZE*2UL) - it.load() ); it += SIMDSIZE;
4710 store( i+SIMDSIZE*3UL, load(i+SIMDSIZE*3UL) - it.load() ); it += SIMDSIZE;
4712 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
4713 store( i, load(i) - it.load() );
4715 for( ; remainder && i<size_; ++i, ++it ) {
4735 template<
typename Type
4739 template<
typename VT >
4744 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
4745 v_[element->index()] -= element->value();
4763 template<
typename Type
4767 template<
typename VT >
4769 -> DisableIf_t< VectorizedMultAssign_v<VT> >
4773 const size_t ipos( size_ &
size_t(-2) );
4776 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4777 v_[i ] *= (~rhs)[i ];
4778 v_[i+1UL] *= (~rhs)[i+1UL];
4780 if( ipos < (~rhs).size() )
4781 v_[ipos] *= (~rhs)[ipos];
4799 template<
typename Type
4803 template<
typename VT >
4805 -> EnableIf_t< VectorizedMultAssign_v<VT> >
4811 constexpr
bool remainder( !IsPadded_v<VT> );
4813 const size_t ipos( ( remainder )?( size_ &
size_t(-SIMDSIZE) ):( size_ ) );
4814 BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % SIMDSIZE ) ) == ipos,
"Invalid end calculation" );
4816 const size_t i4way( size_ &
size_t( -(SIMDSIZE*4UL) ) );
4817 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
4821 ConstIterator_t<VT> it( (~rhs).
begin() );
4823 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
4824 store( i , load(i ) * it.load() ); it += SIMDSIZE;
4825 store( i+SIMDSIZE , load(i+SIMDSIZE ) * it.load() ); it += SIMDSIZE;
4826 store( i+SIMDSIZE*2UL, load(i+SIMDSIZE*2UL) * it.load() ); it += SIMDSIZE;
4827 store( i+SIMDSIZE*3UL, load(i+SIMDSIZE*3UL) * it.load() ); it += SIMDSIZE;
4829 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
4830 store( i, load(i) * it.load() );
4832 for( ; remainder && i<size_; ++i, ++it ) {
4852 template<
typename Type
4856 template<
typename VT >
4861 const ResultType tmp(
serial( *
this ) );
4865 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
4866 v_[element->index()] = tmp[element->index()] * element->value();
4884 template<
typename Type
4888 template<
typename VT >
4890 -> DisableIf_t< VectorizedDivAssign_v<VT> >
4894 const size_t ipos( size_ &
size_t(-2) );
4897 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4898 v_[i ] /= (~rhs)[i ];
4899 v_[i+1UL] /= (~rhs)[i+1UL];
4901 if( ipos < (~rhs).size() )
4902 v_[ipos] /= (~rhs)[ipos];
4920 template<
typename Type
4924 template<
typename VT >
4926 -> EnableIf_t< VectorizedDivAssign_v<VT> >
4932 const size_t ipos( size_ &
size_t(-SIMDSIZE) );
4935 const size_t i4way( size_ &
size_t( -(SIMDSIZE*4UL) ) );
4936 BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE*4UL) ) ) == i4way,
"Invalid end calculation" );
4940 ConstIterator_t<VT> it( (~rhs).
begin() );
4942 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
4943 store( i , load(i ) / it.load() ); it += SIMDSIZE;
4944 store( i+SIMDSIZE , load(i+SIMDSIZE ) / it.load() ); it += SIMDSIZE;
4945 store( i+SIMDSIZE*2UL, load(i+SIMDSIZE*2UL) / it.load() ); it += SIMDSIZE;
4946 store( i+SIMDSIZE*3UL, load(i+SIMDSIZE*3UL) / it.load() ); it += SIMDSIZE;
4948 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
4949 store( i, load(i) / it.load() );
4951 for( ; i<size_; ++i, ++it ) {
4974 template<
typename Type,
bool AF,
bool PF,
bool TF,
typename RT >
4975 void reset( CustomVector<Type,AF,PF,TF,RT>& v );
4977 template<
typename Type,
bool AF,
bool PF,
bool TF,
typename RT >
4978 void clear( CustomVector<Type,AF,PF,TF,RT>& v );
4980 template<
bool RF,
typename Type,
bool AF,
bool PF,
bool TF,
typename RT >
4981 bool isDefault(
const CustomVector<Type,AF,PF,TF,RT>& v );
4983 template<
typename Type,
bool AF,
bool PF,
bool TF,
typename RT >
4984 bool isIntact(
const CustomVector<Type,AF,PF,TF,RT>& v ) noexcept;
4986 template<
typename Type,
bool AF,
bool PF,
bool TF,
typename RT >
4987 void swap( CustomVector<Type,AF,PF,TF,RT>& a, CustomVector<Type,AF,PF,TF,RT>& b ) noexcept;
4999 template<
typename Type
5018 template<
typename Type
5066 return ( v.size() == 0UL );
5092 template<
typename Type
5099 return ( v.size() <= v.capacity() );
5112 template<
typename Type
5134 template<
typename T,
bool AF,
bool PF,
bool TF,
typename RT >
5135 struct HasConstDataAccess< CustomVector<T,AF,PF,TF,RT> >
5152 template<
typename T,
bool AF,
bool PF,
bool TF,
typename RT >
5153 struct HasMutableDataAccess< CustomVector<T,AF,PF,TF,RT> >
5170 template<
typename T,
bool AF,
bool PF,
bool TF,
typename RT >
5171 struct IsCustom< CustomVector<T,AF,PF,TF,RT> >
5188 template<
typename T,
bool PF,
bool TF,
typename RT >
5189 struct IsAligned< CustomVector<T,
aligned,PF,TF,RT> >
5206 template<
typename T,
bool PF,
bool TF,
typename RT >
5207 struct IsContiguous< CustomVector<T,
aligned,PF,TF,RT> >
5224 template<
typename T,
bool AF,
bool TF,
typename RT >
5225 struct IsPadded< CustomVector<T,AF,
padded,TF,RT> >
Constraint on the data type.
#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.
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: CustomVector.h:604
typename T1::template Rebind< T2 >::Other Rebind_t
Alias declaration for nested Rebind class templates.The Rebind_t alias declaration provides a conveni...
Definition: Aliases.h:310
Header file for the nextMultiple shim.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression,...
Definition: Assert.h:117
auto subAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedSubAssign_v< VT > >
Default implementation of the subtraction assignment of a dense vector.
Definition: CustomVector.h:2366
Header file for the alignment flag values.
Header file for basic type definitions.
Header file for the SparseVector base class.
bool canSMPAssign() const noexcept
Returns whether the vector can be used in SMP assignments.
Definition: CustomVector.h:1875
CustomVector< NewType, AF, PF, TF, RRT > Other
The type of the other CustomVector.
Definition: CustomVector.h:427
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: CustomVector.h:1929
auto divAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedDivAssign_v< VT > >
Default implementation of the division assignment of a dense vector.
Definition: CustomVector.h:2594
Iterator end() noexcept
Returns an iterator just past the last element of the custom vector.
Definition: CustomVector.h:1044
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.The IsSIMDCombinable_v variable templ...
Definition: IsSIMDCombinable.h:137
Header file for the serial shim.
typename DivTrait< T1, T2 >::Type DivTrait_t
Auxiliary alias declaration for the DivTrait class template.The DivTrait_t alias declaration provides...
Definition: DivTrait.h:239
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CustomVector.h:453
void clear()
Clearing the vector to its default state.
Definition: CustomVector.h:1630
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: CustomVector.h:405
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
CustomVector< Type, AF, PF, TF, RT > This
Type of this CustomVector instance.
Definition: CustomVector.h:398
Header file for the IsIntegral type trait.
typename SIMDTrait< T >::Type SIMDTrait_t
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_t alias declaration provid...
Definition: SIMDTrait.h:315
Header file for the DenseVector base class.
Header file for the MAYBE_UNUSED function template.
DenseVector< This, TF > BaseType
Base type of this CustomVector instance.
Definition: CustomVector.h:399
auto assign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedAssign_v< VT > >
Default implementation of the assignment of a dense vector.
Definition: CustomVector.h:2128
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type,...
Definition: Volatile.h:79
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.The HasSIMDAdd_v variable template provides...
Definition: HasSIMDAdd.h:187
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: IntegralConstant.h:132
Header file for all forward declarations of the math module.
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:75
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
Header file for the implementation of an arbitrarily sized vector.
typename T::template Resize< Ns... >::Other Resize_t
Alias declaration for nested Resize class templates.The Resize_t alias declaration provides a conveni...
Definition: Aliases.h:370
auto addAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedAddAssign_v< VT > >
Default implementation of the addition assignment of a dense vector.
Definition: CustomVector.h:2254
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
auto smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:220
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: CustomVector.h:1997
void reset()
Reset to the default initial values.
Definition: CustomVector.h:1608
Type ElementType
Type of the vector elements.
Definition: CustomVector.h:407
Constraint on the data type.
SIMDTrait_t< ElementType > SIMDType
SIMD type of the vector elements.
Definition: CustomVector.h:408
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
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:2095
Iterator begin() noexcept
Returns an iterator to the first element of the custom vector.
Definition: CustomVector.h:990
Header file for the DisableIf class template.
void swap(CustomVector &v) noexcept
Swapping the contents of two vectors.
Definition: CustomVector.h:1649
BLAZE_ALWAYS_INLINE void storea(size_t index, const SIMDType &value) noexcept
Aligned store of a SIMD element of the vector.
Definition: CustomVector.h:2026
Header file for the IsCustom type trait.
Header file for the multiplication trait.
bool isAligned() const noexcept
Returns whether the vector is properly aligned in memory.
Definition: CustomVector.h:1853
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
ConstIterator cend() const noexcept
Returns an iterator just past the last element of the custom vector.
Definition: CustomVector.h:1080
#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.
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.The HasSIMDSub_v variable template provides...
Definition: HasSIMDSub.h:187
Resize_t< RT, NewN > RRT
The resized result type.
Definition: CustomVector.h:436
Type & Reference
Reference to a non-constant vector value.
Definition: CustomVector.h:412
#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.
Header file for all SIMD functionality.
Constraint on the data type.
CustomVector< Type, AF, PF, TF, RRT > Other
The type of the other CustomVector.
Definition: CustomVector.h:437
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Type * Pointer
Pointer to a non-constant vector value.
Definition: CustomVector.h:414
Header file for the IsAligned type trait.
Constraint on the data type.
Efficient implementation of a customizable vector.
Definition: CustomVector.h:393
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:78
#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
Constraint on the data type.
void swap(CustomVector< Type, AF, PF, TF, RT > &a, CustomVector< Type, AF, PF, TF, RT > &b) noexcept
Swapping the contents of two vectors.
Definition: CustomVector.h:5117
Header file for the exception macros of the math module.
Type * v_
The custom array of elements.
Definition: CustomVector.h:671
Reference at(size_t index)
Checked access to the vector elements.
Definition: CustomVector.h:903
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:438
constexpr bool HasSIMDDiv_v
Auxiliary variable template for the HasSIMDDiv type trait.The HasSIMDDiv_v variable template provides...
Definition: HasSIMDDiv.h:171
Constraint on the data type.
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:615
Header file for the IsPadded type trait.
BLAZE_ALWAYS_INLINE SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: CustomVector.h:1900
typename CrossTrait< T1, T2 >::Type CrossTrait_t
Auxiliary alias declaration for the CrossTrait class template.The CrossTrait_t alias declaration prov...
Definition: CrossTrait.h:164
static constexpr bool simdEnabled
Compilation flag for SIMD optimization.
Definition: CustomVector.h:447
typename MultTrait< T1, T2 >::Type MultTrait_t
Auxiliary alias declaration for the MultTrait class template.The MultTrait_t alias declaration provid...
Definition: MultTrait.h:240
Header file for the IsVectorizable type trait.
size_t capacity() const noexcept
Returns the maximum capacity of the vector.
Definition: CustomVector.h:1564
Resize mechanism to obtain a CustomVector with a different fixed number of elements.
Definition: CustomVector.h:435
Flag for aligned vectors and matrices.
Definition: AlignmentFlag.h:65
Header file for the HasConstDataAccess type trait.
BLAZE_ALWAYS_INLINE void storeu(size_t index, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the vector.
Definition: CustomVector.h:2061
auto multAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedMultAssign_v< VT > >
Default implementation of the multiplication assignment of a dense vector.
Definition: CustomVector.h:2478
Header file for the RemoveConst type trait.
Header file for the IsSIMDCombinable type trait.
Header file for the IsSparseVector type trait.
Header file for the HasSIMDMult type trait.
Rebind mechanism to obtain a CustomVector with different data/element type.
Definition: CustomVector.h:425
size_t spacing() const noexcept
Returns the minimum capacity of the vector.
Definition: CustomVector.h:1547
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: CustomVector.h:1584
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
Header file for run time assertion macros.
Header file for the cross product trait.
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
Header file for the division trait.
ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the custom vector.
Definition: CustomVector.h:1026
Header file for the IsContiguous type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CustomVector.h:409
RT ResultType
Result type for expression template evaluations.
Definition: CustomVector.h:402
const CustomVector & CompositeType
Data type for composite expression templates.
Definition: CustomVector.h:410
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:295
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,...
Definition: Reference.h:79
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:282
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
Constraint on the data type.
Header file for the HasSIMDSub type trait.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
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
DenseIterator< Type, AF > Iterator
Iterator over non-constant elements.
Definition: CustomVector.h:417
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
CustomVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: CustomVector.h:1106
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
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.The ConstIterator_t alias declaration pro...
Definition: Aliases.h:110
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< 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:74
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
size_t size_
The size/dimension of the custom vector.
Definition: CustomVector.h:670
#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:61
size_t size() const noexcept
Returns the size/dimension of the vector.
Definition: CustomVector.h:1527
Header file for the HasSIMDDiv type trait.
DenseIterator< const Type, AF > ConstIterator
Iterator over constant elements.
Definition: CustomVector.h:418
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:198
CustomVector()
The default constructor for CustomVector.
Definition: CustomVector.h:709
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
Header file for the default transpose flag for all vectors of the Blaze library.
Initializer list type of the Blaze library.
Rebind_t< RT, RemoveConst_t< NewType > > RRT
The rebound result type.
Definition: CustomVector.h:426
Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: CustomVector.h:856
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.The HasSIMDMult_v variable template provid...
Definition: HasSIMDMult.h:188
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:146
Header file for the IntegralConstant class template.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
const Type * ConstPointer
Pointer to a constant vector value.
Definition: CustomVector.h:415
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: CustomVector.h:1964
#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
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: CustomVector.h:1832
System settings for the inline keywords.
#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.
constexpr bool padded
Padding flag for padded vectors and matrices.Via this flag it is possible to specify custom vectors a...
Definition: PaddingFlag.h:86
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
Definition: Assert.h:101
auto smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector.
Definition: DenseVector.h:191
const Type & ConstReference
Reference to a constant vector value.
Definition: CustomVector.h:413
Header file for the clear shim.
Pointer data() noexcept
Low-level data access to the vector elements.
Definition: CustomVector.h:952
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: CustomVector.h:1809