35 #ifndef _BLAZE_MATH_DENSE_STATICVECTOR_H_ 36 #define _BLAZE_MATH_DENSE_STATICVECTOR_H_ 182 template<
typename Type
184 ,
bool TF = defaultTransposeFlag >
186 :
public DenseVector< StaticVector<Type,N,TF>, TF >
211 template<
typename NewType >
220 template<
size_t NewN >
238 enum :
bool { smpAssignable =
false };
248 template<
typename Other >
251 template<
typename Other,
size_t Dim >
285 inline StaticVector&
operator=(
const Type& rhs );
288 template<
typename Other,
size_t Dim >
291 inline StaticVector&
operator=(
const StaticVector& rhs );
299 template<
typename VT >
inline StaticVector& operator%=(
const Vector<VT,TF>& rhs );
301 template<
typename Other >
304 template<
typename Other >
312 inline constexpr
size_t size()
const noexcept;
313 inline constexpr
size_t spacing()
const noexcept;
314 inline constexpr
size_t capacity()
const noexcept;
317 inline void swap( StaticVector& v ) noexcept;
324 template<
typename Other >
inline StaticVector& scale(
const Other& scalar );
331 static inline void*
operator new ( std::size_t
size );
332 static inline void*
operator new[]( std::size_t
size );
333 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
334 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
336 static inline void operator delete (
void* ptr );
337 static inline void operator delete[](
void* ptr );
338 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
339 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
346 template<
typename VT >
348 struct VectorizedAssign {
349 enum :
bool { value = useOptimizedKernels &&
350 simdEnabled && VT::simdEnabled &&
358 template<
typename VT >
360 struct VectorizedAddAssign {
361 enum :
bool { value = useOptimizedKernels &&
362 simdEnabled && VT::simdEnabled &&
371 template<
typename VT >
373 struct VectorizedSubAssign {
374 enum :
bool { value = useOptimizedKernels &&
375 simdEnabled && VT::simdEnabled &&
384 template<
typename VT >
386 struct VectorizedMultAssign {
387 enum :
bool { value = useOptimizedKernels &&
388 simdEnabled && VT::simdEnabled &&
397 template<
typename VT >
399 struct VectorizedDivAssign {
400 enum :
bool { value = useOptimizedKernels &&
401 simdEnabled && VT::simdEnabled &&
417 inline bool isIntact()
const noexcept;
424 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
425 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
438 template<
typename VT >
441 template<
typename VT >
446 template<
typename VT >
449 template<
typename VT >
454 template<
typename VT >
457 template<
typename VT >
462 template<
typename VT >
465 template<
typename VT >
470 template<
typename VT >
473 template<
typename VT >
481 enum :
size_t { NN = ( usePadding )?(
nextMultiple( N, SIMDSIZE ) ):( N ) };
523 template<
typename Type
532 for(
size_t i=0UL; i<NN; ++i )
546 template<
typename Type
554 for(
size_t i=0UL; i<N; ++i )
557 for(
size_t i=N; i<NN; ++i )
582 template<
typename Type
590 if( list.size() > N ) {
594 std::fill( std::copy( list.begin(), list.end(), v_.
data() ), v_.
data()+NN, Type() );
623 template<
typename Type
626 template<
typename Other >
636 for(
size_t i=0UL; i<n; ++i )
640 for(
size_t i=n; i<NN; ++i )
665 template<
typename Type
668 template<
typename Other
676 for(
size_t i=0UL; i<N; ++i )
679 for(
size_t i=N; i<NN; ++i )
694 template<
typename Type
702 for(
size_t i=0UL; i<NN; ++i )
715 template<
typename Type
718 template<
typename Other >
724 for(
size_t i=0UL; i<N; ++i )
727 for(
size_t i=N; i<NN; ++i )
745 template<
typename Type
748 template<
typename VT >
756 if( (~v).
size() != N ) {
788 template<
typename Type
809 template<
typename Type
831 template<
typename Type
840 return (*
this)[index];
855 template<
typename Type
864 return (*
this)[index];
876 template<
typename Type
893 template<
typename Type
908 template<
typename Type
923 template<
typename Type
938 template<
typename Type
953 template<
typename Type
968 template<
typename Type
983 template<
typename Type
1007 template<
typename Type
1012 for(
size_t i=0UL; i<N; ++i )
1037 template<
typename Type
1042 if( list.size() > N ) {
1046 std::fill( std::copy( list.begin(), list.end(), v_.
data() ), v_.
data()+N, Type() );
1070 template<
typename Type
1073 template<
typename Other
1079 for(
size_t i=0UL; i<N; ++i )
1094 template<
typename Type
1099 using blaze::assign;
1101 assign( *
this, ~rhs );
1116 template<
typename Type
1119 template<
typename Other >
1122 using blaze::assign;
1124 assign( *
this, ~rhs );
1143 template<
typename Type
1146 template<
typename VT >
1149 using blaze::assign;
1151 if( (~rhs).
size() != N ) {
1156 StaticVector tmp( ~rhs );
1162 assign( *
this, ~rhs );
1182 template<
typename Type
1185 template<
typename VT >
1188 using blaze::addAssign;
1190 if( (~rhs).
size() != N ) {
1195 StaticVector tmp( ~rhs );
1196 addAssign( *
this, tmp );
1199 addAssign( *
this, ~rhs );
1219 template<
typename Type
1222 template<
typename VT >
1225 using blaze::subAssign;
1227 if( (~rhs).
size() != N ) {
1232 StaticVector tmp( ~rhs );
1233 subAssign( *
this, tmp );
1236 subAssign( *
this, ~rhs );
1257 template<
typename Type
1260 template<
typename VT >
1263 using blaze::assign;
1264 using blaze::multAssign;
1266 if( (~rhs).
size() != N ) {
1271 const StaticVector tmp( *
this * (~rhs) );
1272 assign( *
this, tmp );
1275 multAssign( *
this, ~rhs );
1295 template<
typename Type
1298 template<
typename VT >
1301 using blaze::assign;
1302 using blaze::divAssign;
1304 if( (~rhs).
size() != N ) {
1309 const StaticVector tmp( *
this / (~rhs) );
1310 assign( *
this, tmp );
1313 divAssign( *
this, ~rhs );
1334 template<
typename Type
1337 template<
typename VT >
1340 using blaze::assign;
1351 if( N != 3UL || (~rhs).
size() != 3UL ) {
1355 const CrossType tmp( *
this % (~rhs) );
1356 assign( *
this, tmp );
1372 template<
typename Type
1375 template<
typename Other >
1379 using blaze::assign;
1381 assign( *
this, (*
this) * rhs );
1399 template<
typename Type
1402 template<
typename Other >
1406 using blaze::assign;
1410 assign( *
this, (*
this) / rhs );
1432 template<
typename Type
1450 template<
typename Type
1465 template<
typename Type
1483 template<
typename Type
1488 size_t nonzeros( 0 );
1490 for(
size_t i=0UL; i<N; ++i ) {
1505 template<
typename Type
1511 for(
size_t i=0UL; i<N; ++i )
1523 template<
typename Type
1530 for(
size_t i=0UL; i<N; ++i )
1531 swap( v_[i], v.v_[i] );
1561 template<
typename Type
1564 template<
typename Other >
1567 for(
size_t i=0; i<N; ++i )
1592 template<
typename Type
1601 return allocate<StaticVector>( 1UL );
1616 template<
typename Type
1624 return allocate<StaticVector>( size/
sizeof(
StaticVector) );
1639 template<
typename Type
1648 return allocate<StaticVector>( 1UL );
1663 template<
typename Type
1671 return allocate<StaticVector>( size/
sizeof(
StaticVector) );
1682 template<
typename Type
1687 deallocate( static_cast<StaticVector*>( ptr ) );
1698 template<
typename Type
1703 deallocate( static_cast<StaticVector*>( ptr ) );
1714 template<
typename Type
1719 deallocate( static_cast<StaticVector*>( ptr ) );
1730 template<
typename Type
1735 deallocate( static_cast<StaticVector*>( ptr ) );
1757 template<
typename Type
1763 for(
size_t i=N; i<NN; ++i ) {
1764 if( v_[i] != Type() )
1792 template<
typename Type
1795 template<
typename Other >
1798 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1813 template<
typename Type
1816 template<
typename Other >
1819 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1833 template<
typename Type
1855 template<
typename Type
1861 return loada( index );
1879 template<
typename Type
1894 return loada( &v_[index] );
1912 template<
typename Type
1925 return loadu( &v_[index] );
1943 template<
typename Type
1967 template<
typename Type
1982 storea( &v_[index], value );
2000 template<
typename Type
2013 storeu( &v_[index], value );
2032 template<
typename Type
2047 stream( &v_[index], value );
2063 template<
typename Type
2066 template<
typename VT >
2072 for(
size_t i=0UL; i<N; ++i )
2089 template<
typename Type
2092 template<
typename VT >
2102 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2103 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2107 for( ; i<ipos; i+=SIMDSIZE ) {
2110 for( ; remainder && i<N; ++i ) {
2128 template<
typename Type
2131 template<
typename VT >
2137 v_[element->index()] = element->value();
2153 template<
typename Type
2156 template<
typename VT >
2162 for(
size_t i=0UL; i<N; ++i )
2179 template<
typename Type
2182 template<
typename VT >
2192 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2193 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2197 for( ; i<ipos; i+=SIMDSIZE ) {
2200 for( ; remainder && i<N; ++i ) {
2218 template<
typename Type
2221 template<
typename VT >
2227 v_[element->index()] += element->value();
2243 template<
typename Type
2246 template<
typename VT >
2252 for(
size_t i=0UL; i<N; ++i )
2269 template<
typename Type
2272 template<
typename VT >
2282 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2283 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2287 for( ; i<ipos; i+=SIMDSIZE ) {
2290 for( ; remainder && i<N; ++i ) {
2308 template<
typename Type
2311 template<
typename VT >
2317 v_[element->index()] -= element->value();
2333 template<
typename Type
2336 template<
typename VT >
2342 for(
size_t i=0UL; i<N; ++i )
2359 template<
typename Type
2362 template<
typename VT >
2372 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2373 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2377 for( ; i<ipos; i+=SIMDSIZE ) {
2380 for( ; remainder && i<N; ++i ) {
2398 template<
typename Type
2401 template<
typename VT >
2406 const StaticVector tmp(
serial( *
this ) );
2411 v_[element->index()] = tmp[element->index()] * element->value();
2427 template<
typename Type
2430 template<
typename VT >
2436 for(
size_t i=0UL; i<N; ++i )
2453 template<
typename Type
2456 template<
typename VT >
2464 const size_t ipos( N &
size_t(-SIMDSIZE) );
2469 for( ; i<ipos; i+=SIMDSIZE ) {
2494 template<
typename Type,
size_t N,
bool TF >
2497 template<
typename Type,
size_t N,
bool TF >
2500 template<
bool RF,
typename Type,
size_t N,
bool TF >
2503 template<
typename Type,
size_t N,
bool TF >
2506 template<
typename Type,
bool TF >
2509 template<
typename Type,
bool TF >
2512 template<
typename Type,
size_t N,
bool TF >
2525 template<
typename Type
2544 template<
typename Type
2585 for(
size_t i=0UL; i<N; ++i )
2586 if( !isDefault<RF>( v[i] ) )
return false;
2610 template<
typename Type
2615 return v.isIntact();
2631 template<
typename Type
2648 template<
typename Type
2652 if( v[0] != Type() || v[1] != Type() )
2668 template<
typename Type
2688 template<
typename T,
size_t N,
bool TF >
2689 struct Size< StaticVector<T,N,TF> >
2706 template<
typename T,
size_t N,
bool TF >
2724 template<
typename T,
size_t N,
bool TF >
2742 template<
typename T,
size_t N,
bool TF >
2743 struct IsStatic< StaticVector<T,N,TF> >
2760 template<
typename T,
size_t N,
bool TF >
2761 struct IsAligned< StaticVector<T,N,TF> >
2778 template<
typename T,
size_t N,
bool TF >
2779 struct IsPadded< StaticVector<T,N,TF> >
2796 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2797 struct AddTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2815 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2816 struct SubTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2834 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2835 struct MultTrait< StaticVector<T1,N,TF>, T2, EnableIf_<IsNumeric<T2> > >
2840 template<
typename T1,
typename T2,
size_t N,
bool TF >
2841 struct MultTrait< T1, StaticVector<T2,N,TF>, EnableIf_<IsNumeric<T1> > >
2846 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2847 struct MultTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2852 template<
typename T1,
size_t M,
typename T2,
size_t N >
2853 struct MultTrait< StaticVector<T1,M,false>, StaticVector<T2,N,true> >
2858 template<
typename T1,
size_t N,
typename T2 >
2859 struct MultTrait< StaticVector<T1,N,true>, StaticVector<T2,N,false> >
2877 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2878 struct DivTrait< StaticVector<T1,N,TF>, T2, EnableIf_<IsNumeric<T2> > >
2883 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2884 struct DivTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2902 template<
typename T1,
typename T2,
bool TF >
2903 struct CrossTrait< StaticVector<T1,3UL,TF>, StaticVector<T2,3UL,TF> >
2925 template<
typename T,
size_t N,
bool TF,
typename OP >
2944 template<
typename T1,
size_t N,
bool TF,
typename T2,
typename OP >
2945 struct BinaryMapTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF>, OP >
2963 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2964 struct HighType< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2982 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2983 struct LowType< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
3001 template<
typename T,
size_t N,
bool TF >
constexpr size_t spacing() const noexcept
Returns the minimum capacity of the vector.
Definition: StaticVector.h:1453
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
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: StaticVector.h:1817
Header file for the alignment flag values.
ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the static vector.
Definition: StaticVector.h:941
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
Header file for basic type definitions.
Header file for the SparseVector base class.
DenseIterator< Type, aligned > Iterator
Iterator over non-constant elements.
Definition: StaticVector.h:204
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
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
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
#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
Iterator end() noexcept
Returns an iterator just past the last element of the static vector.
Definition: StaticVector.h:956
Header file for memory allocation and deallocation functionality.
System settings for performance optimizations.
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
Compile time check for static data types.This type trait tests whether the given data type is a stati...
Definition: IsStatic.h:85
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
Constraint on the data type.
Base template for the CrossTrait class.
Definition: CrossTrait.h:116
Type ElementType
Type of the vector elements.
Definition: StaticVector.h:194
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
void swap(StaticVector &v) noexcept
Swapping the contents of two static vectors.
Definition: StaticVector.h:1526
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
Resize mechanism to obtain a StaticVector with a different fixed number of elements.
Definition: StaticVector.h:221
bool isAligned() const noexcept
Returns whether the vector is properly aligned in memory.
Definition: StaticVector.h:1836
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
BLAZE_ALWAYS_INLINE void stream(size_t index, const SIMDType &value) noexcept
Aligned, non-temporal store of a SIMD element of the vector.
Definition: StaticVector.h:2036
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
Reference at(size_t index)
Checked access to the vector elements.
Definition: StaticVector.h:835
Type & Reference
Reference to a non-constant vector value.
Definition: StaticVector.h:199
StaticVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: StaticVector.h:1010
#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.
Efficient implementation of a fixed-sized matrix.The StaticMatrix class template is the representatio...
Definition: Forward.h:60
constexpr size_t capacity() const noexcept
Returns the maximum capacity of the vector.
Definition: StaticVector.h:1468
Header file for the DenseIterator class template.
const Type * ConstPointer
Pointer to a constant vector value.
Definition: StaticVector.h:202
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
SIMDTrait_< ElementType > SIMDType
SIMD type of the vector elements.
Definition: StaticVector.h:195
Header file for the IsAligned type trait.
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
StaticVector< Type, N, TF > This
Type of this StaticVector instance.
Definition: StaticVector.h:190
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: StaticVector.h:1883
void reset()
Reset to the default initial values.
Definition: StaticVector.h:1508
#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
Pointer data() noexcept
Low-level data access to the vector elements.
Definition: StaticVector.h:879
Constraint on the data type.
Header file for the exception macros of the math module.
typename CrossTrait< T1, T2 >::Type CrossTrait_
Auxiliary alias declaration for the CrossTrait class template.The CrossTrait_ alias declaration provi...
Definition: CrossTrait.h:159
Iterator begin() noexcept
Returns an iterator to the first element of the static vector.
Definition: StaticVector.h:911
Constraint on the data type.
const StaticVector< Type, 2UL, TF > perp(const StaticVector< Type, 2UL, TF > &v)
Unary perp dot product operator for the calculation of a perpendicular vector ( ).
Definition: StaticVector.h:2633
constexpr size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: StaticVector.h:1435
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
AlignedArray< Type, NN > v_
The statically allocated vector elements.
Definition: StaticVector.h:487
Header file for the HasConstDataAccess type trait.
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 IsSIMDCombinable type trait.
Header file for the PtrdiffT class template.
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
StaticVector()
The default constructor for StaticVector.
Definition: StaticVector.h:526
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:139
ConstIterator cend() const noexcept
Returns an iterator just past the last element of the static vector.
Definition: StaticVector.h:986
Base template for the MultTrait class.
Definition: MultTrait.h:139
Header file for the addition trait.
Header file for the cross product trait.
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: StaticVector.h:1796
Header file for the division trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: StaticVector.h:196
Constraint on the data type.
Compile time integral constant wrapper for ptrdiff_t.The PtrdiffT class template represents an integr...
Definition: PtrdiffT.h:72
Header file for the AlignedArray implementation.
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
Header file for the IsStatic type trait.
#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
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: StaticVector.h:1916
Header file for the isDefault shim.
Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: StaticVector.h:792
DenseIterator< const Type, aligned > ConstIterator
Iterator over constant elements.
Definition: StaticVector.h:205
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
Type * Pointer
Pointer to a non-constant vector value.
Definition: StaticVector.h:201
Header file for the HasMutableDataAccess type trait.
Pointer data() noexcept
Low-level data access to the array elements.
Definition: AlignedArray.h:356
#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
bool isIntact() const noexcept
Returns whether the invariants of the static vector are intact.
Definition: StaticVector.h:1760
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
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
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
Header file for the HasSIMDDiv type trait.
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: StaticVector.h:1486
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.
BLAZE_ALWAYS_INLINE void storea(size_t index, const SIMDType &value) noexcept
Aligned store of a SIMD element of the vector.
Definition: StaticVector.h:1971
Compile time evaluation of the size of a vector.The Size type trait evaluates the size of the given v...
Definition: Size.h:74
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.
BLAZE_ALWAYS_INLINE void storeu(size_t index, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the vector.
Definition: StaticVector.h:2004
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
Base template for the BinaryMapTrait class.
Definition: BinaryMapTrait.h:119
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:117
System settings for the inline keywords.
const Type & ConstReference
Reference to a constant vector value.
Definition: StaticVector.h:200
Header file for the Size type trait.
#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
BLAZE_ALWAYS_INLINE SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: StaticVector.h:1859
Rebind mechanism to obtain a StaticVector with different data/element type.
Definition: StaticVector.h:212
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: StaticVector.h:1947