35 #ifndef _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_ 36 #define _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_ 183 template<
typename Type
184 ,
bool TF = defaultTransposeFlag >
211 template<
typename NewType >
220 template<
size_t NewN >
249 template<
typename Other >
252 template<
typename Other,
size_t Dim >
289 inline DynamicVector&
operator=(
const Type& rhs );
292 template<
typename Other,
size_t Dim >
295 inline DynamicVector&
operator=(
const DynamicVector& rhs );
296 inline DynamicVector&
operator=( DynamicVector&& rhs ) noexcept;
303 template<
typename VT >
inline DynamicVector& operator%=(
const Vector<VT,TF>& rhs );
310 inline size_t size()
const noexcept;
311 inline size_t spacing()
const noexcept;
312 inline size_t capacity()
const noexcept;
316 inline void resize(
size_t n,
bool preserve=
true );
317 inline void extend(
size_t n,
bool preserve=
true );
318 inline void reserve(
size_t n );
320 inline void swap( DynamicVector& v ) noexcept;
327 template<
typename Other >
inline DynamicVector& scale(
const Other& scalar );
334 template<
typename VT >
336 struct VectorizedAssign {
337 enum :
bool { value = useOptimizedKernels &&
338 simdEnabled && VT::simdEnabled &&
346 template<
typename VT >
348 struct VectorizedAddAssign {
349 enum :
bool { value = useOptimizedKernels &&
350 simdEnabled && VT::simdEnabled &&
359 template<
typename VT >
361 struct VectorizedSubAssign {
362 enum :
bool { value = useOptimizedKernels &&
363 simdEnabled && VT::simdEnabled &&
372 template<
typename VT >
374 struct VectorizedMultAssign {
375 enum :
bool { value = useOptimizedKernels &&
376 simdEnabled && VT::simdEnabled &&
385 template<
typename VT >
387 struct VectorizedDivAssign {
388 enum :
bool { value = useOptimizedKernels &&
389 simdEnabled && VT::simdEnabled &&
405 inline bool isIntact()
const noexcept;
412 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
413 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
427 template<
typename VT >
430 template<
typename VT >
435 template<
typename VT >
438 template<
typename VT >
443 template<
typename VT >
446 template<
typename VT >
451 template<
typename VT >
454 template<
typename VT >
459 template<
typename VT >
462 template<
typename VT >
471 inline size_t addPadding(
size_t value )
const noexcept;
512 template<
typename Type
530 template<
typename Type
555 template<
typename Type
560 for(
size_t i=0UL; i<
size_; ++i )
583 template<
typename Type
588 std::fill( std::copy( list.begin(), list.end(),
begin() ),
end(), Type() );
615 template<
typename Type
617 template<
typename Other >
621 for(
size_t i=0UL; i<n; ++i )
646 template<
typename Type
648 template<
typename Other
653 for(
size_t i=0UL; i<Dim; ++i )
669 template<
typename Type
688 template<
typename Type
707 template<
typename Type
709 template<
typename VT >
714 for(
size_t i=0UL; i<
size_; ++i ) {
737 template<
typename Type
763 template<
typename Type
783 template<
typename Type
804 template<
typename Type
809 if( index >=
size_ ) {
812 return (*
this)[index];
827 template<
typename Type
832 if( index >=
size_ ) {
835 return (*
this)[index];
847 template<
typename Type
863 template<
typename Type
877 template<
typename Type
891 template<
typename Type
905 template<
typename Type
919 template<
typename Type
933 template<
typename Type
947 template<
typename Type
970 template<
typename Type
974 for(
size_t i=0UL; i<
size_; ++i )
997 template<
typename Type
1001 resize( list.size(), false );
1002 std::copy( list.begin(), list.end(),
v_ );
1027 template<
typename Type
1029 template<
typename Other
1035 for(
size_t i=0UL; i<Dim; ++i )
1052 template<
typename Type
1056 if( &rhs ==
this )
return *
this;
1074 template<
typename Type
1085 rhs.capacity_ = 0UL;
1101 template<
typename Type
1103 template<
typename VT >
1134 template<
typename Type
1136 template<
typename VT >
1169 template<
typename Type
1171 template<
typename VT >
1204 template<
typename Type
1206 template<
typename VT >
1238 template<
typename Type
1240 template<
typename VT >
1273 template<
typename Type
1275 template<
typename VT >
1278 using blaze::assign;
1289 if(
size_ != 3UL || (~rhs).
size() != 3UL ) {
1293 const CrossType tmp( *
this % (~rhs) );
1294 assign( *
this, tmp );
1316 template<
typename Type
1333 template<
typename Type
1347 template<
typename Type
1364 template<
typename Type
1368 size_t nonzeros( 0 );
1370 for(
size_t i=0UL; i<
size_; ++i ) {
1385 template<
typename Type
1390 for(
size_t i=0UL; i<
size_; ++i )
1403 template<
typename Type
1441 template<
typename Type
1459 for(
size_t i=
size_; i<newCapacity; ++i )
1470 for(
size_t i=n; i<
size_; ++i )
1491 template<
typename Type
1509 template<
typename Type
1525 for(
size_t i=
size_; i<newCapacity; ++i )
1548 template<
typename Type
1565 template<
typename Type
1587 template<
typename Type
1592 return nextMultiple<size_t>( value, SIMDSIZE );
1623 template<
typename Type
1625 template<
typename Other >
1628 for(
size_t i=0UL; i<
size_; ++i )
1652 template<
typename Type
1661 if(
v_[i] != Type() )
1689 template<
typename Type
1691 template<
typename Other >
1694 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1709 template<
typename Type
1711 template<
typename Other >
1714 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1728 template<
typename Type
1747 template<
typename Type
1751 return (
size() > SMP_DVECASSIGN_THRESHOLD );
1768 template<
typename Type
1773 return loada( index );
1791 template<
typename Type
1823 template<
typename Type
1853 template<
typename Type
1876 template<
typename Type
1908 template<
typename Type
1939 template<
typename Type
1969 template<
typename Type
1971 template<
typename VT >
1977 const size_t ipos(
size_ &
size_t(-2) );
1980 for(
size_t i=0UL; i<ipos; i+=2UL ) {
1981 v_[i ] = (~rhs)[i ];
1982 v_[i+1UL] = (~rhs)[i+1UL];
1984 if( ipos < (~rhs).size() )
1985 v_[ipos] = (~rhs)[ipos];
2001 template<
typename Type
2003 template<
typename VT >
2013 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2020 if( useStreaming &&
size_ > ( cacheSize/(
sizeof(Type) * 3UL ) ) && !(~rhs).
isAliased(
this ) )
2022 for( ; i<ipos; i+=SIMDSIZE ) {
2023 left.
stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2025 for( ; remainder && i<
size_; ++i ) {
2026 *left = *right; ++left; ++right;
2031 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2032 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2033 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2034 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2035 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2037 for( ; i<ipos; i+=SIMDSIZE ) {
2038 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2040 for( ; remainder && i<
size_; ++i ) {
2041 *left = *right; ++left; ++right;
2059 template<
typename Type
2061 template<
typename VT >
2067 v_[element->index()] = element->value();
2083 template<
typename Type
2085 template<
typename VT >
2091 const size_t ipos(
size_ &
size_t(-2) );
2094 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2095 v_[i ] += (~rhs)[i ];
2096 v_[i+1UL] += (~rhs)[i+1UL];
2098 if( ipos < (~rhs).size() )
2099 v_[ipos] += (~rhs)[ipos];
2115 template<
typename Type
2117 template<
typename VT >
2127 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2134 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2135 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2136 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2137 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2138 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2140 for( ; i<ipos; i+=SIMDSIZE ) {
2141 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2143 for( ; remainder && i<
size_; ++i ) {
2144 *left += *right; ++left; ++right;
2161 template<
typename Type
2163 template<
typename VT >
2169 v_[element->index()] += element->value();
2185 template<
typename Type
2187 template<
typename VT >
2193 const size_t ipos(
size_ &
size_t(-2) );
2196 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2197 v_[i ] -= (~rhs)[i ];
2198 v_[i+1UL] -= (~rhs)[i+1UL];
2200 if( ipos < (~rhs).size() )
2201 v_[ipos] -= (~rhs)[ipos];
2217 template<
typename Type
2219 template<
typename VT >
2229 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2236 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2237 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2238 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2239 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2240 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2242 for( ; i<ipos; i+=SIMDSIZE ) {
2243 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2245 for( ; remainder && i<
size_; ++i ) {
2246 *left -= *right; ++left; ++right;
2263 template<
typename Type
2265 template<
typename VT >
2271 v_[element->index()] -= element->value();
2287 template<
typename Type
2289 template<
typename VT >
2295 const size_t ipos(
size_ &
size_t(-2) );
2298 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2299 v_[i ] *= (~rhs)[i ];
2300 v_[i+1UL] *= (~rhs)[i+1UL];
2302 if( ipos < (~rhs).size() )
2303 v_[ipos] *= (~rhs)[ipos];
2319 template<
typename Type
2321 template<
typename VT >
2331 const size_t ipos( ( remainder )?(
size_ &
size_t(-SIMDSIZE) ):(
size_ ) );
2338 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2339 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2340 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2341 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2342 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2344 for( ; i<ipos; i+=SIMDSIZE ) {
2345 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2347 for( ; remainder && i<
size_; ++i ) {
2348 *left *= *right; ++left; ++right;
2365 template<
typename Type
2367 template<
typename VT >
2377 v_[element->index()] = tmp[element->index()] * element->value();
2393 template<
typename Type
2395 template<
typename VT >
2401 const size_t ipos(
size_ &
size_t(-2) );
2404 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2405 v_[i ] /= (~rhs)[i ];
2406 v_[i+1UL] /= (~rhs)[i+1UL];
2408 if( ipos < (~rhs).size() )
2409 v_[ipos] /= (~rhs)[ipos];
2425 template<
typename Type
2427 template<
typename VT >
2435 const size_t ipos(
size_ &
size_t(-SIMDSIZE) );
2442 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2443 left.
store( left.
load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2444 left.
store( left.
load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2445 left.
store( left.
load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2446 left.
store( left.
load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2448 for( ; i<ipos; i+=SIMDSIZE ) {
2449 left.
store( left.
load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2451 for( ; i<
size_; ++i ) {
2452 *left /= *right; ++left; ++right;
2469 template<
typename Type,
bool TF >
2472 template<
typename Type,
bool TF >
2475 template<
bool RF,
typename Type,
bool TF >
2478 template<
typename Type,
bool TF >
2481 template<
typename Type,
bool TF >
2494 template<
typename Type
2510 template<
typename Type
2548 return ( v.
size() == 0UL );
2571 template<
typename Type
2588 template<
typename Type
2607 template<
typename T,
bool TF >
2625 template<
typename T,
bool TF >
2643 template<
typename T,
bool TF >
2661 template<
typename T,
bool TF >
2679 template<
typename T,
bool TF >
2680 struct IsPadded< DynamicVector<T,TF> >
2697 template<
typename T,
bool TF >
2715 template<
typename T,
bool TF >
2733 template<
typename T1,
bool TF,
typename T2,
size_t N >
2734 struct AddTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2739 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2740 struct AddTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2745 template<
typename T1,
bool TF,
typename T2,
size_t N >
2746 struct AddTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2751 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2752 struct AddTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2757 template<
typename T1,
bool TF,
typename T2 >
2758 struct AddTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2776 template<
typename T1,
bool TF,
typename T2,
size_t N >
2777 struct SubTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2782 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2783 struct SubTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2788 template<
typename T1,
bool TF,
typename T2,
size_t N >
2789 struct SubTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2794 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2795 struct SubTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2800 template<
typename T1,
bool TF,
typename T2 >
2801 struct SubTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2819 template<
typename T1,
bool TF,
typename T2 >
2820 struct MultTrait< DynamicVector<T1,TF>, T2, EnableIf_<IsNumeric<T2> > >
2825 template<
typename T1,
typename T2,
bool TF >
2826 struct MultTrait< T1, DynamicVector<T2,TF>, EnableIf_<IsNumeric<T1> > >
2831 template<
typename T1,
bool TF,
typename T2,
size_t N >
2832 struct MultTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2837 template<
typename T1,
typename T2,
size_t N >
2838 struct MultTrait< DynamicVector<T1,false>, StaticVector<T2,N,true> >
2843 template<
typename T1,
typename T2,
size_t N >
2844 struct MultTrait< DynamicVector<T1,true>, StaticVector<T2,N,false> >
2849 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2850 struct MultTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2855 template<
typename T1,
size_t N,
typename T2 >
2856 struct MultTrait< StaticVector<T1,N,false>, DynamicVector<T2,true> >
2861 template<
typename T1,
size_t N,
typename T2 >
2862 struct MultTrait< StaticVector<T1,N,true>, DynamicVector<T2,false> >
2867 template<
typename T1,
bool TF,
typename T2,
size_t N >
2868 struct MultTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2873 template<
typename T1,
typename T2,
size_t N >
2874 struct MultTrait< DynamicVector<T1,false>, HybridVector<T2,N,true> >
2879 template<
typename T1,
typename T2,
size_t N >
2880 struct MultTrait< DynamicVector<T1,true>, HybridVector<T2,N,false> >
2885 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2886 struct MultTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2891 template<
typename T1,
size_t N,
typename T2 >
2892 struct MultTrait< HybridVector<T1,N,false>, DynamicVector<T2,true> >
2897 template<
typename T1,
size_t N,
typename T2 >
2898 struct MultTrait< HybridVector<T1,N,true>, DynamicVector<T2,false> >
2903 template<
typename T1,
bool TF,
typename T2 >
2904 struct MultTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2909 template<
typename T1,
typename T2 >
2910 struct MultTrait< DynamicVector<T1,false>, DynamicVector<T2,true> >
2915 template<
typename T1,
typename T2 >
2916 struct MultTrait< DynamicVector<T1,true>, DynamicVector<T2,false> >
2934 template<
typename T1,
bool TF,
typename T2 >
2935 struct DivTrait< DynamicVector<T1,TF>, T2, EnableIf_<IsNumeric<T2> > >
2940 template<
typename T1,
bool TF,
typename T2,
size_t N >
2941 struct DivTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2946 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2947 struct DivTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2952 template<
typename T1,
bool TF,
typename T2,
size_t N >
2953 struct DivTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2958 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2959 struct DivTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2964 template<
typename T1,
bool TF,
typename T2 >
2965 struct DivTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2983 template<
typename T1,
bool TF,
typename T2 >
2984 struct CrossTrait< DynamicVector<T1,TF>, StaticVector<T2,3UL,TF> >
2993 template<
typename T1,
bool TF,
typename T2 >
2994 struct CrossTrait< StaticVector<T1,3UL,TF>, DynamicVector<T2,TF> >
3003 template<
typename T1,
bool TF,
typename T2,
size_t N >
3004 struct CrossTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
3013 template<
typename T1,
size_t N,
bool TF,
typename T2 >
3014 struct CrossTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
3023 template<
typename T1,
bool TF,
typename T2 >
3024 struct CrossTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
3046 template<
typename T,
bool TF,
typename OP >
3065 template<
typename T1,
bool TF,
typename T2,
size_t N,
typename OP >
3066 struct BinaryMapTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF>, OP >
3071 template<
typename T1,
size_t N,
bool TF,
typename T2,
typename OP >
3072 struct BinaryMapTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF>, OP >
3077 template<
typename T1,
bool TF,
typename T2,
size_t N,
typename OP >
3078 struct BinaryMapTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF>, OP >
3083 template<
typename T1,
size_t N,
bool TF,
typename T2,
typename OP >
3084 struct BinaryMapTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF>, OP >
3089 template<
typename T1,
bool TF,
typename T2,
typename OP >
3090 struct BinaryMapTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF>, OP >
3108 template<
typename T1,
bool TF,
typename T2 >
3109 struct HighType< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
3127 template<
typename T1,
bool TF,
typename T2 >
3128 struct LowType< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
3146 template<
typename T,
bool TF,
size_t I,
size_t N >
3152 template<
typename T,
bool TF >
3171 template<
typename T,
bool TF,
size_t... CEAs >
3174 using Type = StaticVector<T,
sizeof...(CEAs),TF>;
3177 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:1942
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: DynamicVector.h:1856
Header file for auxiliary alias declarations.
Type *BLAZE_RESTRICT v_
The dynamically allocated vector elements.
Definition: DynamicVector.h:480
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:201
BLAZE_ALWAYS_INLINE void storea(size_t index, const SIMDType &value) noexcept
Aligned store of a SIMD element of the vector.
Definition: DynamicVector.h:1879
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:1318
const SIMDType load() const noexcept
Load of the SIMD element at the current iterator position.
Definition: DenseIterator.h:405
size_t spacing() const noexcept
Returns the minimum capacity of the vector.
Definition: DynamicVector.h:1335
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:1405
Header file for the serial shim.
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
bool isIntact() const noexcept
Returns whether the invariants of the dynamic vector are intact.
Definition: DynamicVector.h:1654
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:1749
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:1911
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:907
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:291
Efficient implementation of an arbitrary sized vector.The DynamicVector class template is the represe...
Definition: DynamicVector.h:185
Header file for memory allocation and deallocation functionality.
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
Efficient implementation of a dynamic matrix.The DynamicMatrix class template is the representation ...
Definition: DynamicMatrix.h:217
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
Header file for the elements trait.
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: DynamicVector.h:1794
Constraint on the data type.
Base template for the CrossTrait class.
Definition: CrossTrait.h:113
Efficient implementation of a fixed-sized vector.The StaticVector class template is the representatio...
Definition: Forward.h:61
Base template for the SubvectorTrait class.
Definition: SubvectorTrait.h:109
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:739
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:879
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:1826
Compile time check for the memory layout of data types.This type trait tests whether the given data t...
Definition: IsContiguous.h:86
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:1443
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:58
#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:5908
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:514
#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:1349
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:533
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:470
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:76
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:1387
Resize mechanism to obtain a DynamicVector with a different fixed number of elements.
Definition: DynamicVector.h:221
bool isAligned() const noexcept
Returns whether the vector is properly aligned in memory.
Definition: DynamicVector.h:1730
Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: DynamicVector.h:766
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:949
size_t size_
The current size/dimension of the vector.
Definition: DynamicVector.h:478
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:123
Base template for the ElementsTrait class.
Definition: ElementsTrait.h:108
typename CrossTrait< T1, T2 >::Type CrossTrait_
Auxiliary alias declaration for the CrossTrait class template.The CrossTrait_ alias declaration provi...
Definition: CrossTrait.h:209
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:608
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:1771
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:479
const Type & ReturnType
Return type for expression template evaluations.
Definition: DynamicVector.h:196
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:195
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:190
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:119
const Type & ConstReference
Reference to a constant vector value.
Definition: DynamicVector.h:200
Base template for the MultTrait class.
Definition: MultTrait.h:119
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
Constraint on the data type.
Header file for the IsContiguous type trait.
Pointer data() noexcept
Low-level data access to the vector elements.
Definition: DynamicVector.h:849
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:199
void extend(size_t n, bool preserve=true)
Extending the size of the vector.
Definition: DynamicVector.h:1493
size_t addPadding(size_t value) const noexcept
Add the necessary amount of padding to the given value.
Definition: DynamicVector.h:1589
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:212
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:816
Header file for the HasMutableDataAccess type trait.
void reserve(size_t n)
Setting the minimum capacity of the vector.
Definition: DynamicVector.h:1511
#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:205
void swap(DynamicVector &v) noexcept
Swapping the contents of two vectors.
Definition: DynamicVector.h:1567
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: DynamicVector.h:1366
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:120
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:1712
Type ElementType
Type of the vector elements.
Definition: DynamicVector.h:194
EnableIf_< IsNumeric< ST >, MT &> operator/=(DenseMatrix< MT, SO > &mat, ST scalar)
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:655
void shrinkToFit()
Requesting the removal of unused capacity.
Definition: DynamicVector.h:1550
Iterator end() noexcept
Returns an iterator just past the last element of the dynamic vector.
Definition: DynamicVector.h:921
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.
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:202
DynamicVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: DynamicVector.h:972
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:628
Base template for the SubTrait class.
Definition: SubTrait.h:119
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:807
DenseIterator< Type, aligned > Iterator
Iterator over non-constant elements.
Definition: DynamicVector.h:204
EnableIf_< IsNumeric< ST >, MT &> operator*=(DenseMatrix< MT, SO > &mat, ST scalar)
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:593
Base template for the BinaryMapTrait class.
Definition: BinaryMapTrait.h:97
Header file for the IsResizable type trait.
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:95
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:1692
#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.