35#ifndef _BLAZE_MATH_DENSE_STATICVECTOR_H_
36#define _BLAZE_MATH_DENSE_STATICVECTOR_H_
222template<
typename Type
229 :
public DenseVector< StaticVector<Type,N,TF,AF,PF,Tag>, TF >
258 template<
typename NewType >
267 template<
size_t NewN >
295 template<
typename Other >
298 template<
typename Other,
size_t Dim >
301 template<
typename Other,
size_t Dim >
302 constexpr StaticVector(
const std::array<Other,Dim>& array );
306 template<
typename Other, AlignmentFlag AF2, PaddingFlag PF2 >
309 template<
typename VT >
343 constexpr
StaticVector& operator=( initializer_list<Type> list ) &;
345 template< typename Other,
size_t Dim >
346 constexpr
StaticVector& operator=( const Other (&array)[Dim] ) &;
348 template< typename Other,
size_t Dim >
349 constexpr
StaticVector& operator=( const std::array<Other,Dim>& array ) &;
356 template< typename VT > inline
StaticVector& operator= ( const
Vector<VT,TF>& rhs ) &;
357 template< typename VT > inline
StaticVector& operator+=( const
Vector<VT,TF>& rhs ) &;
358 template< typename VT > inline
StaticVector& operator-=( const
Vector<VT,TF>& rhs ) &;
359 template< typename VT > inline
StaticVector& operator*=( const
Vector<VT,TF>& rhs ) &;
361 template< typename VT > inline
StaticVector& operator%=( const
Vector<VT,TF>& rhs ) &;
368 static constexpr
size_t size() noexcept;
369 static constexpr
size_t spacing() noexcept;
370 static constexpr
size_t capacity() noexcept;
372 constexpr
void reset();
380 template< typename Other > inline
StaticVector& scale( const Other& scalar );
387 static inline
void* operator new ( std::
size_t size );
388 static inline
void* operator new[]( std::
size_t size );
389 static inline
void* operator new ( std::
size_t size, const std::nothrow_t& );
390 static inline
void* operator new[]( std::
size_t size, const std::nothrow_t& );
392 static inline
void operator delete (
void* ptr );
393 static inline
void operator delete[](
void* ptr );
394 static inline
void operator delete (
void* ptr, const std::nothrow_t& );
395 static inline
void operator delete[](
void* ptr, const std::nothrow_t& );
411 template< typename VT >
412 static constexpr
bool VectorizedAssign_v =
413 ( useOptimizedKernels &&
423 template< typename VT >
424 static constexpr
bool VectorizedAddAssign_v =
425 ( VectorizedAssign_v<VT> &&
433 template< typename VT >
434 static constexpr
bool VectorizedSubAssign_v =
435 ( VectorizedAssign_v<VT> &&
443 template< typename VT >
444 static constexpr
bool VectorizedMultAssign_v =
445 ( VectorizedAssign_v<VT> &&
453 template< typename VT >
454 static constexpr
bool VectorizedDivAssign_v =
455 ( VectorizedAssign_v<VT> &&
464 constexpr
bool isIntact() const noexcept;
471 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
472 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
474 static constexpr
bool isAligned() noexcept;
485 template< typename VT >
488 template< typename VT >
493 template< typename VT >
496 template< typename VT >
501 template< typename VT >
504 template< typename VT >
509 template< typename VT >
512 template< typename VT >
517 template< typename VT >
520 template< typename VT >
573template<
typename Type,
typename... Ts >
576template<
typename Type,
size_t N >
579template<
typename Type,
size_t N >
607template<
typename Type
614#if BLAZE_USE_DEFAULT_INITIALIZATION
618#if !BLAZE_USE_DEFAULT_INITIALIZATION
621 if( IsNumeric_v<Type> && PF ==
unpadded ) {
622 for(
size_t i=N; i<
NN; ++i )
637template<
typename Type
648 for(
size_t i=0UL; i<N; ++i )
651 for(
size_t i=N; i<
NN; ++i )
676template<
typename Type
685 if( list.size() > N ) {
691 for(
const auto& element : list ) {
723template<
typename Type
729template<
typename Other >
739 for(
size_t i=0UL; i<n; ++i )
742 if( IsNumeric_v<Type> ) {
743 for(
size_t i=n; i<NN; ++i )
770template<
typename Type
776template<
typename Other
806template<
typename Type
812template<
typename Other
831template<
typename Type
851template<
typename Type
857template<
typename Other
860inline StaticVector<Type,N,TF,AF,PF,Tag>::StaticVector(
const StaticVector<Other,N,TF,AF2,PF2,Tag>& v )
865 for(
size_t i=0UL; i<N; ++i )
868 for(
size_t i=N; i<NN; ++i )
886template<
typename Type
892template<
typename VT >
901 if( (*v).size() != N ) {
905 for(
size_t i=( IsSparseVector_v<VT> ? 0UL : N ); i<NN; ++i ) {
933template<
typename Type
957template<
typename Type
982template<
typename Type
994 return (*
this)[index];
1009template<
typename Type
1021 return (*
this)[index];
1033template<
typename Type
1054template<
typename Type
1073template<
typename Type
1092template<
typename Type
1111template<
typename Type
1130template<
typename Type
1149template<
typename Type
1168template<
typename Type
1196template<
typename Type
1205 for(
size_t i=0UL; i<N; ++i )
1230template<
typename Type
1241 if( list.size() > N ) {
1247 for(
const auto& element : list ) {
1280template<
typename Type
1286template<
typename Other
1293 for(
size_t i=0UL; i<N; ++i )
1320template<
typename Type
1326template<
typename Other
1333 for(
size_t i=0UL; i<N; ++i )
1349template<
typename Type
1373template<
typename Type
1379template<
typename Other
1383 StaticVector<Type,N,TF,AF,PF,Tag>::operator=(
const StaticVector<Other,N,TF,AF2,PF2,Tag>& rhs ) &
1385 using blaze::assign;
1387 assign( *
this, *rhs );
1406template<
typename Type
1412template<
typename VT >
1416 using blaze::assign;
1420 if( (*rhs).size() != N ) {
1424 if( (*rhs).canAlias(
this ) ) {
1429 if( IsSparseVector_v<VT> )
1431 assign( *
this, *rhs );
1451template<
typename Type
1457template<
typename VT >
1461 using blaze::addAssign;
1465 if( (*rhs).size() != N ) {
1469 if( (*rhs).canAlias(
this ) ) {
1471 addAssign( *
this, tmp );
1474 addAssign( *
this, *rhs );
1494template<
typename Type
1500template<
typename VT >
1504 using blaze::subAssign;
1508 if( (*rhs).size() != N ) {
1512 if( (*rhs).canAlias(
this ) ) {
1514 subAssign( *
this, tmp );
1517 subAssign( *
this, *rhs );
1538template<
typename Type
1544template<
typename VT >
1548 using blaze::assign;
1549 using blaze::multAssign;
1553 if( (*rhs).size() != N ) {
1557 if( IsSparseVector_v<VT> || (*rhs).canAlias(
this ) ) {
1559 assign( *
this, tmp );
1562 multAssign( *
this, *rhs );
1582template<
typename Type
1588template<
typename VT >
1592 using blaze::assign;
1593 using blaze::divAssign;
1597 if( (*rhs).size() != N ) {
1601 if( (*rhs).canAlias(
this ) ) {
1603 assign( *
this, tmp );
1606 divAssign( *
this, *rhs );
1627template<
typename Type
1633template<
typename VT >
1637 using blaze::assign;
1650 if( N != 3UL || (*rhs).size() != 3UL ) {
1654 const CrossType tmp( *
this % (*rhs) );
1655 assign( *
this, tmp );
1677template<
typename Type
1698template<
typename Type
1716template<
typename Type
1738template<
typename Type
1746 size_t nonzeros( 0 );
1748 for(
size_t i=0UL; i<N; ++i ) {
1749 if( !isDefault<strict>( v_[i] ) )
1763template<
typename Type
1772 for(
size_t i=0UL; i<N; ++i )
1784template<
typename Type
1794 for(
size_t i=0UL; i<N; ++i )
1795 swap( v_[i], v.v_[i] );
1825template<
typename Type
1831template<
typename Other >
1835 for(
size_t i=0; i<N; ++i )
1860template<
typename Type
1872 return allocate<StaticVector>( 1UL );
1887template<
typename Type
1913template<
typename Type
1925 return allocate<StaticVector>( 1UL );
1940template<
typename Type
1962template<
typename Type
1981template<
typename Type
2000template<
typename Type
2019template<
typename Type
2049template<
typename Type
2057 if( IsNumeric_v<Type> ) {
2058 for(
size_t i=N; i<NN; ++i ) {
2059 if( !isDefault<strict>( v_[i] ) )
2087template<
typename Type
2093template<
typename Other >
2096 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
2111template<
typename Type
2117template<
typename Other >
2120 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
2134template<
typename Type
2159template<
typename Type
2169 return loada( index );
2171 return loadu( index );
2189template<
typename Type
2207 return loada( &v_[index] );
2225template<
typename Type
2241 return loadu( &v_[index] );
2259template<
typename Type
2289template<
typename Type
2307 storea( &v_[index], value );
2325template<
typename Type
2341 storeu( &v_[index], value );
2360template<
typename Type
2378 stream( &v_[index], value );
2394template<
typename Type
2400template<
typename VT >
2406 for(
size_t i=0UL; i<N; ++i )
2423template<
typename Type
2429template<
typename VT >
2437 constexpr bool remainder( PF ==
unpadded || !IsPadded_v<VT> );
2439 constexpr size_t ipos( remainder ?
prevMultiple( N, SIMDSIZE ) : N );
2444 for( ; i<ipos; i+=SIMDSIZE ) {
2445 store( i, (*rhs).load(i) );
2447 for( ; remainder && i<N; ++i ) {
2465template<
typename Type
2471template<
typename VT >
2476 for(
auto element=(*rhs).begin(); element!=(*rhs).end(); ++element )
2477 v_[element->index()] = element->value();
2493template<
typename Type
2499template<
typename VT >
2505 for(
size_t i=0UL; i<N; ++i )
2522template<
typename Type
2528template<
typename VT >
2536 constexpr bool remainder( PF ==
unpadded || !IsPadded_v<VT> );
2538 constexpr size_t ipos( remainder ?
prevMultiple( N, SIMDSIZE ) : N );
2543 for( ; i<ipos; i+=SIMDSIZE ) {
2544 store( i, load(i) + (*rhs).load(i) );
2546 for( ; remainder && i<N; ++i ) {
2564template<
typename Type
2570template<
typename VT >
2575 for(
auto element=(*rhs).begin(); element!=(*rhs).end(); ++element )
2576 v_[element->index()] += element->value();
2592template<
typename Type
2598template<
typename VT >
2604 for(
size_t i=0UL; i<N; ++i )
2621template<
typename Type
2627template<
typename VT >
2635 constexpr bool remainder( PF ==
unpadded || !IsPadded_v<VT> );
2637 constexpr size_t ipos( remainder ?
prevMultiple( N, SIMDSIZE ) : N );
2642 for( ; i<ipos; i+=SIMDSIZE ) {
2643 store( i, load(i) - (*rhs).load(i) );
2645 for( ; remainder && i<N; ++i ) {
2663template<
typename Type
2669template<
typename VT >
2674 for(
auto element=(*rhs).begin(); element!=(*rhs).end(); ++element )
2675 v_[element->index()] -= element->value();
2691template<
typename Type
2697template<
typename VT >
2703 for(
size_t i=0UL; i<N; ++i )
2720template<
typename Type
2726template<
typename VT >
2734 constexpr bool remainder( PF ==
unpadded || !IsPadded_v<VT> );
2736 constexpr size_t ipos( remainder ?
prevMultiple( N, SIMDSIZE ) : N );
2741 for( ; i<ipos; i+=SIMDSIZE ) {
2742 store( i, load(i) * (*rhs).load(i) );
2744 for( ; remainder && i<N; ++i ) {
2762template<
typename Type
2768template<
typename VT >
2777 for(
auto element=(*rhs).begin(); element!=(*rhs).end(); ++element )
2778 v_[element->index()] = tmp[element->index()] * element->value();
2794template<
typename Type
2800template<
typename VT >
2806 for(
size_t i=0UL; i<N; ++i )
2823template<
typename Type
2829template<
typename VT >
2842 for( ; i<ipos; i+=SIMDSIZE ) {
2843 store( i, load(i) / (*rhs).load(i) );
2867template< RelaxationFlag RF,
typename Type,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
2868bool isDefault(
const StaticVector<Type,N,TF,AF,PF,Tag>& v );
2870template<
typename Type,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
2871constexpr bool isIntact(
const StaticVector<Type,N,TF,AF,PF,Tag>& v )
noexcept;
2873template<
typename Type,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
2874const StaticVector<Type,2UL,TF,AF,PF,Tag>
perp(
const StaticVector<Type,2UL,TF,AF,PF,Tag>& v );
2876template<
typename Type,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
2877const StaticVector<Type,3UL,TF,AF,PF,Tag>
perp(
const StaticVector<Type,3UL,TF,AF,PF,Tag>& v );
2879template<
typename Type,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
2880void swap( StaticVector<Type,N,TF,AF,PF,Tag>& a, StaticVector<Type,N,TF,AF,PF,Tag>& b )
noexcept;
2882template<
size_t I,
typename Type,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
2883constexpr Type&
get( StaticVector<Type,N,TF,AF,PF,Tag>& v )
noexcept;
2885template<
size_t I,
typename Type,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
2886constexpr Type&&
get( StaticVector<Type,N,TF,AF,PF,Tag>&& v )
noexcept;
2888template<
size_t I,
typename Type,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
2889constexpr const Type&
get(
const StaticVector<Type,N,TF,AF,PF,Tag>& v)
noexcept;
2891template<
size_t I,
typename Type,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
2892constexpr const Type&&
get(
const StaticVector<Type,N,TF,AF,PF,Tag>&& v )
noexcept;
2931 for(
size_t i=0UL; i<N; ++i )
2932 if( !isDefault<RF>( v[i] ) )
return false;
2956template<
typename Type
2964 return v.isIntact();
2980template<
typename Type
2985inline const StaticVector<Type,2UL,TF,AF,PF,Tag>
3001template<
typename Type
3006inline const StaticVector<Type,3UL,TF,AF,PF,Tag>
3009 if( v[0] != Type() || v[1] != Type() )
3025template<
typename Type
3031inline void swap(
StaticVector<Type,N,TF,AF,PF,Tag>& a,
StaticVector<Type,N,TF,AF,PF,Tag>& b )
noexcept
3077 return std::move( v[I] );
3121 return std::move( v[I] );
3136template<
typename T,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
3137struct Size< StaticVector<T,N,TF,AF,PF,Tag>, 0UL >
3138 :
public Ptrdiff_t< static_cast<ptrdiff_t>(N) >
3154template<
typename T,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
3155struct MaxSize< StaticVector<T,N,TF,AF,PF,Tag>, 0UL >
3156 :
public Ptrdiff_t< static_cast<ptrdiff_t>(N) >
3172template<
typename T,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
3173struct HasConstDataAccess< StaticVector<T,N,TF,AF,PF,Tag> >
3190template<
typename T,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
3191struct HasMutableDataAccess< StaticVector<T,N,TF,AF,PF,Tag> >
3208template<
typename T,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
3209struct IsAligned< StaticVector<T,N,TF,AF,PF,Tag> >
3226template<
typename T,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
3227struct IsContiguous< StaticVector<T,N,TF,AF,PF,Tag> >
3244template<
typename T,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
3245struct IsPadded< StaticVector<T,N,TF,AF,PF,Tag> >
3262template<
typename T1,
typename T2 >
3263struct AddTraitEval2< T1, T2
3269 using Type = StaticVector< AddTrait_t< ElementType_t<T1>, ElementType_t<T2> >
3270 ,
max( Size_v<T1,0UL>, Size_v<T2,0UL> )
3271 , TransposeFlag_v<T1>
3274 , AddTrait_t< TagType_t<T1>, TagType_t<T2> > >;
3290template<
typename T1,
typename T2 >
3291struct SubTraitEval2< T1, T2
3297 using Type = StaticVector< SubTrait_t< ElementType_t<T1>, ElementType_t<T2> >
3298 ,
max( Size_v<T1,0UL>, Size_v<T2,0UL> )
3299 , TransposeFlag_v<T1>
3302 , SubTrait_t< TagType_t<T1>, TagType_t<T2> > >;
3318template<
typename T1,
typename T2 >
3319struct MultTraitEval2< T1, T2
3324 using Type = StaticVector< MultTrait_t< ElementType_t<T1>, T2 >
3326 , TransposeFlag_v<T1>
3329 , MultTrait_t< TagType_t<T1>, T2 > >;
3332template<
typename T1,
typename T2 >
3333struct MultTraitEval2< T1, T2
3338 using Type = StaticVector< MultTrait_t< T1, ElementType_t<T2> >
3340 , TransposeFlag_v<T2>
3343 , MultTrait_t< T1, TagType_t<T2> > >;
3346template<
typename T1,
typename T2 >
3347struct MultTraitEval2< T1, T2
3349 ( IsColumnVector_v<T1> && IsColumnVector_v<T2> ) ) &&
3350 IsDenseVector_v<T1> &&
3351 IsDenseVector_v<T2> &&
3354 using Type = StaticVector< MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >
3355 ,
max( Size_v<T1,0UL>, Size_v<T2,0UL> )
3356 , TransposeFlag_v<T1>
3359 , MultTrait_t< TagType_t<T1>, TagType_t<T2> > >;
3362template<
typename T1,
typename T2 >
3363struct MultTraitEval2< T1, T2
3365 IsColumnVector_v<T2> &&
3369 using MultType = MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >;
3370 using MultTag = MultTrait_t< TagType_t<T1>, TagType_t<T2> >;
3372 using Type = StaticVector< AddTrait_t<MultType,MultType>
3373 , ( Size_v<T1,0UL> !=
DefaultSize_v ? Size_v<T1,0UL> : Size_v<T2,0UL> )
3377 , AddTrait_t<MultTag,MultTag> >;
3380template<
typename T1,
typename T2 >
3381struct MultTraitEval2< T1, T2
3387 using MultType = MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >;
3388 using MultTag = MultTrait_t< TagType_t<T1>, TagType_t<T2> >;
3390 using Type = StaticVector< AddTrait_t<MultType,MultType>
3391 , ( Size_v<T2,1UL> !=
DefaultSize_v ? Size_v<T2,1UL> : Size_v<T1,0UL> )
3395 , AddTrait_t<MultTag,MultTag> >;
3411template<
typename T1,
typename T2 >
3412struct KronTraitEval2< T1, T2
3414 IsDenseVector_v<T2> &&
3418 using Type = StaticVector< MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >
3419 , Size_v<T1,0UL> * Size_v<T2,0UL>
3420 , TransposeFlag_v<T2>
3423 , MultTrait_t< TagType_t<T1>, TagType_t<T2> > >;
3439template<
typename T1,
typename T2 >
3440struct DivTraitEval2< T1, T2
3445 using Type = StaticVector< DivTrait_t< ElementType_t<T1>, T2 >
3447 , TransposeFlag_v<T1>
3450 , DivTrait_t< TagType_t<T1>, T2 > >;
3453template<
typename T1,
typename T2 >
3454struct DivTraitEval2< T1, T2
3456 IsDenseVector_v<T2> &&
3460 using Type = StaticVector< DivTrait_t< ElementType_t<T1>, ElementType_t<T2> >
3461 ,
max( Size_v<T1,0UL>, Size_v<T2,0UL> )
3462 , TransposeFlag_v<T1>
3465 , DivTrait_t< TagType_t<T1>, TagType_t<T2> > >;
3481template<
typename T1,
typename T2 >
3482struct CrossTraitEval2< T1, T2
3485 using MultType = MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >;
3486 using MultTag = MultTrait_t< TagType_t<T1>, TagType_t<T2> >;
3488 using Type = StaticVector< SubTrait_t<MultType,MultType>
3490 , TransposeFlag_v<T1>
3493 , SubTrait_t<MultTag,MultTag> >;
3509template<
typename T,
typename OP >
3510struct UnaryMapTraitEval2< T, OP
3514 using ElementType =
decltype( std::declval<OP>()( std::declval< ElementType_t<T> >() ) );
3516 using Type = StaticVector< EvaluateTrait_t<ElementType>
3518 , TransposeFlag_v<T>
3521 , MapTrait_t< TagType_t<T>, OP > >;
3529template<
typename T1,
typename T2,
typename OP >
3530struct BinaryMapTraitEval2< T1, T2, OP
3532 ( IsColumnVector_v<T1> && IsColumnVector_v<T2> ) ) &&
3536 using ElementType =
decltype( std::declval<OP>()( std::declval< ElementType_t<T1> >()
3537 , std::declval< ElementType_t<T2> >() ) );
3539 using Type = StaticVector< EvaluateTrait_t<ElementType>
3540 ,
max( Size_v<T1,0UL>, Size_v<T2,0UL> )
3541 , TransposeFlag_v<T1>
3544 , MapTrait_t< TagType_t<T1>, TagType_t<T2>, OP > >;
3560template<
typename T,
typename OP, ReductionFlag RF >
3561struct PartialReduceTraitEval2< T, OP, RF
3566 using ET = ElementType_t<T>;
3568 static constexpr bool TF = ( RF ==
columnwise );
3570 using Type = StaticVector< decltype( std::declval<OP>()( std::declval<ET>(), std::declval<ET>() ) )
3571 , Size_v< T, TF ? 1UL : 0UL >
3575 , MapTrait_t< TagType_t<T>, OP > >;
3591template<
typename T,
size_t R0 >
3592struct RepeatTraitEval2< T, R0,
inf,
inf
3597 using Type = StaticVector< ElementType_t<T>
3599 , TransposeFlag_v<T>
3618template<
typename T1,
typename T2 >
3619struct SolveTraitEval2< T1, T2
3621 IsDenseVector_v<T2> &&
3626 using Type = StaticVector< ElementType_t<T2>
3627 ,
max( Size_v<T1,0UL>, Size_v<T1,1UL>, Size_v<T2,0UL> )
3628 , TransposeFlag_v<T2>
3647template<
typename T1,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag,
typename T2 >
3648struct HighType< StaticVector<T1,N,TF,AF,PF,Tag>, StaticVector<T2,N,TF,AF,PF,Tag> >
3650 using Type = StaticVector< typename HighType<T1,T2>::Type, N, TF, AF, PF, Tag >;
3666template<
typename T1,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag,
typename T2 >
3667struct LowType< StaticVector<T1,N,TF,AF,PF,Tag>, StaticVector<T2,N,TF,AF,PF,Tag> >
3669 using Type = StaticVector< typename LowType<T1,T2>::Type, N, TF, AF, PF, Tag >;
3685template<
typename VT,
size_t I,
size_t N >
3686struct SubvectorTraitEval2< VT, I, N
3688 IsDenseVector_v<VT> > >
3690 using Type = StaticVector< RemoveConst_t< ElementType_t<VT> >
3692 , TransposeFlag_v<VT>
3711template<
typename VT,
size_t N >
3712struct ElementsTraitEval2< VT, N
3714 IsDenseVector_v<VT> > >
3716 using Type = StaticVector< RemoveConst_t< ElementType_t<VT> >
3718 , TransposeFlag_v<VT>
3737template<
typename MT,
size_t I >
3738struct RowTraitEval2< MT, I
3742 using Type = StaticVector< RemoveConst_t< ElementType_t<MT> >
3763template<
typename MT,
size_t I >
3764struct ColumnTraitEval2< MT, I
3768 using Type = StaticVector< RemoveConst_t< ElementType_t<MT> >
3789template<
typename MT, ptrdiff_t I >
3790struct BandTraitEval2< MT, I
3795 static constexpr size_t M = Size_v<MT,0UL>;
3796 static constexpr size_t N = Size_v<MT,1UL>;
3797 static constexpr size_t Min =
min( M - ( I >= 0L ? 0UL : -I ), N - ( I >= 0L ? I : 0UL ) );
3799 using Type = StaticVector< RemoveConst_t< ElementType_t<MT> >
3825template<
typename Type
3831class tuple_size< blaze::StaticVector<Type,N,TF,AF,PF,Tag> >
3832 :
public integral_constant< size_t, N >
3842class tuple_element< I, blaze::StaticVector<Type,N,TF,AF,PF,Tag> >
Header file for the addition trait.
Header file for auxiliary alias declarations.
typename ResultType_t< T >::TagType TagType_t
Alias declaration for nested TagType type definitions.
Definition: Aliases.h:530
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition: Aliases.h:450
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition: Aliases.h:190
Header file for the AlignedArray implementation.
Header file for the alignment check function.
Header file for the alignment flag enumeration.
Header file for the AlignmentOf type trait.
Header file for run time assertion macros.
Header file for the band trait.
Header file for the column trait.
Constraint on the data type.
Header file for the cross product trait.
Header file for the DenseIterator class template.
Header file for the division trait.
Header file for the elements trait.
Header file for the EnableIf class template.
Header file for the EvaluateTrait class template.
Header file for the HasConstDataAccess type trait.
Header file for the HasMutableDataAccess type trait.
Header file for the HasSIMDAdd type trait.
Header file for the HasSIMDDiv type trait.
Header file for the HasSIMDMult type trait.
Header file for the HasSIMDSub type trait.
Header file for the HighType type trait.
Header file for the IntegralConstant class template.
Header file for the IsAligned type trait.
Header file for the IsColumnVector type trait.
Header file for the IsContiguous type trait.
Header file for the isDefault shim.
Header file for the IsDenseMatrix type trait.
Header file for the IsDenseVector type trait.
Header file for the IsMatrix type trait.
Header file for the IsNumeric type trait.
Header file for the IsPadded type trait.
Header file for the IsRowVector type trait.
Header file for the IsSIMDCombinable type trait.
Header file for the IsScalar type trait.
Header file for the IsSparseVector type trait.
Header file for the IsSquare type trait.
Header file for the IsVector type trait.
Header file for the IsVectorizable type trait.
Header file for the Kron product trait.
Header file for the LowType type trait.
Header file for the map trait.
Header file for the MaxSize type trait.
Header file for the MAYBE_UNUSED function template.
Header file for memory allocation and deallocation functionality.
Header file for the multiplication trait.
Header file for the nextMultiple shim.
Header file for the padding flag enumeration.
Constraint on the data type.
Header file for the prevMultiple shim.
Header file for the reduce trait.
Header file for the reduction flags.
constexpr ReductionFlag columnwise
Reduction flag for column-wise reduction operations.
Definition: ReductionFlag.h:97
Constraint on the data type.
Header file for the relaxation flag enumeration.
Header file for the RemoveCV type trait.
Header file for the RemoveConst type trait.
Header file for the repeat trait.
Header file for the row trait.
Header file for all SIMD functionality.
Header file for the Solver trait.
C++-standard-specific system settings.
Header file for the subtraction trait.
Header file for the subvector trait.
Constraint on the data type.
Constraint on the data type.
Implementation of a generic iterator for dense vectors and matrices.
Definition: DenseIterator.h:60
Base class for N-dimensional dense vectors.
Definition: DenseVector.h:77
SIMD characteristics of data types.
Definition: SIMDTrait.h:297
Base class for sparse vectors.
Definition: SparseVector.h:72
Efficient implementation of a fixed-sized vector.
Definition: StaticVector.h:230
static constexpr bool isAligned() noexcept
Returns whether the vector is properly aligned in memory.
Definition: StaticVector.h:2140
const Type & ReturnType
Return type for expression template evaluations.
Definition: StaticVector.h:243
BLAZE_ALWAYS_INLINE void storeu(size_t index, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the vector.
Definition: StaticVector.h:2332
Reference at(size_t index)
Checked access to the vector elements.
Definition: StaticVector.h:989
void swap(StaticVector &v) noexcept
Swapping the contents of two static vectors.
Definition: StaticVector.h:1790
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:2698
static constexpr size_t capacity() noexcept
Returns the maximum capacity of the vector.
Definition: StaticVector.h:1722
constexpr Iterator begin() noexcept
Returns an iterator to the first element of the static vector.
Definition: StaticVector.h:1080
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD vector.
Definition: StaticVector.h:402
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: StaticVector.h:2196
constexpr Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: StaticVector.h:940
Type * Pointer
Pointer to a non-constant vector value.
Definition: StaticVector.h:248
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:2500
StaticVector()
The default constructor for StaticVector.
Definition: StaticVector.h:613
BLAZE_ALWAYS_INLINE void storea(size_t index, const SIMDType &value) noexcept
Aligned store of a SIMD element of the vector.
Definition: StaticVector.h:2296
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: StaticVector.h:2266
SIMDTrait_t< ElementType > SIMDType
SIMD type of the vector elements.
Definition: StaticVector.h:241
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: StaticVector.h:2094
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:2801
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: StaticVector.h:1744
const Type * ConstPointer
Pointer to a constant vector value.
Definition: StaticVector.h:249
Type & Reference
Reference to a non-constant vector value.
Definition: StaticVector.h:246
StaticVector< Type, N, TF, AF, PF, Tag > This
Type of this StaticVector instance.
Definition: StaticVector.h:233
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: StaticVector.h:2118
AlignedStorage v_
The statically allocated vector elements.
Definition: StaticVector.h:538
BLAZE_ALWAYS_INLINE SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: StaticVector.h:2166
auto assign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedAssign_v< VT > >
Default implementation of the assignment of a dense vector.
Definition: StaticVector.h:2401
constexpr Iterator end() noexcept
Returns an iterator just past the last element of the static vector.
Definition: StaticVector.h:1137
static constexpr bool simdEnabled
Compilation flag for SIMD optimization.
Definition: StaticVector.h:279
constexpr void reset()
Reset to the default initial values.
Definition: StaticVector.h:1769
constexpr ConstIterator cend() const noexcept
Returns an iterator just past the last element of the static vector.
Definition: StaticVector.h:1175
const Type & ConstReference
Reference to a constant vector value.
Definition: StaticVector.h:247
Type ElementType
Type of the vector elements.
Definition: StaticVector.h:240
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: StaticVector.h:2232
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:2599
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: StaticVector.h:285
Tag TagType
Tag type of this StaticVector instance.
Definition: StaticVector.h:242
constexpr ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the static vector.
Definition: StaticVector.h:1118
constexpr bool isIntact() const noexcept
Returns whether the invariants of the static vector are intact.
Definition: StaticVector.h:2055
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:2367
constexpr StaticVector & operator=(const Type &rhs) &
Homogenous assignment to all vector elements.
Definition: StaticVector.h:1203
static constexpr size_t Alignment
Alignment of the data elements.
Definition: StaticVector.h:528
static constexpr size_t spacing() noexcept
Returns the minimum capacity of the vector.
Definition: StaticVector.h:1704
static constexpr size_t NN
Alignment adjustment.
Definition: StaticVector.h:405
constexpr Pointer data() noexcept
Low-level data access to the vector elements.
Definition: StaticVector.h:1040
static constexpr size_t size() noexcept
Returns the current size/dimension of the vector.
Definition: StaticVector.h:1683
Base class for N-dimensional vectors.
Definition: Vector.h:82
Constraint on the data type.
Constraint on the data type.
Header file for the DenseVector base class.
Header file for the SparseVector base class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.
Definition: Volatile.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.
Definition: Pointer.h:79
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.
Definition: Vectorizable.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.
Definition: Const.h:79
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TAG(A, B)
Data type constraint.
Definition: SameTag.h:68
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.
Definition: Reference.h:79
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:1339
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:1375
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:812
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition: RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.
Definition: TransposeFlag.h:63
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.
Definition: DenseVector.h:61
typename CrossTrait< T1, T2 >::Type CrossTrait_t
Auxiliary alias declaration for the CrossTrait class template.
Definition: CrossTrait.h:138
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.
Definition: HasSIMDSub.h:187
constexpr bool IsScalar_v
Auxiliary variable template for the IsScalar type trait.
Definition: IsScalar.h:104
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.
Definition: IsSIMDCombinable.h:137
constexpr ptrdiff_t DefaultSize_v
Default size of the Size type trait.
Definition: Size.h:72
constexpr bool IsVector_v
Auxiliary variable template for the IsVector type trait.
Definition: IsVector.h:125
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.
Definition: IsMatrix.h:124
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.
Definition: HasSIMDAdd.h:187
constexpr bool HasSIMDDiv_v
Auxiliary variable template for the HasSIMDDiv type trait.
Definition: HasSIMDDiv.h:173
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.
Definition: HasSIMDMult.h:188
constexpr bool IsRowVector_v
Auxiliary variable template for the IsRowVector type trait.
Definition: IsRowVector.h:126
constexpr bool IsDenseMatrix_v
Auxiliary variable template for the IsDenseMatrix type trait.
Definition: IsDenseMatrix.h:124
constexpr bool IsDenseVector_v
Auxiliary variable template for the IsDenseVector type trait.
Definition: IsDenseVector.h:124
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition: RelaxationFlag.h:66
BLAZE_ALWAYS_INLINE constexpr auto prevMultiple(T1 value, T2 factor) noexcept
Rounds down an integral value to the previous multiple of a given factor.
Definition: PrevMultiple.h:68
constexpr Infinity inf
Global Infinity instance.
Definition: Infinity.h:1080
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
PaddingFlag
Padding flag for (un-)padded vectors and matrices.
Definition: PaddingFlag.h:77
AlignmentFlag
Alignment flag for (un-)aligned vectors and matrices.
Definition: AlignmentFlag.h:63
@ padded
Flag for padded vectors and matrices.
Definition: PaddingFlag.h:79
@ unpadded
Flag for unpadded vectors and matrices.
Definition: PaddingFlag.h:78
@ aligned
Flag for aligned vectors and matrices.
Definition: AlignmentFlag.h:65
constexpr void clear(Matrix< MT, SO > &matrix)
Clearing the given matrix.
Definition: Matrix.h:960
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition: Matrix.h:806
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:676
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.
Definition: Assert.h:117
typename SIMDTrait< T >::Type SIMDTrait_t
Auxiliary alias declaration for the SIMDTrait class template.
Definition: SIMDTrait.h:315
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
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
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 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
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
#define BLAZE_STATIC_ASSERT_MSG(expr, msg)
Compile time assertion macro.
Definition: StaticAssert.h:123
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition: StaticAssert.h:112
const StaticVector< Type, 3UL, TF, AF, PF, Tag > perp(const StaticVector< Type, 3UL, TF, AF, PF, Tag > &v)
Creates a perpendicular vector b which satisfies .
Definition: StaticVector.h:3007
void swap(StaticVector< Type, N, TF, AF, PF, Tag > &a, StaticVector< Type, N, TF, AF, PF, Tag > &b) noexcept
Swapping the contents of two static vectors.
Definition: StaticVector.h:3031
bool isDefault(const StaticVector< Type, N, TF, AF, PF, Tag > &v)
Returns whether the given static vector is in default state.
Definition: StaticVector.h:2929
constexpr bool isIntact(const StaticVector< Type, N, TF, AF, PF, Tag > &v) noexcept
Returns whether the invariants of the given static vector are intact.
Definition: StaticVector.h:2962
constexpr const Type && get(const StaticVector< Type, N, TF, AF, PF, Tag > &&v) noexcept
Tuple-like index-based access the contents of a constant temporary static vector.
Definition: StaticVector.h:3118
constexpr PaddingFlag defaultPaddingFlag
The default padding flag for all vectors and matrices of the Blaze library.
Definition: Padding.h:74
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
constexpr AlignmentFlag defaultAlignmentFlag
The default alignment for all vectors and matrices of the Blaze library.
Definition: Alignment.h:75
constexpr bool defaultTransposeFlag
The default transpose flag for all vectors of the Blaze library.
Definition: TransposeFlag.h:75
constexpr bool IsVectorizable_v
Auxiliary variable template for the IsVectorizable type trait.
Definition: IsVectorizable.h:157
constexpr size_t AlignmentOf_v
Auxiliary variable template for the AlignmentOf type trait.
Definition: AlignmentOf.h:239
BoolConstant< true > TrueType
Type traits base class.
Definition: IntegralConstant.h:132
void deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:230
IntegralConstant< ptrdiff_t, N > Ptrdiff_t
Compile time integral constant wrapper for ptrdiff_t.
Definition: IntegralConstant.h:237
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition: IntegralConstant.h:110
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition: Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:175
Header file for the exception macros of the math module.
Header file for all forward declarations of the math module.
Header file for the extended initializer_list functionality.
Constraint on the data type.
Header file for all forward declarations for dense vectors and matrices.
Header file for the Size type trait.
Header file for the TransposeFlag type trait.
Header file for the clear shim.
Header file for the serial shim.
Rebind mechanism to obtain a StaticVector with different data/element type.
Definition: StaticVector.h:259
Resize mechanism to obtain a StaticVector with a different fixed number of elements.
Definition: StaticVector.h:268
System settings for the inline keywords.
System settings for performance optimizations.
Header file for the default transpose flag for all vectors of the Blaze library.
Header file for basic type definitions.
Header file for the generic max algorithm.
Header file for the generic min algorithm.