26#ifndef _BLAZE_MATH_DENSE_HYBRIDVECTOR_H_
27#define _BLAZE_MATH_DENSE_HYBRIDVECTOR_H_
214template<
typename Type
221 :
public DenseVector< HybridVector<Type,N,TF,AF,PF,Tag>, TF >
250 template<
typename NewType >
259 template<
size_t NewN >
288 template<
typename Other >
291 template<
typename Other,
size_t Dim >
294 template<
typename Other,
size_t Dim >
295 constexpr HybridVector(
const std::array<Other,Dim>& array );
299 template<
typename VT >
333 constexpr
HybridVector& operator=( initializer_list<Type> list ) &;
335 template< typename Other,
size_t Dim >
336 constexpr
HybridVector& operator=( const Other (&array)[Dim] ) &;
338 template< typename Other,
size_t Dim >
339 constexpr
HybridVector& operator=( const std::array<Other,Dim>& array ) &;
343 template< typename VT > inline
HybridVector& operator= ( const
Vector<VT,TF>& rhs ) &;
344 template< typename VT > inline
HybridVector& operator+=( const
Vector<VT,TF>& rhs ) &;
345 template< typename VT > inline
HybridVector& operator-=( const
Vector<VT,TF>& rhs ) &;
346 template< typename VT > inline
HybridVector& operator*=( const
Vector<VT,TF>& rhs ) &;
348 template< typename VT > inline
HybridVector& operator%=( const
Vector<VT,TF>& rhs ) &;
355 constexpr
size_t size() const noexcept;
356 static constexpr
size_t spacing() noexcept;
357 static constexpr
size_t capacity() noexcept;
359 constexpr
void reset();
360 constexpr
void clear();
361 constexpr
void resize(
size_t n,
bool preserve=true );
362 constexpr
void extend(
size_t n,
bool preserve=true );
370 template< typename Other > inline
HybridVector& scale( const Other& scalar );
377 static inline
void* operator new ( std::
size_t size );
378 static inline
void* operator new[]( std::
size_t size );
379 static inline
void* operator new ( std::
size_t size, const std::nothrow_t& );
380 static inline
void* operator new[]( std::
size_t size, const std::nothrow_t& );
382 static inline
void operator delete (
void* ptr );
383 static inline
void operator delete[](
void* ptr );
384 static inline
void operator delete (
void* ptr, const std::nothrow_t& );
385 static inline
void operator delete[](
void* ptr, const std::nothrow_t& );
401 template< typename VT >
402 static constexpr
bool VectorizedAssign_v =
403 ( useOptimizedKernels &&
413 template< typename VT >
414 static constexpr
bool VectorizedAddAssign_v =
415 ( VectorizedAssign_v<VT> &&
423 template< typename VT >
424 static constexpr
bool VectorizedSubAssign_v =
425 ( VectorizedAssign_v<VT> &&
433 template< typename VT >
434 static constexpr
bool VectorizedMultAssign_v =
435 ( VectorizedAssign_v<VT> &&
443 template< typename VT >
444 static constexpr
bool VectorizedDivAssign_v =
445 ( VectorizedAssign_v<VT> &&
454 constexpr
bool isIntact() const noexcept;
461 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
462 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
464 static constexpr
bool isAligned() noexcept;
475 template< typename VT >
478 template< typename VT >
483 template< typename VT >
486 template< typename VT >
491 template< typename VT >
494 template< typename VT >
499 template< typename VT >
502 template< typename VT >
507 template< typename VT >
510 template< typename VT >
564template<
typename Type,
typename... Ts >
567template<
typename Type,
size_t N >
570template<
typename Type,
size_t N >
590template<
typename Type
615template<
typename Type
645template<
typename Type
661 for(
size_t i=0UL; i<n; ++i )
664 if( IsNumeric_v<Type> ) {
665 for(
size_t i=n; i<
NN; ++i )
692template<
typename Type
700 , size_( list.
size() )
708 for(
const auto& element : list ) {
741template<
typename Type
747template<
typename Other >
758 for(
size_t i=0UL; i<n; ++i )
761 if( IsNumeric_v<Type> ) {
762 for(
size_t i=n; i<
NN; ++i )
789template<
typename Type
795template<
typename Other
826template<
typename Type
832template<
typename Other
852template<
typename Type
878template<
typename Type
884template<
typename VT >
886 : size_( (*v).
size() )
894 if( (*v).size() > N ) {
898 for(
size_t i=( IsSparseVector_v<VT> ? 0UL :
size_ );
899 i<( IsNumeric_v<Type> ?
NN :
size_ ); ++i ) {
927template<
typename Type
951template<
typename Type
976template<
typename Type
985 if( index >= size_ ) {
988 return (*
this)[index];
1003template<
typename Type
1012 if( index >= size_ ) {
1015 return (*
this)[index];
1027template<
typename Type
1048template<
typename Type
1067template<
typename Type
1086template<
typename Type
1105template<
typename Type
1124template<
typename Type
1144template<
typename Type
1164template<
typename Type
1193template<
typename Type
1204 for(
size_t i=0UL; i<size_; ++i )
1230template<
typename Type
1239 if( list.size() > N ) {
1243 resize( list.size(),
false );
1247 for(
const auto& element : list ) {
1276template<
typename Type
1282template<
typename Other
1291 for(
size_t i=0UL; i<Dim; ++i )
1318template<
typename Type
1324template<
typename Other
1333 for(
size_t i=0UL; i<Dim; ++i )
1349template<
typename Type
1358 using blaze::assign;
1363 assign( *
this, *rhs );
1382template<
typename Type
1388template<
typename VT >
1392 using blaze::assign;
1396 if( (*rhs).size() > N ) {
1400 if( (*rhs).canAlias(
this ) ) {
1405 resize( (*rhs).size(),
false );
1406 if( IsSparseVector_v<VT> )
1408 assign( *
this, *rhs );
1428template<
typename Type
1434template<
typename VT >
1438 using blaze::addAssign;
1442 if( (*rhs).size() != size_ ) {
1446 if( (*rhs).canAlias(
this ) ) {
1448 addAssign( *
this, tmp );
1451 addAssign( *
this, *rhs );
1471template<
typename Type
1477template<
typename VT >
1481 using blaze::subAssign;
1485 if( (*rhs).size() != size_ ) {
1489 if( (*rhs).canAlias(
this ) ) {
1491 subAssign( *
this, tmp );
1494 subAssign( *
this, *rhs );
1515template<
typename Type
1521template<
typename VT >
1525 using blaze::assign;
1526 using blaze::multAssign;
1530 if( (*rhs).size() != size_ ) {
1534 if( IsSparseVector_v<VT> || (*rhs).canAlias(
this ) ) {
1536 assign( *
this, tmp );
1539 multAssign( *
this, *rhs );
1559template<
typename Type
1565template<
typename VT >
1569 using blaze::assign;
1570 using blaze::divAssign;
1574 if( (*rhs).size() != size_ ) {
1578 if( (*rhs).canAlias(
this ) ) {
1580 assign( *
this, tmp );
1583 divAssign( *
this, *rhs );
1604template<
typename Type
1610template<
typename VT >
1614 using blaze::assign;
1627 if( size_ != 3UL || (*rhs).size() != 3UL ) {
1631 const CrossType tmp( *
this % (*rhs) );
1632 assign( *
this, tmp );
1654template<
typename Type
1675template<
typename Type
1693template<
typename Type
1715template<
typename Type
1723 size_t nonzeros( 0 );
1725 for(
size_t i=0UL; i<size_; ++i ) {
1726 if( !isDefault<strict>( v_[i] ) )
1740template<
typename Type
1749 for(
size_t i=0UL; i<size_; ++i )
1762template<
typename Type
1806template<
typename Type
1822 if( IsNumeric_v<Type> && n < size_ ) {
1823 for(
size_t i=n; i<size_; ++i )
1846template<
typename Type
1866template<
typename Type
1876 const size_t maxsize(
max( size_, v.size_ ) );
1877 for(
size_t i=0UL; i<maxsize; ++i )
1878 swap( v_[i], v.v_[i] );
1879 swap( size_, v.size_ );
1909template<
typename Type
1915template<
typename Other >
1919 for(
size_t i=0; i<size_; ++i )
1944template<
typename Type
1956 return allocate<HybridVector>( 1UL );
1971template<
typename Type
1997template<
typename Type
2009 return allocate<HybridVector>( 1UL );
2024template<
typename Type
2046template<
typename Type
2065template<
typename Type
2084template<
typename Type
2103template<
typename Type
2133template<
typename Type
2144 if( IsVectorizable_v<Type> ) {
2145 for(
size_t i=size_; i<NN; ++i ) {
2146 if( !isDefault<strict>( v_[i] ) )
2174template<
typename Type
2180template<
typename Other >
2183 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
2198template<
typename Type
2204template<
typename Other >
2207 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
2221template<
typename Type
2246template<
typename Type
2256 return loada( index );
2258 return loadu( index );
2276template<
typename Type
2294 return loada( &v_[index] );
2312template<
typename Type
2328 return loadu( &v_[index] );
2346template<
typename Type
2376template<
typename Type
2394 storea( &v_[index], value );
2412template<
typename Type
2428 storeu( &v_[index], value );
2447template<
typename Type
2465 stream( &v_[index], value );
2481template<
typename Type
2487template<
typename VT >
2493 for(
size_t i=0UL; i<size_; ++i )
2510template<
typename Type
2516template<
typename VT >
2524 constexpr bool remainder( PF ==
unpadded || !IsPadded_v<VT> );
2526 const size_t ipos( remainder ?
prevMultiple( size_, SIMDSIZE ) : size_ );
2531 for( ; i<ipos; i+=SIMDSIZE ) {
2532 store( i, (*rhs).load(i) );
2534 for( ; remainder && i<size_; ++i ) {
2552template<
typename Type
2558template<
typename VT >
2563 for(
auto element=(*rhs).begin(); element!=(*rhs).end(); ++element )
2564 v_[element->index()] = element->value();
2580template<
typename Type
2586template<
typename VT >
2592 for(
size_t i=0UL; i<size_; ++i )
2609template<
typename Type
2615template<
typename VT >
2623 constexpr bool remainder( PF ==
unpadded || !IsPadded_v<VT> );
2625 const size_t ipos( remainder ?
prevMultiple( size_, SIMDSIZE ) : size_ );
2630 for( ; i<ipos; i+=SIMDSIZE ) {
2631 store( i, load(i) + (*rhs).load(i) );
2633 for( ; remainder && i<size_; ++i ) {
2651template<
typename Type
2657template<
typename VT >
2662 for(
auto element=(*rhs).begin(); element!=(*rhs).end(); ++element )
2663 v_[element->index()] += element->value();
2679template<
typename Type
2685template<
typename VT >
2691 for(
size_t i=0UL; i<size_; ++i )
2708template<
typename Type
2714template<
typename VT >
2722 constexpr bool remainder( PF ==
unpadded || !IsPadded_v<VT> );
2724 const size_t ipos( remainder ?
prevMultiple( size_, SIMDSIZE ) : size_ );
2729 for( ; i<ipos; i+=SIMDSIZE ) {
2730 store( i, load(i) - (*rhs).load(i) );
2732 for( ; remainder && i<size_; ++i ) {
2750template<
typename Type
2756template<
typename VT >
2761 for(
auto element=(*rhs).begin(); element!=(*rhs).end(); ++element )
2762 v_[element->index()] -= element->value();
2778template<
typename Type
2784template<
typename VT >
2790 for(
size_t i=0UL; i<size_; ++i )
2807template<
typename Type
2813template<
typename VT >
2821 constexpr bool remainder( PF ==
unpadded || !IsPadded_v<VT> );
2823 const size_t ipos( remainder ?
prevMultiple( size_, SIMDSIZE ) : size_ );
2828 for( ; i<ipos; i+=SIMDSIZE ) {
2829 store( i, load(i) * (*rhs).load(i) );
2831 for( ; remainder && i<size_; ++i ) {
2849template<
typename Type
2855template<
typename VT >
2864 for(
auto element=(*rhs).begin(); element!=(*rhs).end(); ++element )
2865 v_[element->index()] = tmp[element->index()] * element->value();
2881template<
typename Type
2887template<
typename VT >
2893 for(
size_t i=0UL; i<size_; ++i )
2910template<
typename Type
2916template<
typename VT >
2929 for( ; i<ipos; i+=SIMDSIZE ) {
2930 store( i, load(i) / (*rhs).load(i) );
2932 for( ; i<size_; ++i ) {
2954template< RelaxationFlag RF,
typename Type,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
2955bool isDefault(
const HybridVector<Type,N,TF,AF,PF,Tag>& v );
2957template<
typename Type,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
2958constexpr bool isIntact(
const HybridVector<Type,N,TF,AF,PF,Tag>& v );
2960template<
typename Type,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
2961void swap( HybridVector<Type,N,TF,AF,PF,Tag>& a, HybridVector<Type,N,TF,AF,PF,Tag>& b )
noexcept;
2999 return ( v.
size() == 0UL );
3022template<
typename Type
3043template<
typename Type
3049inline void swap(
HybridVector<Type,N,TF,AF,PF,Tag>& a,
HybridVector<Type,N,TF,AF,PF,Tag>& b )
noexcept
3066template<
typename T,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
3067struct MaxSize< HybridVector<T,N,TF,AF,PF,Tag>, 0UL >
3068 :
public Ptrdiff_t< static_cast<ptrdiff_t>(N) >
3084template<
typename T,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
3085struct HasConstDataAccess< HybridVector<T,N,TF,AF,PF,Tag> >
3102template<
typename T,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
3103struct HasMutableDataAccess< HybridVector<T,N,TF,AF,PF,Tag> >
3120template<
typename T,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
3121struct IsAligned< HybridVector<T,N,TF,AF,PF,Tag> >
3138template<
typename T,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
3139struct IsContiguous< HybridVector<T,N,TF,AF,PF,Tag> >
3156template<
typename T,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
3157struct IsPadded< HybridVector<T,N,TF,AF,PF,Tag> >
3174template<
typename T1,
typename T2 >
3175struct AddTraitEval2< T1, T2
3183 using Type = HybridVector< AddTrait_t< ElementType_t<T1>, ElementType_t<T2> >
3184 ,
min(
size_t( MaxSize_v<T1,0UL> ),
size_t( MaxSize_v<T2,0UL> ) )
3185 , TransposeFlag_v<T1>
3188 , AddTrait_t< TagType_t<T1>, TagType_t<T2> > >;
3204template<
typename T1,
typename T2 >
3205struct SubTraitEval2< T1, T2
3213 using Type = HybridVector< SubTrait_t< ElementType_t<T1>, ElementType_t<T2> >
3214 ,
min(
size_t( MaxSize_v<T1,0UL> ),
size_t( MaxSize_v<T2,0UL> ) )
3215 , TransposeFlag_v<T1>
3218 , SubTrait_t< TagType_t<T1>, TagType_t<T2> > >;
3234template<
typename T1,
typename T2 >
3235struct MultTraitEval2< T1, T2
3241 using Type = HybridVector< MultTrait_t< ElementType_t<T1>, T2 >
3243 , TransposeFlag_v<T1>
3246 , MultTrait_t< TagType_t<T1>, T2 > >;
3249template<
typename T1,
typename T2 >
3250struct MultTraitEval2< T1, T2
3256 using Type = HybridVector< MultTrait_t< T1, ElementType_t<T2> >
3258 , TransposeFlag_v<T2>
3261 , MultTrait_t< T1, TagType_t<T2> > >;
3264template<
typename T1,
typename T2 >
3265struct MultTraitEval2< T1, T2
3267 ( IsColumnVector_v<T1> && IsColumnVector_v<T2> ) ) &&
3268 IsDenseVector_v<T1> &&
3269 IsDenseVector_v<T2> &&
3275 using Type = HybridVector< MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >
3276 ,
min(
size_t( MaxSize_v<T1,0UL> ),
size_t( MaxSize_v<T2,0UL> ) )
3277 , TransposeFlag_v<T1>
3280 , MultTrait_t< TagType_t<T1>, TagType_t<T2> > >;
3283template<
typename T1,
typename T2 >
3284struct MultTraitEval2< T1, T2
3286 IsColumnVector_v<T2> &&
3292 using MultType = MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >;
3293 using MultTag = MultTrait_t< TagType_t<T1>, TagType_t<T2> >;
3295 using Type = HybridVector< AddTrait_t<MultType,MultType>
3296 , ( MaxSize_v<T1,0UL> !=
DefaultMaxSize_v ? MaxSize_v<T1,0UL> : MaxSize_v<T2,0UL> )
3300 , AddTrait_t<MultTag,MultTag> >;
3303template<
typename T1,
typename T2 >
3304struct MultTraitEval2< T1, T2
3312 using MultType = MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >;
3313 using MultTag = MultTrait_t< TagType_t<T1>, TagType_t<T2> >;
3315 using Type = HybridVector< AddTrait_t<MultType,MultType>
3316 , ( MaxSize_v<T2,1UL> !=
DefaultMaxSize_v ? MaxSize_v<T2,1UL> : MaxSize_v<T1,0UL> )
3320 , AddTrait_t<MultTag,MultTag> >;
3336template<
typename T1,
typename T2 >
3337struct KronTraitEval2< T1, T2
3339 IsDenseVector_v<T2> &&
3345 using Type = HybridVector< MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >
3346 , MaxSize_v<T1,0UL> * MaxSize_v<T2,0UL>
3347 , TransposeFlag_v<T2>
3350 , MultTrait_t< TagType_t<T1>, TagType_t<T2> > >;
3366template<
typename T1,
typename T2 >
3367struct DivTraitEval2< T1, T2
3373 using Type = HybridVector< DivTrait_t< ElementType_t<T1>, T2 >
3375 , TransposeFlag_v<T1>
3378 , DivTrait_t< TagType_t<T1>, T2 > >;
3381template<
typename T1,
typename T2 >
3382struct DivTraitEval2< T1, T2
3384 IsDenseVector_v<T2> &&
3390 using Type = HybridVector< DivTrait_t< ElementType_t<T1>, ElementType_t<T2> >
3391 ,
min(
size_t( MaxSize_v<T1,0UL> ),
size_t( MaxSize_v<T2,0UL> ) )
3392 , TransposeFlag_v<T1>
3395 , DivTrait_t< TagType_t<T1>, TagType_t<T2> > >;
3411template<
typename T,
typename OP >
3412struct UnaryMapTraitEval2< T, OP
3417 using ElementType =
decltype( std::declval<OP>()( std::declval< ElementType_t<T> >() ) );
3419 using Type = HybridVector< EvaluateTrait_t<ElementType>
3421 , TransposeFlag_v<T>
3424 , MapTrait_t< TagType_t<T>, OP > >;
3432template<
typename T1,
typename T2,
typename OP >
3433struct BinaryMapTraitEval2< T1, T2, OP
3435 ( IsColumnVector_v<T1> && IsColumnVector_v<T2> ) ) &&
3441 using ElementType =
decltype( std::declval<OP>()( std::declval< ElementType_t<T1> >()
3442 , std::declval< ElementType_t<T2> >() ) );
3444 using Type = HybridVector< EvaluateTrait_t<ElementType>
3445 ,
min(
size_t( MaxSize_v<T1,0UL> ),
size_t( MaxSize_v<T2,0UL> ) )
3446 , TransposeFlag_v<T1>
3449 , MapTrait_t< TagType_t<T1>, TagType_t<T2>, OP > >;
3465template<
typename T,
typename OP, ReductionFlag RF >
3466struct PartialReduceTraitEval2< T, OP, RF
3473 using ET = ElementType_t<T>;
3475 static constexpr bool TF = ( RF ==
columnwise );
3477 using Type = HybridVector< decltype( std::declval<OP>()( std::declval<ET>(), std::declval<ET>() ) )
3478 , MaxSize_v< T, TF ? 1UL : 0UL >
3482 , MapTrait_t< TagType_t<T>, OP > >;
3498template<
typename T,
size_t R0 >
3499struct RepeatTraitEval2< T, R0,
inf,
inf
3505 using Type = HybridVector< ElementType_t<T>
3506 , R0*MaxSize_v<T,0UL>
3507 , TransposeFlag_v<T>
3526template<
typename T1,
typename T2 >
3527struct SolveTraitEval2< T1, T2
3529 IsDenseVector_v<T2> &&
3540 ?
min( MaxSize_v<T1,0UL>, MaxSize_v<T1,1UL>, MaxSize_v<T2,0UL> )
3551 using Type = HybridVector< ElementType_t<T2>
3553 , TransposeFlag_v<T2>
3572template<
typename T1,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag,
typename T2 >
3573struct HighType< HybridVector<T1,N,TF,AF,PF,Tag>, HybridVector<T2,N,TF,AF,PF,Tag> >
3575 using Type = StaticVector< typename HighType<T1,T2>::Type, N, TF, AF, PF, Tag >;
3591template<
typename T1,
size_t N,
bool TF, AlignmentFlag AF, PaddingFlag PF,
typename Tag,
typename T2 >
3592struct LowType< HybridVector<T1,N,TF,AF,PF,Tag>, HybridVector<T2,N,TF,AF,PF,Tag> >
3594 using Type = StaticVector< typename LowType<T1,T2>::Type, N, TF, AF, PF, Tag >;
3610template<
typename VT >
3611struct SubvectorTraitEval2< VT,
inf,
inf
3616 using Type = HybridVector< RemoveConst_t< ElementType_t<VT> >
3617 ,
max( Size_v<VT,0UL>, MaxSize_v<VT,0UL> )
3618 , TransposeFlag_v<VT>
3637template<
typename MT,
size_t I >
3638struct RowTraitEval2< MT, I
3643 using Type = HybridVector< RemoveConst_t< ElementType_t<MT> >
3664template<
typename MT,
size_t I >
3665struct ColumnTraitEval2< MT, I
3670 using Type = HybridVector< RemoveConst_t< ElementType_t<MT> >
3691template<
typename MT, ptrdiff_t I >
3692struct BandTraitEval2< MT, I
3699 static constexpr size_t M = MaxSize_v<MT,0UL>;
3700 static constexpr size_t N = MaxSize_v<MT,1UL>;
3701 static constexpr size_t Min =
min( M - ( I >= 0L ? 0UL : -I ), N - ( I >= 0L ? I : 0UL ) );
3703 using Type = HybridVector< RemoveConst_t< ElementType_t<MT> >
3711template<
typename MT >
3712struct BandTraitEval2< MT,
inf
3717 using Type = HybridVector< RemoveConst_t< ElementType_t<MT> >
3718 ,
min( Size_v<MT,0UL>, Size_v<MT,1UL> )
3725template<
typename MT >
3726struct BandTraitEval2< MT,
inf
3733 using Type = HybridVector< RemoveConst_t< ElementType_t<MT> >
3734 ,
min( MaxSize_v<MT,0UL>, MaxSize_v<MT,1UL> )
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 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.
Numerical infinity for built-in data types.
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.
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
Efficient implementation of a dynamically sized vector with static memory.
Definition: HybridVector.h:222
static constexpr bool isAligned() noexcept
Returns whether the vector is properly aligned in memory.
Definition: HybridVector.h:2227
const Type & ReturnType
Return type for expression template evaluations.
Definition: HybridVector.h:234
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: HybridVector.h:2353
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: HybridVector.h:1721
BLAZE_ALWAYS_INLINE void storeu(size_t index, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the vector.
Definition: HybridVector.h:2419
constexpr void extend(size_t n, bool preserve=true)
Extending the size of the vector.
Definition: HybridVector.h:1852
size_t size_
The current size/dimension of the vector.
Definition: HybridVector.h:534
constexpr HybridVector()
The default constructor for HybridVector.
Definition: HybridVector.h:596
HybridVector< Type, N, TF, AF, PF, Tag > This
Type of this HybridVector instance.
Definition: HybridVector.h:225
Reference at(size_t index)
Checked access to the vector elements.
Definition: HybridVector.h:983
auto multAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedMultAssign_v< VT > >
Default implementation of the multiplication assignment of a dense vector.
Definition: HybridVector.h:2785
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: HybridVector.h:2181
BLAZE_ALWAYS_INLINE void storea(size_t index, const SIMDType &value) noexcept
Aligned store of a SIMD element of the vector.
Definition: HybridVector.h:2383
const Type * ConstPointer
Pointer to a constant vector value.
Definition: HybridVector.h:241
constexpr Iterator begin() noexcept
Returns an iterator to the first element of the hybrid vector.
Definition: HybridVector.h:1074
Type ElementType
Type of the vector elements.
Definition: HybridVector.h:232
static constexpr size_t Alignment
Alignment of the data elements.
Definition: HybridVector.h:518
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: HybridVector.h:2205
constexpr void resize(size_t n, bool preserve=true)
Changing the size of the vector.
Definition: HybridVector.h:1812
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: HybridVector.h:2283
constexpr size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: HybridVector.h:1660
constexpr void clear()
Clearing the vector.
Definition: HybridVector.h:1768
auto assign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedAssign_v< VT > >
Default implementation of the assignment of a dense vector.
Definition: HybridVector.h:2488
constexpr ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the hybrid vector.
Definition: HybridVector.h:1112
SIMDTrait_t< ElementType > SIMDType
SIMD type of the vector elements.
Definition: HybridVector.h:233
auto divAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedDivAssign_v< VT > >
Default implementation of the division assignment of a dense vector.
Definition: HybridVector.h:2888
static constexpr size_t spacing() noexcept
Returns the minimum capacity of the vector.
Definition: HybridVector.h:1681
static constexpr size_t NN
Alignment adjustment.
Definition: HybridVector.h:395
const Type & ConstReference
Reference to a constant vector value.
Definition: HybridVector.h:239
constexpr Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: HybridVector.h:934
static constexpr bool simdEnabled
Compilation flag for SIMD optimization.
Definition: HybridVector.h:271
static constexpr size_t capacity() noexcept
Returns the maximum capacity of the vector.
Definition: HybridVector.h:1699
BLAZE_ALWAYS_INLINE SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: HybridVector.h:2253
constexpr HybridVector & operator=(const Type &rhs) &
Homogenous assignment to all vector elements.
Definition: HybridVector.h:1200
constexpr ConstIterator cend() const noexcept
Returns an iterator just past the last element of the hybrid vector.
Definition: HybridVector.h:1171
auto subAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedSubAssign_v< VT > >
Default implementation of the subtraction assignment of a dense vector.
Definition: HybridVector.h:2686
Type & Reference
Reference to a non-constant vector value.
Definition: HybridVector.h:238
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: HybridVector.h:2319
void swap(HybridVector &v) noexcept
Swapping the contents of two hybrid vectors.
Definition: HybridVector.h:1872
BLAZE_ALWAYS_INLINE void stream(size_t index, const SIMDType &value) noexcept
Aligned, non-temporal store of a SIMD element of the vector.
Definition: HybridVector.h:2454
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD vector.
Definition: HybridVector.h:392
AlignedStorage v_
The statically allocated vector elements.
Definition: HybridVector.h:528
constexpr void reset()
Reset to the default initial values.
Definition: HybridVector.h:1746
Type * Pointer
Pointer to a non-constant vector value.
Definition: HybridVector.h:240
Tag TagType
Tag type of this HybridVector instance.
Definition: HybridVector.h:235
constexpr bool isIntact() const noexcept
Returns whether the invariants of the hybrid vector are intact.
Definition: HybridVector.h:2139
auto addAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedAddAssign_v< VT > >
Default implementation of the addition assignment of a dense vector.
Definition: HybridVector.h:2587
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: HybridVector.h:277
constexpr Pointer data() noexcept
Low-level data access to the vector elements.
Definition: HybridVector.h:1034
constexpr Iterator end() noexcept
Returns an iterator just past the last element of the hybrid vector.
Definition: HybridVector.h:1131
SIMD characteristics of data types.
Definition: SIMDTrait.h:297
Base class for sparse vectors.
Definition: SparseVector.h:72
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
constexpr bool isIntact(const HybridVector< Type, N, TF, AF, PF, Tag > &v)
Returns whether the invariants of the given hybrid vector are intact.
Definition: HybridVector.h:3028
void swap(HybridVector< Type, N, TF, AF, PF, Tag > &a, HybridVector< Type, N, TF, AF, PF, Tag > &b) noexcept
Swapping the contents of two hybrid vectors.
Definition: HybridVector.h:3049
bool isDefault(const HybridVector< Type, N, TF, AF, PF, Tag > &v)
Returns whether the given hybrid vector is in default state.
Definition: HybridVector.h:2997
#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 ptrdiff_t DefaultMaxSize_v
Default size of the MaxSize type trait.
Definition: MaxSize.h:72
constexpr ptrdiff_t MaxSize_v
Auxiliary variable template for the MaxSize type trait.
Definition: MaxSize.h:175
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
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:1108
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(expr)
Compile time assertion macro.
Definition: StaticAssert.h:112
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 HybridVector with different data/element type.
Definition: HybridVector.h:251
Resize mechanism to obtain a HybridVector with a different fixed number of elements.
Definition: HybridVector.h:260
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.