26 #ifndef _BLAZE_MATH_DENSE_HYBRIDVECTOR_H_ 27 #define _BLAZE_MATH_DENSE_HYBRIDVECTOR_H_ 176 template<
typename Type
178 ,
bool TF = defaultTransposeFlag >
180 :
public DenseVector< HybridVector<Type,N,TF>, TF >
205 template<
typename NewType >
214 template<
size_t NewN >
232 enum :
bool { smpAssignable =
false };
240 explicit inline HybridVector(
size_t n,
const Type& init );
243 template<
typename Other >
246 template<
typename Other,
size_t Dim >
279 inline HybridVector&
operator=(
const Type& rhs );
282 template<
typename Other,
size_t Dim >
285 inline HybridVector&
operator= (
const HybridVector& rhs );
291 template<
typename VT >
inline HybridVector& operator%=(
const Vector<VT,TF>& rhs );
293 template<
typename Other >
296 template<
typename Other >
304 inline size_t size()
const noexcept;
305 inline size_t spacing()
const noexcept;
306 inline size_t capacity()
const noexcept;
310 inline void resize(
size_t n,
bool preserve=
true );
311 inline void extend(
size_t n,
bool preserve=
true );
312 inline void swap( HybridVector& v ) noexcept;
319 template<
typename Other >
inline HybridVector& scale(
const Other& scalar );
326 static inline void*
operator new ( std::size_t
size );
327 static inline void*
operator new[]( std::size_t
size );
328 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
329 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
331 static inline void operator delete (
void* ptr );
332 static inline void operator delete[](
void* ptr );
333 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
334 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
341 template<
typename VT >
343 struct VectorizedAssign {
344 enum :
bool { value = useOptimizedKernels &&
345 simdEnabled && VT::simdEnabled &&
353 template<
typename VT >
355 struct VectorizedAddAssign {
356 enum :
bool { value = useOptimizedKernels &&
357 simdEnabled && VT::simdEnabled &&
366 template<
typename VT >
368 struct VectorizedSubAssign {
369 enum :
bool { value = useOptimizedKernels &&
370 simdEnabled && VT::simdEnabled &&
379 template<
typename VT >
381 struct VectorizedMultAssign {
382 enum :
bool { value = useOptimizedKernels &&
383 simdEnabled && VT::simdEnabled &&
392 template<
typename VT >
394 struct VectorizedDivAssign {
395 enum :
bool { value = useOptimizedKernels &&
396 simdEnabled && VT::simdEnabled &&
412 inline bool isIntact()
const noexcept;
419 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
420 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
433 template<
typename VT >
436 template<
typename VT >
441 template<
typename VT >
444 template<
typename VT >
449 template<
typename VT >
452 template<
typename VT >
457 template<
typename VT >
460 template<
typename VT >
465 template<
typename VT >
468 template<
typename VT >
476 enum :
size_t { NN = ( usePadding )?(
nextMultiple( N, SIMDSIZE ) ):( N ) };
519 template<
typename Type
529 for(
size_t i=0UL; i<NN; ++i )
548 template<
typename Type
562 for(
size_t i=0UL; i<NN; ++i )
582 template<
typename Type
595 for(
size_t i=0UL; i<n; ++i )
599 for(
size_t i=n; i<NN; ++i )
626 template<
typename Type
639 std::fill( std::copy( list.begin(), list.end(),
v_.
data() ),
v_.
data()+NN, Type() );
669 template<
typename Type
672 template<
typename Other >
683 for(
size_t i=0UL; i<n; ++i )
687 for(
size_t i=n; i<NN; ++i )
714 template<
typename Type
717 template<
typename Other
726 for(
size_t i=0UL; i<Dim; ++i )
730 for(
size_t i=Dim; i<NN; ++i )
746 template<
typename Type
755 for(
size_t i=0UL; i<
size_; ++i )
759 for(
size_t i=size_; i<NN; ++i )
778 template<
typename Type
781 template<
typename VT >
790 if( (~v).
size() > N ) {
795 i<( IsNumeric<Type>::value ? NN :
size_ ); ++i ) {
823 template<
typename Type
844 template<
typename Type
866 template<
typename Type
872 if( index >=
size_ ) {
875 return (*
this)[index];
890 template<
typename Type
896 if( index >=
size_ ) {
899 return (*
this)[index];
911 template<
typename Type
928 template<
typename Type
943 template<
typename Type
958 template<
typename Type
973 template<
typename Type
988 template<
typename Type
1004 template<
typename Type
1020 template<
typename Type
1045 template<
typename Type
1052 for(
size_t i=0UL; i<
size_; ++i )
1078 template<
typename Type
1083 if( list.size() > N ) {
1087 resize( list.size(), false );
1088 std::copy( list.begin(), list.end(),
v_.
data() );
1114 template<
typename Type
1117 template<
typename Other
1125 for(
size_t i=0UL; i<Dim; ++i )
1141 template<
typename Type
1146 using blaze::assign;
1151 assign( *
this, ~rhs );
1170 template<
typename Type
1173 template<
typename VT >
1176 using blaze::assign;
1178 if( (~rhs).
size() > N ) {
1190 assign( *
this, ~rhs );
1210 template<
typename Type
1213 template<
typename VT >
1216 using blaze::addAssign;
1224 addAssign( *
this, tmp );
1227 addAssign( *
this, ~rhs );
1247 template<
typename Type
1250 template<
typename VT >
1253 using blaze::subAssign;
1261 subAssign( *
this, tmp );
1264 subAssign( *
this, ~rhs );
1285 template<
typename Type
1288 template<
typename VT >
1291 using blaze::assign;
1292 using blaze::multAssign;
1300 assign( *
this, tmp );
1303 multAssign( *
this, ~rhs );
1323 template<
typename Type
1326 template<
typename VT >
1329 using blaze::assign;
1330 using blaze::divAssign;
1338 assign( *
this, tmp );
1341 divAssign( *
this, ~rhs );
1362 template<
typename Type
1365 template<
typename VT >
1368 using blaze::assign;
1379 if(
size_ != 3UL || (~rhs).
size() != 3UL ) {
1383 const CrossType tmp( *
this % (~rhs) );
1384 assign( *
this, tmp );
1400 template<
typename Type
1403 template<
typename Other >
1407 using blaze::assign;
1409 assign( *
this, (*
this) * rhs );
1427 template<
typename Type
1430 template<
typename Other >
1434 using blaze::assign;
1438 assign( *
this, (*
this) / rhs );
1460 template<
typename Type
1478 template<
typename Type
1493 template<
typename Type
1511 template<
typename Type
1516 size_t nonzeros( 0 );
1518 for(
size_t i=0UL; i<
size_; ++i ) {
1533 template<
typename Type
1539 for(
size_t i=0UL; i<
size_; ++i )
1552 template<
typename Type
1593 template<
typename Type
1605 for(
size_t i=n; i<
size_; ++i )
1628 template<
typename Type
1645 template<
typename Type
1652 const size_t maxsize(
max(
size_, v.size_ ) );
1653 for(
size_t i=0UL; i<maxsize; ++i )
1685 template<
typename Type
1688 template<
typename Other >
1691 for(
size_t i=0; i<
size_; ++i )
1716 template<
typename Type
1725 return allocate<HybridVector>( 1UL );
1740 template<
typename Type
1763 template<
typename Type
1772 return allocate<HybridVector>( 1UL );
1787 template<
typename Type
1795 return allocate<HybridVector>( size/
sizeof(
HybridVector) );
1806 template<
typename Type
1811 deallocate( static_cast<HybridVector*>( ptr ) );
1822 template<
typename Type
1827 deallocate( static_cast<HybridVector*>( ptr ) );
1838 template<
typename Type
1843 deallocate( static_cast<HybridVector*>( ptr ) );
1854 template<
typename Type
1859 deallocate( static_cast<HybridVector*>( ptr ) );
1881 template<
typename Type
1890 for(
size_t i=
size_; i<NN; ++i ) {
1891 if(
v_[i] != Type() )
1919 template<
typename Type
1922 template<
typename Other >
1925 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1940 template<
typename Type
1943 template<
typename Other >
1946 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1960 template<
typename Type
1982 template<
typename Type
1988 return loada( index );
2006 template<
typename Type
2039 template<
typename Type
2070 template<
typename Type
2094 template<
typename Type
2127 template<
typename Type
2159 template<
typename Type
2190 template<
typename Type
2193 template<
typename VT >
2199 for(
size_t i=0UL; i<
size_; ++i )
2216 template<
typename Type
2219 template<
typename VT >
2229 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2234 for( ; i<ipos; i+=SIMDSIZE ) {
2237 for( ; remainder && i<
size_; ++i ) {
2255 template<
typename Type
2258 template<
typename VT >
2264 v_[element->index()] = element->value();
2280 template<
typename Type
2283 template<
typename VT >
2289 for(
size_t i=0UL; i<
size_; ++i )
2306 template<
typename Type
2309 template<
typename VT >
2319 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2324 for( ; i<ipos; i+=SIMDSIZE ) {
2327 for( ; remainder && i<
size_; ++i ) {
2345 template<
typename Type
2348 template<
typename VT >
2354 v_[element->index()] += element->value();
2370 template<
typename Type
2373 template<
typename VT >
2379 for(
size_t i=0UL; i<
size_; ++i )
2396 template<
typename Type
2399 template<
typename VT >
2409 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2414 for( ; i<ipos; i+=SIMDSIZE ) {
2417 for( ; remainder && i<
size_; ++i ) {
2435 template<
typename Type
2438 template<
typename VT >
2444 v_[element->index()] -= element->value();
2460 template<
typename Type
2463 template<
typename VT >
2469 for(
size_t i=0UL; i<
size_; ++i )
2486 template<
typename Type
2489 template<
typename VT >
2499 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2504 for( ; i<ipos; i+=SIMDSIZE ) {
2507 for( ; remainder && i<
size_; ++i ) {
2525 template<
typename Type
2528 template<
typename VT >
2538 v_[element->index()] = tmp[element->index()] * element->value();
2554 template<
typename Type
2557 template<
typename VT >
2563 for(
size_t i=0UL; i<
size_; ++i )
2580 template<
typename Type
2583 template<
typename VT >
2591 const size_t ipos(
size_ &
size_t(-SIMDSIZE) );
2596 for( ; i<ipos; i+=SIMDSIZE ) {
2599 for( ; i<
size_; ++i ) {
2621 template<
typename Type,
size_t N,
bool TF >
2624 template<
typename Type,
size_t N,
bool TF >
2627 template<
bool RF,
typename Type,
size_t N,
bool TF >
2630 template<
typename Type,
size_t N,
bool TF >
2633 template<
typename Type,
size_t N,
bool TF >
2646 template<
typename Type
2663 template<
typename Type
2703 return ( v.size() == 0UL );
2726 template<
typename Type
2731 return v.isIntact();
2744 template<
typename Type
2764 template<
typename T,
size_t N,
bool TF >
2782 template<
typename T,
size_t N,
bool TF >
2800 template<
typename T,
size_t N,
bool TF >
2801 struct IsAligned< HybridVector<T,N,TF> >
2818 template<
typename T,
size_t N,
bool TF >
2819 struct IsPadded< HybridVector<T,N,TF> >
2836 template<
typename T,
size_t N,
bool TF >
2854 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2855 struct AddTrait< HybridVector<T1,M,TF>, StaticVector<T2,N,TF> >
2860 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2861 struct AddTrait< StaticVector<T1,M,TF>, HybridVector<T2,N,TF> >
2866 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2867 struct AddTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
2885 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2886 struct SubTrait< HybridVector<T1,M,TF>, StaticVector<T2,N,TF> >
2891 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2892 struct SubTrait< StaticVector<T1,M,TF>, HybridVector<T2,N,TF> >
2897 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2898 struct SubTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
2916 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2917 struct MultTrait< HybridVector<T1,N,TF>, T2, EnableIf_<IsNumeric<T2> > >
2922 template<
typename T1,
typename T2,
size_t N,
bool TF >
2923 struct MultTrait< T1, HybridVector<T2,N,TF>, EnableIf_<IsNumeric<T1> > >
2928 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2929 struct MultTrait< HybridVector<T1,M,TF>, StaticVector<T2,N,TF> >
2934 template<
typename T1,
size_t M,
typename T2,
size_t N >
2935 struct MultTrait< HybridVector<T1,M,false>, StaticVector<T2,N,true> >
2940 template<
typename T1,
size_t M,
typename T2,
size_t N >
2941 struct MultTrait< HybridVector<T1,M,true>, StaticVector<T2,N,false> >
2946 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2947 struct MultTrait< StaticVector<T1,M,TF>, HybridVector<T2,N,TF> >
2952 template<
typename T1,
size_t M,
typename T2,
size_t N >
2953 struct MultTrait< StaticVector<T1,M,false>, HybridVector<T2,N,true> >
2958 template<
typename T1,
size_t M,
typename T2,
size_t N >
2959 struct MultTrait< StaticVector<T1,M,true>, HybridVector<T2,N,false> >
2964 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2965 struct MultTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
2970 template<
typename T1,
size_t M,
typename T2,
size_t N >
2971 struct MultTrait< HybridVector<T1,M,false>, HybridVector<T2,N,true> >
2976 template<
typename T1,
size_t M,
typename T2,
size_t N >
2977 struct MultTrait< HybridVector<T1,M,true>, HybridVector<T2,N,false> >
2995 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2996 struct DivTrait< HybridVector<T1,N,TF>, T2, EnableIf_<IsNumeric<T2> > >
3001 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
3002 struct DivTrait< HybridVector<T1,M,TF>, StaticVector<T2,N,TF> >
3007 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
3008 struct DivTrait< StaticVector<T1,M,TF>, HybridVector<T2,N,TF> >
3013 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
3014 struct DivTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
3032 template<
typename T1,
size_t N,
bool TF,
typename T2 >
3033 struct CrossTrait< HybridVector<T1,N,TF>, StaticVector<T2,3UL,TF> >
3042 template<
typename T1,
bool TF,
typename T2,
size_t N >
3043 struct CrossTrait< StaticVector<T1,3UL,TF>, HybridVector<T2,N,TF> >
3052 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
3053 struct CrossTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
3075 template<
typename T,
size_t N,
bool TF,
typename OP >
3094 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N,
typename OP >
3095 struct BinaryMapTrait< HybridVector<T1,M,TF>, StaticVector<T2,N,TF>, OP >
3100 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N,
typename OP >
3101 struct BinaryMapTrait< StaticVector<T1,M,TF>, HybridVector<T2,N,TF>, OP >
3106 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N,
typename OP >
3107 struct BinaryMapTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF>, OP >
3125 template<
typename T1,
size_t N,
bool TF,
typename T2 >
3126 struct HighType< HybridVector<T1,N,TF>, HybridVector<T2,N,TF> >
3144 template<
typename T1,
size_t N,
bool TF,
typename T2 >
3145 struct LowType< HybridVector<T1,N,TF>, HybridVector<T2,N,TF> >
3163 template<
typename T,
size_t N,
bool TF >
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:135
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:171
Header file for mathematical functions.
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:1631
Header file for the alignment flag values.
Header file for the UNUSED_PARAMETER function template.
HybridVector()
The default constructor for HybridVector.
Definition: HybridVector.h:522
Header file for the subtraction trait.
Header file for basic type definitions.
DenseIterator< const Type, aligned > ConstIterator
Iterator over constant elements.
Definition: HybridVector.h:199
Header file for the SparseVector base class.
AlignedArray< Type, NN > v_
The statically allocated vector elements.
Definition: HybridVector.h:482
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:1411
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:172
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:316
Iterator end() noexcept
Returns an iterator just past the last element of the hybrid vector.
Definition: HybridVector.h:991
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: HybridVector.h:1463
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:171
Pointer data() noexcept
Low-level data access to the vector elements.
Definition: HybridVector.h:914
#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
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:250
Header file for memory allocation and deallocation functionality.
System settings for performance optimizations.
Efficient implementation of a dynamic matrix.The DynamicMatrix class template is the representation ...
Definition: DynamicMatrix.h:212
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:1393
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:1496
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:343
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1809
Type ElementType
Type of the vector elements.
Definition: HybridVector.h:188
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: HybridVector.h:1944
Constraint on the data type.
Base template for the CrossTrait class.
Definition: CrossTrait.h:116
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
Type & Reference
Reference to a non-constant vector value.
Definition: HybridVector.h:193
Rebind mechanism to obtain a HybridVector with different data/element type.
Definition: HybridVector.h:206
Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: HybridVector.h:827
BLAZE_ALWAYS_INLINE void storeu(size_t index, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the vector.
Definition: HybridVector.h:2131
Headerfile for the generic max algorithm.
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 unary map 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:5924
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
Type * Pointer
Pointer to a non-constant vector value.
Definition: HybridVector.h:195
#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:946
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: HybridVector.h:2010
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:150
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:103
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:2098
Constraint on the data type.
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
Constraint on the data type.
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:2043
BLAZE_ALWAYS_INLINE SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: HybridVector.h:1986
typename CrossTrait< T1, T2 >::Type CrossTrait_
Auxiliary alias declaration for the CrossTrait class template.The CrossTrait_ alias declaration provi...
Definition: CrossTrait.h:159
Constraint on the data type.
void clear()
Clearing the vector.
Definition: HybridVector.h:1555
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:580
Header file for the IsPadded type trait.
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
size_t spacing() const noexcept
Returns the minimum capacity of the vector.
Definition: HybridVector.h:1481
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:1596
size_t size_
The current size/dimension of the vector.
Definition: HybridVector.h:488
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:1023
Header file for the IsSIMDCombinable type trait.
Header file for the IsSparseVector type trait.
Header file for the HasSIMDMult type trait.
Header file for the binary map 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:156
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:1357
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:139
HybridVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: HybridVector.h:1048
Base template for the MultTrait class.
Definition: MultTrait.h:139
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:1963
bool isIntact() const noexcept
Returns whether the invariants of the hybrid vector are intact.
Definition: HybridVector.h:1884
Constraint on the data type.
ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the hybrid vector.
Definition: HybridVector.h:976
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:2163
Constraint on the data type.
Header file for the HasSIMDSub type trait.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:819
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:1648
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
const Type & ConstReference
Reference to a constant vector value.
Definition: HybridVector.h:194
EnableIf_< IsBuiltin< T > > deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:230
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
Base template for the DivTrait class.
Definition: DivTrait.h:139
DenseIterator< Type, aligned > Iterator
Iterator over non-constant elements.
Definition: HybridVector.h:198
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
const Type * ConstPointer
Pointer to a constant vector value.
Definition: HybridVector.h:196
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
void reset()
Reset to the default initial values.
Definition: HybridVector.h:1536
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:61
SIMDTrait_< ElementType > SIMDType
SIMD type of the vector elements.
Definition: HybridVector.h:189
Reference at(size_t index)
Checked access to the vector elements.
Definition: HybridVector.h:870
HybridVector< Type, N, TF > This
Type of this HybridVector instance.
Definition: HybridVector.h:184
Resize mechanism to obtain a HybridVector with a different fixed number of elements.
Definition: HybridVector.h:215
Header file for the HasSIMDDiv type trait.
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:177
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:130
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:600
Base template for the SubTrait class.
Definition: SubTrait.h:139
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:1375
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:2074
Base template for the BinaryMapTrait class.
Definition: BinaryMapTrait.h:119
Header file for the IsResizable type trait.
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:117
System settings for the inline keywords.
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:63
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, 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:1514
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: HybridVector.h:1923
const Type & ReturnType
Return type for expression template evaluations.
Definition: HybridVector.h:190