26 #ifndef _BLAZE_MATH_DENSE_HYBRIDVECTOR_H_ 27 #define _BLAZE_MATH_DENSE_HYBRIDVECTOR_H_ 170 template<
typename Type
173 class HybridVector :
public DenseVector< HybridVector<Type,N,TF>, TF >
198 template<
typename NewType >
207 template<
size_t NewN >
225 enum :
bool { smpAssignable =
false };
233 explicit inline HybridVector(
size_t n,
const Type& init );
236 template<
typename Other >
239 template<
typename Other,
size_t M >
254 inline Reference
operator[](
size_t index ) noexcept;
255 inline ConstReference
operator[](
size_t index )
const noexcept;
256 inline Reference
at(
size_t index );
257 inline ConstReference
at(
size_t index )
const;
258 inline Pointer
data () noexcept;
259 inline ConstPointer
data ()
const noexcept;
260 inline Iterator
begin () noexcept;
261 inline ConstIterator
begin ()
const noexcept;
262 inline ConstIterator
cbegin()
const noexcept;
263 inline Iterator
end () noexcept;
264 inline ConstIterator
end ()
const noexcept;
265 inline ConstIterator
cend ()
const noexcept;
272 inline HybridVector&
operator=(
const Type& rhs );
275 template<
typename Other,
size_t M >
278 inline HybridVector&
operator= (
const HybridVector& rhs );
285 template<
typename Other >
288 template<
typename Other >
296 inline size_t size()
const noexcept;
297 inline size_t capacity()
const noexcept;
301 inline void resize(
size_t n,
bool preserve=
true );
302 inline void extend(
size_t n,
bool preserve=
true );
303 inline void swap( HybridVector& v ) noexcept;
310 template<
typename Other >
inline HybridVector& scale(
const Other& scalar );
317 static inline void*
operator new ( std::size_t
size );
318 static inline void*
operator new[]( std::size_t
size );
319 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
320 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
322 static inline void operator delete (
void* ptr );
323 static inline void operator delete[](
void* ptr );
324 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
325 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
332 template<
typename VT >
334 struct VectorizedAssign {
336 simdEnabled && VT::simdEnabled &&
344 template<
typename VT >
346 struct VectorizedAddAssign {
348 simdEnabled && VT::simdEnabled &&
357 template<
typename VT >
359 struct VectorizedSubAssign {
361 simdEnabled && VT::simdEnabled &&
370 template<
typename VT >
372 struct VectorizedMultAssign {
374 simdEnabled && VT::simdEnabled &&
383 template<
typename VT >
385 struct VectorizedDivAssign {
387 simdEnabled && VT::simdEnabled &&
403 inline bool isIntact()
const noexcept;
410 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
411 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
424 template<
typename VT >
427 template<
typename VT >
432 template<
typename VT >
435 template<
typename VT >
440 template<
typename VT >
443 template<
typename VT >
448 template<
typename VT >
451 template<
typename VT >
456 template<
typename VT >
459 template<
typename VT >
510 template<
typename Type
520 for(
size_t i=0UL; i<NN; ++i )
539 template<
typename Type
553 for(
size_t i=0UL; i<NN; ++i )
573 template<
typename Type
586 for(
size_t i=0UL; i<n; ++i )
590 for(
size_t i=n; i<NN; ++i )
617 template<
typename Type
630 std::fill( std::copy( list.begin(), list.end(),
v_.
data() ),
v_.
data()+NN, Type() );
660 template<
typename Type
663 template<
typename Other >
674 for(
size_t i=0UL; i<n; ++i )
678 for(
size_t i=n; i<NN; ++i )
705 template<
typename Type
708 template<
typename Other
717 for(
size_t i=0UL; i<M; ++i )
721 for(
size_t i=M; i<NN; ++i )
737 template<
typename Type
746 for(
size_t i=0UL; i<
size_; ++i )
750 for(
size_t i=size_; i<NN; ++i )
769 template<
typename Type
772 template<
typename VT >
781 if( (~v).
size() > N ) {
786 i<( IsNumeric<Type>::value ? NN :
size_ ); ++i ) {
814 template<
typename Type
835 template<
typename Type
857 template<
typename Type
863 if( index >=
size_ ) {
866 return (*
this)[index];
881 template<
typename Type
887 if( index >=
size_ ) {
890 return (*
this)[index];
902 template<
typename Type
919 template<
typename Type
934 template<
typename Type
949 template<
typename Type
964 template<
typename Type
979 template<
typename Type
995 template<
typename Type
1011 template<
typename Type
1036 template<
typename Type
1043 for(
size_t i=0UL; i<
size_; ++i )
1069 template<
typename Type
1074 if( list.size() > N ) {
1078 resize( list.size(), false );
1079 std::copy( list.begin(), list.end(),
v_.
data() );
1105 template<
typename Type
1108 template<
typename Other
1116 for(
size_t i=0UL; i<M; ++i )
1132 template<
typename Type
1137 using blaze::assign;
1142 assign( *
this, ~rhs );
1161 template<
typename Type
1164 template<
typename VT >
1167 using blaze::assign;
1169 if( (~rhs).
size() > N ) {
1181 assign( *
this, ~rhs );
1201 template<
typename Type
1204 template<
typename VT >
1207 using blaze::addAssign;
1215 addAssign( *
this, tmp );
1218 addAssign( *
this, ~rhs );
1238 template<
typename Type
1241 template<
typename VT >
1244 using blaze::subAssign;
1252 subAssign( *
this, tmp );
1255 subAssign( *
this, ~rhs );
1276 template<
typename Type
1279 template<
typename VT >
1282 using blaze::multAssign;
1293 multAssign( *
this, ~rhs );
1313 template<
typename Type
1316 template<
typename VT >
1319 using blaze::divAssign;
1330 divAssign( *
this, ~rhs );
1347 template<
typename Type
1350 template<
typename Other >
1354 using blaze::assign;
1356 assign( *
this, (*
this) * rhs );
1374 template<
typename Type
1377 template<
typename Other >
1381 using blaze::assign;
1385 assign( *
this, (*
this) / rhs );
1407 template<
typename Type
1422 template<
typename Type
1440 template<
typename Type
1445 size_t nonzeros( 0 );
1447 for(
size_t i=0UL; i<
size_; ++i ) {
1462 template<
typename Type
1468 for(
size_t i=0UL; i<
size_; ++i )
1481 template<
typename Type
1522 template<
typename Type
1534 for(
size_t i=n; i<
size_; ++i )
1557 template<
typename Type
1574 template<
typename Type
1581 const size_t maxsize(
max(
size_, v.size_ ) );
1582 for(
size_t i=0UL; i<maxsize; ++i )
1603 template<
typename Type
1606 template<
typename Other >
1609 for(
size_t i=0; i<
size_; ++i )
1634 template<
typename Type
1643 return allocate<HybridVector>( 1UL );
1658 template<
typename Type
1681 template<
typename Type
1690 return allocate<HybridVector>( 1UL );
1705 template<
typename Type
1713 return allocate<HybridVector>( size/
sizeof(
HybridVector) );
1724 template<
typename Type
1729 deallocate( static_cast<HybridVector*>( ptr ) );
1740 template<
typename Type
1745 deallocate( static_cast<HybridVector*>( ptr ) );
1756 template<
typename Type
1761 deallocate( static_cast<HybridVector*>( ptr ) );
1772 template<
typename Type
1777 deallocate( static_cast<HybridVector*>( ptr ) );
1799 template<
typename Type
1808 for(
size_t i=
size_; i<NN; ++i ) {
1809 if(
v_[i] != Type() )
1837 template<
typename Type
1840 template<
typename Other >
1843 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1858 template<
typename Type
1861 template<
typename Other >
1864 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1878 template<
typename Type
1900 template<
typename Type
1906 return loada( index );
1924 template<
typename Type
1957 template<
typename Type
1988 template<
typename Type
2012 template<
typename Type
2045 template<
typename Type
2077 template<
typename Type
2108 template<
typename Type
2111 template<
typename VT >
2117 for(
size_t i=0UL; i<
size_; ++i )
2134 template<
typename Type
2137 template<
typename VT >
2147 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2152 for( ; i<ipos; i+=SIMDSIZE ) {
2155 for( ; remainder && i<
size_; ++i ) {
2173 template<
typename Type
2176 template<
typename VT >
2182 v_[element->index()] = element->value();
2198 template<
typename Type
2201 template<
typename VT >
2207 for(
size_t i=0UL; i<
size_; ++i )
2224 template<
typename Type
2227 template<
typename VT >
2237 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2242 for( ; i<ipos; i+=SIMDSIZE ) {
2245 for( ; remainder && i<
size_; ++i ) {
2263 template<
typename Type
2266 template<
typename VT >
2272 v_[element->index()] += element->value();
2288 template<
typename Type
2291 template<
typename VT >
2297 for(
size_t i=0UL; i<
size_; ++i )
2314 template<
typename Type
2317 template<
typename VT >
2327 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2332 for( ; i<ipos; i+=SIMDSIZE ) {
2335 for( ; remainder && i<
size_; ++i ) {
2353 template<
typename Type
2356 template<
typename VT >
2362 v_[element->index()] -= element->value();
2378 template<
typename Type
2381 template<
typename VT >
2387 for(
size_t i=0UL; i<
size_; ++i )
2404 template<
typename Type
2407 template<
typename VT >
2417 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2422 for( ; i<ipos; i+=SIMDSIZE ) {
2425 for( ; remainder && i<
size_; ++i ) {
2443 template<
typename Type
2446 template<
typename VT >
2456 v_[element->index()] = tmp[element->index()] * element->value();
2472 template<
typename Type
2475 template<
typename VT >
2481 for(
size_t i=0UL; i<
size_; ++i )
2498 template<
typename Type
2501 template<
typename VT >
2509 const size_t ipos(
size_ &
size_t(-SIMDSIZE) );
2514 for( ; i<ipos; i+=SIMDSIZE ) {
2517 for( ; i<
size_; ++i ) {
2544 template<
typename Type
2566 template<
typename Type,
size_t N,
bool TF >
2569 template<
typename Type,
size_t N,
bool TF >
2572 template<
bool RF,
typename Type,
size_t N,
bool TF >
2575 template<
typename Type,
size_t N,
bool TF >
2578 template<
typename Type,
size_t N,
bool TF >
2591 template<
typename Type
2608 template<
typename Type
2648 return ( v.size() == 0UL );
2671 template<
typename Type
2676 return v.isIntact();
2689 template<
typename Type
2709 template<
typename T,
size_t N,
bool TF >
2726 template<
typename T,
size_t N,
bool TF >
2743 template<
typename T,
size_t N,
bool TF >
2760 template<
typename T,
size_t N,
bool TF >
2777 template<
typename T,
size_t N,
bool TF >
2794 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2795 struct AddTrait< HybridVector<T1,M,TF>, StaticVector<T2,N,TF> >
2800 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2801 struct AddTrait< StaticVector<T1,M,TF>, HybridVector<T2,N,TF> >
2806 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2807 struct AddTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
2825 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2826 struct SubTrait< HybridVector<T1,M,TF>, StaticVector<T2,N,TF> >
2831 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2832 struct SubTrait< StaticVector<T1,M,TF>, HybridVector<T2,N,TF> >
2837 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2838 struct SubTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
2856 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2857 struct MultTrait< HybridVector<T1,N,TF>, T2, EnableIf_<IsNumeric<T2> > >
2862 template<
typename T1,
typename T2,
size_t N,
bool TF >
2863 struct MultTrait< T1, HybridVector<T2,N,TF>, EnableIf_<IsNumeric<T1> > >
2868 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2869 struct MultTrait< HybridVector<T1,M,TF>, StaticVector<T2,N,TF> >
2874 template<
typename T1,
size_t M,
typename T2,
size_t N >
2875 struct MultTrait< HybridVector<T1,M,false>, StaticVector<T2,N,true> >
2880 template<
typename T1,
size_t M,
typename T2,
size_t N >
2881 struct MultTrait< HybridVector<T1,M,true>, StaticVector<T2,N,false> >
2886 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2887 struct MultTrait< StaticVector<T1,M,TF>, HybridVector<T2,N,TF> >
2892 template<
typename T1,
size_t M,
typename T2,
size_t N >
2893 struct MultTrait< StaticVector<T1,M,false>, HybridVector<T2,N,true> >
2898 template<
typename T1,
size_t M,
typename T2,
size_t N >
2899 struct MultTrait< StaticVector<T1,M,true>, HybridVector<T2,N,false> >
2904 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2905 struct MultTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
2910 template<
typename T1,
size_t M,
typename T2,
size_t N >
2911 struct MultTrait< HybridVector<T1,M,false>, HybridVector<T2,N,true> >
2916 template<
typename T1,
size_t M,
typename T2,
size_t N >
2917 struct MultTrait< HybridVector<T1,M,true>, HybridVector<T2,N,false> >
2935 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2936 struct CrossTrait< HybridVector<T1,N,TF>, StaticVector<T2,3UL,TF> >
2945 template<
typename T1,
bool TF,
typename T2,
size_t N >
2946 struct CrossTrait< StaticVector<T1,3UL,TF>, HybridVector<T2,N,TF> >
2955 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2956 struct CrossTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
2978 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2979 struct DivTrait< HybridVector<T1,N,TF>, T2, EnableIf_<IsNumeric<T2> > >
2984 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2985 struct DivTrait< HybridVector<T1,M,TF>, StaticVector<T2,N,TF> >
2990 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2991 struct DivTrait< StaticVector<T1,M,TF>, HybridVector<T2,N,TF> >
2996 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2997 struct DivTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
3015 template<
typename T1,
size_t N,
bool TF,
typename T2 >
3016 struct HighType< HybridVector<T1,N,TF>, HybridVector<T2,N,TF> >
3034 template<
typename T1,
size_t N,
bool TF,
typename T2 >
3035 struct LowType< HybridVector<T1,N,TF>, HybridVector<T2,N,TF> >
3053 template<
typename T1,
size_t N,
bool 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
Availability of a SIMD subtraction for the given data types.Depending on the available instruction se...
Definition: HasSIMDSub.h:163
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
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
void extend(size_t n, bool preserve=true)
Extending the size of the vector.
Definition: HybridVector.h:1560
Header file for the alignment flag values.
Header file for the UNUSED_PARAMETER function template.
HybridVector()
The default constructor for HybridVector.
Definition: HybridVector.h:513
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:473
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.
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
BLAZE_ALWAYS_INLINE T1 & operator/=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Division assignment operator for the division of two SIMD packs.
Definition: BasicTypes.h:1339
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:162
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:315
Iterator end() noexcept
Returns an iterator just past the last element of the hybrid vector.
Definition: HybridVector.h:982
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:181
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: HybridVector.h:1410
Header file for the DenseVector base class.
Availability of a SIMD addition for the given data types.Depending on the available instruction set (...
Definition: HasSIMDAdd.h:163
Pointer data() noexcept
Low-level data access to the vector elements.
Definition: HybridVector.h:905
#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
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:245
Header file for memory allocation and deallocation functionality.
HybridVector< Type, NewN, TF > Other
The type of the other HybridVector.
Definition: HybridVector.h:209
System settings for performance optimizations.
Efficient implementation of a dynamic matrix.The DynamicMatrix class template is the representation ...
Definition: DynamicMatrix.h:204
BLAZE_ALWAYS_INLINE T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1321
Compile time check for data types.This type trait tests whether or not the given types can be combine...
Definition: IsSIMDCombinable.h:120
size_t capacity() const noexcept
Returns the maximum capacity of the vector.
Definition: HybridVector.h:1425
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:1802
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: HybridVector.h:1862
SIMDTrait_< ElementType > SIMDType
SIMD type of the vector elements.
Definition: HybridVector.h:182
Constraint on the data type.
Base template for the CrossTrait class.
Definition: CrossTrait.h:110
Efficient implementation of a fixed-sized vector.The StaticVector class template is the representatio...
Definition: Forward.h:61
Header file for the std::initializer_list aliases.
Base template for the SubvectorTrait class.
Definition: SubvectorTrait.h:120
Efficient implementation of a dynamically sized vector with static memory.The HybridVector class temp...
Definition: Forward.h:59
Compile time check for low-level access to mutable data.This type trait tests whether the given data ...
Definition: HasMutableDataAccess.h:75
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
HybridVector< Type, N,!TF > TransposeType
Transpose type for expression template evaluations.
Definition: HybridVector.h:180
Rebind mechanism to obtain a HybridVector with different data/element type.
Definition: HybridVector.h:199
Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: HybridVector.h:818
BLAZE_ALWAYS_INLINE void storeu(size_t index, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the vector.
Definition: HybridVector.h:2049
Header file for the DisableIf class template.
Header file for the LowType type trait.
Base template for the HighType type trait.
Definition: HighType.h:133
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:5635
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.
#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:191
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the HasSIMDAdd type trait.
Header file for the DenseIterator class template.
Iterator begin() noexcept
Returns an iterator to the first element of the hybrid vector.
Definition: HybridVector.h:937
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: HybridVector.h:1928
Header file for the subvector trait.
Header file for all SIMD functionality.
Constraint on the data type.
Availability of a SIMD division for the given data types.Depending on the available instruction set (...
Definition: HasSIMDDiv.h:144
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:2016
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
Header file for the exception macros of the math module.
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: HybridVector.h:1961
BLAZE_ALWAYS_INLINE SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: HybridVector.h:1904
const Type * ConstPointer
Pointer to a constant vector value.
Definition: HybridVector.h:189
DenseIterator< const Type, aligned > ConstIterator
Iterator over constant elements.
Definition: HybridVector.h:192
void clear()
Clearing the vector.
Definition: HybridVector.h:1484
const Type & ReturnType
Return type for expression template evaluations.
Definition: HybridVector.h:183
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.
HybridVector< NewType, N, TF > Other
The type of the other HybridVector.
Definition: HybridVector.h:200
Header file for the IsVectorizable type trait.
Header file for the IsNumeric type trait.
Base template for the LowType type trait.
Definition: LowType.h:133
Header file for the HasConstDataAccess type trait.
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
void resize(size_t n, bool preserve=true)
Changing the size of the vector.
Definition: HybridVector.h:1525
size_t size_
The current size/dimension of the vector.
Definition: HybridVector.h:479
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
ConstIterator cend() const noexcept
Returns an iterator just past the last element of the hybrid vector.
Definition: HybridVector.h:1014
Header file for the IsSIMDCombinable type trait.
Header file for the IsSparseVector type trait.
Header file for the HasSIMDMult type trait.
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: Functions.h:261
const HybridVector & CompositeType
Data type for composite expression templates.
Definition: HybridVector.h:184
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1285
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:143
HybridVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: HybridVector.h:1039
Base template for the MultTrait class.
Definition: MultTrait.h:143
Type * Pointer
Pointer to a non-constant vector value.
Definition: HybridVector.h:188
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
bool isAligned() const noexcept
Returns whether the vector is properly aligned in memory.
Definition: HybridVector.h:1881
bool isIntact() const noexcept
Returns whether the invariants of the hybrid vector are intact.
Definition: HybridVector.h:1802
Constraint on the data type.
ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the hybrid vector.
Definition: HybridVector.h:967
Header file for the AlignedArray implementation.
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
#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
Header file for the isDefault shim.
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:2081
Constraint on the data type.
Header file for the HasSIMDSub type trait.
Header file for the HasMutableDataAccess type trait.
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:1577
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
Base template for the DivTrait class.
Definition: DivTrait.h:143
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:76
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
Type & Reference
Reference to a non-constant vector value.
Definition: HybridVector.h:186
void reset()
Reset to the default initial values.
Definition: HybridVector.h:1465
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:861
constexpr bool usePadding
Configuration of the padding of dense vectors and matrices.This configuration switch enables/disables...
Definition: Optimizations.h:52
Resize mechanism to obtain a HybridVector with a different fixed number of elements.
Definition: HybridVector.h:208
Header file for the HasSIMDDiv type trait.
HybridVector< Type, N, TF > This
Type of this HybridVector instance.
Definition: HybridVector.h:177
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:164
const Type & ConstReference
Reference to a constant vector value.
Definition: HybridVector.h:187
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:120
Header file for the IntegralConstant class template.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Base template for the SubTrait class.
Definition: SubTrait.h:143
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1303
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:1992
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
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: HybridVector.h:1443
DenseVector< This, TF > BaseType
Base type of this HybridVector instance.
Definition: HybridVector.h:178
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.
This ResultType
Result type for expression template evaluations.
Definition: HybridVector.h:179
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: HybridVector.h:1841