35 #ifndef _BLAZE_MATH_DENSE_STATICVECTOR_H_ 36 #define _BLAZE_MATH_DENSE_STATICVECTOR_H_ 184 template<
typename Type
186 ,
bool TF = defaultTransposeFlag >
188 :
public DenseVector< StaticVector<Type,N,TF>, TF >
213 template<
typename NewType >
222 template<
size_t NewN >
240 enum :
bool { smpAssignable =
false };
250 template<
typename Other >
253 template<
typename Other,
size_t Dim >
287 inline StaticVector&
operator=(
const Type& rhs );
290 template<
typename Other,
size_t Dim >
293 inline StaticVector&
operator=(
const StaticVector& rhs );
301 template<
typename VT >
inline StaticVector& operator%=(
const Vector<VT,TF>& rhs );
308 static inline constexpr
size_t size() noexcept;
309 static inline constexpr
size_t spacing() noexcept;
310 static inline constexpr
size_t capacity() noexcept;
313 inline void swap( StaticVector& v ) noexcept;
320 template<
typename Other >
inline StaticVector& scale(
const Other& scalar );
327 static inline void*
operator new ( std::size_t
size );
328 static inline void*
operator new[]( std::size_t
size );
329 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
330 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
332 static inline void operator delete (
void* ptr );
333 static inline void operator delete[](
void* ptr );
334 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
335 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
342 template<
typename VT >
344 struct VectorizedAssign {
345 enum :
bool { value = useOptimizedKernels &&
346 simdEnabled && VT::simdEnabled &&
354 template<
typename VT >
356 struct VectorizedAddAssign {
357 enum :
bool { value = useOptimizedKernels &&
358 simdEnabled && VT::simdEnabled &&
367 template<
typename VT >
369 struct VectorizedSubAssign {
370 enum :
bool { value = useOptimizedKernels &&
371 simdEnabled && VT::simdEnabled &&
380 template<
typename VT >
382 struct VectorizedMultAssign {
383 enum :
bool { value = useOptimizedKernels &&
384 simdEnabled && VT::simdEnabled &&
393 template<
typename VT >
395 struct VectorizedDivAssign {
396 enum :
bool { value = useOptimizedKernels &&
397 simdEnabled && VT::simdEnabled &&
413 inline bool isIntact()
const noexcept;
420 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
421 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
434 template<
typename VT >
437 template<
typename VT >
442 template<
typename VT >
445 template<
typename VT >
450 template<
typename VT >
453 template<
typename VT >
458 template<
typename VT >
461 template<
typename VT >
466 template<
typename VT >
469 template<
typename VT >
477 enum :
size_t { NN = ( usePadding )?(
nextMultiple( N, SIMDSIZE ) ):( N ) };
519 template<
typename Type
528 for(
size_t i=0UL; i<NN; ++i )
542 template<
typename Type
550 for(
size_t i=0UL; i<N; ++i )
553 for(
size_t i=N; i<NN; ++i )
578 template<
typename Type
586 if( list.size() > N ) {
590 std::fill( std::copy( list.begin(), list.end(), v_.
data() ), v_.
data()+NN, Type() );
619 template<
typename Type
622 template<
typename Other >
632 for(
size_t i=0UL; i<n; ++i )
636 for(
size_t i=n; i<NN; ++i )
661 template<
typename Type
664 template<
typename Other
672 for(
size_t i=0UL; i<N; ++i )
675 for(
size_t i=N; i<NN; ++i )
690 template<
typename Type
698 for(
size_t i=0UL; i<NN; ++i )
711 template<
typename Type
714 template<
typename Other >
720 for(
size_t i=0UL; i<N; ++i )
723 for(
size_t i=N; i<NN; ++i )
741 template<
typename Type
744 template<
typename VT >
752 if( (~v).
size() != N ) {
784 template<
typename Type
805 template<
typename Type
827 template<
typename Type
836 return (*
this)[index];
851 template<
typename Type
860 return (*
this)[index];
872 template<
typename Type
889 template<
typename Type
904 template<
typename Type
919 template<
typename Type
934 template<
typename Type
949 template<
typename Type
964 template<
typename Type
979 template<
typename Type
1003 template<
typename Type
1008 for(
size_t i=0UL; i<N; ++i )
1033 template<
typename Type
1038 if( list.size() > N ) {
1042 std::fill( std::copy( list.begin(), list.end(), v_.
data() ), v_.
data()+N, Type() );
1066 template<
typename Type
1069 template<
typename Other
1075 for(
size_t i=0UL; i<N; ++i )
1090 template<
typename Type
1095 using blaze::assign;
1097 assign( *
this, ~rhs );
1112 template<
typename Type
1115 template<
typename Other >
1118 using blaze::assign;
1120 assign( *
this, ~rhs );
1139 template<
typename Type
1142 template<
typename VT >
1145 using blaze::assign;
1147 if( (~rhs).
size() != N ) {
1152 StaticVector tmp( ~rhs );
1158 assign( *
this, ~rhs );
1178 template<
typename Type
1181 template<
typename VT >
1184 using blaze::addAssign;
1186 if( (~rhs).
size() != N ) {
1191 StaticVector tmp( ~rhs );
1192 addAssign( *
this, tmp );
1195 addAssign( *
this, ~rhs );
1215 template<
typename Type
1218 template<
typename VT >
1221 using blaze::subAssign;
1223 if( (~rhs).
size() != N ) {
1228 StaticVector tmp( ~rhs );
1229 subAssign( *
this, tmp );
1232 subAssign( *
this, ~rhs );
1253 template<
typename Type
1256 template<
typename VT >
1259 using blaze::assign;
1260 using blaze::multAssign;
1262 if( (~rhs).
size() != N ) {
1267 const StaticVector tmp( *
this * (~rhs) );
1268 assign( *
this, tmp );
1271 multAssign( *
this, ~rhs );
1291 template<
typename Type
1294 template<
typename VT >
1297 using blaze::assign;
1298 using blaze::divAssign;
1300 if( (~rhs).
size() != N ) {
1305 const StaticVector tmp( *
this / (~rhs) );
1306 assign( *
this, tmp );
1309 divAssign( *
this, ~rhs );
1330 template<
typename Type
1333 template<
typename VT >
1336 using blaze::assign;
1347 if( N != 3UL || (~rhs).
size() != 3UL ) {
1351 const CrossType tmp( *
this % (~rhs) );
1352 assign( *
this, tmp );
1374 template<
typename Type
1392 template<
typename Type
1407 template<
typename Type
1425 template<
typename Type
1430 size_t nonzeros( 0 );
1432 for(
size_t i=0UL; i<N; ++i ) {
1447 template<
typename Type
1453 for(
size_t i=0UL; i<N; ++i )
1465 template<
typename Type
1472 for(
size_t i=0UL; i<N; ++i )
1473 swap( v_[i], v.v_[i] );
1503 template<
typename Type
1506 template<
typename Other >
1509 for(
size_t i=0; i<N; ++i )
1534 template<
typename Type
1543 return allocate<StaticVector>( 1UL );
1558 template<
typename Type
1566 return allocate<StaticVector>( size/
sizeof(
StaticVector) );
1581 template<
typename Type
1590 return allocate<StaticVector>( 1UL );
1605 template<
typename Type
1613 return allocate<StaticVector>( size/
sizeof(
StaticVector) );
1624 template<
typename Type
1629 deallocate( static_cast<StaticVector*>( ptr ) );
1640 template<
typename Type
1645 deallocate( static_cast<StaticVector*>( ptr ) );
1656 template<
typename Type
1661 deallocate( static_cast<StaticVector*>( ptr ) );
1672 template<
typename Type
1677 deallocate( static_cast<StaticVector*>( ptr ) );
1699 template<
typename Type
1705 for(
size_t i=N; i<NN; ++i ) {
1706 if( v_[i] != Type() )
1734 template<
typename Type
1737 template<
typename Other >
1740 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1755 template<
typename Type
1758 template<
typename Other >
1761 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1775 template<
typename Type
1797 template<
typename Type
1803 return loada( index );
1821 template<
typename Type
1836 return loada( &v_[index] );
1854 template<
typename Type
1867 return loadu( &v_[index] );
1885 template<
typename Type
1909 template<
typename Type
1924 storea( &v_[index], value );
1942 template<
typename Type
1955 storeu( &v_[index], value );
1974 template<
typename Type
1989 stream( &v_[index], value );
2005 template<
typename Type
2008 template<
typename VT >
2014 for(
size_t i=0UL; i<N; ++i )
2031 template<
typename Type
2034 template<
typename VT >
2044 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2045 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2049 for( ; i<ipos; i+=SIMDSIZE ) {
2052 for( ; remainder && i<N; ++i ) {
2070 template<
typename Type
2073 template<
typename VT >
2079 v_[element->index()] = element->value();
2095 template<
typename Type
2098 template<
typename VT >
2104 for(
size_t i=0UL; i<N; ++i )
2121 template<
typename Type
2124 template<
typename VT >
2134 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2135 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2139 for( ; i<ipos; i+=SIMDSIZE ) {
2142 for( ; remainder && i<N; ++i ) {
2160 template<
typename Type
2163 template<
typename VT >
2169 v_[element->index()] += element->value();
2185 template<
typename Type
2188 template<
typename VT >
2194 for(
size_t i=0UL; i<N; ++i )
2211 template<
typename Type
2214 template<
typename VT >
2224 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2225 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2229 for( ; i<ipos; i+=SIMDSIZE ) {
2232 for( ; remainder && i<N; ++i ) {
2250 template<
typename Type
2253 template<
typename VT >
2259 v_[element->index()] -= element->value();
2275 template<
typename Type
2278 template<
typename VT >
2284 for(
size_t i=0UL; i<N; ++i )
2301 template<
typename Type
2304 template<
typename VT >
2314 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2315 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2319 for( ; i<ipos; i+=SIMDSIZE ) {
2322 for( ; remainder && i<N; ++i ) {
2340 template<
typename Type
2343 template<
typename VT >
2348 const StaticVector tmp(
serial( *
this ) );
2353 v_[element->index()] = tmp[element->index()] * element->value();
2369 template<
typename Type
2372 template<
typename VT >
2378 for(
size_t i=0UL; i<N; ++i )
2395 template<
typename Type
2398 template<
typename VT >
2406 const size_t ipos( N &
size_t(-SIMDSIZE) );
2411 for( ; i<ipos; i+=SIMDSIZE ) {
2436 template<
typename Type,
size_t N,
bool TF >
2439 template<
typename Type,
size_t N,
bool TF >
2442 template<
bool RF,
typename Type,
size_t N,
bool TF >
2445 template<
typename Type,
size_t N,
bool TF >
2448 template<
typename Type,
bool TF >
2451 template<
typename Type,
bool TF >
2454 template<
typename Type,
size_t N,
bool TF >
2467 template<
typename Type
2486 template<
typename Type
2527 for(
size_t i=0UL; i<N; ++i )
2528 if( !isDefault<RF>( v[i] ) )
return false;
2552 template<
typename Type
2557 return v.isIntact();
2573 template<
typename Type
2590 template<
typename Type
2594 if( v[0] != Type() || v[1] != Type() )
2610 template<
typename Type
2630 template<
typename T,
size_t N,
bool TF >
2631 struct Size< StaticVector<T,N,TF>, 0UL >
2648 template<
typename T,
size_t N,
bool TF >
2666 template<
typename T,
size_t N,
bool TF >
2684 template<
typename T,
size_t N,
bool TF >
2685 struct IsStatic< StaticVector<T,N,TF> >
2702 template<
typename T,
size_t N,
bool TF >
2703 struct IsAligned< StaticVector<T,N,TF> >
2720 template<
typename T,
size_t N,
bool TF >
2738 template<
typename T,
size_t N,
bool TF >
2739 struct IsPadded< StaticVector<T,N,TF> >
2756 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2757 struct AddTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2775 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2776 struct SubTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2794 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2795 struct MultTrait< StaticVector<T1,N,TF>, T2, EnableIf_<IsNumeric<T2> > >
2800 template<
typename T1,
typename T2,
size_t N,
bool TF >
2801 struct MultTrait< T1, StaticVector<T2,N,TF>, EnableIf_<IsNumeric<T1> > >
2806 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2807 struct MultTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2812 template<
typename T1,
size_t M,
typename T2,
size_t N >
2813 struct MultTrait< StaticVector<T1,M,false>, StaticVector<T2,N,true> >
2818 template<
typename T1,
size_t N,
typename T2 >
2819 struct MultTrait< StaticVector<T1,N,true>, StaticVector<T2,N,false> >
2837 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2838 struct DivTrait< StaticVector<T1,N,TF>, T2, EnableIf_<IsNumeric<T2> > >
2843 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2844 struct DivTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2862 template<
typename T1,
typename T2,
bool TF >
2863 struct CrossTrait< StaticVector<T1,3UL,TF>, StaticVector<T2,3UL,TF> >
2885 template<
typename T,
size_t N,
bool TF,
typename OP >
2904 template<
typename T1,
size_t N,
bool TF,
typename T2,
typename OP >
2905 struct BinaryMapTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF>, OP >
2923 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2924 struct HighType< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2942 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2943 struct LowType< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2961 template<
typename T,
size_t N1,
bool TF,
size_t I,
size_t N2 >
2967 template<
typename T,
size_t N,
bool TF >
2986 template<
typename T,
size_t N1,
bool TF,
size_t... CEAs >
2989 using Type = StaticVector<T,
sizeof...(CEAs),TF>;
2992 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
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: StaticVector.h:1759
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:937
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:206
static constexpr size_t spacing() noexcept
Returns the minimum capacity of the vector.
Definition: StaticVector.h:1395
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
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:291
Iterator end() noexcept
Returns an iterator just past the last element of the static vector.
Definition: StaticVector.h:952
Header file for memory allocation and deallocation functionality.
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
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
Header file for the elements trait.
Constraint on the data type.
Base template for the CrossTrait class.
Definition: CrossTrait.h:113
Type ElementType
Type of the vector elements.
Definition: StaticVector.h:196
Efficient implementation of a fixed-sized vector.The StaticVector class template is the representatio...
Definition: Forward.h:61
Base template for the SubvectorTrait class.
Definition: SubvectorTrait.h:109
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:1468
Compile time check for the memory layout of data types.This type trait tests whether the given data t...
Definition: IsContiguous.h:86
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:58
#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:5908
Resize mechanism to obtain a StaticVector with a different fixed number of elements.
Definition: StaticVector.h:223
bool isAligned() const noexcept
Returns whether the vector is properly aligned in memory.
Definition: StaticVector.h:1778
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:1978
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:831
Type & Reference
Reference to a non-constant vector value.
Definition: StaticVector.h:201
StaticVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: StaticVector.h:1006
#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.
static constexpr size_t capacity() noexcept
Returns the maximum capacity of the vector.
Definition: StaticVector.h:1410
Efficient implementation of a fixed-sized matrix.The StaticMatrix class template is the representatio...
Definition: Forward.h:60
Header file for the DenseIterator class template.
const Type * ConstPointer
Pointer to a constant vector value.
Definition: StaticVector.h:204
Header file for the subvector trait.
static constexpr size_t size() noexcept
Returns the current size/dimension of the vector.
Definition: StaticVector.h:1377
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:76
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:197
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:192
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: StaticVector.h:1825
void reset()
Reset to the default initial values.
Definition: StaticVector.h:1450
#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:875
Constraint on the data type.
Header file for the exception macros of the math module.
Base template for the ElementsTrait class.
Definition: ElementsTrait.h:108
typename CrossTrait< T1, T2 >::Type CrossTrait_
Auxiliary alias declaration for the CrossTrait class template.The CrossTrait_ alias declaration provi...
Definition: CrossTrait.h:209
Iterator begin() noexcept
Returns an iterator to the first element of the static vector.
Definition: StaticVector.h:907
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:2575
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:608
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:483
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:522
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:119
ConstIterator cend() const noexcept
Returns an iterator just past the last element of the static vector.
Definition: StaticVector.h:982
Base template for the MultTrait class.
Definition: MultTrait.h:119
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:1738
Header file for the division trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: StaticVector.h:198
Constraint on the data type.
Header file for the IsContiguous type trait.
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:1858
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:788
DenseIterator< const Type, aligned > ConstIterator
Iterator over constant elements.
Definition: StaticVector.h:207
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:816
Type * Pointer
Pointer to a non-constant vector value.
Definition: StaticVector.h:203
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:1702
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:120
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
EnableIf_< IsNumeric< ST >, MT &> operator/=(DenseMatrix< MT, SO > &mat, ST scalar)
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:655
Header file for the HasSIMDDiv type trait.
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: StaticVector.h:1428
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.
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:1913
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
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:1946
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
Base template for the SubTrait class.
Definition: SubTrait.h:119
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
EnableIf_< IsNumeric< ST >, MT &> operator*=(DenseMatrix< MT, SO > &mat, ST scalar)
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:593
Base template for the BinaryMapTrait class.
Definition: BinaryMapTrait.h:97
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:95
System settings for the inline keywords.
const Type & ConstReference
Reference to a constant vector value.
Definition: StaticVector.h:202
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:1801
Rebind mechanism to obtain a StaticVector with different data/element type.
Definition: StaticVector.h:214
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:1889