35 #ifndef _BLAZE_MATH_DENSE_STATICVECTOR_H_ 36 #define _BLAZE_MATH_DENSE_STATICVECTOR_H_ 176 template<
typename Type
179 class StaticVector :
public DenseVector< StaticVector<Type,N,TF>, TF >
204 template<
typename NewType >
213 template<
size_t NewN >
231 enum :
bool { smpAssignable =
false };
241 template<
typename Other >
244 template<
typename Other >
260 inline Reference
operator[](
size_t index ) noexcept;
261 inline ConstReference
operator[](
size_t index )
const noexcept;
262 inline Reference
at(
size_t index );
263 inline ConstReference
at(
size_t index )
const;
264 inline Pointer
data () noexcept;
265 inline ConstPointer
data ()
const noexcept;
266 inline Iterator
begin () noexcept;
267 inline ConstIterator
begin ()
const noexcept;
268 inline ConstIterator
cbegin()
const noexcept;
269 inline Iterator
end () noexcept;
270 inline ConstIterator
end ()
const noexcept;
271 inline ConstIterator
cend ()
const noexcept;
281 template<
typename Other >
293 template<
typename Other >
296 template<
typename Other >
304 inline constexpr
size_t size()
const noexcept;
305 inline constexpr
size_t capacity()
const noexcept;
322 static inline void*
operator new ( std::size_t
size );
323 static inline void*
operator new[]( std::size_t
size );
324 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
325 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
327 static inline void operator delete (
void* ptr );
328 static inline void operator delete[](
void* ptr );
329 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
330 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
337 template<
typename VT >
339 struct VectorizedAssign {
341 simdEnabled && VT::simdEnabled &&
349 template<
typename VT >
351 struct VectorizedAddAssign {
353 simdEnabled && VT::simdEnabled &&
362 template<
typename VT >
364 struct VectorizedSubAssign {
366 simdEnabled && VT::simdEnabled &&
375 template<
typename VT >
377 struct VectorizedMultAssign {
379 simdEnabled && VT::simdEnabled &&
388 template<
typename VT >
390 struct VectorizedDivAssign {
392 simdEnabled && VT::simdEnabled &&
408 inline bool isIntact()
const noexcept;
415 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
416 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
429 template<
typename VT >
432 template<
typename VT >
437 template<
typename VT >
440 template<
typename VT >
445 template<
typename VT >
448 template<
typename VT >
453 template<
typename VT >
456 template<
typename VT >
461 template<
typename VT >
464 template<
typename VT >
514 template<
typename Type
523 for(
size_t i=0UL; i<NN; ++i )
537 template<
typename Type
545 for(
size_t i=0UL; i<N; ++i )
548 for(
size_t i=N; i<NN; ++i )
573 template<
typename Type
581 if( list.size() > N ) {
585 std::fill( std::copy( list.begin(), list.end(), v_.
data() ), v_.
data()+NN, Type() );
614 template<
typename Type
617 template<
typename Other >
627 for(
size_t i=0UL; i<n; ++i )
631 for(
size_t i=n; i<NN; ++i )
656 template<
typename Type
659 template<
typename Other >
665 for(
size_t i=0UL; i<N; ++i )
668 for(
size_t i=N; i<NN; ++i )
683 template<
typename Type
691 for(
size_t i=0UL; i<NN; ++i )
704 template<
typename Type
707 template<
typename Other >
713 for(
size_t i=0UL; i<N; ++i )
716 for(
size_t i=N; i<NN; ++i )
734 template<
typename Type
737 template<
typename VT >
745 if( (~v).
size() != N ) {
777 template<
typename Type
798 template<
typename Type
820 template<
typename Type
829 return (*
this)[index];
844 template<
typename Type
853 return (*
this)[index];
865 template<
typename Type
882 template<
typename Type
897 template<
typename Type
912 template<
typename Type
927 template<
typename Type
942 template<
typename Type
957 template<
typename Type
972 template<
typename Type
996 template<
typename Type
1001 for(
size_t i=0UL; i<N; ++i )
1026 template<
typename Type
1031 if( list.size() > N ) {
1035 std::fill( std::copy( list.begin(), list.end(), v_.
data() ), v_.
data()+N, Type() );
1059 template<
typename Type
1062 template<
typename Other >
1065 for(
size_t i=0UL; i<N; ++i )
1080 template<
typename Type
1085 using blaze::assign;
1087 assign( *
this, ~rhs );
1102 template<
typename Type
1105 template<
typename Other >
1108 using blaze::assign;
1110 assign( *
this, ~rhs );
1129 template<
typename Type
1132 template<
typename VT >
1135 using blaze::assign;
1137 if( (~rhs).
size() != N ) {
1148 assign( *
this, ~rhs );
1168 template<
typename Type
1171 template<
typename VT >
1174 using blaze::addAssign;
1176 if( (~rhs).
size() != N ) {
1182 addAssign( *
this, tmp );
1185 addAssign( *
this, ~rhs );
1205 template<
typename Type
1208 template<
typename VT >
1211 using blaze::subAssign;
1213 if( (~rhs).
size() != N ) {
1219 subAssign( *
this, tmp );
1222 subAssign( *
this, ~rhs );
1243 template<
typename Type
1246 template<
typename VT >
1249 using blaze::multAssign;
1251 if( (~rhs).
size() != N ) {
1260 multAssign( *
this, ~rhs );
1280 template<
typename Type
1283 template<
typename VT >
1286 using blaze::divAssign;
1288 if( (~rhs).
size() != N ) {
1297 divAssign( *
this, ~rhs );
1314 template<
typename Type
1317 template<
typename Other >
1321 using blaze::assign;
1323 assign( *
this, (*
this) * rhs );
1341 template<
typename Type
1344 template<
typename Other >
1348 using blaze::assign;
1352 assign( *
this, (*
this) / rhs );
1374 template<
typename Type
1389 template<
typename Type
1407 template<
typename Type
1412 size_t nonzeros( 0 );
1414 for(
size_t i=0UL; i<N; ++i ) {
1429 template<
typename Type
1435 for(
size_t i=0UL; i<N; ++i )
1447 template<
typename Type
1454 for(
size_t i=0UL; i<N; ++i )
1455 swap( v_[i], v.v_[i] );
1474 template<
typename Type
1477 template<
typename Other >
1480 for(
size_t i=0; i<N; ++i )
1505 template<
typename Type
1514 return allocate<StaticVector>( 1UL );
1529 template<
typename Type
1537 return allocate<StaticVector>( size/
sizeof(
StaticVector) );
1552 template<
typename Type
1561 return allocate<StaticVector>( 1UL );
1576 template<
typename Type
1584 return allocate<StaticVector>( size/
sizeof(
StaticVector) );
1595 template<
typename Type
1600 deallocate( static_cast<StaticVector*>( ptr ) );
1611 template<
typename Type
1616 deallocate( static_cast<StaticVector*>( ptr ) );
1627 template<
typename Type
1632 deallocate( static_cast<StaticVector*>( ptr ) );
1643 template<
typename Type
1648 deallocate( static_cast<StaticVector*>( ptr ) );
1670 template<
typename Type
1676 for(
size_t i=N; i<NN; ++i ) {
1677 if( v_[i] != Type() )
1705 template<
typename Type
1708 template<
typename Other >
1711 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1726 template<
typename Type
1729 template<
typename Other >
1732 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1746 template<
typename Type
1768 template<
typename Type
1774 return loada( index );
1792 template<
typename Type
1807 return loada( &v_[index] );
1825 template<
typename Type
1838 return loadu( &v_[index] );
1856 template<
typename Type
1880 template<
typename Type
1895 storea( &v_[index], value );
1913 template<
typename Type
1926 storeu( &v_[index], value );
1945 template<
typename Type
1960 stream( &v_[index], value );
1976 template<
typename Type
1979 template<
typename VT >
1985 for(
size_t i=0UL; i<N; ++i )
2002 template<
typename Type
2005 template<
typename VT >
2015 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2016 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2020 for( ; i<ipos; i+=SIMDSIZE ) {
2023 for( ; remainder && i<N; ++i ) {
2041 template<
typename Type
2044 template<
typename VT >
2050 v_[element->index()] = element->value();
2066 template<
typename Type
2069 template<
typename VT >
2075 for(
size_t i=0UL; i<N; ++i )
2092 template<
typename Type
2095 template<
typename VT >
2105 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2106 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2110 for( ; i<ipos; i+=SIMDSIZE ) {
2113 for( ; remainder && i<N; ++i ) {
2131 template<
typename Type
2134 template<
typename VT >
2140 v_[element->index()] += element->value();
2156 template<
typename Type
2159 template<
typename VT >
2165 for(
size_t i=0UL; i<N; ++i )
2182 template<
typename Type
2185 template<
typename VT >
2195 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2196 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2200 for( ; i<ipos; i+=SIMDSIZE ) {
2203 for( ; remainder && i<N; ++i ) {
2221 template<
typename Type
2224 template<
typename VT >
2230 v_[element->index()] -= element->value();
2246 template<
typename Type
2249 template<
typename VT >
2255 for(
size_t i=0UL; i<N; ++i )
2272 template<
typename Type
2275 template<
typename VT >
2285 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2286 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2290 for( ; i<ipos; i+=SIMDSIZE ) {
2293 for( ; remainder && i<N; ++i ) {
2311 template<
typename Type
2314 template<
typename VT >
2324 v_[element->index()] = tmp[element->index()] * element->value();
2340 template<
typename Type
2343 template<
typename VT >
2349 for(
size_t i=0UL; i<N; ++i )
2366 template<
typename Type
2369 template<
typename VT >
2377 const size_t ipos( N &
size_t(-SIMDSIZE) );
2382 for( ; i<ipos; i+=SIMDSIZE ) {
2412 template<
typename Type
2434 template<
typename Type,
size_t N,
bool TF >
2437 template<
typename Type,
size_t N,
bool TF >
2440 template<
bool RF,
typename Type,
size_t N,
bool TF >
2443 template<
typename Type,
size_t N,
bool TF >
2446 template<
typename Type,
bool TF >
2449 template<
typename Type,
bool TF >
2452 template<
typename Type,
size_t N,
bool TF >
2465 template<
typename Type
2484 template<
typename Type
2525 for(
size_t i=0UL; i<N; ++i )
2526 if( !isDefault<RF>( v[i] ) )
return false;
2550 template<
typename Type
2555 return v.isIntact();
2571 template<
typename Type
2588 template<
typename Type
2592 if( v[0] != Type() || v[1] != Type() )
2608 template<
typename Type
2628 template<
typename T,
size_t N,
bool TF >
2629 struct Size< StaticVector<T,N,TF> > :
public SizeT<N>
2645 template<
typename T,
size_t N,
bool TF >
2662 template<
typename T,
size_t N,
bool TF >
2679 template<
typename T,
size_t N,
bool TF >
2696 template<
typename T,
size_t N,
bool TF >
2713 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2714 struct AddTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2732 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2733 struct SubTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2751 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2752 struct MultTrait< StaticVector<T1,N,TF>, T2, EnableIf_<IsNumeric<T2> > >
2757 template<
typename T1,
typename T2,
size_t N,
bool TF >
2758 struct MultTrait< T1, StaticVector<T2,N,TF>, EnableIf_<IsNumeric<T1> > >
2763 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2764 struct MultTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2769 template<
typename T1,
size_t M,
typename T2,
size_t N >
2770 struct MultTrait< StaticVector<T1,M,false>, StaticVector<T2,N,true> >
2775 template<
typename T1,
size_t N,
typename T2 >
2776 struct MultTrait< StaticVector<T1,N,true>, StaticVector<T2,N,false> >
2794 template<
typename T1,
typename T2,
bool TF >
2795 struct CrossTrait< StaticVector<T1,3UL,TF>, StaticVector<T2,3UL,TF> >
2817 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2818 struct DivTrait< StaticVector<T1,N,TF>, T2, EnableIf_<IsNumeric<T2> > >
2823 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2824 struct DivTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2842 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2843 struct HighType< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2861 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2862 struct LowType< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2880 template<
typename T1,
size_t N,
bool TF >
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:133
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h:79
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:79
Availability of a SIMD subtraction for the given data types.Depending on the available instruction se...
Definition: HasSIMDSub.h:163
Header file for mathematical functions.
constexpr bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: StaticVector.h:1730
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:930
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.
Type * Pointer
Pointer to a non-constant vector value.
Definition: StaticVector.h:194
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:79
Header file for the serial shim.
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
BLAZE_ALWAYS_INLINE T1 & operator/=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Division assignment operator for the division of two SIMD packs.
Definition: BasicTypes.h:1339
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:162
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:315
DenseVector< This, TF > BaseType
Base type of this StaticVector instance.
Definition: StaticVector.h:184
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
Header file for the DenseVector base class.
Availability of a SIMD addition for the given data types.Depending on the available instruction set (...
Definition: HasSIMDAdd.h:163
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:245
Header file for the SizeT class template.
Iterator end() noexcept
Returns an iterator just past the last element of the static vector.
Definition: StaticVector.h:945
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:1321
Compile time check for data types.This type trait tests whether or not the given types can be combine...
Definition: IsSIMDCombinable.h:120
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
Constraint on the data type.
Base template for the CrossTrait class.
Definition: CrossTrait.h:110
Efficient implementation of a fixed-sized vector.The StaticVector class template is the representatio...
Definition: Forward.h:61
Header file for the std::initializer_list aliases.
Base template for the SubvectorTrait class.
Definition: SubvectorTrait.h:120
Efficient implementation of a dynamically sized vector with static memory.The HybridVector class temp...
Definition: Forward.h:59
Compile time check for low-level access to mutable data.This type trait tests whether the given data ...
Definition: HasMutableDataAccess.h:75
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
void swap(StaticVector &v) noexcept
Swapping the contents of two static vectors.
Definition: StaticVector.h:1450
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.
const StaticVector & CompositeType
Data type for composite expression templates.
Definition: StaticVector.h:190
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for nested template disabiguation.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5635
Resize mechanism to obtain a StaticVector with a different fixed number of elements.
Definition: StaticVector.h:214
bool isAligned() const noexcept
Returns whether the vector is properly aligned in memory.
Definition: StaticVector.h:1749
constexpr bool defaultTransposeFlag
The default transpose flag for all vectors of the Blaze library.This value specifies the default tran...
Definition: TransposeFlag.h:56
Header file for all forward declarations of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
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:1949
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:824
StaticVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: StaticVector.h:999
#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:1392
Header file for the DenseIterator class template.
const Type * ConstPointer
Pointer to a constant vector value.
Definition: StaticVector.h:195
Header file for the subvector trait.
Header file for all SIMD functionality.
Constraint on the data type.
Availability of a SIMD division for the given data types.Depending on the available instruction set (...
Definition: HasSIMDDiv.h:144
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Compile time check for sparse vector types.This type trait tests whether or not the given template pa...
Definition: IsSparseVector.h:78
const Type & ReturnType
Return type for expression template evaluations.
Definition: StaticVector.h:189
Header file for the IsAligned type trait.
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< NewType, N, TF > Other
The type of the other StaticVector.
Definition: StaticVector.h:206
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: StaticVector.h:1796
void reset()
Reset to the default initial values.
Definition: StaticVector.h:1432
#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:868
Header file for the exception macros of the math module.
Iterator begin() noexcept
Returns an iterator to the first element of the static vector.
Definition: StaticVector.h:900
This ResultType
Result type for expression template evaluations.
Definition: StaticVector.h:185
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:2573
DenseIterator< const Type, aligned > ConstIterator
Iterator over constant elements.
Definition: StaticVector.h:198
constexpr size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: StaticVector.h:1377
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
Header file for the IsPadded type trait.
StaticVector< Type, NewN, TF > Other
The type of the other StaticVector.
Definition: StaticVector.h:215
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:478
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 IsSparseVector type trait.
Header file for the HasSIMDMult type trait.
BLAZE_ALWAYS_INLINE constexpr auto nextMultiple(T1 value, T2 factor) noexcept
Rounds up an integral value to the next multiple of a given factor.
Definition: Functions.h:261
Compile time integral constant wrapper for size_t.The SizeT class template represents an integral wra...
Definition: SizeT.h:72
Type ElementType
Type of the vector elements.
Definition: StaticVector.h:187
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1285
StaticVector()
The default constructor for StaticVector.
Definition: StaticVector.h:517
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:143
ConstIterator cend() const noexcept
Returns an iterator just past the last element of the static vector.
Definition: StaticVector.h:975
Base template for the MultTrait class.
Definition: MultTrait.h:143
Header file for the addition trait.
DenseIterator< Type, aligned > Iterator
Iterator over non-constant elements.
Definition: StaticVector.h:197
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:1709
Header file for the division trait.
Constraint on the data type.
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
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: StaticVector.h:1829
Header file for the isDefault shim.
StaticVector< Type, N, TF > This
Type of this StaticVector instance.
Definition: StaticVector.h:183
Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: StaticVector.h:781
Constraint on the data type.
Header file for the HasSIMDSub type trait.
Header file for the HasMutableDataAccess type trait.
Pointer data() noexcept
Low-level data access to the array elements.
Definition: AlignedArray.h:356
bool isIntact() const noexcept
Returns whether the invariants of the static vector are intact.
Definition: StaticVector.h:1673
EnableIf_< IsBuiltin< T > > deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:225
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
Base template for the DivTrait class.
Definition: DivTrait.h:143
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:76
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
constexpr bool usePadding
Configuration of the padding of dense vectors and matrices.This configuration switch enables/disables...
Definition: Optimizations.h:52
Header file for the HasSIMDDiv type trait.
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: StaticVector.h:1410
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:164
Header file for the default transpose flag for all vectors of the Blaze library.
Initializer list type of the Blaze library.
StaticVector< Type, N,!TF > TransposeType
Transpose type for expression template evaluations.
Definition: StaticVector.h:186
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:1884
Compile time evaluation of the size of a vector.The Size type trait evaluates the size of the given v...
Definition: Size.h:75
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:120
Header file for the IntegralConstant class template.
BLAZE_ALWAYS_INLINE void storeu(size_t index, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the vector.
Definition: StaticVector.h:1917
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Base template for the SubTrait class.
Definition: SubTrait.h:143
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1303
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
System settings for the inline keywords.
Header file for the Size type trait.
#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:1772
Rebind mechanism to obtain a StaticVector with different data/element type.
Definition: StaticVector.h:205
const Type & ConstReference
Reference to a constant vector value.
Definition: StaticVector.h:193
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.
Type & Reference
Reference to a non-constant vector value.
Definition: StaticVector.h:192
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: StaticVector.h:1860
SIMDTrait_< ElementType > SIMDType
SIMD type of the vector elements.
Definition: StaticVector.h:188