26 #ifndef _BLAZE_MATH_DENSE_HYBRIDVECTOR_H_
27 #define _BLAZE_MATH_DENSE_HYBRIDVECTOR_H_
171 template<
typename Type
174 class HybridVector :
public DenseVector< HybridVector<Type,N,TF>, TF >
199 template<
typename ET >
217 enum :
bool { smpAssignable =
false };
225 explicit inline HybridVector(
size_t n,
const Type& init );
226 explicit inline HybridVector( initializer_list<Type> list );
228 template<
typename Other >
229 explicit inline HybridVector(
size_t n,
const Other* array );
231 template<
typename Other,
size_t M >
232 explicit inline HybridVector(
const Other (&array)[M] );
235 template<
typename VT >
inline HybridVector(
const Vector<VT,TF>& v );
246 inline Reference
operator[](
size_t index ) noexcept;
247 inline ConstReference
operator[](
size_t index )
const noexcept;
248 inline Reference
at(
size_t index );
249 inline ConstReference
at(
size_t index )
const;
250 inline Pointer
data () noexcept;
251 inline ConstPointer
data () const noexcept;
252 inline Iterator
begin () noexcept;
253 inline ConstIterator
begin () const noexcept;
254 inline ConstIterator
cbegin() const noexcept;
255 inline Iterator
end () noexcept;
256 inline ConstIterator
end () const noexcept;
257 inline ConstIterator
cend () const noexcept;
265 inline
HybridVector& operator=( initializer_list<Type> list );
267 template< typename Other,
size_t M >
268 inline
HybridVector& operator=( const Other (&array)[M] );
271 template< typename VT > inline
HybridVector& operator= ( const Vector<VT,TF>& rhs );
272 template< typename VT > inline
HybridVector& operator+=( const Vector<VT,TF>& rhs );
273 template< typename VT > inline
HybridVector& operator-=( const Vector<VT,TF>& rhs );
274 template< typename VT > inline
HybridVector& operator*=( const Vector<VT,TF>& rhs );
275 template< typename VT > inline
HybridVector& operator/=( const DenseVector<VT,TF>& rhs );
277 template< typename Other >
280 template< typename Other >
288 inline
size_t size() const noexcept;
289 inline
size_t capacity() const noexcept;
293 inline
void resize(
size_t n,
bool preserve=true );
294 inline
void extend(
size_t n,
bool preserve=true );
295 template< typename Other > inline
HybridVector& scale( const Other& scalar );
303 static inline
void* operator new (
std::
size_t size );
304 static inline
void* operator new[](
std::
size_t size );
305 static inline
void* operator new (
std::
size_t size, const
std::nothrow_t& );
306 static inline
void* operator new[](
std::
size_t size, const
std::nothrow_t& );
308 static inline
void operator delete (
void* ptr );
309 static inline
void operator delete[](
void* ptr );
310 static inline
void operator delete (
void* ptr, const
std::nothrow_t& );
311 static inline
void operator delete[](
void* ptr, const
std::nothrow_t& );
318 template< typename VT >
320 struct VectorizedAssign {
322 simdEnabled && VT::simdEnabled &&
323 AreSIMDCombinable< Type, ElementType_<VT> >::value };
330 template<
typename VT >
332 struct VectorizedAddAssign {
334 simdEnabled && VT::simdEnabled &&
335 AreSIMDCombinable< Type, ElementType_<VT> >::value &&
336 HasSIMDAdd< Type, ElementType_<VT> >::value };
343 template<
typename VT >
345 struct VectorizedSubAssign {
347 simdEnabled && VT::simdEnabled &&
348 AreSIMDCombinable< Type, ElementType_<VT> >::value &&
349 HasSIMDSub< Type, ElementType_<VT> >::value };
356 template<
typename VT >
358 struct VectorizedMultAssign {
360 simdEnabled && VT::simdEnabled &&
361 AreSIMDCombinable< Type, ElementType_<VT> >::value &&
362 HasSIMDMult< Type, ElementType_<VT> >::value };
369 template<
typename VT >
371 struct VectorizedDivAssign {
373 simdEnabled && VT::simdEnabled &&
374 AreSIMDCombinable< Type, ElementType_<VT> >::value &&
375 HasSIMDDiv< Type, ElementType_<VT> >::value };
389 inline bool isIntact() const noexcept;
396 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
397 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
410 template< typename VT >
411 inline
DisableIf_<VectorizedAssign<VT> > assign( const DenseVector<VT,TF>& rhs );
413 template< typename VT >
414 inline
EnableIf_<VectorizedAssign<VT> > assign( const DenseVector<VT,TF>& rhs );
416 template< typename VT > inline
void assign( const SparseVector<VT,TF>& rhs );
418 template< typename VT >
419 inline
DisableIf_<VectorizedAddAssign<VT> > addAssign( const DenseVector<VT,TF>& rhs );
421 template< typename VT >
422 inline
EnableIf_<VectorizedAddAssign<VT> > addAssign( const DenseVector<VT,TF>& rhs );
424 template< typename VT > inline
void addAssign( const SparseVector<VT,TF>& rhs );
426 template< typename VT >
427 inline
DisableIf_<VectorizedSubAssign<VT> > subAssign( const DenseVector<VT,TF>& rhs );
429 template< typename VT >
430 inline
EnableIf_<VectorizedSubAssign<VT> > subAssign( const DenseVector<VT,TF>& rhs );
432 template< typename VT > inline
void subAssign( const SparseVector<VT,TF>& rhs );
434 template< typename VT >
435 inline
DisableIf_<VectorizedMultAssign<VT> > multAssign( const DenseVector<VT,TF>& rhs );
437 template< typename VT >
438 inline
EnableIf_<VectorizedMultAssign<VT> > multAssign( const DenseVector<VT,TF>& rhs );
440 template< typename VT > inline
void multAssign( const SparseVector<VT,TF>& rhs );
442 template< typename VT >
443 inline
DisableIf_<VectorizedDivAssign<VT> > divAssign( const DenseVector<VT,TF>& rhs );
445 template< typename VT >
446 inline
EnableIf_<VectorizedDivAssign<VT> > divAssign( const DenseVector<VT,TF>& rhs );
453 enum :
size_t { NN = (
usePadding )?( NextMultiple< SizeT<N>, SizeT<SIMDSIZE> >::value ):( N ) };
496 template<
typename Type
506 for(
size_t i=0UL; i<NN; ++i )
525 template<
typename Type
539 for(
size_t i=0UL; i<NN; ++i )
559 template<
typename Type
572 for(
size_t i=0UL; i<n; ++i )
576 for(
size_t i=n; i<NN; ++i )
603 template<
typename Type
608 , size_( list.
size() )
616 std::fill( std::copy( list.begin(), list.end(),
v_.
data() ),
v_.
data()+NN, Type() );
646 template<
typename Type
649 template<
typename Other >
660 for(
size_t i=0UL; i<n; ++i )
664 for(
size_t i=n; i<NN; ++i )
691 template<
typename Type
694 template<
typename Other
703 for(
size_t i=0UL; i<M; ++i )
707 for(
size_t i=M; i<NN; ++i )
723 template<
typename Type
732 for(
size_t i=0UL; i<
size_; ++i )
736 for(
size_t i=size_; i<NN; ++i )
755 template<
typename Type
758 template<
typename VT >
761 , size_( (~v).
size() )
767 if( (~v).
size() > N ) {
772 i<( IsNumeric<Type>::value ? NN :
size_ ); ++i ) {
800 template<
typename Type
821 template<
typename Type
843 template<
typename Type
849 if( index >= size_ ) {
852 return (*
this)[index];
867 template<
typename Type
873 if( index >= size_ ) {
876 return (*
this)[index];
888 template<
typename Type
905 template<
typename Type
920 template<
typename Type
935 template<
typename Type
950 template<
typename Type
965 template<
typename Type
981 template<
typename Type
997 template<
typename Type
1022 template<
typename Type
1029 for(
size_t i=0UL; i<size_; ++i )
1055 template<
typename Type
1060 if( list.size() > N ) {
1064 resize( list.size(), false );
1065 std::copy( list.begin(), list.end(), v_.data() );
1091 template<
typename Type
1094 template<
typename Other
1102 for(
size_t i=0UL; i<M; ++i )
1118 template<
typename Type
1123 using blaze::assign;
1128 assign( *
this, ~rhs );
1147 template<
typename Type
1150 template<
typename VT >
1153 using blaze::assign;
1155 if( (~rhs).
size() > N ) {
1159 if( (~rhs).canAlias(
this ) ) {
1167 assign( *
this, ~rhs );
1187 template<
typename Type
1190 template<
typename VT >
1193 using blaze::addAssign;
1195 if( (~rhs).
size() != size_ ) {
1199 if( (~rhs).canAlias(
this ) ) {
1201 addAssign( *
this, tmp );
1204 addAssign( *
this, ~rhs );
1224 template<
typename Type
1227 template<
typename VT >
1230 using blaze::subAssign;
1232 if( (~rhs).
size() != size_ ) {
1236 if( (~rhs).canAlias(
this ) ) {
1238 subAssign( *
this, tmp );
1241 subAssign( *
this, ~rhs );
1262 template<
typename Type
1265 template<
typename VT >
1268 using blaze::multAssign;
1270 if( (~rhs).
size() != size_ ) {
1276 this->operator=( tmp );
1279 multAssign( *
this, ~rhs );
1299 template<
typename Type
1302 template<
typename VT >
1305 using blaze::divAssign;
1307 if( (~rhs).
size() != size_ ) {
1311 if( (~rhs).canAlias(
this ) ) {
1313 this->operator=( tmp );
1316 divAssign( *
this, ~rhs );
1333 template<
typename Type
1336 template<
typename Other >
1340 using blaze::assign;
1342 assign( *
this, (*
this) * rhs );
1360 template<
typename Type
1363 template<
typename Other >
1367 using blaze::assign;
1371 assign( *
this, (*
this) / rhs );
1393 template<
typename Type
1408 template<
typename Type
1426 template<
typename Type
1431 size_t nonzeros( 0 );
1433 for(
size_t i=0UL; i<size_; ++i ) {
1448 template<
typename Type
1454 for(
size_t i=0UL; i<size_; ++i )
1467 template<
typename Type
1508 template<
typename Type
1520 for(
size_t i=n; i<size_; ++i )
1543 template<
typename Type
1560 template<
typename Type
1563 template<
typename Other >
1566 for(
size_t i=0; i<size_; ++i )
1579 template<
typename Type
1586 const size_t maxsize(
max( size_, v.size_ ) );
1587 for(
size_t i=0UL; i<maxsize; ++i )
1588 swap( v_[i], v.v_[i] );
1589 swap( size_, v.size_ );
1612 template<
typename Type
1621 return allocate<HybridVector>( 1UL );
1636 template<
typename Type
1659 template<
typename Type
1668 return allocate<HybridVector>( 1UL );
1683 template<
typename Type
1691 return allocate<HybridVector>( size/
sizeof(
HybridVector) );
1702 template<
typename Type
1707 deallocate( static_cast<HybridVector*>( ptr ) );
1718 template<
typename Type
1723 deallocate( static_cast<HybridVector*>( ptr ) );
1734 template<
typename Type
1739 deallocate( static_cast<HybridVector*>( ptr ) );
1750 template<
typename Type
1755 deallocate( static_cast<HybridVector*>( ptr ) );
1777 template<
typename Type
1786 for(
size_t i=size_; i<NN; ++i ) {
1787 if( v_[i] != Type() )
1815 template<
typename Type
1818 template<
typename Other >
1821 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1836 template<
typename Type
1839 template<
typename Other >
1842 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1856 template<
typename Type
1878 template<
typename Type
1884 return loada( index );
1902 template<
typename Type
1917 return loada( &v_[index] );
1935 template<
typename Type
1948 return loadu( &v_[index] );
1966 template<
typename Type
1990 template<
typename Type
2005 storea( &v_[index], value );
2023 template<
typename Type
2036 storeu( &v_[index], value );
2055 template<
typename Type
2070 stream( &v_[index], value );
2086 template<
typename Type
2089 template<
typename VT >
2095 for(
size_t i=0UL; i<size_; ++i )
2112 template<
typename Type
2115 template<
typename VT >
2125 const size_t ipos( ( remainder )?( size_ &
size_t(-SIMDSIZE) ):( size_ ) );
2126 BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2130 for( ; i<ipos; i+=SIMDSIZE ) {
2131 store( i, (~rhs).load(i) );
2133 for( ; remainder && i<size_; ++i ) {
2151 template<
typename Type
2154 template<
typename VT >
2160 v_[element->index()] = element->value();
2176 template<
typename Type
2179 template<
typename VT >
2185 for(
size_t i=0UL; i<size_; ++i )
2202 template<
typename Type
2205 template<
typename VT >
2215 const size_t ipos( ( remainder )?( size_ &
size_t(-SIMDSIZE) ):( size_ ) );
2216 BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2220 for( ; i<ipos; i+=SIMDSIZE ) {
2221 store( i, load(i) + (~rhs).load(i) );
2223 for( ; remainder && i<size_; ++i ) {
2241 template<
typename Type
2244 template<
typename VT >
2250 v_[element->index()] += element->value();
2266 template<
typename Type
2269 template<
typename VT >
2275 for(
size_t i=0UL; i<size_; ++i )
2292 template<
typename Type
2295 template<
typename VT >
2305 const size_t ipos( ( remainder )?( size_ &
size_t(-SIMDSIZE) ):( size_ ) );
2306 BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2310 for( ; i<ipos; i+=SIMDSIZE ) {
2311 store( i, load(i) - (~rhs).load(i) );
2313 for( ; remainder && i<size_; ++i ) {
2331 template<
typename Type
2334 template<
typename VT >
2340 v_[element->index()] -= element->value();
2356 template<
typename Type
2359 template<
typename VT >
2365 for(
size_t i=0UL; i<size_; ++i )
2382 template<
typename Type
2385 template<
typename VT >
2395 const size_t ipos( ( remainder )?( size_ &
size_t(-SIMDSIZE) ):( size_ ) );
2396 BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2400 for( ; i<ipos; i+=SIMDSIZE ) {
2401 store( i, load(i) * (~rhs).load(i) );
2403 for( ; remainder && i<size_; ++i ) {
2421 template<
typename Type
2424 template<
typename VT >
2434 v_[element->index()] = tmp[element->index()] * element->value();
2450 template<
typename Type
2453 template<
typename VT >
2459 for(
size_t i=0UL; i<size_; ++i )
2476 template<
typename Type
2479 template<
typename VT >
2487 const size_t ipos( size_ &
size_t(-SIMDSIZE) );
2492 for( ; i<ipos; i+=SIMDSIZE ) {
2493 store( i, load(i) / (~rhs).load(i) );
2495 for( ; i<size_; ++i ) {
2522 template<
typename Type
2544 template<
typename Type,
size_t N,
bool TF >
2547 template<
typename Type,
size_t N,
bool TF >
2550 template<
typename Type,
size_t N,
bool TF >
2553 template<
typename Type,
size_t N,
bool TF >
2556 template<
typename Type,
size_t N,
bool TF >
2569 template<
typename Type
2586 template<
typename Type
2613 template<
typename Type
2618 return ( v.size() == 0UL );
2641 template<
typename Type
2646 return v.isIntact();
2659 template<
typename Type
2679 template<
typename T,
size_t N,
bool TF >
2680 struct HasConstDataAccess< HybridVector<T,N,TF> > :
public TrueType
2696 template<
typename T,
size_t N,
bool TF >
2697 struct HasMutableDataAccess< HybridVector<T,N,TF> > :
public TrueType
2713 template<
typename T,
size_t N,
bool TF >
2714 struct IsAligned< HybridVector<T,N,TF> > :
public TrueType
2730 template<
typename T,
size_t N,
bool TF >
2731 struct IsPadded< HybridVector<T,N,TF> > :
public BoolConstant<usePadding>
2747 template<
typename T,
size_t N,
bool TF >
2748 struct IsResizable< HybridVector<T,N,TF> > :
public TrueType
2764 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2765 struct AddTrait< HybridVector<T1,M,TF>, StaticVector<T2,N,TF> >
2767 using Type = StaticVector< AddTrait_<T1,T2>, N, TF >;
2770 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2771 struct AddTrait< StaticVector<T1,M,TF>, HybridVector<T2,N,TF> >
2773 using Type = StaticVector< AddTrait_<T1,T2>, M, TF >;
2776 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2777 struct AddTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
2779 using Type = HybridVector< AddTrait_<T1,T2>, ( M < N )?( M ):( N ), TF >;
2795 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2796 struct SubTrait< HybridVector<T1,M,TF>, StaticVector<T2,N,TF> >
2798 using Type = StaticVector< SubTrait_<T1,T2>, N, TF >;
2801 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2802 struct SubTrait< StaticVector<T1,M,TF>, HybridVector<T2,N,TF> >
2804 using Type = StaticVector< SubTrait_<T1,T2>, M, TF >;
2807 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2808 struct SubTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
2810 using Type = HybridVector< SubTrait_<T1,T2>, ( M < N )?( M ):( N ), TF >;
2826 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2827 struct MultTrait< HybridVector<T1,N,TF>, T2,
EnableIf_<IsNumeric<T2> > >
2829 using Type = HybridVector< MultTrait_<T1,T2>, N, TF >;
2832 template<
typename T1,
typename T2,
size_t N,
bool TF >
2833 struct MultTrait< T1, HybridVector<T2,N,TF>,
EnableIf_<IsNumeric<T1> > >
2835 using Type = HybridVector< MultTrait_<T1,T2>, N, TF >;
2838 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2839 struct MultTrait< HybridVector<T1,M,TF>, StaticVector<T2,N,TF> >
2841 using Type = StaticVector< MultTrait_<T1,T2>, N, TF >;
2844 template<
typename T1,
size_t M,
typename T2,
size_t N >
2845 struct MultTrait< HybridVector<T1,M,false>, StaticVector<T2,N,true> >
2847 using Type = DynamicMatrix< MultTrait_<T1,T2>,
false >;
2850 template<
typename T1,
size_t M,
typename T2,
size_t N >
2851 struct MultTrait< HybridVector<T1,M,true>, StaticVector<T2,N,false> >
2853 using Type = MultTrait_<T1,T2>;
2856 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2857 struct MultTrait< StaticVector<T1,M,TF>, HybridVector<T2,N,TF> >
2859 using Type = StaticVector< MultTrait_<T1,T2>, M, TF >;
2862 template<
typename T1,
size_t M,
typename T2,
size_t N >
2863 struct MultTrait< StaticVector<T1,M,false>, HybridVector<T2,N,true> >
2865 using Type = DynamicMatrix< MultTrait_<T1,T2>,
false >;
2868 template<
typename T1,
size_t M,
typename T2,
size_t N >
2869 struct MultTrait< StaticVector<T1,M,true>, HybridVector<T2,N,false> >
2871 using Type = MultTrait_<T1,T2>;
2874 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2875 struct MultTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
2877 using Type = HybridVector< MultTrait_<T1,T2>, ( M < N )?( M ):( N ), TF >;
2880 template<
typename T1,
size_t M,
typename T2,
size_t N >
2881 struct MultTrait< HybridVector<T1,M,false>, HybridVector<T2,N,true> >
2883 using Type = DynamicMatrix< MultTrait_<T1,T2>,
false >;
2886 template<
typename T1,
size_t M,
typename T2,
size_t N >
2887 struct MultTrait< HybridVector<T1,M,true>, HybridVector<T2,N,false> >
2889 using Type = MultTrait_<T1,T2>;
2905 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2906 struct CrossTrait< HybridVector<T1,N,TF>, StaticVector<T2,3UL,TF> >
2909 using T = MultTrait_<T1,T2>;
2912 using Type = StaticVector< SubTrait_<T,T>, 3UL, TF >;
2915 template<
typename T1,
bool TF,
typename T2,
size_t N >
2916 struct CrossTrait< StaticVector<T1,3UL,TF>, HybridVector<T2,N,TF> >
2919 using T = MultTrait_<T1,T2>;
2922 using Type = StaticVector< SubTrait_<T,T>, 3UL, TF >;
2925 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2926 struct CrossTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
2929 using T = MultTrait_<T1,T2>;
2932 using Type = StaticVector< SubTrait_<T,T>, 3UL, TF >;
2948 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2949 struct DivTrait< HybridVector<T1,N,TF>, T2,
EnableIf_<IsNumeric<T2> > >
2951 using Type = HybridVector< DivTrait_<T1,T2>, N, TF >;
2954 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2955 struct DivTrait< HybridVector<T1,M,TF>, StaticVector<T2,N,TF> >
2957 using Type = StaticVector< DivTrait_<T1,T2>, N, TF >;
2960 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2961 struct DivTrait< StaticVector<T1,M,TF>, HybridVector<T2,N,TF> >
2963 using Type = StaticVector< DivTrait_<T1,T2>, M, TF >;
2966 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2967 struct DivTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
2969 using Type = HybridVector< DivTrait_<T1,T2>, ( M < N )?( M ):( N ), TF >;
2985 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2986 struct MathTrait< HybridVector<T1,N,TF>, HybridVector<T2,N,TF> >
2988 using HighType = StaticVector< typename MathTrait<T1,T2>::HighType, N, TF >;
2989 using LowType = StaticVector< typename MathTrait<T1,T2>::LowType , N, TF >;
3005 template<
typename T1,
size_t N,
bool TF >
3006 struct SubvectorTrait< HybridVector<T1,N,TF> >
3008 using Type = HybridVector<T1,N,TF>;
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:133
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, a compilation error is created.
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.
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:79
Header file for mathematical functions.
constexpr bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
Header file for the NextMultiple class template.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
void extend(size_t n, bool preserve=true)
Extending the size of the vector.
Definition: HybridVector.h:1546
Header file for the alignment flag values.
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: HybridVector.h:1939
Header file for the UNUSED_PARAMETER function template.
HybridVector()
The default constructor for HybridVector.
Definition: HybridVector.h:499
Header file for the subtraction trait.
Header file for basic type definitions.
Header file for the SparseVector base class.
AlignedArray< Type, NN > v_
The statically allocated vector elements.
Definition: HybridVector.h:459
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:79
Header file for the serial shim.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:188
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:315
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
Iterator end() noexcept
Returns an iterator just past the last element of the hybrid vector.
Definition: HybridVector.h:968
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
Type ElementType
Type of the vector elements.
Definition: HybridVector.h:182
Header file for the DenseVector base class.
Pointer data() noexcept
Low-level data access to the vector elements.
Definition: HybridVector.h:891
size_t capacity() const noexcept
Returns the maximum capacity of the vector.
Definition: HybridVector.h:1411
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
BLAZE_ALWAYS_INLINE SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: HybridVector.h:1882
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
Header file for the SizeT class template.
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: HybridVector.h:1429
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Header file for memory allocation and deallocation functionality.
System settings for performance optimizations.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1716
SIMDTrait_< ElementType > SIMDType
SIMD type of the vector elements.
Definition: HybridVector.h:183
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Constraint on the data type.
Header file for the std::initializer_list aliases.
Efficient implementation of a dynamically sized vector with static memory.The HybridVector class temp...
Definition: Forward.h:59
HybridVector< Type, N,!TF > TransposeType
Transpose type for expression template evaluations.
Definition: HybridVector.h:181
Rebind mechanism to obtain a HybridVector with different data/element type.
Definition: HybridVector.h:200
Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: HybridVector.h:804
BLAZE_ALWAYS_INLINE void storeu(size_t index, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the vector.
Definition: HybridVector.h:2027
Header file for the DisableIf class template.
HybridVector< ET, N, TF > Other
The type of the other HybridVector.
Definition: HybridVector.h:201
Header file for the multiplication trait.
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for nested template disabiguation.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5148
ConstIterator cend() const noexcept
Returns an iterator just past the last element of the hybrid vector.
Definition: HybridVector.h:1000
constexpr bool defaultTransposeFlag
The default transpose flag for all vectors of the Blaze library.This value specifies the default tran...
Definition: TransposeFlag.h:56
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
#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
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
DenseIterator< Type, aligned > Iterator
Iterator over non-constant elements.
Definition: HybridVector.h:192
#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
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: HybridVector.h:1906
Header file for the HasSIMDAdd type trait.
bool isAligned() const noexcept
Returns whether the vector is properly aligned in memory.
Definition: HybridVector.h:1859
Header file for the DenseIterator class template.
Iterator begin() noexcept
Returns an iterator to the first element of the hybrid vector.
Definition: HybridVector.h:923
Header file for the subvector trait.
Header file for all SIMD functionality.
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: HybridVector.h:1840
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:70
Compile time check for sparse vector types.This type trait tests whether or not the given template pa...
Definition: IsSparseVector.h:78
Header file for the IsAligned type trait.
BLAZE_ALWAYS_INLINE void storea(size_t index, const SIMDType &value) noexcept
Aligned store of a SIMD element of the vector.
Definition: HybridVector.h:1994
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:80
#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
bool isIntact() const noexcept
Returns whether the invariants of the hybrid vector are intact.
Definition: HybridVector.h:1780
Header file for the exception macros of the math module.
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:538
BLAZE_ALWAYS_INLINE 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:254
ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the hybrid vector.
Definition: HybridVector.h:953
const Type * ConstPointer
Pointer to a constant vector value.
Definition: HybridVector.h:190
DenseIterator< const Type, aligned > ConstIterator
Iterator over constant elements.
Definition: HybridVector.h:193
void clear()
Clearing the vector.
Definition: HybridVector.h:1470
const Type & ReturnType
Return type for expression template evaluations.
Definition: HybridVector.h:184
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
Header file for the IsPadded type trait.
Header file for the IsVectorizable type trait.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
void resize(size_t n, bool preserve=true)
Changing the size of the vector.
Definition: HybridVector.h:1511
size_t size_
The current size/dimension of the vector.
Definition: HybridVector.h:465
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:75
Header file for the IsSparseVector type trait.
Header file for the HasSIMDMult type trait.
const HybridVector & CompositeType
Data type for composite expression templates.
Definition: HybridVector.h:185
Header file for run time assertion macros.
HybridVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: HybridVector.h:1025
Type * Pointer
Pointer to a non-constant vector value.
Definition: HybridVector.h:189
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
Constraint on the data type.
Header file for the AlignedArray implementation.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2646
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:258
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:2059
Constraint on the data type.
Header file for the HasSIMDSub type trait.
Header file for the HasMutableDataAccess type trait.
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: HybridVector.h:1819
Pointer data() noexcept
Low-level data access to the array elements.
Definition: AlignedArray.h:356
void swap(HybridVector &v) noexcept
Swapping the contents of two hybrid vectors.
Definition: HybridVector.h:1582
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
EnableIf_< IsBuiltin< T > > deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:225
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:76
Header file for the mathematical trait.
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
Type & Reference
Reference to a non-constant vector value.
Definition: HybridVector.h:187
void reset()
Reset to the default initial values.
Definition: HybridVector.h:1451
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
Reference at(size_t index)
Checked access to the vector elements.
Definition: HybridVector.h:847
Header file for the AreSIMDCombinable type trait.
constexpr bool usePadding
Configuration of the padding of dense vectors and matrices.This configuration switch enables/disables...
Definition: Optimizations.h:52
Header file for the HasSIMDDiv type trait.
HybridVector< Type, N, TF > This
Type of this HybridVector instance.
Definition: HybridVector.h:178
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:154
const Type & ConstReference
Reference to a constant vector value.
Definition: HybridVector.h:188
Header file for the default transpose flag for all vectors of the Blaze library.
Initializer list type of the Blaze library.
Header file for the alignment check function.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:110
Header file for the IntegralConstant class template.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: HybridVector.h:1396
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: HybridVector.h:1970
Header file for the IsResizable type trait.
System settings for the inline keywords.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
DenseVector< This, TF > BaseType
Base type of this HybridVector instance.
Definition: HybridVector.h:179
Header file for the TrueType type/value trait base class.
This ResultType
Result type for expression template evaluations.
Definition: HybridVector.h:180