35 #ifndef _BLAZE_MATH_DENSE_STATICVECTOR_H_ 36 #define _BLAZE_MATH_DENSE_STATICVECTOR_H_ 197 template<
typename Type
199 ,
bool TF = defaultTransposeFlag >
201 :
public DenseVector< StaticVector<Type,N,TF>, TF >
238 template<
typename NewType >
247 template<
size_t NewN >
275 template<
typename Other >
276 explicit inline StaticVector(
size_t n,
const Other* array );
278 template<
typename Other,
size_t Dim >
279 explicit inline StaticVector(
const Other (&array)[Dim] );
283 template<
typename Other >
286 template<
typename VT >
319 inline constexpr
StaticVector& operator=( const Type& rhs );
322 template< typename Other,
size_t Dim >
323 inline
StaticVector& operator=( const Other (&array)[Dim] );
327 template< typename Other >
342 static inline constexpr
size_t size() noexcept;
343 static inline constexpr
size_t spacing() noexcept;
344 static inline constexpr
size_t capacity() noexcept;
346 inline constexpr
void reset();
354 template< typename Other > inline
StaticVector& scale( const Other& scalar );
361 static inline
void* operator new ( std::
size_t size );
362 static inline
void* operator new[]( std::
size_t size );
363 static inline
void* operator new ( std::
size_t size, const std::nothrow_t& );
364 static inline
void* operator new[]( std::
size_t size, const std::nothrow_t& );
366 static inline
void operator delete (
void* ptr );
367 static inline
void operator delete[](
void* ptr );
368 static inline
void operator delete (
void* ptr, const std::nothrow_t& );
369 static inline
void operator delete[](
void* ptr, const std::nothrow_t& );
376 template< typename VT >
378 static constexpr
bool VectorizedAssign_v =
379 ( useOptimizedKernels &&
387 template< typename VT >
389 static constexpr
bool VectorizedAddAssign_v =
390 ( useOptimizedKernels &&
399 template< typename VT >
401 static constexpr
bool VectorizedSubAssign_v =
402 ( useOptimizedKernels &&
411 template< typename VT >
413 static constexpr
bool VectorizedMultAssign_v =
414 ( useOptimizedKernels &&
423 template< typename VT >
425 static constexpr
bool VectorizedDivAssign_v =
426 ( useOptimizedKernels &&
437 inline constexpr
bool isIntact() const noexcept;
444 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
445 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
447 static inline constexpr
bool isAligned() noexcept;
458 template< typename VT >
461 template< typename VT >
466 template< typename VT >
469 template< typename VT >
474 template< typename VT >
477 template< typename VT >
482 template< typename VT >
485 template< typename VT >
490 template< typename VT >
493 template< typename VT >
555 template< typename Type
563 if( IsNumeric_v<Type> ) {
564 if( useDefaultInitialization ) {
565 for(
size_t i=0UL; i<
NN; ++i )
568 else if( usePadding ) {
569 for(
size_t i=N; i<
NN; ++i )
584 template<
typename Type
592 for(
size_t i=0UL; i<N; ++i )
595 for(
size_t i=N; i<
NN; ++i )
620 template<
typename Type
628 if( list.size() > N ) {
634 for(
const auto& element : list ) {
666 template<
typename Type
669 template<
typename Other >
679 for(
size_t i=0UL; i<n; ++i )
682 if( IsNumeric_v<Type> ) {
683 for(
size_t i=n; i<
NN; ++i )
708 template<
typename Type
711 template<
typename Other
719 for(
size_t i=0UL; i<N; ++i )
722 for(
size_t i=N; i<
NN; ++i )
737 template<
typename Type
755 template<
typename Type
758 template<
typename Other >
764 for(
size_t i=0UL; i<N; ++i )
767 for(
size_t i=N; i<
NN; ++i )
785 template<
typename Type
788 template<
typename VT >
796 if( (~v).
size() != N ) {
800 for(
size_t i=( IsSparseVector_v<VT> ? 0UL : N ); i<
NN; ++i ) {
828 template<
typename Type
849 template<
typename Type
871 template<
typename Type
880 return (*
this)[index];
895 template<
typename Type
904 return (*
this)[index];
916 template<
typename Type
934 template<
typename Type
950 template<
typename Type
966 template<
typename Type
982 template<
typename Type
998 template<
typename Type
1014 template<
typename Type
1030 template<
typename Type
1055 template<
typename Type
1061 for(
size_t i=0UL; i<N; ++i )
1086 template<
typename Type
1092 if( list.size() > N ) {
1098 for(
const auto& element : list ) {
1129 template<
typename Type
1132 template<
typename Other
1138 for(
size_t i=0UL; i<N; ++i )
1153 template<
typename Type
1173 template<
typename Type
1176 template<
typename Other >
1179 using blaze::assign;
1181 assign( *
this, ~rhs );
1200 template<
typename Type
1203 template<
typename VT >
1206 using blaze::assign;
1208 if( (~rhs).
size() != N ) {
1212 if( (~rhs).canAlias(
this ) ) {
1217 if( IsSparseVector_v<VT> )
1219 assign( *
this, ~rhs );
1239 template<
typename Type
1242 template<
typename VT >
1245 using blaze::addAssign;
1247 if( (~rhs).
size() != N ) {
1251 if( (~rhs).canAlias(
this ) ) {
1253 addAssign( *
this, tmp );
1256 addAssign( *
this, ~rhs );
1276 template<
typename Type
1279 template<
typename VT >
1282 using blaze::subAssign;
1284 if( (~rhs).
size() != N ) {
1288 if( (~rhs).canAlias(
this ) ) {
1290 subAssign( *
this, tmp );
1293 subAssign( *
this, ~rhs );
1314 template<
typename Type
1317 template<
typename VT >
1320 using blaze::assign;
1321 using blaze::multAssign;
1323 if( (~rhs).
size() != N ) {
1327 if( IsSparseVector_v<VT> || (~rhs).canAlias(
this ) ) {
1329 assign( *
this, tmp );
1332 multAssign( *
this, ~rhs );
1352 template<
typename Type
1355 template<
typename VT >
1358 using blaze::assign;
1359 using blaze::divAssign;
1361 if( (~rhs).
size() != N ) {
1365 if( (~rhs).canAlias(
this ) ) {
1367 assign( *
this, tmp );
1370 divAssign( *
this, ~rhs );
1391 template<
typename Type
1394 template<
typename VT >
1397 using blaze::assign;
1408 if( N != 3UL || (~rhs).
size() != 3UL ) {
1412 const CrossType tmp( *
this % (~rhs) );
1413 assign( *
this, tmp );
1435 template<
typename Type
1453 template<
typename Type
1468 template<
typename Type
1486 template<
typename Type
1491 size_t nonzeros( 0 );
1493 for(
size_t i=0UL; i<N; ++i ) {
1508 template<
typename Type
1514 for(
size_t i=0UL; i<N; ++i )
1526 template<
typename Type
1533 for(
size_t i=0UL; i<N; ++i )
1534 swap( v_[i], v.v_[i] );
1564 template<
typename Type
1567 template<
typename Other >
1570 for(
size_t i=0; i<N; ++i )
1595 template<
typename Type
1604 return allocate<StaticVector>( 1UL );
1619 template<
typename Type
1642 template<
typename Type
1651 return allocate<StaticVector>( 1UL );
1666 template<
typename Type
1685 template<
typename Type
1690 deallocate( static_cast<StaticVector*>( ptr ) );
1701 template<
typename Type
1706 deallocate( static_cast<StaticVector*>( ptr ) );
1717 template<
typename Type
1722 deallocate( static_cast<StaticVector*>( ptr ) );
1733 template<
typename Type
1738 deallocate( static_cast<StaticVector*>( ptr ) );
1760 template<
typename Type
1765 if( IsNumeric_v<Type> ) {
1766 for(
size_t i=N; i<NN; ++i ) {
1767 if( v_[i] != Type() )
1795 template<
typename Type
1798 template<
typename Other >
1801 return static_cast<const void*>(
this ) == static_cast<const void*>( alias );
1816 template<
typename Type
1819 template<
typename Other >
1822 return static_cast<const void*>(
this ) == static_cast<const void*>( alias );
1836 template<
typename Type
1858 template<
typename Type
1864 return loada( index );
1882 template<
typename Type
1897 return loada( &v_[index] );
1915 template<
typename Type
1928 return loadu( &v_[index] );
1946 template<
typename Type
1970 template<
typename Type
1985 storea( &v_[index], value );
2003 template<
typename Type
2016 storeu( &v_[index], value );
2035 template<
typename Type
2050 stream( &v_[index], value );
2066 template<
typename Type
2069 template<
typename VT >
2075 for(
size_t i=0UL; i<N; ++i )
2092 template<
typename Type
2095 template<
typename VT >
2103 constexpr
bool remainder( !usePadding || !IsPadded_v<VT> );
2105 constexpr
size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2106 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2110 for( ; i<ipos; i+=SIMDSIZE ) {
2111 store( i, (~rhs).load(i) );
2113 for( ; remainder && i<N; ++i ) {
2131 template<
typename Type
2134 template<
typename VT >
2139 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2140 v_[element->index()] = element->value();
2156 template<
typename Type
2159 template<
typename VT >
2165 for(
size_t i=0UL; i<N; ++i )
2182 template<
typename Type
2185 template<
typename VT >
2193 constexpr
bool remainder( !usePadding || !IsPadded_v<VT> );
2195 constexpr
size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2196 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2200 for( ; i<ipos; i+=SIMDSIZE ) {
2201 store( i, load(i) + (~rhs).load(i) );
2203 for( ; remainder && i<N; ++i ) {
2221 template<
typename Type
2224 template<
typename VT >
2229 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2230 v_[element->index()] += element->value();
2246 template<
typename Type
2249 template<
typename VT >
2255 for(
size_t i=0UL; i<N; ++i )
2272 template<
typename Type
2275 template<
typename VT >
2283 constexpr
bool remainder( !usePadding || !IsPadded_v<VT> );
2285 constexpr
size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2286 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2290 for( ; i<ipos; i+=SIMDSIZE ) {
2291 store( i, load(i) - (~rhs).load(i) );
2293 for( ; remainder && i<N; ++i ) {
2311 template<
typename Type
2314 template<
typename VT >
2319 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2320 v_[element->index()] -= element->value();
2336 template<
typename Type
2339 template<
typename VT >
2345 for(
size_t i=0UL; i<N; ++i )
2362 template<
typename Type
2365 template<
typename VT >
2373 constexpr
bool remainder( !usePadding || !IsPadded_v<VT> );
2375 constexpr
size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2376 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2380 for( ; i<ipos; i+=SIMDSIZE ) {
2381 store( i, load(i) * (~rhs).load(i) );
2383 for( ; remainder && i<N; ++i ) {
2401 template<
typename Type
2404 template<
typename VT >
2413 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2414 v_[element->index()] = tmp[element->index()] * element->value();
2430 template<
typename Type
2433 template<
typename VT >
2439 for(
size_t i=0UL; i<N; ++i )
2456 template<
typename Type
2459 template<
typename VT >
2467 constexpr
size_t ipos( N &
size_t(-SIMDSIZE) );
2472 for( ; i<ipos; i+=SIMDSIZE ) {
2473 store( i, load(i) / (~rhs).load(i) );
2497 template<
typename Type,
size_t N,
bool TF >
2498 constexpr
void reset( StaticVector<Type,N,TF>& v );
2500 template<
typename Type,
size_t N,
bool TF >
2501 constexpr
void clear( StaticVector<Type,N,TF>& v );
2503 template<
bool RF,
typename Type,
size_t N,
bool TF >
2504 bool isDefault(
const StaticVector<Type,N,TF>& v );
2506 template<
typename Type,
size_t N,
bool TF >
2507 constexpr
bool isIntact(
const StaticVector<Type,N,TF>& v ) noexcept;
2509 template<
typename Type,
bool TF >
2510 const StaticVector<Type,2UL,TF>
perp(
const StaticVector<Type,2UL,TF>& v );
2512 template<
typename Type,
bool TF >
2513 const StaticVector<Type,3UL,TF>
perp(
const StaticVector<Type,3UL,TF>& v );
2515 template<
typename Type,
size_t N,
bool TF >
2516 void swap( StaticVector<Type,N,TF>& a, StaticVector<Type,N,TF>& b ) noexcept;
2518 template<
size_t I,
typename Type,
size_t N,
bool TF >
2519 constexpr Type&
get( StaticVector<Type,N,TF>& v ) noexcept;
2521 template<
size_t I,
typename Type,
size_t N,
bool TF >
2522 constexpr Type&&
get( StaticVector<Type,N,TF>&& v ) noexcept;
2524 template<
size_t I,
typename Type,
size_t N,
bool TF >
2525 constexpr
const Type&
get(
const StaticVector<Type,N,TF>& v) noexcept;
2527 template<
size_t I,
typename Type,
size_t N,
bool TF >
2528 constexpr
const Type&&
get(
const StaticVector<Type,N,TF>&& v ) noexcept;
2540 template<
typename Type
2559 template<
typename Type
2600 for(
size_t i=0UL; i<N; ++i )
2601 if( !isDefault<RF>( v[i] ) )
return false;
2625 template<
typename Type
2630 return v.isIntact();
2646 template<
typename Type
2663 template<
typename Type
2667 if( v[0] != Type() || v[1] != Type() )
2683 template<
typename Type
2726 return std::move( v[I] );
2764 return std::move( v[I] );
2779 template<
typename T,
size_t N,
bool TF >
2780 struct Size< StaticVector<T,N,TF>, 0UL >
2797 template<
typename T,
size_t N,
bool TF >
2798 struct MaxSize< StaticVector<T,N,TF>, 0UL >
2815 template<
typename T,
size_t N,
bool TF >
2816 struct HasConstDataAccess< StaticVector<T,N,TF> >
2833 template<
typename T,
size_t N,
bool TF >
2834 struct HasMutableDataAccess< StaticVector<T,N,TF> >
2851 template<
typename T,
size_t N,
bool TF >
2852 struct IsStatic< StaticVector<T,N,TF> >
2869 template<
typename T,
size_t N,
bool TF >
2870 struct IsAligned< StaticVector<T,N,TF> >
2871 :
public BoolConstant< StaticVector<T,N,TF>::isAligned() >
2887 template<
typename T,
size_t N,
bool TF >
2888 struct IsContiguous< StaticVector<T,N,TF> >
2905 template<
typename T,
size_t N,
bool TF >
2906 struct IsPadded< StaticVector<T,N,TF> >
2923 template<
typename T1,
typename T2 >
2924 struct AddTraitEval2< T1, T2
2930 using ET1 = ElementType_t<T1>;
2931 using ET2 = ElementType_t<T2>;
2933 static constexpr
size_t N =
max( Size_v<T1,0UL>, Size_v<T2,0UL> );
2935 using Type = StaticVector< AddTrait_t<ET1,ET2>, N, TransposeFlag_v<T1> >;
2951 template<
typename T1,
typename T2 >
2952 struct SubTraitEval2< T1, T2
2958 using ET1 = ElementType_t<T1>;
2959 using ET2 = ElementType_t<T2>;
2961 static constexpr
size_t N =
max( Size_v<T1,0UL>, Size_v<T2,0UL> );
2963 using Type = StaticVector< SubTrait_t<ET1,ET2>, N, TransposeFlag_v<T1> >;
2979 template<
typename T1,
typename T2 >
2980 struct MultTraitEval2< T1, T2
2985 using ET1 = ElementType_t<T1>;
2987 static constexpr
size_t N = Size_v<T1,0UL>;
2989 using Type = StaticVector< MultTrait_t<ET1,T2>, N, TransposeFlag_v<T1> >;
2992 template<
typename T1,
typename T2 >
2993 struct MultTraitEval2< T1, T2
2998 using ET2 = ElementType_t<T2>;
3000 static constexpr
size_t N = Size_v<T2,0UL>;
3002 using Type = StaticVector< MultTrait_t<T1,ET2>, N, TransposeFlag_v<T2> >;
3005 template<
typename T1,
typename T2 >
3006 struct MultTraitEval2< T1, T2
3008 ( IsColumnVector_v<T1> && IsColumnVector_v<T2> ) ) &&
3009 IsDenseVector_v<T1> &&
3010 IsDenseVector_v<T2> &&
3013 using ET1 = ElementType_t<T1>;
3014 using ET2 = ElementType_t<T2>;
3016 static constexpr
size_t N =
max( Size_v<T1,0UL>, Size_v<T2,0UL> );
3018 using Type = StaticVector< MultTrait_t<ET1,ET2>, N, TransposeFlag_v<T1> >;
3021 template<
typename T1,
typename T2 >
3022 struct MultTraitEval2< T1, T2
3024 IsColumnVector_v<T2> &&
3028 using ET1 = ElementType_t<T1>;
3029 using ET2 = ElementType_t<T2>;
3031 static constexpr
size_t N = ( Size_v<T1,0UL> !=
DefaultSize_v ? Size_v<T1,0UL> : Size_v<T2,0UL> );
3033 using Type = StaticVector< MultTrait_t<ET1,ET2>, N,
false >;
3036 template<
typename T1,
typename T2 >
3037 struct MultTraitEval2< T1, T2
3043 using ET1 = ElementType_t<T1>;
3044 using ET2 = ElementType_t<T2>;
3046 static constexpr
size_t N = ( Size_v<T2,1UL> !=
DefaultSize_v ? Size_v<T2,1UL> : Size_v<T1,0UL> );
3048 using Type = StaticVector< MultTrait_t<ET1,ET2>, N,
true >;
3064 template<
typename T1,
typename T2 >
3065 struct KronTraitEval2< T1, T2
3067 IsDenseVector_v<T2> &&
3071 using ET1 = ElementType_t<T1>;
3072 using ET2 = ElementType_t<T2>;
3074 static constexpr
size_t N = Size_v<T1,0UL> * Size_v<T2,0UL>;
3076 using Type = StaticVector< MultTrait_t<ET1,ET2>, N, TransposeFlag_v<T2> >;
3092 template<
typename T1,
typename T2 >
3093 struct DivTraitEval2< T1, T2
3098 using ET1 = ElementType_t<T1>;
3100 static constexpr
size_t N = Size_v<T1,0UL>;
3102 using Type = StaticVector< DivTrait_t<ET1,T2>, N, TransposeFlag_v<T1> >;
3105 template<
typename T1,
typename T2 >
3106 struct DivTraitEval2< T1, T2
3108 IsDenseVector_v<T2> &&
3112 using ET1 = ElementType_t<T1>;
3113 using ET2 = ElementType_t<T2>;
3115 static constexpr
size_t N =
max( Size_v<T1,0UL>, Size_v<T2,0UL> );
3117 using Type = StaticVector< DivTrait_t<ET1,ET2>, N, TransposeFlag_v<T1> >;
3133 template<
typename T1,
typename T2 >
3134 struct CrossTraitEval2< T1, T2
3137 using Tmp = MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >;
3139 using Type = StaticVector< SubTrait_t<Tmp,Tmp>, 3UL, TransposeFlag_v<T1> >;
3155 template<
typename T,
typename OP >
3156 struct UnaryMapTraitEval2< T, OP
3160 using ET = ElementType_t<T>;
3162 using Type = StaticVector< MapTrait_t<ET,OP>, Size_v<T,0UL>, TransposeFlag_v<T> >;
3170 template<
typename T1,
typename T2,
typename OP >
3171 struct BinaryMapTraitEval2< T1, T2, OP
3177 using ET1 = ElementType_t<T1>;
3178 using ET2 = ElementType_t<T2>;
3180 static constexpr
size_t N =
max( Size_v<T1,0UL>, Size_v<T2,0UL> );
3182 using Type = StaticVector< MapTrait_t<ET1,ET2,OP>, N, TransposeFlag_v<T1> >;
3198 template<
typename T,
typename OP,
size_t RF >
3199 struct PartialReduceTraitEval2< T, OP, RF
3204 using ET = ElementType_t<T>;
3205 using RT = decltype( std::declval<OP>()( std::declval<ET>(), std::declval<ET>() ) );
3207 static constexpr
bool TF = ( RF == 0UL );
3209 static constexpr
size_t N = Size_v< T, TF ? 1UL : 0UL >;
3211 using Type = StaticVector<RT,N,TF>;
3227 template<
typename T1,
size_t N,
bool TF,
typename T2 >
3228 struct HighType< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
3230 using Type = StaticVector< typename HighType<T1,T2>::Type, N, TF >;
3246 template<
typename T1,
size_t N,
bool TF,
typename T2 >
3247 struct LowType< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
3249 using Type = StaticVector< typename LowType<T1,T2>::Type, N, TF >;
3265 template<
typename VT,
size_t I,
size_t N >
3266 struct SubvectorTraitEval2< VT, I, N
3268 IsDenseVector_v<VT> > >
3270 using Type = StaticVector< RemoveConst_t< ElementType_t<VT> >, N, TransposeFlag_v<VT> >;
3286 template<
typename VT,
size_t N >
3287 struct ElementsTraitEval2< VT, N
3289 IsDenseVector_v<VT> > >
3291 using Type = StaticVector< RemoveConst_t< ElementType_t<VT> >, N, TransposeFlag_v<VT> >;
3307 template<
typename MT,
size_t I >
3308 struct RowTraitEval2< MT, I
3312 using Type = StaticVector< RemoveConst_t< ElementType_t<MT> >, Size_v<MT,1UL>,
true >;
3328 template<
typename MT,
size_t I >
3329 struct ColumnTraitEval2< MT, I
3333 using Type = StaticVector< RemoveConst_t< ElementType_t<MT> >, Size_v<MT,0UL>,
false >;
3349 template<
typename MT, ptrdiff_t I >
3350 struct BandTraitEval2< MT, I
3355 static constexpr
size_t M = Size_v<MT,0UL>;
3356 static constexpr
size_t N = Size_v<MT,1UL>;
3357 static constexpr
size_t Min =
min( M - ( I >= 0L ? 0UL : -I ), N - ( I >= 0L ? I : 0UL ) );
3359 using Type = StaticVector< RemoveConst_t< ElementType_t<MT> >, Min, defaultTransposeFlag >;
3379 template<
typename Type,
size_t N,
bool TF >
3380 class tuple_size<
blaze::StaticVector<Type,N,TF> >
3381 :
public integral_constant< size_t, N >
3384 template<
size_t I,
typename Type,
size_t N,
bool TF >
3385 class tuple_element< I,
blaze::StaticVector<Type,N,TF> >
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,...
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.
Headerfile for the generic min algorithm.
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.The IsMatrix_v variable template provides a c...
Definition: IsMatrix.h:138
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
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: StaticVector.h:1820
Header file for the AlignmentOf type trait.
Header file for the subtraction trait.
Header file for basic type definitions.
Header file for the SparseVector base class.
static constexpr size_t spacing() noexcept
Returns the minimum capacity of the vector.
Definition: StaticVector.h:1456
constexpr Iterator begin() noexcept
Returns an iterator to the first element of the static vector.
Definition: StaticVector.h:954
Header file for the row trait.
IntegralConstant< ptrdiff_t, N > Ptrdiff_t
Compile time integral constant wrapper for ptrdiff_t.The Ptrdiff_t alias template represents an integ...
Definition: IntegralConstant.h:237
constexpr bool IsRowVector_v
Auxiliary variable template for the IsRowVector type trait.The IsRowVector_v variable template provid...
Definition: IsRowVector.h:142
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.
static constexpr bool align
Compilation switch for the choice of alignment.
Definition: StaticVector.h:212
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
static constexpr bool simdEnabled
Compilation flag for SIMD optimization.
Definition: StaticVector.h:259
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
Header file for the IsRowVector 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.
constexpr ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the static vector.
Definition: StaticVector.h:986
#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
SIMDTrait_t< ElementType > SIMDType
SIMD type of the vector elements.
Definition: StaticVector.h:222
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.
Header file for memory allocation and deallocation functionality.
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
auto addAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedAddAssign_v< VT > >
Default implementation of the addition assignment of a dense vector.
Definition: StaticVector.h:2160
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
#define BLAZE_STATIC_ASSERT_MSG(expr, msg)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:123
Header file for the reduce trait.
Header file for the MaxSize type trait.
Header file for the elements trait.
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
Header file for the band trait.
Constraint on the data type.
Type ElementType
Type of the vector elements.
Definition: StaticVector.h:221
constexpr bool IsDenseMatrix_v
Auxiliary variable template for the IsDenseMatrix type trait.The IsDenseMatrix_v variable template pr...
Definition: IsDenseMatrix.h:138
Efficient implementation of a fixed-sized vector.The StaticVector class template is the representatio...
Definition: Forward.h:61
Header file for the IsMatrix type trait.
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: StaticVector.h:265
Header file for the IsSquare type trait.
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
void swap(StaticVector &v) noexcept
Swapping the contents of two static vectors.
Definition: StaticVector.h:1529
Headerfile for the generic max algorithm.
Header file for the DisableIf class template.
Header file for the LowType type trait.
Header file for the multiplication trait.
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
Resize mechanism to obtain a StaticVector with a different fixed number of elements.
Definition: StaticVector.h:248
#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
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.The HasSIMDSub_v variable template provides...
Definition: HasSIMDSub.h:187
BLAZE_ALWAYS_INLINE void stream(size_t index, const SIMDType &value) noexcept
Aligned, non-temporal store of a SIMD element of the vector.
Definition: StaticVector.h:2039
Reference at(size_t index)
Checked access to the vector elements.
Definition: StaticVector.h:875
Type & Reference
Reference to a non-constant vector value.
Definition: StaticVector.h:226
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1162
#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.
static constexpr size_t capacity() noexcept
Returns the maximum capacity of the vector.
Definition: StaticVector.h:1471
Header file for the DenseIterator class template.
const Type * ConstPointer
Pointer to a constant vector value.
Definition: StaticVector.h:229
Header file for the subvector trait.
constexpr bool IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.The IsNumeric_v variable template provides a...
Definition: IsNumeric.h:143
static constexpr size_t size() noexcept
Returns the current size/dimension of the vector.
Definition: StaticVector.h:1438
Header file for all SIMD functionality.
Constraint on the data type.
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
constexpr ConstIterator cend() const noexcept
Returns an iterator just past the last element of the static vector.
Definition: StaticVector.h:1034
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Header file for the IsAligned type trait.
Constraint on the data type.
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
StaticVector< Type, N, TF > This
Type of this StaticVector instance.
Definition: StaticVector.h:217
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: StaticVector.h:1886
Header file for the Kron product trait.
#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
Header file for the TransposeFlag type trait.
auto divAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedDivAssign_v< VT > >
Default implementation of the division assignment of a dense vector.
Definition: StaticVector.h:2434
AlignedStorage v_
The statically allocated vector elements.
Definition: StaticVector.h:511
Constraint on the data type.
Header file for the exception macros of the math module.
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1198
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 IsVector type trait.
Header file for the IsDenseMatrix type trait.
const StaticVector< Type, 2UL, TF > perp(const StaticVector< Type, 2UL, TF > &v)
Unary perp dot product operator for the calculation of a perpendicular vector ( ).
Definition: StaticVector.h:2648
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:615
constexpr void reset()
Reset to the default initial values.
Definition: StaticVector.h:1511
Header file for the IsPadded type trait.
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
constexpr bool isIntact() const noexcept
Returns whether the invariants of the static vector are intact.
Definition: StaticVector.h:1763
Header file for the IsVectorizable type trait.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
Header file for the RemoveConst type trait.
Header file for the IsSIMDCombinable type trait.
auto assign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedAssign_v< VT > >
Default implementation of the assignment of a dense vector.
Definition: StaticVector.h:2070
Header file for the IsSparseVector type trait.
Header file for the HasSIMDMult type trait.
static constexpr size_t Alignment
Alignment of the data elements.
Definition: StaticVector.h:501
BLAZE_ALWAYS_INLINE constexpr auto nextMultiple(T1 value, T2 factor) noexcept
Rounds up an integral value to the next multiple of a given factor.
Definition: NextMultiple.h:68
StaticVector()
The default constructor for StaticVector.
Definition: StaticVector.h:558
Header file for run time assertion macros.
Header file for the addition trait.
Header file for the cross product trait.
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: StaticVector.h:1799
Header file for the division trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: StaticVector.h:223
Constraint on the data type.
Header file for the IsContiguous type trait.
static constexpr size_t NN
Alignment adjustment.
Definition: StaticVector.h:209
constexpr bool IsVector_v
Auxiliary variable template for the IsVector type trait.The IsVector_v variable template provides a c...
Definition: IsVector.h:139
Header file for the AlignedArray implementation.
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:295
Header file for the IsStatic type trait.
constexpr StaticVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: StaticVector.h:1059
#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
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: StaticVector.h:1919
Header file for the column trait.
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
static constexpr bool isAligned() noexcept
Returns whether the vector is properly aligned in memory.
Definition: StaticVector.h:1839
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
Type * Pointer
Pointer to a non-constant vector value.
Definition: StaticVector.h:228
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
constexpr ptrdiff_t DefaultSize_v
Default size of the Size type trait.
Definition: Size.h:72
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant alias template represents ...
Definition: IntegralConstant.h:110
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
constexpr Iterator end() noexcept
Returns an iterator just past the last element of the static vector.
Definition: StaticVector.h:1002
constexpr Pointer data() noexcept
Low-level data access to the vector elements.
Definition: StaticVector.h:920
Header file for the IsDenseVector type trait.
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
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
#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
constexpr size_t AlignmentOf_v
Auxiliary variable template for the AlignmentOf type trait.The AlignmentOf_v variable template provid...
Definition: AlignmentOf.h:238
Header file for the HasSIMDDiv type trait.
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: StaticVector.h:1489
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:198
EnableIf_t< IsBuiltin_v< T > > deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:224
Header file for the default transpose flag for all vectors of the Blaze library.
constexpr Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: StaticVector.h:832
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.
BLAZE_ALWAYS_INLINE void storea(size_t index, const SIMDType &value) noexcept
Aligned store of a SIMD element of the vector.
Definition: StaticVector.h:1974
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:146
constexpr bool IsDenseVector_v
Auxiliary variable template for the IsDenseVector type trait.The IsDenseVector_v variable template pr...
Definition: IsDenseVector.h:138
Header file for the IntegralConstant class template.
constexpr Infinity inf
Global Infinity instance.The blaze::inf instance can be used wherever a built-in data type is expecte...
Definition: Infinity.h:1080
Header file for the map trait.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
auto multAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedMultAssign_v< VT > >
Default implementation of the multiplication assignment of a dense vector.
Definition: StaticVector.h:2340
BLAZE_ALWAYS_INLINE void storeu(size_t index, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the vector.
Definition: StaticVector.h:2007
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
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
Header file for the IsColumnVector type trait.
#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
void swap(StaticVector< Type, N, TF > &a, StaticVector< Type, N, TF > &b) noexcept
Swapping the contents of two static vectors.
Definition: StaticVector.h:2686
auto subAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedSubAssign_v< VT > >
Default implementation of the subtraction assignment of a dense vector.
Definition: StaticVector.h:2250
System settings for the inline keywords.
const Type & ConstReference
Reference to a constant vector value.
Definition: StaticVector.h:227
Header file for the Size type trait.
#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
#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
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD vector.
Definition: StaticVector.h:206
BLAZE_ALWAYS_INLINE SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: StaticVector.h:1862
Rebind mechanism to obtain a StaticVector with different data/element type.
Definition: StaticVector.h:239
Header file for the HighType type trait.
Header file for the clear shim.
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: StaticVector.h:1950
constexpr Type & get(StaticVector< Type, N, TF > &v) noexcept
Tuple-like index-based access the contents of a static vector.
Definition: StaticVector.h:2704