35 #ifndef _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_ 36 #define _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_ 181 template<
typename Type
182 ,
bool TF = defaultTransposeFlag >
209 template<
typename NewType >
218 template<
size_t NewN >
247 template<
typename Other >
250 template<
typename Other,
size_t Dim >
287 inline DynamicVector&
operator=(
const Type& rhs );
290 template<
typename Other,
size_t Dim >
293 inline DynamicVector&
operator=(
const DynamicVector& rhs );
294 inline DynamicVector&
operator=( DynamicVector&& rhs ) noexcept;
301 template<
typename VT >
inline DynamicVector& operator%=(
const Vector<VT,TF>& rhs );
303 template<
typename Other >
306 template<
typename Other >
314 inline size_t size()
const noexcept;
315 inline size_t spacing()
const noexcept;
316 inline size_t capacity()
const noexcept;
320 inline void resize(
size_t n,
bool preserve=
true );
321 inline void extend(
size_t n,
bool preserve=
true );
322 inline void reserve(
size_t n );
324 inline void swap( DynamicVector& v ) noexcept;
331 template<
typename Other >
inline DynamicVector& scale(
const Other& scalar );
338 template<
typename VT >
340 struct VectorizedAssign {
341 enum :
bool { value = useOptimizedKernels &&
342 simdEnabled && VT::simdEnabled &&
350 template<
typename VT >
352 struct VectorizedAddAssign {
353 enum :
bool { value = useOptimizedKernels &&
354 simdEnabled && VT::simdEnabled &&
363 template<
typename VT >
365 struct VectorizedSubAssign {
366 enum :
bool { value = useOptimizedKernels &&
367 simdEnabled && VT::simdEnabled &&
376 template<
typename VT >
378 struct VectorizedMultAssign {
379 enum :
bool { value = useOptimizedKernels &&
380 simdEnabled && VT::simdEnabled &&
389 template<
typename VT >
391 struct VectorizedDivAssign {
392 enum :
bool { value = useOptimizedKernels &&
393 simdEnabled && VT::simdEnabled &&
409 inline bool isIntact()
const noexcept;
416 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
417 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
431 template<
typename VT >
434 template<
typename VT >
439 template<
typename VT >
442 template<
typename VT >
447 template<
typename VT >
450 template<
typename VT >
455 template<
typename VT >
458 template<
typename VT >
463 template<
typename VT >
466 template<
typename VT >
475 inline size_t addPadding(
size_t value )
const noexcept;
516 template<
typename Type
534 template<
typename Type
559 template<
typename Type
566 for(
size_t i=0UL; i<
size_; ++i )
594 template<
typename Type
601 std::fill( std::copy( list.begin(), list.end(),
v_ ),
v_+
capacity_, Type() );
628 template<
typename Type
630 template<
typename Other >
636 for(
size_t i=0UL; i<n; ++i )
666 template<
typename Type
668 template<
typename Other
675 for(
size_t i=0UL; i<Dim; ++i )
696 template<
typename Type
718 template<
typename Type
737 template<
typename Type
739 template<
typename VT >
768 template<
typename Type
794 template<
typename Type
814 template<
typename Type
835 template<
typename Type
840 if( index >=
size_ ) {
843 return (*
this)[index];
858 template<
typename Type
863 if( index >=
size_ ) {
866 return (*
this)[index];
878 template<
typename Type
894 template<
typename Type
908 template<
typename Type
922 template<
typename Type
936 template<
typename Type
950 template<
typename Type
964 template<
typename Type
978 template<
typename Type
1001 template<
typename Type
1005 for(
size_t i=0UL; i<
size_; ++i )
1028 template<
typename Type
1032 resize( list.size(), false );
1033 std::copy( list.begin(), list.end(),
v_ );
1058 template<
typename Type
1060 template<
typename Other
1066 for(
size_t i=0UL; i<Dim; ++i )
1083 template<
typename Type
1087 if( &rhs ==
this )
return *
this;
1105 template<
typename Type
1116 rhs.capacity_ = 0UL;
1132 template<
typename Type
1134 template<
typename VT >
1165 template<
typename Type
1167 template<
typename VT >
1200 template<
typename Type
1202 template<
typename VT >
1235 template<
typename Type
1237 template<
typename VT >
1269 template<
typename Type
1271 template<
typename VT >
1304 template<
typename Type
1306 template<
typename VT >
1309 using blaze::assign;
1320 if(
size_ != 3UL || (~rhs).
size() != 3UL ) {
1324 const CrossType tmp( *
this % (~rhs) );
1325 assign( *
this, tmp );
1341 template<
typename Type
1343 template<
typename Other >
1365 template<
typename Type
1367 template<
typename Other >
1395 template<
typename Type
1412 template<
typename Type
1426 template<
typename Type
1443 template<
typename Type
1447 size_t nonzeros( 0 );
1449 for(
size_t i=0UL; i<
size_; ++i ) {
1464 template<
typename Type
1469 for(
size_t i=0UL; i<
size_; ++i )
1482 template<
typename Type
1520 template<
typename Type
1536 for(
size_t i=
size_; i<newCapacity; ++i )
1547 for(
size_t i=n; i<
size_; ++i )
1568 template<
typename Type
1586 template<
typename Type
1600 for(
size_t i=
size_; i<newCapacity; ++i )
1623 template<
typename Type
1640 template<
typename Type
1660 template<
typename Type
1665 return nextMultiple<size_t>( value, SIMDSIZE );
1696 template<
typename Type
1698 template<
typename Other >
1701 for(
size_t i=0UL; i<
size_; ++i )
1725 template<
typename Type
1734 if(
v_[i] != Type() )
1762 template<
typename Type
1764 template<
typename Other >
1767 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1782 template<
typename Type
1784 template<
typename Other >
1787 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1801 template<
typename Type
1820 template<
typename Type
1824 return (
size() > SMP_DVECASSIGN_THRESHOLD );
1841 template<
typename Type
1846 return loada( index );
1864 template<
typename Type
1896 template<
typename Type
1926 template<
typename Type
1949 template<
typename Type
1981 template<
typename Type
2012 template<
typename Type
2042 template<
typename Type
2044 template<
typename VT >
2050 const size_t ipos(
size_ &
size_t(-2) );
2053 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2054 v_[i ] = (~rhs)[i ];
2055 v_[i+1UL] = (~rhs)[i+1UL];
2057 if( ipos < (~rhs).size() )
2058 v_[ipos] = (~rhs)[ipos];
2074 template<
typename Type
2076 template<
typename VT >
2086 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2093 if( useStreaming &&
size_ > ( cacheSize/(
sizeof(Type) * 3UL ) ) && !(~rhs).
isAliased(
this ) )
2095 for( ; i<ipos; i+=SIMDSIZE ) {
2096 left.
stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2098 for( ; remainder && i<
size_; ++i ) {
2099 *left = *right; ++left; ++right;
2104 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2105 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2106 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2107 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2108 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2110 for( ; i<ipos; i+=SIMDSIZE ) {
2111 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2113 for( ; remainder && i<
size_; ++i ) {
2114 *left = *right; ++left; ++right;
2132 template<
typename Type
2134 template<
typename VT >
2140 v_[element->index()] = element->value();
2156 template<
typename Type
2158 template<
typename VT >
2164 const size_t ipos(
size_ &
size_t(-2) );
2167 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2168 v_[i ] += (~rhs)[i ];
2169 v_[i+1UL] += (~rhs)[i+1UL];
2171 if( ipos < (~rhs).size() )
2172 v_[ipos] += (~rhs)[ipos];
2188 template<
typename Type
2190 template<
typename VT >
2200 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2207 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2208 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2209 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2210 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2211 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2213 for( ; i<ipos; i+=SIMDSIZE ) {
2214 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2216 for( ; remainder && i<
size_; ++i ) {
2217 *left += *right; ++left; ++right;
2234 template<
typename Type
2236 template<
typename VT >
2242 v_[element->index()] += element->value();
2258 template<
typename Type
2260 template<
typename VT >
2266 const size_t ipos(
size_ &
size_t(-2) );
2269 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2270 v_[i ] -= (~rhs)[i ];
2271 v_[i+1UL] -= (~rhs)[i+1UL];
2273 if( ipos < (~rhs).size() )
2274 v_[ipos] -= (~rhs)[ipos];
2290 template<
typename Type
2292 template<
typename VT >
2302 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2309 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2310 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2311 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2312 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2313 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2315 for( ; i<ipos; i+=SIMDSIZE ) {
2316 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2318 for( ; remainder && i<
size_; ++i ) {
2319 *left -= *right; ++left; ++right;
2336 template<
typename Type
2338 template<
typename VT >
2344 v_[element->index()] -= element->value();
2360 template<
typename Type
2362 template<
typename VT >
2368 const size_t ipos(
size_ &
size_t(-2) );
2371 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2372 v_[i ] *= (~rhs)[i ];
2373 v_[i+1UL] *= (~rhs)[i+1UL];
2375 if( ipos < (~rhs).size() )
2376 v_[ipos] *= (~rhs)[ipos];
2392 template<
typename Type
2394 template<
typename VT >
2404 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2411 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2412 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2413 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2414 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2415 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2417 for( ; i<ipos; i+=SIMDSIZE ) {
2418 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2420 for( ; remainder && i<
size_; ++i ) {
2421 *left *= *right; ++left; ++right;
2438 template<
typename Type
2440 template<
typename VT >
2450 v_[element->index()] = tmp[element->index()] * element->value();
2466 template<
typename Type
2468 template<
typename VT >
2474 const size_t ipos(
size_ &
size_t(-2) );
2477 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2478 v_[i ] /= (~rhs)[i ];
2479 v_[i+1UL] /= (~rhs)[i+1UL];
2481 if( ipos < (~rhs).size() )
2482 v_[ipos] /= (~rhs)[ipos];
2498 template<
typename Type
2500 template<
typename VT >
2508 const size_t ipos(
size_ &
size_t(-SIMDSIZE) );
2515 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2516 left.
store( left.
load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2517 left.
store( left.
load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2518 left.
store( left.
load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2519 left.
store( left.
load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2521 for( ; i<ipos; i+=SIMDSIZE ) {
2522 left.
store( left.
load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2524 for( ; i<
size_; ++i ) {
2525 *left /= *right; ++left; ++right;
2542 template<
typename Type,
bool TF >
2545 template<
typename Type,
bool TF >
2548 template<
bool RF,
typename Type,
bool TF >
2551 template<
typename Type,
bool TF >
2554 template<
typename Type,
bool TF >
2567 template<
typename Type
2583 template<
typename Type
2621 return ( v.
size() == 0UL );
2644 template<
typename Type
2661 template<
typename Type
2680 template<
typename T,
bool TF >
2698 template<
typename T,
bool TF >
2716 template<
typename T,
bool TF >
2734 template<
typename T,
bool TF >
2735 struct IsPadded< DynamicVector<T,TF> >
2752 template<
typename T,
bool TF >
2770 template<
typename T,
bool TF >
2788 template<
typename T1,
bool TF,
typename T2,
size_t N >
2789 struct AddTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2794 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2795 struct AddTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2800 template<
typename T1,
bool TF,
typename T2,
size_t N >
2801 struct AddTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2806 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2807 struct AddTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2812 template<
typename T1,
bool TF,
typename T2 >
2813 struct AddTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2831 template<
typename T1,
bool TF,
typename T2,
size_t N >
2832 struct SubTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2837 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2838 struct SubTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2843 template<
typename T1,
bool TF,
typename T2,
size_t N >
2844 struct SubTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2849 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2850 struct SubTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2855 template<
typename T1,
bool TF,
typename T2 >
2856 struct SubTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2874 template<
typename T1,
bool TF,
typename T2 >
2875 struct MultTrait< DynamicVector<T1,TF>, T2, EnableIf_<IsNumeric<T2> > >
2880 template<
typename T1,
typename T2,
bool TF >
2881 struct MultTrait< T1, DynamicVector<T2,TF>, EnableIf_<IsNumeric<T1> > >
2886 template<
typename T1,
bool TF,
typename T2,
size_t N >
2887 struct MultTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2892 template<
typename T1,
typename T2,
size_t N >
2893 struct MultTrait< DynamicVector<T1,false>, StaticVector<T2,N,true> >
2898 template<
typename T1,
typename T2,
size_t N >
2899 struct MultTrait< DynamicVector<T1,true>, StaticVector<T2,N,false> >
2904 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2905 struct MultTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2910 template<
typename T1,
size_t N,
typename T2 >
2911 struct MultTrait< StaticVector<T1,N,false>, DynamicVector<T2,true> >
2916 template<
typename T1,
size_t N,
typename T2 >
2917 struct MultTrait< StaticVector<T1,N,true>, DynamicVector<T2,false> >
2922 template<
typename T1,
bool TF,
typename T2,
size_t N >
2923 struct MultTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2928 template<
typename T1,
typename T2,
size_t N >
2929 struct MultTrait< DynamicVector<T1,false>, HybridVector<T2,N,true> >
2934 template<
typename T1,
typename T2,
size_t N >
2935 struct MultTrait< DynamicVector<T1,true>, HybridVector<T2,N,false> >
2940 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2941 struct MultTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2946 template<
typename T1,
size_t N,
typename T2 >
2947 struct MultTrait< HybridVector<T1,N,false>, DynamicVector<T2,true> >
2952 template<
typename T1,
size_t N,
typename T2 >
2953 struct MultTrait< HybridVector<T1,N,true>, DynamicVector<T2,false> >
2958 template<
typename T1,
bool TF,
typename T2 >
2959 struct MultTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2964 template<
typename T1,
typename T2 >
2965 struct MultTrait< DynamicVector<T1,false>, DynamicVector<T2,true> >
2970 template<
typename T1,
typename T2 >
2971 struct MultTrait< DynamicVector<T1,true>, DynamicVector<T2,false> >
2989 template<
typename T1,
bool TF,
typename T2 >
2990 struct DivTrait< DynamicVector<T1,TF>, T2, EnableIf_<IsNumeric<T2> > >
2995 template<
typename T1,
bool TF,
typename T2,
size_t N >
2996 struct DivTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
3001 template<
typename T1,
size_t N,
bool TF,
typename T2 >
3002 struct DivTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
3007 template<
typename T1,
bool TF,
typename T2,
size_t N >
3008 struct DivTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
3013 template<
typename T1,
size_t N,
bool TF,
typename T2 >
3014 struct DivTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
3019 template<
typename T1,
bool TF,
typename T2 >
3020 struct DivTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
3038 template<
typename T1,
bool TF,
typename T2 >
3039 struct CrossTrait< DynamicVector<T1,TF>, StaticVector<T2,3UL,TF> >
3048 template<
typename T1,
bool TF,
typename T2 >
3049 struct CrossTrait< StaticVector<T1,3UL,TF>, DynamicVector<T2,TF> >
3058 template<
typename T1,
bool TF,
typename T2,
size_t N >
3059 struct CrossTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
3068 template<
typename T1,
size_t N,
bool TF,
typename T2 >
3069 struct CrossTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
3078 template<
typename T1,
bool TF,
typename T2 >
3079 struct CrossTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
3101 template<
typename T,
bool TF,
typename OP >
3120 template<
typename T1,
bool TF,
typename T2,
size_t N,
typename OP >
3121 struct BinaryMapTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF>, OP >
3126 template<
typename T1,
size_t N,
bool TF,
typename T2,
typename OP >
3127 struct BinaryMapTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF>, OP >
3132 template<
typename T1,
bool TF,
typename T2,
size_t N,
typename OP >
3133 struct BinaryMapTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF>, OP >
3138 template<
typename T1,
size_t N,
bool TF,
typename T2,
typename OP >
3139 struct BinaryMapTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF>, OP >
3144 template<
typename T1,
bool TF,
typename T2,
typename OP >
3145 struct BinaryMapTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF>, OP >
3163 template<
typename T1,
bool TF,
typename T2 >
3164 struct HighType< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
3182 template<
typename T1,
bool TF,
typename T2 >
3183 struct LowType< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
3201 template<
typename T,
bool TF >
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:135
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h:79
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
BLAZE_ALWAYS_INLINE void stream(size_t index, const SIMDType &value) noexcept
Aligned, non-temporal store of a SIMD element of the vector.
Definition: DynamicVector.h:2015
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: DynamicVector.h:1929
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
Type *BLAZE_RESTRICT v_
The dynamically allocated vector elements.
Definition: DynamicVector.h:484
Availability of a SIMD subtraction for the given data types.Depending on the available instruction se...
Definition: HasSIMDSub.h:171
Header file for mathematical functions.
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the alignment flag values.
Type * Pointer
Pointer to a non-constant vector value.
Definition: DynamicVector.h:199
BLAZE_ALWAYS_INLINE void storea(size_t index, const SIMDType &value) noexcept
Aligned store of a SIMD element of the vector.
Definition: DynamicVector.h:1952
Header file for the subtraction trait.
Header file for basic type definitions.
Header file for the SparseVector base class.
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DynamicVector.h:1397
const SIMDType load() const noexcept
Load of the SIMD element at the current iterator position.
Definition: DenseIterator.h:403
size_t spacing() const noexcept
Returns the minimum capacity of the vector.
Definition: DynamicVector.h:1414
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
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:164
void clear()
Clearing the vector.
Definition: DynamicVector.h:1484
Header file for the serial shim.
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
BLAZE_ALWAYS_INLINE T1 & operator/=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Division assignment operator for the division of two SIMD packs.
Definition: BasicTypes.h:1411
bool isIntact() const noexcept
Returns whether the invariants of the dynamic vector are intact.
Definition: DynamicVector.h:1727
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:172
bool canSMPAssign() const noexcept
Returns whether the vector can be used in SMP assignments.
Definition: DynamicVector.h:1822
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:316
EnableIf_< IsDenseVector< VT1 > > smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:193
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
Header file for the DenseVector base class.
BLAZE_ALWAYS_INLINE void storeu(size_t index, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the vector.
Definition: DynamicVector.h:1984
Availability of a SIMD addition for the given data types.Depending on the available instruction set (...
Definition: HasSIMDAdd.h:171
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:938
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:250
Efficient implementation of an arbitrary sized vector.The DynamicVector class template is the represe...
Definition: DynamicVector.h:183
Header file for memory allocation and deallocation functionality.
System settings for performance optimizations.
Efficient implementation of a dynamic matrix.The DynamicMatrix class template is the representation ...
Definition: DynamicMatrix.h:212
BLAZE_ALWAYS_INLINE T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1393
Compile time check for data types.This type trait tests whether or not the given types can be combine...
Definition: IsSIMDCombinable.h:120
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:133
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: DynamicVector.h:1867
Constraint on the data type.
Base template for the CrossTrait class.
Definition: CrossTrait.h:116
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
~DynamicVector()
The destructor for DynamicVector.
Definition: DynamicVector.h:770
Compile time check for low-level access to mutable data.This type trait tests whether the given data ...
Definition: HasMutableDataAccess.h:75
Iterator begin() noexcept
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:910
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
EnableIf_< IsBuiltin< T >, T *> allocate(size_t size)
Aligned array allocation for built-in data types.
Definition: Memory.h:155
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: DynamicVector.h:1899
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
void resize(size_t n, bool preserve=true)
Changing the size of the vector.
Definition: DynamicVector.h:1522
Header file for the multiplication trait.
Header file for the unary map trait.
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for nested template disabiguation.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5924
Header file for the IsShrinkable type trait.
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
Header file for the IsSMPAssignable type trait.
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:102
DynamicVector() noexcept
The default constructor for DynamicVector.
Definition: DynamicVector.h:518
#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
size_t capacity() const noexcept
Returns the maximum capacity of the vector.
Definition: DynamicVector.h:1428
Header file for the HasSIMDAdd type trait.
Header file for the DenseIterator class template.
void stream(const SIMDType &value) const noexcept
Aligned, non-temporal store of the SIMD element at the current iterator position. ...
Definition: DenseIterator.h:531
Header file for the subvector trait.
Header file for all SIMD functionality.
Constraint on the data type.
void store(const SIMDType &value) const noexcept
Store of the SIMD element at the current iterator position.
Definition: DenseIterator.h:468
Availability of a SIMD division for the given data types.Depending on the available instruction set (...
Definition: HasSIMDDiv.h:150
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Compile time check for sparse vector types.This type trait tests whether or not the given template pa...
Definition: IsSparseVector.h:103
void reset()
Reset to the default initial values.
Definition: DynamicVector.h:1466
Resize mechanism to obtain a DynamicVector with a different fixed number of elements.
Definition: DynamicVector.h:219
bool isAligned() const noexcept
Returns whether the vector is properly aligned in memory.
Definition: DynamicVector.h:1803
Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: DynamicVector.h:797
Header file for the IsAligned type trait.
Constraint on the data type.
ConstIterator cend() const noexcept
Returns an iterator just past the last element of the dynamic vector.
Definition: DynamicVector.h:980
size_t size_
The current size/dimension of the vector.
Definition: DynamicVector.h:482
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
#define BLAZE_RESTRICT
Platform dependent setup of the restrict keyword.
Definition: Restrict.h:81
#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
Constraint on the data type.
Header file for the exception macros of the math module.
Compile time check for data types.This type trait tests whether or not the given template parameter i...
Definition: IsSMPAssignable.h:119
typename CrossTrait< T1, T2 >::Type CrossTrait_
Auxiliary alias declaration for the CrossTrait class template.The CrossTrait_ alias declaration provi...
Definition: CrossTrait.h:159
Constraint on the data type.
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:580
Header file for the IsPadded type trait.
BLAZE_ALWAYS_INLINE SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: DynamicVector.h:1844
Header file for the IsVectorizable type trait.
Compile time check for shrinkable data types.This type trait tests whether the given data type is a s...
Definition: IsShrinkable.h:75
Header file for the IsNumeric type trait.
Base template for the LowType type trait.
Definition: LowType.h:133
Header file for the HasConstDataAccess type trait.
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
size_t capacity_
The maximum capacity of the vector.
Definition: DynamicVector.h:483
const Type & ReturnType
Return type for expression template evaluations.
Definition: DynamicVector.h:194
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
SIMDTrait_< ElementType > SIMDType
SIMD type of the vector elements.
Definition: DynamicVector.h:193
Header file for the IsSIMDCombinable type trait.
Header file for the IsSparseVector type trait.
Header file for the HasSIMDMult type trait.
Header file for the binary map trait.
DynamicVector< Type, TF > This
Type of this DynamicVector instance.
Definition: DynamicVector.h:188
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:139
const Type & ConstReference
Reference to a constant vector value.
Definition: DynamicVector.h:198
Base template for the MultTrait class.
Definition: MultTrait.h:139
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
Constraint on the data type.
Pointer data() noexcept
Low-level data access to the vector elements.
Definition: DynamicVector.h:880
EnableIf_< IsDenseVector< VT1 > > smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:222
Headerfile for the generic transfer algorithm.
Type & Reference
Reference to a non-constant vector value.
Definition: DynamicVector.h:197
void extend(size_t n, bool preserve=true)
Extending the size of the vector.
Definition: DynamicVector.h:1570
size_t addPadding(size_t value) const noexcept
Add the necessary amount of padding to the given value.
Definition: DynamicVector.h:1662
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
Header file for the cache size of the target architecture.
#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
Rebind mechanism to obtain a DynamicVector with different data/element type.
Definition: DynamicVector.h:210
Header file for the isDefault shim.
System settings for the restrict keyword.
Constraint on the data type.
Header file for the HasSIMDSub type trait.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:819
Header file for the HasMutableDataAccess type trait.
void reserve(size_t n)
Setting the minimum capacity of the vector.
Definition: DynamicVector.h:1588
#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
DenseIterator< const Type, aligned > ConstIterator
Iterator over constant elements.
Definition: DynamicVector.h:203
void swap(DynamicVector &v) noexcept
Swapping the contents of two vectors.
Definition: DynamicVector.h:1642
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: DynamicVector.h:1445
EnableIf_< IsBuiltin< T > > deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:230
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
Base template for the DivTrait class.
Definition: DivTrait.h:139
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:76
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:61
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: DynamicVector.h:1785
Type ElementType
Type of the vector elements.
Definition: DynamicVector.h:192
void shrinkToFit()
Requesting the removal of unused capacity.
Definition: DynamicVector.h:1625
Iterator end() noexcept
Returns an iterator just past the last element of the dynamic vector.
Definition: DynamicVector.h:952
Header file for the HasSIMDDiv type trait.
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:177
Header file for the default transpose flag for all vectors of the Blaze library.
Initializer list type of the Blaze library.
Header file for the alignment check function.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
const Type * ConstPointer
Pointer to a constant vector value.
Definition: DynamicVector.h:200
DynamicVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: DynamicVector.h:1003
Header file for the IntegralConstant class template.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:600
Base template for the SubTrait class.
Definition: SubTrait.h:139
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
OutputIterator transfer(InputIterator first, InputIterator last, OutputIterator dest)
Transfers the elements from the given source range to the destination range.
Definition: Transfer.h:70
Reference at(size_t index)
Checked access to the vector elements.
Definition: DynamicVector.h:838
DenseIterator< Type, aligned > Iterator
Iterator over non-constant elements.
Definition: DynamicVector.h:202
Base template for the BinaryMapTrait class.
Definition: BinaryMapTrait.h:119
Header file for the IsResizable type trait.
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:117
System settings for the inline keywords.
#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
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: DynamicVector.h:1765
#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
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.