35 #ifndef _BLAZE_MATH_DENSE_CUSTOMVECTOR_H_ 36 #define _BLAZE_MATH_DENSE_CUSTOMVECTOR_H_ 393 template<
typename Type
396 ,
bool TF = defaultTransposeFlag >
398 :
public DenseVector< CustomVector<Type,AF,PF,TF>, TF >
428 template<
typename NewType >
437 template<
size_t NewN >
463 explicit inline CustomVector( Type* ptr,
size_t n,
size_t nn );
498 template<
typename Other,
size_t N >
516 inline size_t size()
const noexcept;
517 inline size_t spacing()
const noexcept;
518 inline size_t capacity()
const noexcept;
536 inline void reset( Type* ptr,
size_t n );
537 inline void reset( Type* ptr,
size_t n,
size_t nn );
544 template<
typename VT >
546 struct VectorizedAssign {
547 enum :
bool { value = useOptimizedKernels &&
548 simdEnabled && VT::simdEnabled &&
556 template<
typename VT >
558 struct VectorizedAddAssign {
559 enum :
bool { value = useOptimizedKernels &&
560 simdEnabled && VT::simdEnabled &&
569 template<
typename VT >
571 struct VectorizedSubAssign {
572 enum :
bool { value = useOptimizedKernels &&
573 simdEnabled && VT::simdEnabled &&
582 template<
typename VT >
584 struct VectorizedMultAssign {
585 enum :
bool { value = useOptimizedKernels &&
586 simdEnabled && VT::simdEnabled &&
595 template<
typename VT >
597 struct VectorizedDivAssign {
598 enum :
bool { value = useOptimizedKernels &&
599 simdEnabled && VT::simdEnabled &&
615 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
616 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
630 template<
typename VT >
633 template<
typename VT >
638 template<
typename VT >
641 template<
typename VT >
646 template<
typename VT >
649 template<
typename VT >
654 template<
typename VT >
657 template<
typename VT >
662 template<
typename VT >
665 template<
typename VT >
706 template<
typename Type
735 template<
typename Type
743 if( ptr ==
nullptr ) {
776 template<
typename Type
798 template<
typename Type
814 template<
typename Type
847 template<
typename Type
869 template<
typename Type
892 template<
typename Type
899 if( index >=
size_ ) {
902 return (*
this)[index];
917 template<
typename Type
924 if( index >=
size_ ) {
927 return (*
this)[index];
939 template<
typename Type
958 template<
typename Type
975 template<
typename Type
992 template<
typename Type
1009 template<
typename Type
1026 template<
typename Type
1043 template<
typename Type
1060 template<
typename Type
1086 template<
typename Type
1092 for(
size_t i=0UL; i<
size_; ++i )
1123 template<
typename Type
1129 if( list.size() >
size_ ) {
1133 std::fill( std::copy( list.begin(), list.end(),
v_ ),
v_+
size_, Type() );
1167 template<
typename Type
1171 template<
typename Other
1179 for(
size_t i=0UL; i<N; ++i )
1197 template<
typename Type
1220 template<
typename Type
1250 template<
typename Type
1254 template<
typename VT >
1286 template<
typename Type
1290 template<
typename VT >
1321 template<
typename Type
1325 template<
typename VT >
1356 template<
typename Type
1360 template<
typename VT >
1376 const MultType tmp( *
this * (~rhs) );
1400 template<
typename Type
1404 template<
typename VT >
1422 const DivType tmp( *
this / (~rhs) );
1445 template<
typename Type
1449 template<
typename VT >
1452 using blaze::assign;
1463 if(
size_ != 3UL || (~rhs).
size() != 3UL ) {
1467 const CrossType tmp( *
this % (~rhs) );
1468 assign( *
this, tmp );
1488 template<
typename Type
1507 template<
typename Type
1523 template<
typename Type
1542 template<
typename Type
1548 size_t nonzeros( 0 );
1550 for(
size_t i=0UL; i<
size_; ++i ) {
1565 template<
typename Type
1572 for(
size_t i=0UL; i<
size_; ++i )
1586 template<
typename Type
1604 template<
typename Type
1647 template<
typename Type
1651 template<
typename Other >
1654 for(
size_t i=0UL; i<
size_; ++i )
1691 template<
typename Type
1728 template<
typename Type
1759 template<
typename Type
1763 template<
typename Other >
1766 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1781 template<
typename Type
1785 template<
typename Other >
1788 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1802 template<
typename Type
1823 template<
typename Type
1829 return (
size() > SMP_DVECASSIGN_THRESHOLD );
1846 template<
typename Type
1854 return loada( index );
1856 return loadu( index );
1874 template<
typename Type
1908 template<
typename Type
1940 template<
typename Type
1967 template<
typename Type
2000 template<
typename Type
2032 template<
typename Type
2063 template<
typename Type
2067 template<
typename VT >
2073 const size_t ipos(
size_ &
size_t(-2) );
2076 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2077 v_[i ] = (~rhs)[i ];
2078 v_[i+1UL] = (~rhs)[i+1UL];
2080 if( ipos < (~rhs).size() )
2081 v_[ipos] = (~rhs)[ipos];
2097 template<
typename Type
2101 template<
typename VT >
2109 const size_t ipos(
size_ &
size_t(-SIMDSIZE) );
2112 if( AF && useStreaming &&
size_ > ( cacheSize/(
sizeof(Type) * 3UL ) ) && !(~rhs).
isAliased(
this ) )
2116 for( ; i<ipos; i+=SIMDSIZE ) {
2119 for( ; i<
size_; ++i ) {
2125 const size_t i4way(
size_ &
size_t(-SIMDSIZE*4) );
2132 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
2133 store( i , it.load() ); it += SIMDSIZE;
2134 store( i+SIMDSIZE , it.load() ); it += SIMDSIZE;
2135 store( i+SIMDSIZE*2UL, it.load() ); it += SIMDSIZE;
2136 store( i+SIMDSIZE*3UL, it.load() ); it += SIMDSIZE;
2138 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
2139 store( i, it.load() );
2141 for( ; i<
size_; ++i, ++it ) {
2160 template<
typename Type
2164 template<
typename VT >
2170 v_[element->index()] = element->value();
2186 template<
typename Type
2190 template<
typename VT >
2196 const size_t ipos(
size_ &
size_t(-2) );
2199 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2200 v_[i ] += (~rhs)[i ];
2201 v_[i+1UL] += (~rhs)[i+1UL];
2203 if( ipos < (~rhs).size() )
2204 v_[ipos] += (~rhs)[ipos];
2220 template<
typename Type
2224 template<
typename VT >
2232 const size_t ipos(
size_ &
size_t(-SIMDSIZE) );
2235 const size_t i4way(
size_ &
size_t(-SIMDSIZE*4) );
2242 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
2243 store( i ,
load(i ) + it.load() ); it += SIMDSIZE;
2244 store( i+SIMDSIZE ,
load(i+SIMDSIZE ) + it.load() ); it += SIMDSIZE;
2245 store( i+SIMDSIZE*2UL,
load(i+SIMDSIZE*2UL) + it.load() ); it += SIMDSIZE;
2246 store( i+SIMDSIZE*3UL,
load(i+SIMDSIZE*3UL) + it.load() ); it += SIMDSIZE;
2248 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
2251 for( ; i<
size_; ++i, ++it ) {
2269 template<
typename Type
2273 template<
typename VT >
2279 v_[element->index()] += element->value();
2295 template<
typename Type
2299 template<
typename VT >
2305 const size_t ipos(
size_ &
size_t(-2) );
2308 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2309 v_[i ] -= (~rhs)[i ];
2310 v_[i+1UL] -= (~rhs)[i+1UL];
2312 if( ipos < (~rhs).size() )
2313 v_[ipos] -= (~rhs)[ipos];
2329 template<
typename Type
2333 template<
typename VT >
2341 const size_t ipos(
size_ &
size_t(-SIMDSIZE) );
2344 const size_t i4way(
size_ &
size_t(-SIMDSIZE*4) );
2351 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
2352 store( i ,
load(i ) - it.load() ); it += SIMDSIZE;
2353 store( i+SIMDSIZE ,
load(i+SIMDSIZE ) - it.load() ); it += SIMDSIZE;
2354 store( i+SIMDSIZE*2UL,
load(i+SIMDSIZE*2UL) - it.load() ); it += SIMDSIZE;
2355 store( i+SIMDSIZE*3UL,
load(i+SIMDSIZE*3UL) - it.load() ); it += SIMDSIZE;
2357 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
2360 for( ; i<
size_; ++i, ++it ) {
2378 template<
typename Type
2382 template<
typename VT >
2388 v_[element->index()] -= element->value();
2404 template<
typename Type
2408 template<
typename VT >
2414 const size_t ipos(
size_ &
size_t(-2) );
2417 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2418 v_[i ] *= (~rhs)[i ];
2419 v_[i+1UL] *= (~rhs)[i+1UL];
2421 if( ipos < (~rhs).size() )
2422 v_[ipos] *= (~rhs)[ipos];
2438 template<
typename Type
2442 template<
typename VT >
2450 const size_t ipos(
size_ &
size_t(-SIMDSIZE) );
2453 const size_t i4way(
size_ &
size_t(-SIMDSIZE*4) );
2460 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
2461 store( i ,
load(i ) * it.load() ); it += SIMDSIZE;
2462 store( i+SIMDSIZE ,
load(i+SIMDSIZE ) * it.load() ); it += SIMDSIZE;
2463 store( i+SIMDSIZE*2UL,
load(i+SIMDSIZE*2UL) * it.load() ); it += SIMDSIZE;
2464 store( i+SIMDSIZE*3UL,
load(i+SIMDSIZE*3UL) * it.load() ); it += SIMDSIZE;
2466 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
2469 for( ; i<
size_; ++i, ++it ) {
2487 template<
typename Type
2491 template<
typename VT >
2501 v_[element->index()] = tmp[element->index()] * element->value();
2517 template<
typename Type
2521 template<
typename VT >
2527 const size_t ipos(
size_ &
size_t(-2) );
2530 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2531 v_[i ] /= (~rhs)[i ];
2532 v_[i+1UL] /= (~rhs)[i+1UL];
2534 if( ipos < (~rhs).size() )
2535 v_[ipos] /= (~rhs)[ipos];
2551 template<
typename Type
2555 template<
typename VT >
2563 const size_t ipos(
size_ &
size_t(-SIMDSIZE) );
2566 const size_t i4way(
size_ &
size_t(-SIMDSIZE*4) );
2573 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
2574 store( i ,
load(i ) / it.load() ); it += SIMDSIZE;
2575 store( i+SIMDSIZE ,
load(i+SIMDSIZE ) / it.load() ); it += SIMDSIZE;
2576 store( i+SIMDSIZE*2UL,
load(i+SIMDSIZE*2UL) / it.load() ); it += SIMDSIZE;
2577 store( i+SIMDSIZE*3UL,
load(i+SIMDSIZE*3UL) / it.load() ); it += SIMDSIZE;
2579 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
2582 for( ; i<
size_; ++i, ++it ) {
2609 template<
typename Type
2613 :
public DenseVector< CustomVector<Type,AF,padded,TF>, TF >
2643 template<
typename NewType >
2652 template<
size_t NewN >
2677 explicit inline CustomVector( Type* ptr,
size_t n,
size_t nn );
2712 template<
typename Other,
size_t N >
2730 inline size_t size()
const noexcept;
2731 inline size_t spacing()
const noexcept;
2732 inline size_t capacity()
const noexcept;
2734 inline void reset();
2735 inline void clear();
2743 template<
typename Other >
inline CustomVector& scale(
const Other& scalar );
2750 inline void reset( Type* ptr,
size_t n,
size_t nn );
2757 template<
typename VT >
2758 struct VectorizedAssign {
2759 enum :
bool { value = useOptimizedKernels &&
2760 simdEnabled && VT::simdEnabled &&
2767 template<
typename VT >
2768 struct VectorizedAddAssign {
2769 enum :
bool { value = useOptimizedKernels &&
2770 simdEnabled && VT::simdEnabled &&
2778 template<
typename VT >
2779 struct VectorizedSubAssign {
2780 enum :
bool { value = useOptimizedKernels &&
2781 simdEnabled && VT::simdEnabled &&
2789 template<
typename VT >
2790 struct VectorizedMultAssign {
2791 enum :
bool { value = useOptimizedKernels &&
2792 simdEnabled && VT::simdEnabled &&
2800 template<
typename VT >
2801 struct VectorizedDivAssign {
2802 enum :
bool { value = useOptimizedKernels &&
2803 simdEnabled && VT::simdEnabled &&
2818 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
2819 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
2821 inline bool isAligned ()
const noexcept;
2833 template<
typename VT >
2836 template<
typename VT >
2841 template<
typename VT >
2844 template<
typename VT >
2849 template<
typename VT >
2852 template<
typename VT >
2857 template<
typename VT >
2860 template<
typename VT >
2865 template<
typename VT >
2868 template<
typename VT >
2910 template<
typename Type
2944 template<
typename Type
2952 if( ptr ==
nullptr ) {
2981 template<
typename Type
2999 template<
typename Type
3035 template<
typename Type
3058 template<
typename Type
3082 template<
typename Type
3088 if( index >=
size_ ) {
3091 return (*
this)[index];
3108 template<
typename Type
3114 if( index >=
size_ ) {
3117 return (*
this)[index];
3131 template<
typename Type
3151 template<
typename Type
3169 template<
typename Type
3187 template<
typename Type
3205 template<
typename Type
3223 template<
typename Type
3241 template<
typename Type
3259 template<
typename Type
3286 template<
typename Type
3292 for(
size_t i=0UL; i<
size_; ++i )
3325 template<
typename Type
3331 if( list.size() >
size_ ) {
3335 std::fill( std::copy( list.begin(), list.end(),
v_ ),
v_+
capacity_, Type() );
3371 template<
typename Type
3374 template<
typename Other
3383 for(
size_t i=0UL; i<N; ++i )
3403 template<
typename Type
3428 template<
typename Type
3439 rhs.capacity_ = 0UL;
3461 template<
typename Type
3464 template<
typename VT >
3499 template<
typename Type
3502 template<
typename VT >
3536 template<
typename Type
3539 template<
typename VT >
3573 template<
typename Type
3576 template<
typename VT >
3593 const MultType tmp( *
this * (~rhs) );
3619 template<
typename Type
3622 template<
typename VT >
3640 const DivType tmp( *
this / (~rhs) );
3665 template<
typename Type
3668 template<
typename VT >
3672 using blaze::assign;
3683 if(
size_ != 3UL || (~rhs).
size() != 3UL ) {
3687 const CrossType tmp( *
this % (~rhs) );
3688 assign( *
this, tmp );
3710 template<
typename Type
3730 template<
typename Type
3747 template<
typename Type
3767 template<
typename Type
3772 size_t nonzeros( 0 );
3774 for(
size_t i=0UL; i<
size_; ++i ) {
3791 template<
typename Type
3797 for(
size_t i=0UL; i<
size_; ++i )
3813 template<
typename Type
3833 template<
typename Type
3878 template<
typename Type
3881 template<
typename Other >
3885 for(
size_t i=0UL; i<
size_; ++i )
3924 template<
typename Type
3955 template<
typename Type
3958 template<
typename Other >
3961 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
3978 template<
typename Type
3981 template<
typename Other >
3984 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
4000 template<
typename Type
4022 template<
typename Type
4027 return (
size() > SMP_DVECASSIGN_THRESHOLD );
4046 template<
typename Type
4053 return loada( index );
4055 return loadu( index );
4075 template<
typename Type
4110 template<
typename Type
4143 template<
typename Type
4172 template<
typename Type
4207 template<
typename Type
4241 template<
typename Type
4273 template<
typename Type
4276 template<
typename VT >
4282 const size_t ipos(
size_ &
size_t(-2) );
4285 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4286 v_[i ] = (~rhs)[i ];
4287 v_[i+1UL] = (~rhs)[i+1UL];
4289 if( ipos < (~rhs).size() )
4290 v_[ipos] = (~rhs)[ipos];
4308 template<
typename Type
4311 template<
typename VT >
4321 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
4324 if( AF && useStreaming &&
size_ > ( cacheSize/(
sizeof(Type) * 3UL ) ) && !(~rhs).
isAliased(
this ) )
4328 for( ; i<ipos; i+=SIMDSIZE ) {
4331 for( ; remainder && i<
size_; ++i ) {
4337 const size_t i4way(
size_ &
size_t(-SIMDSIZE*4) );
4344 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
4345 store( i , it.load() ); it += SIMDSIZE;
4346 store( i+SIMDSIZE , it.load() ); it += SIMDSIZE;
4347 store( i+SIMDSIZE*2UL, it.load() ); it += SIMDSIZE;
4348 store( i+SIMDSIZE*3UL, it.load() ); it += SIMDSIZE;
4350 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
4351 store( i, it.load() );
4353 for( ; remainder && i<
size_; ++i, ++it ) {
4374 template<
typename Type
4377 template<
typename VT >
4383 v_[element->index()] = element->value();
4401 template<
typename Type
4404 template<
typename VT >
4410 const size_t ipos(
size_ &
size_t(-2) );
4413 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4414 v_[i ] += (~rhs)[i ];
4415 v_[i+1UL] += (~rhs)[i+1UL];
4417 if( ipos < (~rhs).size() )
4418 v_[ipos] += (~rhs)[ipos];
4436 template<
typename Type
4439 template<
typename VT >
4449 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
4452 const size_t i4way(
size_ &
size_t(-SIMDSIZE*4) );
4459 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
4460 store( i ,
load(i ) + it.load() ); it += SIMDSIZE;
4461 store( i+SIMDSIZE ,
load(i+SIMDSIZE ) + it.load() ); it += SIMDSIZE;
4462 store( i+SIMDSIZE*2UL,
load(i+SIMDSIZE*2UL) + it.load() ); it += SIMDSIZE;
4463 store( i+SIMDSIZE*3UL,
load(i+SIMDSIZE*3UL) + it.load() ); it += SIMDSIZE;
4465 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
4468 for( ; remainder && i<
size_; ++i, ++it ) {
4488 template<
typename Type
4491 template<
typename VT >
4497 v_[element->index()] += element->value();
4515 template<
typename Type
4518 template<
typename VT >
4524 const size_t ipos(
size_ &
size_t(-2) );
4527 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4528 v_[i ] -= (~rhs)[i ];
4529 v_[i+1UL] -= (~rhs)[i+1UL];
4531 if( ipos < (~rhs).size() )
4532 v_[ipos] -= (~rhs)[ipos];
4550 template<
typename Type
4553 template<
typename VT >
4563 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
4566 const size_t i4way(
size_ &
size_t(-SIMDSIZE*4) );
4573 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
4574 store( i ,
load(i ) - it.load() ); it += SIMDSIZE;
4575 store( i+SIMDSIZE ,
load(i+SIMDSIZE ) - it.load() ); it += SIMDSIZE;
4576 store( i+SIMDSIZE*2UL,
load(i+SIMDSIZE*2UL) - it.load() ); it += SIMDSIZE;
4577 store( i+SIMDSIZE*3UL,
load(i+SIMDSIZE*3UL) - it.load() ); it += SIMDSIZE;
4579 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
4582 for( ; remainder && i<
size_; ++i, ++it ) {
4602 template<
typename Type
4605 template<
typename VT >
4611 v_[element->index()] -= element->value();
4629 template<
typename Type
4632 template<
typename VT >
4638 const size_t ipos(
size_ &
size_t(-2) );
4641 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4642 v_[i ] *= (~rhs)[i ];
4643 v_[i+1UL] *= (~rhs)[i+1UL];
4645 if( ipos < (~rhs).size() )
4646 v_[ipos] *= (~rhs)[ipos];
4664 template<
typename Type
4667 template<
typename VT >
4677 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
4680 const size_t i4way(
size_ &
size_t(-SIMDSIZE*4) );
4687 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
4688 store( i ,
load(i ) * it.load() ); it += SIMDSIZE;
4689 store( i+SIMDSIZE ,
load(i+SIMDSIZE ) * it.load() ); it += SIMDSIZE;
4690 store( i+SIMDSIZE*2UL,
load(i+SIMDSIZE*2UL) * it.load() ); it += SIMDSIZE;
4691 store( i+SIMDSIZE*3UL,
load(i+SIMDSIZE*3UL) * it.load() ); it += SIMDSIZE;
4693 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
4696 for( ; remainder && i<
size_; ++i, ++it ) {
4716 template<
typename Type
4719 template<
typename VT >
4729 v_[element->index()] = tmp[element->index()] * element->value();
4747 template<
typename Type
4750 template<
typename VT >
4756 const size_t ipos(
size_ &
size_t(-2) );
4759 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4760 v_[i ] /= (~rhs)[i ];
4761 v_[i+1UL] /= (~rhs)[i+1UL];
4763 if( ipos < (~rhs).size() )
4764 v_[ipos] /= (~rhs)[ipos];
4782 template<
typename Type
4785 template<
typename VT >
4793 const size_t ipos(
size_ &
size_t(-SIMDSIZE) );
4796 const size_t i4way(
size_ &
size_t(-SIMDSIZE*4) );
4803 for( ; i<i4way; i+=SIMDSIZE*4UL ) {
4804 store( i ,
load(i ) / it.load() ); it += SIMDSIZE;
4805 store( i+SIMDSIZE ,
load(i+SIMDSIZE ) / it.load() ); it += SIMDSIZE;
4806 store( i+SIMDSIZE*2UL,
load(i+SIMDSIZE*2UL) / it.load() ); it += SIMDSIZE;
4807 store( i+SIMDSIZE*3UL,
load(i+SIMDSIZE*3UL) / it.load() ); it += SIMDSIZE;
4809 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
4812 for( ; i<
size_; ++i, ++it ) {
4835 template<
typename Type,
bool AF,
bool PF,
bool TF >
4838 template<
typename Type,
bool AF,
bool PF,
bool TF >
4841 template<
bool RF,
typename Type,
bool AF,
bool PF,
bool TF >
4844 template<
typename Type,
bool AF,
bool PF,
bool TF >
4847 template<
typename Type,
bool AF,
bool PF,
bool TF >
4860 template<
typename Type
4878 template<
typename Type
4924 return ( v.
size() == 0UL );
4950 template<
typename Type
4969 template<
typename Type
4990 template<
typename T,
bool AF,
bool PF,
bool TF >
5008 template<
typename T,
bool AF,
bool PF,
bool TF >
5026 template<
typename T,
bool AF,
bool PF,
bool TF >
5027 struct IsCustom< CustomVector<T,AF,PF,TF> >
5044 template<
typename T,
bool PF,
bool TF >
5045 struct IsAligned< CustomVector<T,aligned,PF,TF> >
5062 template<
typename T,
bool PF,
bool TF >
5080 template<
typename T,
bool AF,
bool TF >
5081 struct IsPadded< CustomVector<T,AF,padded,TF> >
5098 template<
typename T,
bool AF,
bool PF,
bool TF,
typename OP >
5117 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2,
size_t N,
typename OP >
5118 struct BinaryMapTrait< CustomVector<T1,AF,PF,TF>, StaticVector<T2,N,TF>, OP >
5123 template<
typename T1,
size_t N,
bool TF,
typename T2,
bool AF,
bool PF,
typename OP >
5124 struct BinaryMapTrait< StaticVector<T1,N,TF>, CustomVector<T2,AF,PF,TF>, OP >
5129 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2,
size_t N,
typename OP >
5130 struct BinaryMapTrait< CustomVector<T1,AF,PF,TF>, HybridVector<T2,N,TF>, OP >
5135 template<
typename T1,
size_t N,
bool TF,
typename T2,
bool AF,
bool PF,
typename OP >
5136 struct BinaryMapTrait< HybridVector<T1,N,TF>, CustomVector<T2,AF,PF,TF>, OP >
5141 template<
typename T1,
bool AF,
bool PF,
bool TF,
typename T2,
typename OP >
5142 struct BinaryMapTrait< CustomVector<T1,AF,PF,TF>, DynamicVector<T2,TF>, OP >
5147 template<
typename T1,
bool TF,
typename T2,
bool AF,
bool PF,
typename OP >
5148 struct BinaryMapTrait< DynamicVector<T1,TF>, CustomVector<T2,AF,PF,TF>, OP >
5153 template<
typename T1,
bool AF1,
bool PF1,
bool TF,
typename T2,
bool AF2,
bool PF2,
typename OP >
5154 struct BinaryMapTrait< CustomVector<T1,AF1,PF1,TF>, CustomVector<T2,AF2,PF2,TF>, OP >
5172 template<
typename T,
bool AF,
bool PF,
bool TF,
size_t I,
size_t N >
5178 template<
typename T,
bool AF,
bool PF,
bool TF >
5197 template<
typename T,
bool AF,
bool PF,
bool TF,
size_t... CEAs >
5203 template<
typename T,
bool AF,
bool PF,
bool TF >
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:135
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.
Availability of a SIMD subtraction for the given data types.Depending on the available instruction se...
Definition: HasSIMDSub.h:171
Header file for mathematical functions.
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
#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
const Type & ConstReference
Reference to a constant vector value.
Definition: CustomVector.h:417
Header file for the alignment flag values.
Header file for the UNUSED_PARAMETER function template.
CustomVector()
The default constructor for CustomVector.
Definition: CustomVector.h:710
Iterator begin() noexcept
Returns an iterator to the first element of the custom vector.
Definition: CustomVector.h:980
Header file for basic type definitions.
Header file for the SparseVector base class.
size_t size_
The size/dimension of the custom vector.
Definition: CustomVector.h:674
Type * v_
The custom array of elements.
Definition: CustomVector.h:675
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:164
Header file for the serial shim.
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
BLAZE_ALWAYS_INLINE SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: CustomVector.h:1851
Iterator end() noexcept
Returns an iterator just past the last element of the custom vector.
Definition: CustomVector.h:1031
void swap(CustomVector &v) noexcept
Swapping the contents of two vectors.
Definition: CustomVector.h:1608
CustomVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: CustomVector.h:1090
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:172
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:316
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:224
Header file for the IsIntegral type trait.
Header file for the DenseVector base class.
Availability of a SIMD addition for the given data types.Depending on the available instruction set (...
Definition: HasSIMDAdd.h:171
#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
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:291
Efficient implementation of an arbitrary sized vector.The DynamicVector class template is the represe...
Definition: DynamicVector.h:185
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
Compile time check for data types.This type trait tests whether or not the given types can be combine...
Definition: IsSIMDCombinable.h:120
SIMDTrait_< ElementType > SIMDType
SIMD type of the vector elements.
Definition: CustomVector.h:412
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:2004
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
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:133
Header file for the implementation of an arbitrarily sized vector.
Header file for the elements trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CustomVector.h:413
Constraint on the data type.
Efficient implementation of a fixed-sized vector.The StaticVector class template is the representatio...
Definition: Forward.h:61
size_t capacity_
The current capacity of the pointer array.
Definition: CompressedMatrix.h:3290
Base template for the SubvectorTrait class.
Definition: SubvectorTrait.h:109
Efficient implementation of a dynamically sized vector with static memory.The HybridVector class temp...
Definition: Forward.h:59
Compile time check for low-level access to mutable data.This type trait tests whether the given data ...
Definition: HasMutableDataAccess.h:75
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
Compile time check for the memory layout of data types.This type trait tests whether the given data t...
Definition: IsContiguous.h:86
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: CustomVector.h:1913
Header file for the DisableIf class template.
size_t size() const noexcept
Returns the size/dimension of the vector.
Definition: CustomVector.h:1492
Header file for the IsCustom type trait.
Header file for the multiplication trait.
Header file for the unary map trait.
Header file for the clear shim.
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
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:5908
Header file for all forward declarations of the math module.
#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.
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
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:102
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:2036
#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:1590
DenseIterator< const Type, AF > ConstIterator
Iterator over constant elements.
Definition: CustomVector.h:422
Header file for the subvector trait.
const Type * ConstPointer
Pointer to a constant vector value.
Definition: CustomVector.h:419
Header file for all SIMD functionality.
Constraint on the data type.
Availability of a SIMD division for the given data types.Depending on the available instruction set (...
Definition: HasSIMDDiv.h:150
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
Compile time check for sparse vector types.This type trait tests whether or not the given template pa...
Definition: IsSparseVector.h:103
Header file for the IsAligned type trait.
Constraint on the data type.
Efficient implementation of a customizable vector.
Definition: CustomVector.h:397
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
Compile time check for custom data types.This type trait tests whether the given data type is a custo...
Definition: IsCustom.h:87
void reset()
Reset to the default initial values.
Definition: CustomVector.h:1569
ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the custom vector.
Definition: CustomVector.h:1014
#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
Type & Reference
Reference to a non-constant vector value.
Definition: CustomVector.h:416
Constraint on the data type.
BLAZE_ALWAYS_INLINE void storea(size_t index, const SIMDType &value) noexcept
Aligned store of a SIMD element of the vector.
Definition: CustomVector.h:1971
Header file for the exception macros of the math module.
ConstIterator cend() const noexcept
Returns an iterator just past the last element of the custom vector.
Definition: CustomVector.h:1065
Compile time check for data types.This type trait tests whether or not the given template parameter i...
Definition: IsSMPAssignable.h:123
Base template for the ElementsTrait class.
Definition: ElementsTrait.h:108
typename CrossTrait< T1, T2 >::Type CrossTrait_
Auxiliary alias declaration for the CrossTrait class template.The CrossTrait_ alias declaration provi...
Definition: CrossTrait.h:209
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:608
Header file for the IsPadded type trait.
typename DivTrait< T1, T2 >::Type DivTrait_
Auxiliary alias declaration for the DivTrait class template.The DivTrait_ alias declaration provides ...
Definition: DivTrait.h:292
Header file for the IsVectorizable type trait.
Resize mechanism to obtain a CustomVector with a different fixed number of elements.
Definition: CustomVector.h:438
bool canSMPAssign() const noexcept
Returns whether the vector can be used in SMP assignments.
Definition: CustomVector.h:1827
Header file for the HasConstDataAccess type trait.
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 RemoveConst type trait.
Header file for the IsSIMDCombinable type trait.
Header file for the IsSparseVector type trait.
size_t capacity() const noexcept
Returns the maximum capacity of the vector.
Definition: CustomVector.h:1527
Header file for the HasSIMDMult type trait.
Header file for the binary map trait.
Rebind mechanism to obtain a CustomVector with different data/element type.
Definition: CustomVector.h:429
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:1357
Header file for run time assertion macros.
Pointer data() noexcept
Low-level data access to the vector elements.
Definition: CustomVector.h:944
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: CustomVector.h:1786
Header file for the cross product trait.
Header file for the division trait.
Header file for the IsContiguous type trait.
size_t spacing() const noexcept
Returns the minimum capacity of the vector.
Definition: CustomVector.h:1511
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
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
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
Reference at(size_t index)
Checked access to the vector elements.
Definition: CustomVector.h:897
Header file for the isDefault shim.
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: CustomVector.h:1944
Constraint on the data type.
Header file for the HasSIMDSub type trait.
bool isAligned() const noexcept
Returns whether the vector is properly aligned in memory.
Definition: CustomVector.h:1806
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
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
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: CustomVector.h:1764
Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: CustomVector.h:852
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
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
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: CustomVector.h:1879
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
#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
Type * Pointer
Pointer to a non-constant vector value.
Definition: CustomVector.h:418
EnableIf_< IsNumeric< ST >, MT &> operator/=(DenseMatrix< MT, SO > &mat, ST scalar)
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:655
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:177
Header file for the default transpose flag for all vectors 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:130
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
Type ElementType
Type of the vector elements.
Definition: CustomVector.h:411
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
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:1375
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
EnableIf_< IsNumeric< ST >, MT &> operator*=(DenseMatrix< MT, SO > &mat, ST scalar)
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:593
DenseIterator< Type, AF > Iterator
Iterator over non-constant elements.
Definition: CustomVector.h:421
Base template for the BinaryMapTrait class.
Definition: BinaryMapTrait.h:97
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:95
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
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: CustomVector.h:1546
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the TrueType type/value trait base class.