35 #ifndef _BLAZE_MATH_DENSE_STATICVECTOR_H_ 36 #define _BLAZE_MATH_DENSE_STATICVECTOR_H_ 195 template<
typename Type
197 ,
bool TF = defaultTransposeFlag >
199 :
public DenseVector< StaticVector<Type,N,TF>, TF >
236 template<
typename NewType >
245 template<
size_t NewN >
273 template<
typename Other >
274 explicit inline StaticVector(
size_t n,
const Other* array );
276 template<
typename Other,
size_t Dim >
277 explicit inline StaticVector(
const Other (&array)[Dim] );
281 template<
typename Other >
284 template<
typename VT >
317 inline constexpr
StaticVector& operator=( const Type& rhs );
320 template< typename Other,
size_t Dim >
321 inline
StaticVector& operator=( const Other (&array)[Dim] );
325 template< typename Other >
340 static inline constexpr
size_t size() noexcept;
341 static inline constexpr
size_t spacing() noexcept;
342 static inline constexpr
size_t capacity() noexcept;
344 inline constexpr
void reset();
352 template< typename Other > inline
StaticVector& scale( const Other& scalar );
359 static inline
void* operator new (
std::
size_t size );
360 static inline
void* operator new[](
std::
size_t size );
361 static inline
void* operator new (
std::
size_t size, const
std::nothrow_t& );
362 static inline
void* operator new[](
std::
size_t size, const
std::nothrow_t& );
364 static inline
void operator delete (
void* ptr );
365 static inline
void operator delete[](
void* ptr );
366 static inline
void operator delete (
void* ptr, const
std::nothrow_t& );
367 static inline
void operator delete[](
void* ptr, const
std::nothrow_t& );
374 template< typename VT >
376 static constexpr
bool VectorizedAssign_v =
377 ( useOptimizedKernels &&
385 template< typename VT >
387 static constexpr
bool VectorizedAddAssign_v =
388 ( useOptimizedKernels &&
397 template< typename VT >
399 static constexpr
bool VectorizedSubAssign_v =
400 ( useOptimizedKernels &&
409 template< typename VT >
411 static constexpr
bool VectorizedMultAssign_v =
412 ( useOptimizedKernels &&
421 template< typename VT >
423 static constexpr
bool VectorizedDivAssign_v =
424 ( useOptimizedKernels &&
435 inline constexpr
bool isIntact() const noexcept;
442 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
443 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
445 static inline constexpr
bool isAligned() noexcept;
456 template< typename VT >
459 template< typename VT >
464 template< typename VT >
467 template< typename VT >
472 template< typename VT >
475 template< typename VT >
480 template< typename VT >
483 template< typename VT >
488 template< typename VT >
491 template< typename VT >
545 template< typename Type
553 if( IsNumeric_v<Type> ) {
554 for(
size_t i=0UL; i<
NN; ++i )
568 template<
typename Type
576 for(
size_t i=0UL; i<N; ++i )
579 for(
size_t i=N; i<
NN; ++i )
604 template<
typename Type
612 if( list.size() > N ) {
618 for(
const auto& element : list ) {
650 template<
typename Type
653 template<
typename Other >
663 for(
size_t i=0UL; i<n; ++i )
666 if( IsNumeric_v<Type> ) {
667 for(
size_t i=n; i<
NN; ++i )
692 template<
typename Type
695 template<
typename Other
703 for(
size_t i=0UL; i<N; ++i )
706 for(
size_t i=N; i<
NN; ++i )
721 template<
typename Type
739 template<
typename Type
742 template<
typename Other >
748 for(
size_t i=0UL; i<N; ++i )
751 for(
size_t i=N; i<
NN; ++i )
769 template<
typename Type
772 template<
typename VT >
780 if( (~v).
size() != N ) {
784 for(
size_t i=( IsSparseVector_v<VT> ? 0UL : N ); i<
NN; ++i ) {
812 template<
typename Type
833 template<
typename Type
855 template<
typename Type
864 return (*
this)[index];
879 template<
typename Type
888 return (*
this)[index];
900 template<
typename Type
918 template<
typename Type
934 template<
typename Type
950 template<
typename Type
966 template<
typename Type
982 template<
typename Type
998 template<
typename Type
1014 template<
typename Type
1039 template<
typename Type
1045 for(
size_t i=0UL; i<N; ++i )
1070 template<
typename Type
1076 if( list.size() > N ) {
1082 for(
const auto& element : list ) {
1113 template<
typename Type
1116 template<
typename Other
1122 for(
size_t i=0UL; i<N; ++i )
1137 template<
typename Type
1157 template<
typename Type
1160 template<
typename Other >
1163 using blaze::assign;
1165 assign( *
this, ~rhs );
1184 template<
typename Type
1187 template<
typename VT >
1190 using blaze::assign;
1192 if( (~rhs).
size() != N ) {
1196 if( (~rhs).canAlias(
this ) ) {
1201 if( IsSparseVector_v<VT> )
1203 assign( *
this, ~rhs );
1223 template<
typename Type
1226 template<
typename VT >
1229 using blaze::addAssign;
1231 if( (~rhs).
size() != N ) {
1235 if( (~rhs).canAlias(
this ) ) {
1237 addAssign( *
this, tmp );
1240 addAssign( *
this, ~rhs );
1260 template<
typename Type
1263 template<
typename VT >
1266 using blaze::subAssign;
1268 if( (~rhs).
size() != N ) {
1272 if( (~rhs).canAlias(
this ) ) {
1274 subAssign( *
this, tmp );
1277 subAssign( *
this, ~rhs );
1298 template<
typename Type
1301 template<
typename VT >
1304 using blaze::assign;
1305 using blaze::multAssign;
1307 if( (~rhs).
size() != N ) {
1311 if( IsSparseVector_v<VT> || (~rhs).canAlias(
this ) ) {
1313 assign( *
this, tmp );
1316 multAssign( *
this, ~rhs );
1336 template<
typename Type
1339 template<
typename VT >
1342 using blaze::assign;
1343 using blaze::divAssign;
1345 if( (~rhs).
size() != N ) {
1349 if( (~rhs).canAlias(
this ) ) {
1351 assign( *
this, tmp );
1354 divAssign( *
this, ~rhs );
1375 template<
typename Type
1378 template<
typename VT >
1381 using blaze::assign;
1392 if( N != 3UL || (~rhs).
size() != 3UL ) {
1396 const CrossType tmp( *
this % (~rhs) );
1397 assign( *
this, tmp );
1419 template<
typename Type
1437 template<
typename Type
1452 template<
typename Type
1470 template<
typename Type
1475 size_t nonzeros( 0 );
1477 for(
size_t i=0UL; i<N; ++i ) {
1492 template<
typename Type
1498 for(
size_t i=0UL; i<N; ++i )
1510 template<
typename Type
1517 for(
size_t i=0UL; i<N; ++i )
1518 swap( v_[i], v.v_[i] );
1548 template<
typename Type
1551 template<
typename Other >
1554 for(
size_t i=0; i<N; ++i )
1579 template<
typename Type
1588 return allocate<StaticVector>( 1UL );
1603 template<
typename Type
1626 template<
typename Type
1635 return allocate<StaticVector>( 1UL );
1650 template<
typename Type
1669 template<
typename Type
1674 deallocate( static_cast<StaticVector*>( ptr ) );
1685 template<
typename Type
1690 deallocate( static_cast<StaticVector*>( ptr ) );
1701 template<
typename Type
1706 deallocate( static_cast<StaticVector*>( ptr ) );
1717 template<
typename Type
1722 deallocate( static_cast<StaticVector*>( ptr ) );
1744 template<
typename Type
1749 if( IsNumeric_v<Type> ) {
1750 for(
size_t i=N; i<NN; ++i ) {
1751 if( v_[i] != Type() )
1779 template<
typename Type
1782 template<
typename Other >
1785 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1800 template<
typename Type
1803 template<
typename Other >
1806 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1820 template<
typename Type
1842 template<
typename Type
1848 return loada( index );
1866 template<
typename Type
1881 return loada( &v_[index] );
1899 template<
typename Type
1912 return loadu( &v_[index] );
1930 template<
typename Type
1954 template<
typename Type
1969 storea( &v_[index], value );
1987 template<
typename Type
2000 storeu( &v_[index], value );
2019 template<
typename Type
2034 stream( &v_[index], value );
2050 template<
typename Type
2053 template<
typename VT >
2059 for(
size_t i=0UL; i<N; ++i )
2076 template<
typename Type
2079 template<
typename VT >
2087 constexpr
bool remainder( !usePadding || !IsPadded_v<VT> );
2089 constexpr
size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2090 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2094 for( ; i<ipos; i+=SIMDSIZE ) {
2095 store( i, (~rhs).load(i) );
2097 for( ; remainder && i<N; ++i ) {
2115 template<
typename Type
2118 template<
typename VT >
2123 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2124 v_[element->index()] = element->value();
2140 template<
typename Type
2143 template<
typename VT >
2149 for(
size_t i=0UL; i<N; ++i )
2166 template<
typename Type
2169 template<
typename VT >
2177 constexpr
bool remainder( !usePadding || !IsPadded_v<VT> );
2179 constexpr
size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2180 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2184 for( ; i<ipos; i+=SIMDSIZE ) {
2185 store( i, load(i) + (~rhs).load(i) );
2187 for( ; remainder && i<N; ++i ) {
2205 template<
typename Type
2208 template<
typename VT >
2213 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2214 v_[element->index()] += element->value();
2230 template<
typename Type
2233 template<
typename VT >
2239 for(
size_t i=0UL; i<N; ++i )
2256 template<
typename Type
2259 template<
typename VT >
2267 constexpr
bool remainder( !usePadding || !IsPadded_v<VT> );
2269 constexpr
size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2270 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2274 for( ; i<ipos; i+=SIMDSIZE ) {
2275 store( i, load(i) - (~rhs).load(i) );
2277 for( ; remainder && i<N; ++i ) {
2295 template<
typename Type
2298 template<
typename VT >
2303 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2304 v_[element->index()] -= element->value();
2320 template<
typename Type
2323 template<
typename VT >
2329 for(
size_t i=0UL; i<N; ++i )
2346 template<
typename Type
2349 template<
typename VT >
2357 constexpr
bool remainder( !usePadding || !IsPadded_v<VT> );
2359 constexpr
size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2360 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2364 for( ; i<ipos; i+=SIMDSIZE ) {
2365 store( i, load(i) * (~rhs).load(i) );
2367 for( ; remainder && i<N; ++i ) {
2385 template<
typename Type
2388 template<
typename VT >
2397 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2398 v_[element->index()] = tmp[element->index()] * element->value();
2414 template<
typename Type
2417 template<
typename VT >
2423 for(
size_t i=0UL; i<N; ++i )
2440 template<
typename Type
2443 template<
typename VT >
2451 constexpr
size_t ipos( N &
size_t(-SIMDSIZE) );
2456 for( ; i<ipos; i+=SIMDSIZE ) {
2457 store( i, load(i) / (~rhs).load(i) );
2481 template<
typename Type,
size_t N,
bool TF >
2482 constexpr
void reset( StaticVector<Type,N,TF>& v );
2484 template<
typename Type,
size_t N,
bool TF >
2485 constexpr
void clear( StaticVector<Type,N,TF>& v );
2487 template<
bool RF,
typename Type,
size_t N,
bool TF >
2488 bool isDefault(
const StaticVector<Type,N,TF>& v );
2490 template<
typename Type,
size_t N,
bool TF >
2491 constexpr
bool isIntact(
const StaticVector<Type,N,TF>& v ) noexcept;
2493 template<
typename Type,
bool TF >
2494 const StaticVector<Type,2UL,TF>
perp(
const StaticVector<Type,2UL,TF>& v );
2496 template<
typename Type,
bool TF >
2497 const StaticVector<Type,3UL,TF>
perp(
const StaticVector<Type,3UL,TF>& v );
2499 template<
typename Type,
size_t N,
bool TF >
2500 void swap( StaticVector<Type,N,TF>& a, StaticVector<Type,N,TF>& b ) noexcept;
2512 template<
typename Type
2531 template<
typename Type
2572 for(
size_t i=0UL; i<N; ++i )
2573 if( !isDefault<RF>( v[i] ) )
return false;
2597 template<
typename Type
2602 return v.isIntact();
2618 template<
typename Type
2635 template<
typename Type
2639 if( v[0] != Type() || v[1] != Type() )
2655 template<
typename Type
2675 template<
typename T,
size_t N,
bool TF >
2676 struct Size< StaticVector<T,N,TF>, 0UL >
2693 template<
typename T,
size_t N,
bool TF >
2694 struct MaxSize< StaticVector<T,N,TF>, 0UL >
2711 template<
typename T,
size_t N,
bool TF >
2712 struct HasConstDataAccess< StaticVector<T,N,TF> >
2729 template<
typename T,
size_t N,
bool TF >
2730 struct HasMutableDataAccess< StaticVector<T,N,TF> >
2747 template<
typename T,
size_t N,
bool TF >
2748 struct IsStatic< StaticVector<T,N,TF> >
2765 template<
typename T,
size_t N,
bool TF >
2766 struct IsAligned< StaticVector<T,N,TF> >
2767 :
public BoolConstant< StaticVector<T,N,TF>::isAligned() >
2783 template<
typename T,
size_t N,
bool TF >
2784 struct IsContiguous< StaticVector<T,N,TF> >
2801 template<
typename T,
size_t N,
bool TF >
2802 struct IsPadded< StaticVector<T,N,TF> >
2819 template<
typename T1,
typename T2 >
2820 struct AddTraitEval2< T1, T2
2826 using ET1 = ElementType_t<T1>;
2827 using ET2 = ElementType_t<T2>;
2829 static constexpr
size_t N =
max( Size_v<T1,0UL>, Size_v<T2,0UL> );
2831 using Type = StaticVector< AddTrait_t<ET1,ET2>, N, TransposeFlag_v<T1> >;
2847 template<
typename T1,
typename T2 >
2848 struct SubTraitEval2< T1, T2
2854 using ET1 = ElementType_t<T1>;
2855 using ET2 = ElementType_t<T2>;
2857 static constexpr
size_t N =
max( Size_v<T1,0UL>, Size_v<T2,0UL> );
2859 using Type = StaticVector< SubTrait_t<ET1,ET2>, N, TransposeFlag_v<T1> >;
2875 template<
typename T1,
typename T2 >
2876 struct MultTraitEval2< T1, T2
2881 using ET1 = ElementType_t<T1>;
2883 static constexpr
size_t N = Size_v<T1,0UL>;
2885 using Type = StaticVector< MultTrait_t<ET1,T2>, N, TransposeFlag_v<T1> >;
2888 template<
typename T1,
typename T2 >
2889 struct MultTraitEval2< T1, T2
2894 using ET2 = ElementType_t<T2>;
2896 static constexpr
size_t N = Size_v<T2,0UL>;
2898 using Type = StaticVector< MultTrait_t<T1,ET2>, N, TransposeFlag_v<T2> >;
2901 template<
typename T1,
typename T2 >
2902 struct MultTraitEval2< T1, T2
2904 ( IsColumnVector_v<T1> && IsColumnVector_v<T2> ) ) &&
2905 IsDenseVector_v<T1> &&
2906 IsDenseVector_v<T2> &&
2909 using ET1 = ElementType_t<T1>;
2910 using ET2 = ElementType_t<T2>;
2912 static constexpr
size_t N =
max( Size_v<T1,0UL>, Size_v<T2,0UL> );
2914 using Type = StaticVector< MultTrait_t<ET1,ET2>, N, TransposeFlag_v<T1> >;
2917 template<
typename T1,
typename T2 >
2918 struct MultTraitEval2< T1, T2
2920 IsColumnVector_v<T2> &&
2924 using ET1 = ElementType_t<T1>;
2925 using ET2 = ElementType_t<T2>;
2927 static constexpr
size_t N = ( Size_v<T1,0UL> !=
DefaultSize_v ? Size_v<T1,0UL> : Size_v<T2,0UL> );
2929 using Type = StaticVector< MultTrait_t<ET1,ET2>, N,
false >;
2932 template<
typename T1,
typename T2 >
2933 struct MultTraitEval2< T1, T2
2939 using ET1 = ElementType_t<T1>;
2940 using ET2 = ElementType_t<T2>;
2942 static constexpr
size_t N = ( Size_v<T2,1UL> !=
DefaultSize_v ? Size_v<T2,1UL> : Size_v<T1,0UL> );
2944 using Type = StaticVector< MultTrait_t<ET1,ET2>, N,
true >;
2960 template<
typename T1,
typename T2 >
2961 struct DivTraitEval2< T1, T2
2966 using ET1 = ElementType_t<T1>;
2968 static constexpr
size_t N = Size_v<T1,0UL>;
2970 using Type = StaticVector< DivTrait_t<ET1,T2>, N, TransposeFlag_v<T1> >;
2973 template<
typename T1,
typename T2 >
2974 struct DivTraitEval2< T1, T2
2976 IsDenseVector_v<T2> &&
2980 using ET1 = ElementType_t<T1>;
2981 using ET2 = ElementType_t<T2>;
2983 static constexpr
size_t N =
max( Size_v<T1,0UL>, Size_v<T2,0UL> );
2985 using Type = StaticVector< DivTrait_t<ET1,ET2>, N, TransposeFlag_v<T1> >;
3001 template<
typename T1,
typename T2 >
3002 struct CrossTraitEval2< T1, T2
3005 using Tmp = MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >;
3007 using Type = StaticVector< SubTrait_t<Tmp,Tmp>, 3UL, TransposeFlag_v<T1> >;
3023 template<
typename T,
typename OP >
3024 struct UnaryMapTraitEval2< T, OP
3028 using ET = ElementType_t<T>;
3030 using Type = StaticVector< MapTrait_t<ET,OP>, Size_v<T,0UL>, TransposeFlag_v<T> >;
3038 template<
typename T1,
typename T2,
typename OP >
3039 struct BinaryMapTraitEval2< T1, T2, OP
3045 using ET1 = ElementType_t<T1>;
3046 using ET2 = ElementType_t<T2>;
3048 static constexpr
size_t N =
max( Size_v<T1,0UL>, Size_v<T2,0UL> );
3050 using Type = StaticVector< MapTrait_t<ET1,ET2,OP>, N, TransposeFlag_v<T1> >;
3066 template<
typename T,
typename OP,
size_t RF >
3067 struct PartialReduceTraitEval2< T, OP, RF
3072 static constexpr
bool TF = ( RF == 0UL );
3074 static constexpr
size_t N = Size_v< T, TF ? 1UL : 0UL >;
3076 using Type = StaticVector< ElementType_t<T>, N, TF >;
3092 template<
typename T1,
size_t N,
bool TF,
typename T2 >
3093 struct HighType< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
3095 using Type = StaticVector< typename HighType<T1,T2>::Type, N, TF >;
3111 template<
typename T1,
size_t N,
bool TF,
typename T2 >
3112 struct LowType< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
3114 using Type = StaticVector< typename LowType<T1,T2>::Type, N, TF >;
3130 template<
typename VT,
size_t I,
size_t N >
3131 struct SubvectorTraitEval2< VT, I, N
3133 IsDenseVector_v<VT> > >
3135 using Type = StaticVector< RemoveConst_t< ElementType_t<VT> >, N, TransposeFlag_v<VT> >;
3151 template<
typename VT,
size_t N >
3152 struct ElementsTraitEval2< VT, N
3154 IsDenseVector_v<VT> > >
3156 using Type = StaticVector< RemoveConst_t< ElementType_t<VT> >, N, TransposeFlag_v<VT> >;
3172 template<
typename MT,
size_t I >
3173 struct RowTraitEval2< MT, I
3177 using Type = StaticVector< RemoveConst_t< ElementType_t<MT> >, Size_v<MT,1UL>,
true >;
3193 template<
typename MT,
size_t I >
3194 struct ColumnTraitEval2< MT, I
3198 using Type = StaticVector< RemoveConst_t< ElementType_t<MT> >, Size_v<MT,0UL>,
false >;
3214 template<
typename MT, ptrdiff_t I >
3215 struct BandTraitEval2< MT, I
3220 static constexpr
size_t M = Size_v<MT,0UL>;
3221 static constexpr
size_t N = Size_v<MT,1UL>;
3222 static constexpr
size_t Min =
min( M - ( I >= 0L ? 0UL : -I ), N - ( I >= 0L ? I : 0UL ) );
3224 using Type = StaticVector< RemoveConst_t< ElementType_t<MT> >, Min, defaultTransposeFlag >;
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.
Header file for the nextMultiple shim.
#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:1804
Header file for the AlignmentOf type trait.
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.
static constexpr size_t spacing() noexcept
Returns the minimum capacity of the vector.
Definition: StaticVector.h:1440
constexpr Iterator begin() noexcept
Returns an iterator to the first element of the static vector.
Definition: StaticVector.h:938
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.The HasSIMDSub_v variable template provides...
Definition: HasSIMDSub.h:188
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.The IsMatrix_v variable template provides a c...
Definition: IsMatrix.h:139
Header file for the row trait.
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
Header file for the serial shim.
static constexpr bool align
Compilation switch for the choice of alignment.
Definition: StaticVector.h:210
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
static constexpr bool simdEnabled
Compilation flag for SIMD optimization.
Definition: StaticVector.h:257
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
Header file for the IsRowVector type trait.
typename SIMDTrait< T >::Type SIMDTrait_t
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_t alias declaration provid...
Definition: SIMDTrait.h:315
Header file for the DenseVector base class.
constexpr ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the static vector.
Definition: StaticVector.h:970
#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
SIMDTrait_t< ElementType > SIMDType
SIMD type of the vector elements.
Definition: StaticVector.h:220
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
Header file for memory allocation and deallocation functionality.
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:75
auto addAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedAddAssign_v< VT > >
Default implementation of the addition assignment of a dense vector.
Definition: StaticVector.h:2144
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the reduce trait.
Header file for the MaxSize type trait.
Header file for the elements trait.
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
Header file for the band trait.
Constraint on the data type.
Type ElementType
Type of the vector elements.
Definition: StaticVector.h:219
Efficient implementation of a fixed-sized vector.The StaticVector class template is the representatio...
Definition: Forward.h:61
Header file for the IsMatrix type trait.
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: StaticVector.h:263
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
void swap(StaticVector &v) noexcept
Swapping the contents of two static vectors.
Definition: StaticVector.h:1513
Headerfile for the generic max algorithm.
Header file for the DisableIf class template.
Header file for the LowType type trait.
Header file for the multiplication trait.
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.The IsSIMDCombinable_v variable templ...
Definition: IsSIMDCombinable.h:137
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
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5907
Resize mechanism to obtain a StaticVector with a different fixed number of elements.
Definition: StaticVector.h:246
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.The HasSIMDMult_v variable template provid...
Definition: HasSIMDMult.h:189
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:2023
Reference at(size_t index)
Checked access to the vector elements.
Definition: StaticVector.h:859
Type & Reference
Reference to a non-constant vector value.
Definition: StaticVector.h:224
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1147
#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:1455
constexpr bool HasSIMDDiv_v
Auxiliary variable template for the HasSIMDDiv type trait.The HasSIMDDiv_v variable template provides...
Definition: HasSIMDDiv.h:172
Header file for the DenseIterator class template.
const Type * ConstPointer
Pointer to a constant vector value.
Definition: StaticVector.h:227
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
Header file for the subvector trait.
constexpr bool IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.The IsNumeric_v variable template provides a...
Definition: IsNumeric.h:143
static constexpr size_t size() noexcept
Returns the current size/dimension of the vector.
Definition: StaticVector.h:1422
Header file for all SIMD functionality.
Constraint on the data type.
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
constexpr ConstIterator cend() const noexcept
Returns an iterator just past the last element of the static vector.
Definition: StaticVector.h:1018
Header file for the IsAligned type trait.
constexpr bool IsDenseVector_v
Auxiliary variable template for the IsDenseVector type trait.The IsDenseVector_v variable template pr...
Definition: IsDenseVector.h:139
Constraint on the data type.
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:78
constexpr bool IsVector_v
Auxiliary variable template for the IsVector type trait.The IsVector_v variable template provides a c...
Definition: IsVector.h:140
StaticVector< Type, N, TF > This
Type of this StaticVector instance.
Definition: StaticVector.h:215
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: StaticVector.h:1870
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a vectorizable data type...
Definition: Vectorizable.h:61
Header file for the TransposeFlag type trait.
auto divAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedDivAssign_v< VT > >
Default implementation of the division assignment of a dense vector.
Definition: StaticVector.h:2418
AlignedStorage v_
The statically allocated vector elements.
Definition: StaticVector.h:509
Constraint on the data type.
Header file for the exception macros of the math module.
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1179
MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:438
Constraint on the data type.
Header file for the IsVector type trait.
Header file for the IsDenseMatrix type trait.
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:2620
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:611
constexpr void reset()
Reset to the default initial values.
Definition: StaticVector.h:1495
Header file for the IsPadded type trait.
typename CrossTrait< T1, T2 >::Type CrossTrait_t
Auxiliary alias declaration for the CrossTrait class template.The CrossTrait_t alias declaration prov...
Definition: CrossTrait.h:165
constexpr bool isIntact() const noexcept
Returns whether the invariants of the static vector are intact.
Definition: StaticVector.h:1747
Header file for the IsVectorizable type trait.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
IntegralConstant< ptrdiff_t, N > PtrdiffT
Compile time integral constant wrapper for ptrdiff_t.The PtrdiffT class template represents an integr...
Definition: PtrdiffT.h:72
Header file for the RemoveConst type trait.
Header file for the IsSIMDCombinable type trait.
Header file for the PtrdiffT class template.
auto assign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedAssign_v< VT > >
Default implementation of the assignment of a dense vector.
Definition: StaticVector.h:2054
Header file for the IsSparseVector type trait.
Header file for the HasSIMDMult type trait.
static constexpr size_t Alignment
Alignment of the data elements.
Definition: StaticVector.h:499
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: NextMultiple.h:68
StaticVector()
The default constructor for StaticVector.
Definition: StaticVector.h:548
Header file for run time assertion macros.
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:1783
Header file for the division trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: StaticVector.h:221
Constraint on the data type.
Header file for the IsContiguous type trait.
static constexpr size_t NN
Alignment adjustment.
Definition: StaticVector.h:207
Header file for the AlignedArray implementation.
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:295
Header file for the IsStatic type trait.
constexpr StaticVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: StaticVector.h:1043
#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:1903
Header file for the column trait.
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:281
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
static constexpr bool isAligned() noexcept
Returns whether the vector is properly aligned in memory.
Definition: StaticVector.h:1823
Constraint on the data type.
Header file for the HasSIMDSub type trait.
constexpr bool IsDenseMatrix_v
Auxiliary variable template for the IsDenseMatrix type trait.The IsDenseMatrix_v variable template pr...
Definition: IsDenseMatrix.h:139
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
Type * Pointer
Pointer to a non-constant vector value.
Definition: StaticVector.h:226
Header file for the HasMutableDataAccess type trait.
#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
constexpr ptrdiff_t DefaultSize_v
Default size of the Size type trait.
Definition: Size.h:72
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:101
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
constexpr Iterator end() noexcept
Returns an iterator just past the last element of the static vector.
Definition: StaticVector.h:986
constexpr Pointer data() noexcept
Low-level data access to the vector elements.
Definition: StaticVector.h:904
Header file for the IsDenseVector type trait.
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< 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:74
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
#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
constexpr size_t AlignmentOf_v
Auxiliary variable template for the AlignmentOf type trait.The AlignmentOf_v variable template provid...
Definition: AlignmentOf.h:238
Header file for the HasSIMDDiv type trait.
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: StaticVector.h:1473
constexpr bool IsRowVector_v
Auxiliary variable template for the IsRowVector type trait.The IsRowVector_v variable template provid...
Definition: IsRowVector.h:143
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:186
EnableIf_t< IsBuiltin_v< T > > deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:224
Header file for the default transpose flag for all vectors of the Blaze library.
constexpr Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: StaticVector.h:816
Header file for the alignment check function.
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.The HasSIMDAdd_v variable template provides...
Definition: HasSIMDAdd.h:188
BLAZE_ALWAYS_INLINE void storea(size_t index, const SIMDType &value) noexcept
Aligned store of a SIMD element of the vector.
Definition: StaticVector.h:1958
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:138
Header file for the IntegralConstant class template.
constexpr Infinity inf
Global Infinity instance.The blaze::inf instance can be used wherever a built-in data type is expecte...
Definition: Infinity.h:1080
Header file for the map trait.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
auto multAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedMultAssign_v< VT > >
Default implementation of the multiplication assignment of a dense vector.
Definition: StaticVector.h:2324
BLAZE_ALWAYS_INLINE void storeu(size_t index, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the vector.
Definition: StaticVector.h:1991
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:631
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
Header file for the IsColumnVector type trait.
#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
auto subAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedSubAssign_v< VT > >
Default implementation of the subtraction assignment of a dense vector.
Definition: StaticVector.h:2234
System settings for the inline keywords.
const Type & ConstReference
Reference to a constant vector value.
Definition: StaticVector.h:225
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
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD vector.
Definition: StaticVector.h:204
BLAZE_ALWAYS_INLINE SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: StaticVector.h:1846
Rebind mechanism to obtain a StaticVector with different data/element type.
Definition: StaticVector.h:237
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.
Header file for the clear shim.
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: StaticVector.h:1934