35 #ifndef _BLAZE_MATH_DENSE_STATICVECTOR_H_
36 #define _BLAZE_MATH_DENSE_STATICVECTOR_H_
175 template<
typename Type
178 class StaticVector :
public DenseVector< StaticVector<Type,N,TF>, TF >
203 template<
typename ET >
221 enum :
bool { smpAssignable =
false };
229 explicit inline StaticVector( initializer_list<Type> list );
231 template<
typename Other >
232 explicit inline StaticVector(
size_t n,
const Other* array );
234 template<
typename Other >
235 explicit inline StaticVector(
const Other (&array)[N] );
238 template<
typename Other >
inline StaticVector(
const StaticVector<Other,N,TF>& v );
239 template<
typename VT >
inline StaticVector(
const Vector<VT,TF>& v );
250 inline Reference
operator[](
size_t index ) noexcept;
251 inline ConstReference
operator[](
size_t index )
const noexcept;
252 inline Reference
at(
size_t index );
253 inline ConstReference
at(
size_t index )
const;
254 inline Pointer
data () noexcept;
255 inline ConstPointer
data () const noexcept;
256 inline Iterator
begin () noexcept;
257 inline ConstIterator
begin () const noexcept;
258 inline ConstIterator
cbegin() const noexcept;
259 inline Iterator
end () noexcept;
260 inline ConstIterator
end () const noexcept;
261 inline ConstIterator
cend () const noexcept;
269 inline
StaticVector& operator=( initializer_list<Type> list );
271 template< typename Other >
272 inline
StaticVector& operator=( const Other (&array)[N] );
277 template< typename VT > inline
StaticVector& operator= ( const Vector<VT,TF>& rhs );
278 template< typename VT > inline
StaticVector& operator+=( const Vector<VT,TF>& rhs );
279 template< typename VT > inline
StaticVector& operator-=( const Vector<VT,TF>& rhs );
280 template< typename VT > inline
StaticVector& operator*=( const Vector<VT,TF>& rhs );
281 template< typename VT > inline
StaticVector& operator/=( const DenseVector<VT,TF>& rhs );
283 template< typename Other >
286 template< typename Other >
294 inline constexpr
size_t size() const noexcept;
295 inline constexpr
size_t capacity() const noexcept;
298 template< typename Other > inline
StaticVector& scale( const Other& scalar );
306 static inline
void* operator new (
std::
size_t size );
307 static inline
void* operator new[](
std::
size_t size );
308 static inline
void* operator new (
std::
size_t size, const
std::nothrow_t& );
309 static inline
void* operator new[](
std::
size_t size, const
std::nothrow_t& );
311 static inline
void operator delete (
void* ptr );
312 static inline
void operator delete[](
void* ptr );
313 static inline
void operator delete (
void* ptr, const
std::nothrow_t& );
314 static inline
void operator delete[](
void* ptr, const
std::nothrow_t& );
321 template< typename VT >
323 struct VectorizedAssign {
325 simdEnabled && VT::simdEnabled &&
326 AreSIMDCombinable< Type, ElementType_<VT> >::value };
333 template<
typename VT >
335 struct VectorizedAddAssign {
337 simdEnabled && VT::simdEnabled &&
338 AreSIMDCombinable< Type, ElementType_<VT> >::value &&
339 HasSIMDAdd< Type, ElementType_<VT> >::value };
346 template<
typename VT >
348 struct VectorizedSubAssign {
350 simdEnabled && VT::simdEnabled &&
351 AreSIMDCombinable< Type, ElementType_<VT> >::value &&
352 HasSIMDSub< Type, ElementType_<VT> >::value };
359 template<
typename VT >
361 struct VectorizedMultAssign {
363 simdEnabled && VT::simdEnabled &&
364 AreSIMDCombinable< Type, ElementType_<VT> >::value &&
365 HasSIMDMult< Type, ElementType_<VT> >::value };
372 template<
typename VT >
374 struct VectorizedDivAssign {
376 simdEnabled && VT::simdEnabled &&
377 AreSIMDCombinable< Type, ElementType_<VT> >::value &&
378 HasSIMDDiv< Type, ElementType_<VT> >::value };
392 inline bool isIntact() const noexcept;
399 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
400 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
413 template< typename VT >
414 inline
DisableIf_< VectorizedAssign<VT> > assign( const DenseVector<VT,TF>& rhs );
416 template< typename VT >
417 inline
EnableIf_<VectorizedAssign<VT> > assign( const DenseVector<VT,TF>& rhs );
419 template< typename VT > inline
void assign( const SparseVector<VT,TF>& rhs );
421 template< typename VT >
422 inline
DisableIf_<VectorizedAddAssign<VT> > addAssign( const DenseVector<VT,TF>& rhs );
424 template< typename VT >
425 inline
EnableIf_<VectorizedAddAssign<VT> > addAssign( const DenseVector<VT,TF>& rhs );
427 template< typename VT > inline
void addAssign( const SparseVector<VT,TF>& rhs );
429 template< typename VT >
430 inline
DisableIf_<VectorizedSubAssign<VT> > subAssign( const DenseVector<VT,TF>& rhs );
432 template< typename VT >
433 inline
EnableIf_<VectorizedSubAssign<VT> > subAssign( const DenseVector<VT,TF>& rhs );
435 template< typename VT > inline
void subAssign( const SparseVector<VT,TF>& rhs );
437 template< typename VT >
438 inline
DisableIf_<VectorizedMultAssign<VT> > multAssign( const DenseVector<VT,TF>& rhs );
440 template< typename VT >
441 inline
EnableIf_<VectorizedMultAssign<VT> > multAssign( const DenseVector<VT,TF>& rhs );
443 template< typename VT > inline
void multAssign( const SparseVector<VT,TF>& rhs );
445 template< typename VT >
446 inline
DisableIf_<VectorizedDivAssign<VT> > divAssign( const DenseVector<VT,TF>& rhs );
448 template< typename VT >
449 inline
EnableIf_<VectorizedDivAssign<VT> > divAssign( const DenseVector<VT,TF>& rhs );
456 enum :
size_t { NN = (
usePadding )?( NextMultiple< SizeT<N>, SizeT<SIMDSIZE> >::value ):( N ) };
498 template<
typename Type
507 for(
size_t i=0UL; i<NN; ++i )
521 template<
typename Type
529 for(
size_t i=0UL; i<N; ++i )
532 for(
size_t i=N; i<NN; ++i )
557 template<
typename Type
565 if( list.size() > N ) {
569 std::fill( std::copy( list.begin(), list.end(), v_.
data() ), v_.
data()+NN, Type() );
598 template<
typename Type
601 template<
typename Other >
611 for(
size_t i=0UL; i<n; ++i )
615 for(
size_t i=n; i<NN; ++i )
640 template<
typename Type
643 template<
typename Other >
649 for(
size_t i=0UL; i<N; ++i )
652 for(
size_t i=N; i<NN; ++i )
667 template<
typename Type
675 for(
size_t i=0UL; i<NN; ++i )
688 template<
typename Type
691 template<
typename Other >
697 for(
size_t i=0UL; i<N; ++i )
700 for(
size_t i=N; i<NN; ++i )
718 template<
typename Type
721 template<
typename VT >
729 if( (~v).
size() != N ) {
761 template<
typename Type
782 template<
typename Type
804 template<
typename Type
813 return (*
this)[index];
828 template<
typename Type
837 return (*
this)[index];
849 template<
typename Type
866 template<
typename Type
881 template<
typename Type
896 template<
typename Type
911 template<
typename Type
926 template<
typename Type
941 template<
typename Type
956 template<
typename Type
980 template<
typename Type
985 for(
size_t i=0UL; i<N; ++i )
1010 template<
typename Type
1015 if( list.size() > N ) {
1019 std::fill( std::copy( list.begin(), list.end(), v_.
data() ), v_.
data()+N, Type() );
1043 template<
typename Type
1046 template<
typename Other >
1049 for(
size_t i=0UL; i<N; ++i )
1064 template<
typename Type
1069 using blaze::assign;
1071 assign( *
this, ~rhs );
1086 template<
typename Type
1089 template<
typename Other >
1092 using blaze::assign;
1094 assign( *
this, ~rhs );
1113 template<
typename Type
1116 template<
typename VT >
1119 using blaze::assign;
1121 if( (~rhs).
size() != N ) {
1125 if( (~rhs).canAlias(
this ) ) {
1132 assign( *
this, ~rhs );
1152 template<
typename Type
1155 template<
typename VT >
1158 using blaze::addAssign;
1160 if( (~rhs).
size() != N ) {
1164 if( (~rhs).canAlias(
this ) ) {
1166 addAssign( *
this, tmp );
1169 addAssign( *
this, ~rhs );
1189 template<
typename Type
1192 template<
typename VT >
1195 using blaze::subAssign;
1197 if( (~rhs).
size() != N ) {
1201 if( (~rhs).canAlias(
this ) ) {
1203 subAssign( *
this, tmp );
1206 subAssign( *
this, ~rhs );
1227 template<
typename Type
1230 template<
typename VT >
1233 using blaze::multAssign;
1235 if( (~rhs).
size() != N ) {
1241 this->operator=( tmp );
1244 multAssign( *
this, ~rhs );
1264 template<
typename Type
1267 template<
typename VT >
1270 using blaze::divAssign;
1272 if( (~rhs).
size() != N ) {
1276 if( (~rhs).canAlias(
this ) ) {
1278 this->operator=( tmp );
1281 divAssign( *
this, ~rhs );
1298 template<
typename Type
1301 template<
typename Other >
1305 using blaze::assign;
1307 assign( *
this, (*
this) * rhs );
1325 template<
typename Type
1328 template<
typename Other >
1332 using blaze::assign;
1336 assign( *
this, (*
this) / rhs );
1358 template<
typename Type
1373 template<
typename Type
1391 template<
typename Type
1396 size_t nonzeros( 0 );
1398 for(
size_t i=0UL; i<N; ++i ) {
1413 template<
typename Type
1419 for(
size_t i=0UL; i<N; ++i )
1431 template<
typename Type
1434 template<
typename Other >
1437 for(
size_t i=0; i<N; ++i )
1450 template<
typename Type
1457 for(
size_t i=0UL; i<N; ++i )
1458 swap( v_[i], v.v_[i] );
1481 template<
typename Type
1490 return allocate<StaticVector>( 1UL );
1505 template<
typename Type
1528 template<
typename Type
1537 return allocate<StaticVector>( 1UL );
1552 template<
typename Type
1560 return allocate<StaticVector>( size/
sizeof(
StaticVector) );
1571 template<
typename Type
1576 deallocate( static_cast<StaticVector*>( ptr ) );
1587 template<
typename Type
1592 deallocate( static_cast<StaticVector*>( ptr ) );
1603 template<
typename Type
1608 deallocate( static_cast<StaticVector*>( ptr ) );
1619 template<
typename Type
1624 deallocate( static_cast<StaticVector*>( ptr ) );
1646 template<
typename Type
1652 for(
size_t i=N; i<NN; ++i ) {
1653 if( v_[i] != Type() )
1681 template<
typename Type
1684 template<
typename Other >
1687 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1702 template<
typename Type
1705 template<
typename Other >
1708 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1722 template<
typename Type
1744 template<
typename Type
1750 return loada( index );
1768 template<
typename Type
1783 return loada( &v_[index] );
1801 template<
typename Type
1814 return loadu( &v_[index] );
1832 template<
typename Type
1856 template<
typename Type
1871 storea( &v_[index], value );
1889 template<
typename Type
1902 storeu( &v_[index], value );
1921 template<
typename Type
1936 stream( &v_[index], value );
1952 template<
typename Type
1955 template<
typename VT >
1961 for(
size_t i=0UL; i<N; ++i )
1978 template<
typename Type
1981 template<
typename VT >
1991 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
1992 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
1996 for( ; i<ipos; i+=SIMDSIZE ) {
1997 store( i, (~rhs).load(i) );
1999 for( ; remainder && i<N; ++i ) {
2017 template<
typename Type
2020 template<
typename VT >
2026 v_[element->index()] = element->value();
2042 template<
typename Type
2045 template<
typename VT >
2051 for(
size_t i=0UL; i<N; ++i )
2068 template<
typename Type
2071 template<
typename VT >
2081 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2082 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2086 for( ; i<ipos; i+=SIMDSIZE ) {
2087 store( i, load(i) + (~rhs).load(i) );
2089 for( ; remainder && i<N; ++i ) {
2107 template<
typename Type
2110 template<
typename VT >
2116 v_[element->index()] += element->value();
2132 template<
typename Type
2135 template<
typename VT >
2141 for(
size_t i=0UL; i<N; ++i )
2158 template<
typename Type
2161 template<
typename VT >
2171 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2172 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2176 for( ; i<ipos; i+=SIMDSIZE ) {
2177 store( i, load(i) - (~rhs).load(i) );
2179 for( ; remainder && i<N; ++i ) {
2197 template<
typename Type
2200 template<
typename VT >
2206 v_[element->index()] -= element->value();
2222 template<
typename Type
2225 template<
typename VT >
2231 for(
size_t i=0UL; i<N; ++i )
2248 template<
typename Type
2251 template<
typename VT >
2261 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2262 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
2266 for( ; i<ipos; i+=SIMDSIZE ) {
2267 store( i, load(i) * (~rhs).load(i) );
2269 for( ; remainder && i<N; ++i ) {
2287 template<
typename Type
2290 template<
typename VT >
2300 v_[element->index()] = tmp[element->index()] * element->value();
2316 template<
typename Type
2319 template<
typename VT >
2325 for(
size_t i=0UL; i<N; ++i )
2342 template<
typename Type
2345 template<
typename VT >
2353 const size_t ipos( N &
size_t(-SIMDSIZE) );
2358 for( ; i<ipos; i+=SIMDSIZE ) {
2359 store( i, load(i) / (~rhs).load(i) );
2388 template<
typename Type
2410 template<
typename Type,
size_t N,
bool TF >
2413 template<
typename Type,
size_t N,
bool TF >
2416 template<
typename Type,
size_t N,
bool TF >
2419 template<
typename Type,
size_t N,
bool TF >
2422 template<
typename Type,
bool TF >
2425 template<
typename Type,
bool TF >
2428 template<
typename Type,
size_t N,
bool TF >
2441 template<
typename Type
2460 template<
typename Type
2488 template<
typename Type
2493 for(
size_t i=0UL; i<N; ++i )
2518 template<
typename Type
2523 return v.isIntact();
2539 template<
typename Type
2556 template<
typename Type
2560 if( v[0] != Type() || v[1] != Type() )
2576 template<
typename Type
2596 template<
typename T,
size_t N,
bool TF >
2597 struct Size< StaticVector<T,N,TF> >
2599 static const size_t value = N;
2615 template<
typename T,
size_t N,
bool TF >
2616 struct HasConstDataAccess< StaticVector<T,N,TF> > :
public TrueType
2632 template<
typename T,
size_t N,
bool TF >
2633 struct HasMutableDataAccess< StaticVector<T,N,TF> > :
public TrueType
2649 template<
typename T,
size_t N,
bool TF >
2650 struct IsAligned< StaticVector<T,N,TF> > :
public TrueType
2666 template<
typename T,
size_t N,
bool TF >
2667 struct IsPadded< StaticVector<T,N,TF> > :
public BoolConstant<usePadding>
2683 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2684 struct AddTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2686 using Type = StaticVector< AddTrait_<T1,T2>, N, TF >;
2702 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2703 struct SubTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2705 using Type = StaticVector< SubTrait_<T1,T2>, N, TF >;
2721 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2722 struct MultTrait< StaticVector<T1,N,TF>, T2,
EnableIf_<IsNumeric<T2> > >
2724 using Type = StaticVector< MultTrait_<T1,T2>, N, TF >;
2727 template<
typename T1,
typename T2,
size_t N,
bool TF >
2728 struct MultTrait< T1, StaticVector<T2,N,TF>,
EnableIf_<IsNumeric<T1> > >
2730 using Type = StaticVector< MultTrait_<T1,T2>, N, TF >;
2733 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2734 struct MultTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2736 using Type = StaticVector< MultTrait_<T1,T2>, N, TF >;
2739 template<
typename T1,
size_t M,
typename T2,
size_t N >
2740 struct MultTrait< StaticVector<T1,M,false>, StaticVector<T2,N,true> >
2742 using Type = StaticMatrix< MultTrait_<T1,T2>, M, N,
false >;
2745 template<
typename T1,
size_t N,
typename T2 >
2746 struct MultTrait< StaticVector<T1,N,true>, StaticVector<T2,N,false> >
2748 using Type = MultTrait_<T1,T2>;
2764 template<
typename T1,
typename T2,
bool TF >
2765 struct CrossTrait< StaticVector<T1,3UL,TF>, StaticVector<T2,3UL,TF> >
2768 using T = MultTrait_<T1,T2>;
2771 using Type = StaticVector< SubTrait_<T,T>, 3UL, TF >;
2787 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2788 struct DivTrait< StaticVector<T1,N,TF>, T2,
EnableIf_<IsNumeric<T2> > >
2790 using Type = StaticVector< DivTrait_<T1,T2>, N, TF >;
2793 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2794 struct DivTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2796 using Type = StaticVector< DivTrait_<T1,T2>, N, TF >;
2812 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2813 struct MathTrait< StaticVector<T1,N,TF>, StaticVector<T2,N,TF> >
2815 using HighType = StaticVector< typename MathTrait<T1,T2>::HighType, N, TF >;
2816 using LowType = StaticVector< typename MathTrait<T1,T2>::LowType , N, TF >;
2832 template<
typename T1,
size_t N,
bool TF >
2833 struct SubvectorTrait< StaticVector<T1,N,TF> >
2835 using Type = HybridVector<T1,N,TF>;
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: StaticVector.h:1685
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
constexpr bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
Header file for the NextMultiple class template.
#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
Header file for the alignment flag values.
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:193
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.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the static vector.
Definition: StaticVector.h:914
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:188
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:183
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
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.
#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
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: StaticVector.h:1772
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
Header file for the SizeT class template.
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: StaticVector.h:1394
Iterator end() noexcept
Returns an iterator just past the last element of the static vector.
Definition: StaticVector.h:929
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
Header file for memory allocation and deallocation functionality.
System settings for performance optimizations.
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
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Constraint on the data type.
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.
ConstIterator cend() const noexcept
Returns an iterator just past the last element of the static vector.
Definition: StaticVector.h:959
void swap(StaticVector &v) noexcept
Swapping the contents of two static vectors.
Definition: StaticVector.h:1453
constexpr size_t capacity() const noexcept
Returns the maximum capacity of the vector.
Definition: StaticVector.h:1376
Header file for the DisableIf class template.
Header file for the multiplication trait.
const StaticVector & CompositeType
Data type for composite expression templates.
Definition: StaticVector.h:189
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:5148
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.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: StaticVector.h:1805
BLAZE_ALWAYS_INLINE SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: StaticVector.h:1748
#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:1925
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:808
StaticVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: StaticVector.h:983
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the HasSIMDAdd type trait.
Header file for the DenseIterator class template.
const Type * ConstPointer
Pointer to a constant vector value.
Definition: StaticVector.h:194
Header file for the subvector trait.
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: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:188
bool isIntact() const noexcept
Returns whether the invariants of the static vector are intact.
Definition: StaticVector.h:1649
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
void reset()
Reset to the default initial values.
Definition: StaticVector.h:1416
#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:852
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: StaticVector.h:1706
Header file for the exception macros of the math module.
BLAZE_ALWAYS_INLINE 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:254
Iterator begin() noexcept
Returns an iterator to the first element of the static vector.
Definition: StaticVector.h:884
This ResultType
Result type for expression template evaluations.
Definition: StaticVector.h:184
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:2541
DenseIterator< const Type, aligned > ConstIterator
Iterator over constant elements.
Definition: StaticVector.h:197
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.
Header file for the IsVectorizable type trait.
Header file for the IsNumeric type trait.
AlignedArray< Type, NN > v_
The statically allocated vector elements.
Definition: StaticVector.h:462
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 IsSparseVector type trait.
Header file for the HasSIMDMult type trait.
Type ElementType
Type of the vector elements.
Definition: StaticVector.h:186
bool isAligned() const noexcept
Returns whether the vector is properly aligned in memory.
Definition: StaticVector.h:1725
StaticVector()
The default constructor for StaticVector.
Definition: StaticVector.h:501
Header file for run time assertion macros.
Header file for the addition trait.
DenseIterator< Type, aligned > Iterator
Iterator over non-constant elements.
Definition: StaticVector.h:196
Header file for the cross product trait.
Header file for the division trait.
Constraint on the data type.
Header file for the AlignedArray implementation.
#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
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2646
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:258
StaticVector< Type, N, TF > This
Type of this StaticVector instance.
Definition: StaticVector.h:182
Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: StaticVector.h:765
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
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
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
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
Header file for the mathematical trait.
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
Header file for the AreSIMDCombinable type trait.
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.
StaticVector< ET, N, TF > Other
The type of the other StaticVector.
Definition: StaticVector.h:205
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:154
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:185
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:1860
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:110
Header file for the IntegralConstant class template.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
BLAZE_ALWAYS_INLINE void storeu(size_t index, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the vector.
Definition: StaticVector.h:1893
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
constexpr size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: StaticVector.h:1361
#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
Rebind mechanism to obtain a StaticVector with different data/element type.
Definition: StaticVector.h:204
const Type & ConstReference
Reference to a constant vector value.
Definition: StaticVector.h:192
Header file for the TrueType type/value trait base class.
Type & Reference
Reference to a non-constant vector value.
Definition: StaticVector.h:191
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: StaticVector.h:1836
SIMDTrait_< ElementType > SIMDType
SIMD type of the vector elements.
Definition: StaticVector.h:187