35 #ifndef _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_ 36 #define _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_ 175 template<
typename Type
202 template<
typename NewType >
211 template<
size_t NewN >
240 template<
typename Other >
243 template<
typename Other,
size_t N >
262 inline Reference
operator[](
size_t index ) noexcept;
263 inline ConstReference
operator[](
size_t index )
const noexcept;
264 inline Reference
at(
size_t index );
265 inline ConstReference
at(
size_t index )
const;
266 inline Pointer
data () noexcept;
267 inline ConstPointer
data ()
const noexcept;
268 inline Iterator
begin () noexcept;
269 inline ConstIterator
begin ()
const noexcept;
270 inline ConstIterator
cbegin()
const noexcept;
271 inline Iterator
end () noexcept;
272 inline ConstIterator
end ()
const noexcept;
273 inline ConstIterator
cend ()
const noexcept;
280 inline DynamicVector&
operator=(
const Type& rhs );
283 template<
typename Other,
size_t N >
286 inline DynamicVector&
operator=(
const DynamicVector& rhs );
287 inline DynamicVector&
operator=( DynamicVector&& rhs ) noexcept;
295 template<
typename Other >
298 template<
typename Other >
306 inline size_t size()
const noexcept;
307 inline size_t capacity()
const noexcept;
311 inline void resize(
size_t n,
bool preserve=
true );
312 inline void extend(
size_t n,
bool preserve=
true );
313 inline void reserve(
size_t n );
314 inline void swap( DynamicVector& v ) noexcept;
321 template<
typename Other >
inline DynamicVector& scale(
const Other& scalar );
328 template<
typename VT >
330 struct VectorizedAssign {
332 simdEnabled && VT::simdEnabled &&
340 template<
typename VT >
342 struct VectorizedAddAssign {
344 simdEnabled && VT::simdEnabled &&
353 template<
typename VT >
355 struct VectorizedSubAssign {
357 simdEnabled && VT::simdEnabled &&
366 template<
typename VT >
368 struct VectorizedMultAssign {
370 simdEnabled && VT::simdEnabled &&
379 template<
typename VT >
381 struct VectorizedDivAssign {
383 simdEnabled && VT::simdEnabled &&
399 inline bool isIntact()
const noexcept;
406 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
407 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
421 template<
typename VT >
424 template<
typename VT >
429 template<
typename VT >
432 template<
typename VT >
437 template<
typename VT >
440 template<
typename VT >
445 template<
typename VT >
448 template<
typename VT >
453 template<
typename VT >
456 template<
typename VT >
465 inline size_t adjustCapacity(
size_t minCapacity )
const noexcept;
506 template<
typename Type
524 template<
typename Type
549 template<
typename Type
556 for(
size_t i=0UL; i<
size_; ++i )
584 template<
typename Type
591 std::fill( std::copy( list.begin(), list.end(),
v_ ),
v_+
capacity_, Type() );
618 template<
typename Type
620 template<
typename Other >
626 for(
size_t i=0UL; i<n; ++i )
656 template<
typename Type
658 template<
typename Other
665 for(
size_t i=0UL; i<N; ++i )
686 template<
typename Type
708 template<
typename Type
727 template<
typename Type
729 template<
typename VT >
758 template<
typename Type
784 template<
typename Type
804 template<
typename Type
825 template<
typename Type
830 if( index >=
size_ ) {
833 return (*
this)[index];
848 template<
typename Type
853 if( index >=
size_ ) {
856 return (*
this)[index];
868 template<
typename Type
884 template<
typename Type
898 template<
typename Type
912 template<
typename Type
926 template<
typename Type
940 template<
typename Type
954 template<
typename Type
968 template<
typename Type
991 template<
typename Type
995 for(
size_t i=0UL; i<
size_; ++i )
1018 template<
typename Type
1022 resize( list.size(), false );
1023 std::copy( list.begin(), list.end(),
v_ );
1048 template<
typename Type
1050 template<
typename Other
1056 for(
size_t i=0UL; i<N; ++i )
1073 template<
typename Type
1077 if( &rhs ==
this )
return *
this;
1095 template<
typename Type
1106 rhs.capacity_ = 0UL;
1122 template<
typename Type
1124 template<
typename VT >
1155 template<
typename Type
1157 template<
typename VT >
1190 template<
typename Type
1192 template<
typename VT >
1225 template<
typename Type
1227 template<
typename VT >
1259 template<
typename Type
1261 template<
typename VT >
1290 template<
typename Type
1292 template<
typename Other >
1314 template<
typename Type
1316 template<
typename Other >
1344 template<
typename Type
1358 template<
typename Type
1375 template<
typename Type
1379 size_t nonzeros( 0 );
1381 for(
size_t i=0UL; i<
size_; ++i ) {
1396 template<
typename Type
1401 for(
size_t i=0UL; i<
size_; ++i )
1414 template<
typename Type
1452 template<
typename Type
1468 for(
size_t i=
size_; i<newCapacity; ++i )
1479 for(
size_t i=n; i<
size_; ++i )
1500 template<
typename Type
1518 template<
typename Type
1532 for(
size_t i=
size_; i<newCapacity; ++i )
1551 template<
typename Type
1568 template<
typename Type
1573 return nextMultiple<size_t>( minCapacity, SIMDSIZE );
1574 else return minCapacity;
1593 template<
typename Type
1595 template<
typename Other >
1598 for(
size_t i=0UL; i<
size_; ++i )
1622 template<
typename Type
1631 if(
v_[i] != Type() )
1659 template<
typename Type
1661 template<
typename Other >
1664 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1679 template<
typename Type
1681 template<
typename Other >
1684 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1698 template<
typename Type
1717 template<
typename Type
1721 return (
size() > SMP_DVECASSIGN_THRESHOLD );
1738 template<
typename Type
1743 return loada( index );
1761 template<
typename Type
1793 template<
typename Type
1823 template<
typename Type
1846 template<
typename Type
1878 template<
typename Type
1909 template<
typename Type
1939 template<
typename Type
1941 template<
typename VT >
1947 const size_t ipos(
size_ &
size_t(-2) );
1950 for(
size_t i=0UL; i<ipos; i+=2UL ) {
1951 v_[i ] = (~rhs)[i ];
1952 v_[i+1UL] = (~rhs)[i+1UL];
1954 if( ipos < (~rhs).size() )
1955 v_[ipos] = (~rhs)[ipos];
1971 template<
typename Type
1973 template<
typename VT >
1983 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
1992 for( ; i<ipos; i+=SIMDSIZE ) {
1993 left.
stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1995 for( ; remainder && i<
size_; ++i ) {
1996 *left = *right; ++left; ++right;
2001 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2002 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2003 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2004 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2005 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2007 for( ; i<ipos; i+=SIMDSIZE ) {
2008 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2010 for( ; remainder && i<
size_; ++i ) {
2011 *left = *right; ++left; ++right;
2029 template<
typename Type
2031 template<
typename VT >
2037 v_[element->index()] = element->value();
2053 template<
typename Type
2055 template<
typename VT >
2061 const size_t ipos(
size_ &
size_t(-2) );
2064 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2065 v_[i ] += (~rhs)[i ];
2066 v_[i+1UL] += (~rhs)[i+1UL];
2068 if( ipos < (~rhs).size() )
2069 v_[ipos] += (~rhs)[ipos];
2085 template<
typename Type
2087 template<
typename VT >
2097 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2104 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2105 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2106 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2107 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2108 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2110 for( ; i<ipos; i+=SIMDSIZE ) {
2111 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2113 for( ; remainder && i<
size_; ++i ) {
2114 *left += *right; ++left; ++right;
2131 template<
typename Type
2133 template<
typename VT >
2139 v_[element->index()] += element->value();
2155 template<
typename Type
2157 template<
typename VT >
2163 const size_t ipos(
size_ &
size_t(-2) );
2166 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2167 v_[i ] -= (~rhs)[i ];
2168 v_[i+1UL] -= (~rhs)[i+1UL];
2170 if( ipos < (~rhs).size() )
2171 v_[ipos] -= (~rhs)[ipos];
2187 template<
typename Type
2189 template<
typename VT >
2199 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2206 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2207 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
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;
2212 for( ; i<ipos; i+=SIMDSIZE ) {
2213 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2215 for( ; remainder && i<
size_; ++i ) {
2216 *left -= *right; ++left; ++right;
2233 template<
typename Type
2235 template<
typename VT >
2241 v_[element->index()] -= element->value();
2257 template<
typename Type
2259 template<
typename VT >
2265 const size_t ipos(
size_ &
size_t(-2) );
2268 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2269 v_[i ] *= (~rhs)[i ];
2270 v_[i+1UL] *= (~rhs)[i+1UL];
2272 if( ipos < (~rhs).size() )
2273 v_[ipos] *= (~rhs)[ipos];
2289 template<
typename Type
2291 template<
typename VT >
2301 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2308 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2309 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
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;
2314 for( ; i<ipos; i+=SIMDSIZE ) {
2315 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2317 for( ; remainder && i<
size_; ++i ) {
2318 *left *= *right; ++left; ++right;
2335 template<
typename Type
2337 template<
typename VT >
2347 v_[element->index()] = tmp[element->index()] * element->value();
2363 template<
typename Type
2365 template<
typename VT >
2371 const size_t ipos(
size_ &
size_t(-2) );
2374 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2375 v_[i ] /= (~rhs)[i ];
2376 v_[i+1UL] /= (~rhs)[i+1UL];
2378 if( ipos < (~rhs).size() )
2379 v_[ipos] /= (~rhs)[ipos];
2395 template<
typename Type
2397 template<
typename VT >
2405 const size_t ipos(
size_ &
size_t(-SIMDSIZE) );
2412 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
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;
2416 left.
store( left.
load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2418 for( ; i<ipos; i+=SIMDSIZE ) {
2419 left.
store( left.
load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2421 for( ; i<
size_; ++i ) {
2422 *left /= *right; ++left; ++right;
2439 template<
typename Type,
bool TF >
2442 template<
typename Type,
bool TF >
2445 template<
bool RF,
typename Type,
bool TF >
2448 template<
typename Type,
bool TF >
2451 template<
typename Type,
bool TF >
2464 template<
typename Type
2480 template<
typename Type
2518 return ( v.
size() == 0UL );
2541 template<
typename Type
2558 template<
typename Type
2577 template<
typename T,
bool TF >
2594 template<
typename T,
bool TF >
2611 template<
typename T,
bool TF >
2628 template<
typename T,
bool TF >
2645 template<
typename T,
bool TF >
2662 template<
typename T1,
bool TF,
typename T2,
size_t N >
2663 struct AddTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2668 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2669 struct AddTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2674 template<
typename T1,
bool TF,
typename T2,
size_t N >
2675 struct AddTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2680 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2681 struct AddTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2686 template<
typename T1,
bool TF,
typename T2 >
2687 struct AddTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2705 template<
typename T1,
bool TF,
typename T2,
size_t N >
2706 struct SubTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2711 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2712 struct SubTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2717 template<
typename T1,
bool TF,
typename T2,
size_t N >
2718 struct SubTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2723 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2724 struct SubTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2729 template<
typename T1,
bool TF,
typename T2 >
2730 struct SubTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2748 template<
typename T1,
bool TF,
typename T2 >
2749 struct MultTrait< DynamicVector<T1,TF>, T2, EnableIf_<IsNumeric<T2> > >
2754 template<
typename T1,
typename T2,
bool TF >
2755 struct MultTrait< T1, DynamicVector<T2,TF>, EnableIf_<IsNumeric<T1> > >
2760 template<
typename T1,
bool TF,
typename T2,
size_t N >
2761 struct MultTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2766 template<
typename T1,
typename T2,
size_t N >
2767 struct MultTrait< DynamicVector<T1,false>, StaticVector<T2,N,true> >
2772 template<
typename T1,
typename T2,
size_t N >
2773 struct MultTrait< DynamicVector<T1,true>, StaticVector<T2,N,false> >
2778 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2779 struct MultTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2784 template<
typename T1,
size_t N,
typename T2 >
2785 struct MultTrait< StaticVector<T1,N,false>, DynamicVector<T2,true> >
2790 template<
typename T1,
size_t N,
typename T2 >
2791 struct MultTrait< StaticVector<T1,N,true>, DynamicVector<T2,false> >
2796 template<
typename T1,
bool TF,
typename T2,
size_t N >
2797 struct MultTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2802 template<
typename T1,
typename T2,
size_t N >
2803 struct MultTrait< DynamicVector<T1,false>, HybridVector<T2,N,true> >
2808 template<
typename T1,
typename T2,
size_t N >
2809 struct MultTrait< DynamicVector<T1,true>, HybridVector<T2,N,false> >
2814 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2815 struct MultTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2820 template<
typename T1,
size_t N,
typename T2 >
2821 struct MultTrait< HybridVector<T1,N,false>, DynamicVector<T2,true> >
2826 template<
typename T1,
size_t N,
typename T2 >
2827 struct MultTrait< HybridVector<T1,N,true>, DynamicVector<T2,false> >
2832 template<
typename T1,
bool TF,
typename T2 >
2833 struct MultTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2838 template<
typename T1,
typename T2 >
2839 struct MultTrait< DynamicVector<T1,false>, DynamicVector<T2,true> >
2844 template<
typename T1,
typename T2 >
2845 struct MultTrait< DynamicVector<T1,true>, DynamicVector<T2,false> >
2863 template<
typename T1,
bool TF,
typename T2 >
2864 struct CrossTrait< DynamicVector<T1,TF>, StaticVector<T2,3UL,TF> >
2873 template<
typename T1,
bool TF,
typename T2 >
2874 struct CrossTrait< StaticVector<T1,3UL,TF>, DynamicVector<T2,TF> >
2883 template<
typename T1,
bool TF,
typename T2,
size_t N >
2884 struct CrossTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2893 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2894 struct CrossTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2903 template<
typename T1,
bool TF,
typename T2 >
2904 struct CrossTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2926 template<
typename T1,
bool TF,
typename T2 >
2927 struct DivTrait< DynamicVector<T1,TF>, T2, EnableIf_<IsNumeric<T2> > >
2932 template<
typename T1,
bool TF,
typename T2,
size_t N >
2933 struct DivTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2938 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2939 struct DivTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2944 template<
typename T1,
bool TF,
typename T2,
size_t N >
2945 struct DivTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2950 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2951 struct DivTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2956 template<
typename T1,
bool TF,
typename T2 >
2957 struct DivTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2975 template<
typename T1,
bool TF,
typename T2 >
2976 struct HighType< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2994 template<
typename T1,
bool TF,
typename T2 >
2995 struct LowType< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
3013 template<
typename T1,
bool TF >
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:133
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h:79
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
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:1912
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: DynamicVector.h:1826
Header file for auxiliary alias declarations.
DenseIterator< Type, aligned > Iterator
Iterator over non-constant elements.
Definition: DynamicVector.h:195
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:474
Availability of a SIMD subtraction for the given data types.Depending on the available instruction se...
Definition: HasSIMDSub.h:163
Header file for mathematical functions.
constexpr bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the alignment flag values.
BLAZE_ALWAYS_INLINE void storea(size_t index, const SIMDType &value) noexcept
Aligned store of a SIMD element of the vector.
Definition: DynamicVector.h:1849
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:1346
const SIMDType load() const noexcept
Load of the SIMD element at the current iterator position.
Definition: DenseIterator.h:403
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:160
void clear()
Clearing the vector.
Definition: DynamicVector.h:1416
Header file for the serial shim.
constexpr size_t cacheSize
Cache size of the target architecture.This setting specifies the available cache size in Byte of the ...
Definition: CacheSize.h:48
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
SIMDTrait_< ElementType > SIMDType
SIMD type of the vector elements.
Definition: DynamicVector.h:186
BLAZE_ALWAYS_INLINE T1 & operator/=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Division assignment operator for the division of two SIMD packs.
Definition: BasicTypes.h:1339
bool isIntact() const noexcept
Returns whether the invariants of the dynamic vector are intact.
Definition: DynamicVector.h:1624
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:162
bool canSMPAssign() const noexcept
Returns whether the vector can be used in SMP assignments.
Definition: DynamicVector.h:1719
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:315
const Type * ConstPointer
Pointer to a constant vector value.
Definition: DynamicVector.h:193
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:223
OutputIterator transfer(InputIterator first, InputIterator last, OutputIterator dest)
Transfers the elements from the given source range to the destination range.
Definition: Algorithm.h:71
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:1881
Availability of a SIMD addition for the given data types.Depending on the available instruction set (...
Definition: HasSIMDAdd.h:163
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:928
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:245
Efficient implementation of an arbitrary sized vector.The DynamicVector class template is the represe...
Definition: DynamicVector.h:177
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:204
BLAZE_ALWAYS_INLINE T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1321
Compile time check for data types.This type trait tests whether or not the given types can be combine...
Definition: IsSIMDCombinable.h:120
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
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:129
DenseVector< This, TF > BaseType
Base type of this DynamicVector instance.
Definition: DynamicVector.h:182
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: DynamicVector.h:1764
Constraint on the data type.
Base template for the CrossTrait class.
Definition: CrossTrait.h:110
size_t adjustCapacity(size_t minCapacity) const noexcept
Adjusting the new capacity of the vector according to its data type Type.
Definition: DynamicVector.h:1570
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:760
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:900
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:150
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: DynamicVector.h:1796
DenseIterator< const Type, aligned > ConstIterator
Iterator over constant elements.
Definition: DynamicVector.h:196
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
This ResultType
Result type for expression template evaluations.
Definition: DynamicVector.h:183
void resize(size_t n, bool preserve=true)
Changing the size of the vector.
Definition: DynamicVector.h:1454
Header file for the multiplication 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:5635
constexpr bool useStreaming
Configuration of the streaming behavior.For large vectors and matrices non-temporal stores can provid...
Definition: Optimizations.h:68
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 Type & ReturnType
Return type for expression template evaluations.
Definition: DynamicVector.h:187
#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:98
DynamicVector() noexcept
The default constructor for DynamicVector.
Definition: DynamicVector.h:508
#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:1360
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:144
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Compile time check for sparse vector types.This type trait tests whether or not the given template pa...
Definition: IsSparseVector.h:78
void reset()
Reset to the default initial values.
Definition: DynamicVector.h:1398
Resize mechanism to obtain a DynamicVector with a different fixed number of elements.
Definition: DynamicVector.h:212
bool isAligned() const noexcept
Returns whether the vector is properly aligned in memory.
Definition: DynamicVector.h:1700
Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: DynamicVector.h:787
Header file for the IsAligned type trait.
ConstIterator cend() const noexcept
Returns an iterator just past the last element of the dynamic vector.
Definition: DynamicVector.h:970
size_t size_
The current size/dimension of the vector.
Definition: DynamicVector.h:472
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
Type & Reference
Reference to a non-constant vector value.
Definition: DynamicVector.h:190
#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
const Type & ConstReference
Reference to a constant vector value.
Definition: DynamicVector.h:191
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
Headerfile for generic algorithms.
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.
BLAZE_ALWAYS_INLINE SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: DynamicVector.h:1741
Header file for the IsVectorizable type trait.
Header file for the IsNumeric type trait.
Base template for the LowType type trait.
Definition: LowType.h:133
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:473
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:75
Header file for the IsSIMDCombinable type trait.
Header file for the IsSparseVector type trait.
Header file for the HasSIMDMult type trait.
DynamicVector< Type, TF > Other
The type of the other DynamicVector.
Definition: DynamicVector.h:213
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1285
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:143
Base template for the MultTrait class.
Definition: MultTrait.h:143
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:870
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
const DynamicVector & CompositeType
Data type for composite expression templates.
Definition: DynamicVector.h:188
void extend(size_t n, bool preserve=true)
Extending the size of the vector.
Definition: DynamicVector.h:1502
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:203
Header file for the isDefault shim.
System settings for the restrict keyword.
Type ElementType
Type of the vector elements.
Definition: DynamicVector.h:185
Type * Pointer
Pointer to a non-constant vector value.
Definition: DynamicVector.h:192
Constraint on the data type.
Header file for the HasSIMDSub type trait.
Header file for the HasMutableDataAccess type trait.
void reserve(size_t n)
Setting the minimum capacity of the vector.
Definition: DynamicVector.h:1520
void swap(DynamicVector &v) noexcept
Swapping the contents of two vectors.
Definition: DynamicVector.h:1553
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: DynamicVector.h:1377
EnableIf_< IsBuiltin< T > > deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:225
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
Base template for the DivTrait class.
Definition: DivTrait.h:143
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:76
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: DynamicVector.h:1682
constexpr bool usePadding
Configuration of the padding of dense vectors and matrices.This configuration switch enables/disables...
Definition: Optimizations.h:52
Iterator end() noexcept
Returns an iterator just past the last element of the dynamic vector.
Definition: DynamicVector.h:942
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:164
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:120
DynamicVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: DynamicVector.h:993
Header file for the IntegralConstant class template.
DynamicVector< NewType, TF > Other
The type of the other DynamicVector.
Definition: DynamicVector.h:204
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Base template for the SubTrait class.
Definition: SubTrait.h:143
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1303
Reference at(size_t index)
Checked access to the vector elements.
Definition: DynamicVector.h:828
Header file for the IsResizable type trait.
System settings for the inline keywords.
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:1662
#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.
DynamicVector< Type,!TF > TransposeType
Transpose type for expression template evaluations.
Definition: DynamicVector.h:184
DynamicVector< Type, TF > This
Type of this DynamicVector instance.
Definition: DynamicVector.h:181