35 #ifndef _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_
36 #define _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_
158 template<
typename Type
187 template<
typename ET >
214 template<
typename Other >
explicit inline DynamicVector(
size_t n,
const Other* array );
216 template<
typename Other,
size_t N >
220 template<
typename VT >
inline DynamicVector(
const Vector<VT,TF>& v );
250 template<
typename Other,
size_t N >
255 template<
typename VT >
inline DynamicVector& operator= (
const Vector<VT,TF>& rhs );
256 template<
typename VT >
inline DynamicVector& operator+=(
const Vector<VT,TF>& rhs );
257 template<
typename VT >
inline DynamicVector& operator-=(
const Vector<VT,TF>& rhs );
258 template<
typename VT >
inline DynamicVector& operator*=(
const Vector<VT,TF>& rhs );
260 template<
typename Other >
261 inline typename EnableIf< IsNumeric<Other>,
DynamicVector >::Type&
262 operator*=( Other rhs );
264 template<
typename Other >
265 inline typename EnableIf< IsNumeric<Other>,
DynamicVector >::Type&
266 operator/=( Other rhs );
273 inline size_t size()
const;
278 inline void resize(
size_t n,
bool preserve=
true );
279 inline void extend(
size_t n,
bool preserve=
true );
280 inline void reserve(
size_t n );
281 template<
typename Other >
inline DynamicVector& scale(
const Other& scalar );
289 template<
typename VT >
291 struct VectorizedAssign {
292 enum { value = vectorizable && VT::vectorizable &&
293 IsSame<Type,typename VT::ElementType>::value };
300 template<
typename VT >
302 struct VectorizedAddAssign {
303 enum { value = vectorizable && VT::vectorizable &&
304 IsSame<Type,typename VT::ElementType>::value &&
305 IntrinsicTrait<Type>::addition };
312 template<
typename VT >
314 struct VectorizedSubAssign {
315 enum { value = vectorizable && VT::vectorizable &&
316 IsSame<Type,typename VT::ElementType>::value &&
317 IntrinsicTrait<Type>::subtraction };
324 template<
typename VT >
326 struct VectorizedMultAssign {
327 enum { value = vectorizable && VT::vectorizable &&
328 IsSame<Type,typename VT::ElementType>::value &&
329 IntrinsicTrait<Type>::multiplication };
338 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
339 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
350 template<
typename VT >
351 inline typename DisableIf< VectorizedAssign<VT> >::Type
352 assign(
const DenseVector<VT,TF>& rhs );
354 template<
typename VT >
355 inline typename EnableIf< VectorizedAssign<VT> >::Type
356 assign(
const DenseVector<VT,TF>& rhs );
358 template<
typename VT >
inline void assign(
const SparseVector<VT,TF>& rhs );
360 template<
typename VT >
361 inline typename DisableIf< VectorizedAddAssign<VT> >::Type
362 addAssign(
const DenseVector<VT,TF>& rhs );
364 template<
typename VT >
365 inline typename EnableIf< VectorizedAddAssign<VT> >::Type
366 addAssign(
const DenseVector<VT,TF>& rhs );
368 template<
typename VT >
inline void addAssign(
const SparseVector<VT,TF>& rhs );
370 template<
typename VT >
371 inline typename DisableIf< VectorizedSubAssign<VT> >::Type
372 subAssign(
const DenseVector<VT,TF>& rhs );
374 template<
typename VT >
375 inline typename EnableIf< VectorizedSubAssign<VT> >::Type
376 subAssign(
const DenseVector<VT,TF>& rhs );
378 template<
typename VT >
inline void subAssign(
const SparseVector<VT,TF>& rhs );
380 template<
typename VT >
381 inline typename DisableIf< VectorizedMultAssign<VT> >::Type
382 multAssign(
const DenseVector<VT,TF>& rhs );
384 template<
typename VT >
385 inline typename EnableIf< VectorizedMultAssign<VT> >::Type
386 multAssign(
const DenseVector<VT,TF>& rhs );
388 template<
typename VT >
inline void multAssign(
const SparseVector<VT,TF>& rhs );
437 template<
typename Type
455 template<
typename Type
478 template<
typename Type
485 for(
size_t i=0UL; i<
size_; ++i )
516 template<
typename Type
518 template<
typename Other >
524 for(
size_t i=0UL; i<n; ++i )
552 template<
typename Type
554 template<
typename Other
561 for(
size_t i=0UL; i<N; ++i )
580 template<
typename Type
600 template<
typename Type
602 template<
typename VT >
604 : size_ ( (~v).
size() )
629 template<
typename Type
652 template<
typename Type
669 template<
typename Type
687 template<
typename Type
703 template<
typename Type
717 template<
typename Type
731 template<
typename Type
745 template<
typename Type
759 template<
typename Type
773 template<
typename Type
787 template<
typename Type
822 template<
typename Type
824 template<
typename Other
830 for(
size_t i=0UL; i<N; ++i )
844 template<
typename Type
848 for(
size_t i=0UL; i<size_; ++i )
864 template<
typename Type
868 if( &rhs ==
this )
return *
this;
886 template<
typename Type
888 template<
typename VT >
891 if( (~rhs).canAlias(
this ) ) {
917 template<
typename Type
919 template<
typename VT >
922 if( (~rhs).
size() != size_ )
923 throw std::invalid_argument(
"Vector sizes do not match" );
925 if( (~rhs).canAlias(
this ) ) {
949 template<
typename Type
951 template<
typename VT >
954 if( (~rhs).
size() != size_ )
955 throw std::invalid_argument(
"Vector sizes do not match" );
957 if( (~rhs).canAlias(
this ) ) {
981 template<
typename Type
983 template<
typename VT >
986 if( (~rhs).
size() != size_ )
987 throw std::invalid_argument(
"Vector sizes do not match" );
1009 template<
typename Type
1011 template<
typename Other >
1030 template<
typename Type
1032 template<
typename Other >
1057 template<
typename Type
1071 template<
typename Type
1088 template<
typename Type
1092 size_t nonzeros( 0 );
1094 for(
size_t i=0UL; i<size_; ++i ) {
1109 template<
typename Type
1114 for(
size_t i=0UL; i<size_; ++i )
1127 template<
typename Type
1165 template<
typename Type
1172 const size_t newCapacity( adjustCapacity( n ) );
1177 std::copy( v_, v_+size_, tmp );
1181 for(
size_t i=size_; i<newCapacity; ++i )
1192 for(
size_t i=n; i<size_; ++i )
1213 template<
typename Type
1217 resize( size_+n, preserve );
1231 template<
typename Type
1238 const size_t newCapacity( adjustCapacity( n ) );
1242 std::copy( v_, v_+size_, tmp );
1245 for(
size_t i=size_; i<newCapacity; ++i )
1264 template<
typename Type
1266 template<
typename Other >
1269 for(
size_t i=0UL; i<size_; ++i )
1283 template<
typename Type
1300 template<
typename Type
1306 else return minCapacity;
1329 template<
typename Type
1331 template<
typename Other >
1334 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1349 template<
typename Type
1351 template<
typename Other >
1354 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1368 template<
typename Type
1387 template<
typename Type
1409 template<
typename Type
1422 return load( v_+index );
1440 template<
typename Type
1452 return loadu( v_+index );
1471 template<
typename Type
1483 store( v_+index, value );
1502 template<
typename Type
1513 storeu( v_+index, value );
1532 template<
typename Type
1544 stream( v_+index, value );
1560 template<
typename Type
1562 template<
typename VT >
1568 const size_t iend( (~rhs).
size() &
size_t(-2) );
1569 for(
size_t i=0UL; i<iend; i+=2UL ) {
1570 v_[i ] = (~rhs)[i ];
1571 v_[i+1UL] = (~rhs)[i+1UL];
1573 if( iend < (~rhs).size() )
1574 v_[iend] = (~rhs)[iend];
1590 template<
typename Type
1592 template<
typename VT >
1605 for(
size_t i=0UL; i<size_; i+=
IT::size ) {
1611 const size_t iend( size_ &
size_t(-
IT::size*4) );
1615 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
1622 store( v_+i, it.load() );
1640 template<
typename Type
1642 template<
typename VT >
1648 v_[element->index()] = element->value();
1664 template<
typename Type
1666 template<
typename VT >
1672 const size_t iend( (~rhs).
size() &
size_t(-2) );
1673 for(
size_t i=0UL; i<iend; i+=2UL ) {
1674 v_[i ] += (~rhs)[i ];
1675 v_[i+1UL] += (~rhs)[i+1UL];
1677 if( iend < (~rhs).size() )
1678 v_[iend] += (~rhs)[iend];
1694 template<
typename Type
1696 template<
typename VT >
1707 const size_t iend( size_ &
size_t(-
IT::size*4) );
1711 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
1735 template<
typename Type
1737 template<
typename VT >
1743 v_[element->index()] += element->value();
1759 template<
typename Type
1761 template<
typename VT >
1767 const size_t iend( (~rhs).
size() &
size_t(-2) );
1768 for(
size_t i=0UL; i<iend; i+=2UL ) {
1769 v_[i ] -= (~rhs)[i ];
1770 v_[i+1UL] -= (~rhs)[i+1UL];
1772 if( iend < (~rhs).size() )
1773 v_[iend] -= (~rhs)[iend];
1789 template<
typename Type
1791 template<
typename VT >
1802 const size_t iend( size_ &
size_t(-
IT::size*4) );
1806 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
1830 template<
typename Type
1832 template<
typename VT >
1838 v_[element->index()] -= element->value();
1854 template<
typename Type
1856 template<
typename VT >
1862 const size_t iend( (~rhs).
size() &
size_t(-2) );
1863 for(
size_t i=0UL; i<iend; i+=2UL ) {
1864 v_[i ] *= (~rhs)[i ];
1865 v_[i+1UL] *= (~rhs)[i+1UL];
1867 if( iend < (~rhs).size() )
1868 v_[iend] *= (~rhs)[iend];
1884 template<
typename Type
1886 template<
typename VT >
1897 const size_t iend( size_ &
size_t(-
IT::size*4) );
1901 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
1925 template<
typename Type
1927 template<
typename VT >
1937 v_[element->index()] = tmp[element->index()] * element->value();
1953 template<
typename Type,
bool TF >
1956 template<
typename Type,
bool TF >
1959 template<
typename Type,
bool TF >
1962 template<
typename Type,
bool TF >
1965 template<
typename Type,
bool TF >
1978 template<
typename Type
1994 template<
typename Type
2020 template<
typename Type
2024 return ( v.
size() == 0UL );
2038 template<
typename Type
2056 template<
typename Type
2075 template<
typename T,
bool TF >
2076 struct IsResizable< DynamicVector<T,TF> > :
public TrueType
2095 template<
typename T1,
bool TF,
typename T2,
size_t N >
2096 struct AddTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2098 typedef StaticVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2101 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2102 struct AddTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2104 typedef StaticVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2107 template<
typename T1,
bool TF,
typename T2,
size_t N >
2108 struct AddTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2110 typedef HybridVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2113 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2114 struct AddTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2116 typedef HybridVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2119 template<
typename T1,
bool TF,
typename T2 >
2120 struct AddTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2122 typedef DynamicVector< typename AddTrait<T1,T2>::Type, TF > Type;
2138 template<
typename T1,
bool TF,
typename T2,
size_t N >
2139 struct SubTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2141 typedef StaticVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2144 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2145 struct SubTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2147 typedef StaticVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2150 template<
typename T1,
bool TF,
typename T2,
size_t N >
2151 struct SubTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2153 typedef HybridVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2156 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2157 struct SubTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2159 typedef HybridVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2162 template<
typename T1,
bool TF,
typename T2 >
2163 struct SubTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2165 typedef DynamicVector< typename SubTrait<T1,T2>::Type, TF > Type;
2181 template<
typename T1,
bool TF,
typename T2 >
2182 struct MultTrait< DynamicVector<T1,TF>, T2 >
2184 typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2188 template<
typename T1,
typename T2,
bool TF >
2189 struct MultTrait< T1, DynamicVector<T2,TF> >
2191 typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2195 template<
typename T1,
bool TF,
typename T2,
size_t N >
2196 struct MultTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2198 typedef StaticVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2201 template<
typename T1,
typename T2,
size_t N >
2202 struct MultTrait< DynamicVector<T1,false>, StaticVector<T2,N,true> >
2204 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2207 template<
typename T1,
typename T2,
size_t N >
2208 struct MultTrait< DynamicVector<T1,true>, StaticVector<T2,N,false> >
2210 typedef typename MultTrait<T1,T2>::Type Type;
2213 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2214 struct MultTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2216 typedef StaticVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2219 template<
typename T1,
size_t N,
typename T2 >
2220 struct MultTrait< StaticVector<T1,N,false>, DynamicVector<T2,true> >
2222 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2225 template<
typename T1,
size_t N,
typename T2 >
2226 struct MultTrait< StaticVector<T1,N,true>, DynamicVector<T2,false> >
2228 typedef typename MultTrait<T1,T2>::Type Type;
2231 template<
typename T1,
bool TF,
typename T2,
size_t N >
2232 struct MultTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2234 typedef HybridVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2237 template<
typename T1,
typename T2,
size_t N >
2238 struct MultTrait< DynamicVector<T1,false>, HybridVector<T2,N,true> >
2240 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2243 template<
typename T1,
typename T2,
size_t N >
2244 struct MultTrait< DynamicVector<T1,true>, HybridVector<T2,N,false> >
2246 typedef typename MultTrait<T1,T2>::Type Type;
2249 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2250 struct MultTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2252 typedef HybridVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2255 template<
typename T1,
size_t N,
typename T2 >
2256 struct MultTrait< HybridVector<T1,N,false>, DynamicVector<T2,true> >
2258 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2261 template<
typename T1,
size_t N,
typename T2 >
2262 struct MultTrait< HybridVector<T1,N,true>, DynamicVector<T2,false> >
2264 typedef typename MultTrait<T1,T2>::Type Type;
2267 template<
typename T1,
bool TF,
typename T2 >
2268 struct MultTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2270 typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2273 template<
typename T1,
typename T2 >
2274 struct MultTrait< DynamicVector<T1,false>, DynamicVector<T2,true> >
2276 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2279 template<
typename T1,
typename T2 >
2280 struct MultTrait< DynamicVector<T1,true>, DynamicVector<T2,false> >
2282 typedef typename MultTrait<T1,T2>::Type Type;
2298 template<
typename T1,
typename T2 >
2299 struct CrossTrait< DynamicVector<T1,false>, StaticVector<T2,3UL,false> >
2302 typedef typename MultTrait<T1,T2>::Type T;
2305 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2308 template<
typename T1,
typename T2 >
2309 struct CrossTrait< StaticVector<T1,3UL,false>, DynamicVector<T2,false> >
2312 typedef typename MultTrait<T1,T2>::Type T;
2315 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2318 template<
typename T1,
typename T2,
size_t N >
2319 struct CrossTrait< DynamicVector<T1,false>, HybridVector<T2,N,false> >
2322 typedef typename MultTrait<T1,T2>::Type T;
2325 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2328 template<
typename T1,
size_t N,
typename T2 >
2329 struct CrossTrait< HybridVector<T1,N,false>, DynamicVector<T2,false> >
2332 typedef typename MultTrait<T1,T2>::Type T;
2335 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2338 template<
typename T1,
typename T2 >
2339 struct CrossTrait< DynamicVector<T1,false>, DynamicVector<T2,false> >
2342 typedef typename MultTrait<T1,T2>::Type T;
2345 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2361 template<
typename T1,
bool TF,
typename T2 >
2362 struct DivTrait< DynamicVector<T1,TF>, T2 >
2364 typedef DynamicVector< typename DivTrait<T1,T2>::Type, TF > Type;
2381 template<
typename T1,
bool TF,
typename T2 >
2382 struct MathTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2384 typedef DynamicVector< typename MathTrait<T1,T2>::HighType, TF > HighType;
2385 typedef DynamicVector< typename MathTrait<T1,T2>::LowType , TF > LowType;
2401 template<
typename T1,
bool TF >
2402 struct SubvectorTrait< DynamicVector<T1,TF> >
2404 typedef DynamicVector<T1,TF> Type;
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:108
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:116
const bool defaultTransposeFlag
The default transpose flag for all vectors of the Blaze library.This value specifies the default tran...
Definition: TransposeFlag.h:56
Type *BLAZE_RESTRICT v_
The dynamically allocated vector elements.
Definition: DynamicVector.h:405
Constraint on the data type.
void swap(SymmetricMatrix< MT, SO, DF, NF > &a, SymmetricMatrix< MT, SO, DF, NF > &b)
Swapping the contents of two matrices.
Definition: SymmetricMatrix.h:195
#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 subtraction trait.
Pointer data()
Low-level data access to the vector elements.
Definition: DynamicVector.h:689
Header file for the SparseVector base class.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: DynamicVector.h:1090
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:258
void swap(DynamicVector &v)
Swapping the contents of two vectors.
Definition: DynamicVector.h:1285
Iterator begin()
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:719
void clear()
Clearing the vector.
Definition: DynamicVector.h:1129
IT::Type IntrinsicType
Intrinsic type of the vector elements.
Definition: DynamicVector.h:173
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T > >::Type stream(T *address, const typename Stream< T, sizeof(T)>::Type &value)
Aligned, non-temporal store of a vector of integral values.
Definition: Stream.h:220
Header file for the IsSame and IsStrictlySame type traits.
const bool useStreaming
Configuration of the streaming behavior.For large vectors and matrices non-temporal stores can provid...
Definition: Streaming.h:50
const Type * ConstPointer
Pointer to a constant vector value.
Definition: DynamicVector.h:179
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T >, Load< T, sizeof(T)> >::Type::Type load(const T *address)
Loads a vector of integral values.
Definition: Load.h:224
Header file for the DenseVector base class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:116
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:695
Efficient implementation of an arbitrary sized vector.The DynamicVector class template is the represe...
Definition: DynamicVector.h:160
Header file for memory allocation and deallocation functionality.
void store(size_t index, const IntrinsicType &value)
Aligned store of an intrinsic element of the vector.
Definition: DynamicVector.h:1473
EnableIf< IsBuiltin< T >, T * >::Type allocate(size_t size)
Aligned array allocation for built-in data types.
Definition: Memory.h:151
Constraint on the data type.
size_t capacity_
The current capacity of the pointer array.
Definition: CompressedMatrix.h:2638
~DynamicVector()
The destructor for DynamicVector.
Definition: DynamicVector.h:631
ConstIterator cbegin() const
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:747
DynamicVector< ET, TF > Other
The type of the other DynamicVector.
Definition: DynamicVector.h:189
Header file for the DisableIf class template.
This ResultType
Result type for expression template evaluations.
Definition: DynamicVector.h:170
void resize(size_t n, bool preserve=true)
Changing the size of the vector.
Definition: DynamicVector.h:1167
Header file for the multiplication trait.
Header file for the clear shim.
Header file for nested template disabiguation.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:4754
bool isAligned() const
Returns whether the vector is properly aligned in memory.
Definition: DynamicVector.h:1370
void storeu(size_t index, const IntrinsicType &value)
Unaligned store of an intrinsic element of the dense vector.
Definition: DynamicVector.h:1504
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
const Type & ReturnType
Return type for expression template evaluations.
Definition: DynamicVector.h:174
#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:116
Header file for the IsSMPAssignable type trait.
EnableIf< IsBuiltin< T > >::Type deallocate(T *address)
Deallocation of memory for built-in data types.
Definition: Memory.h:226
Header file for the DenseIterator class template.
BLAZE_ALWAYS_INLINE void clear(const NonNumericProxy< MT > &proxy)
Clearing the represented element.
Definition: NonNumericProxy.h:854
Header file for the subvector trait.
Constraint on the data type.
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Compile time check for sparse vector types.This type trait tests whether or not the given template pa...
Definition: IsSparseVector.h:103
void reset()
Reset to the default initial values.
Definition: DynamicVector.h:1111
size_t size() const
Returns the current size/dimension of the vector.
Definition: DynamicVector.h:1059
DenseIterator< Type > Iterator
Iterator over non-constant elements.
Definition: DynamicVector.h:180
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T >, Loadu< T, sizeof(T)> >::Type::Type loadu(const T *address)
Loads a vector of integral values.
Definition: Loadu.h:221
size_t size_
The current size/dimension of the vector.
Definition: DynamicVector.h:403
#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:176
#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:79
const Type & ConstReference
Reference to a constant vector value.
Definition: DynamicVector.h:177
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:195
Compile time check for data types.This type trait tests whether or not the given template parameter i...
Definition: IsSMPAssignable.h:120
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:535
size_t adjustCapacity(size_t minCapacity) const
Adjusting the new capacity of the vector according to its data type Type.
Definition: DynamicVector.h:1302
IntrinsicType load(size_t index) const
Aligned load of an intrinsic element of the vector.
Definition: DynamicVector.h:1412
System settings for streaming (non-temporal stores)
DynamicVector()
The default constructor for DynamicVector.
Definition: DynamicVector.h:439
Header file for the EnableIf class template.
Header file for the serial shim.
Header file for the IsVectorizable type trait.
Header file for the IsNumeric type trait.
size_t capacity_
The maximum capacity of the vector.
Definition: DynamicVector.h:404
bool isAliased(const Other *alias) const
Returns whether the vector is aliased with the given address alias.
Definition: DynamicVector.h:1352
EnableIf< IsDenseMatrix< MT1 > >::Type 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
Header file for the IsSparseVector type trait.
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:749
ConstIterator cend() const
Returns an iterator just past the last element of the dynamic vector.
Definition: DynamicVector.h:789
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type 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
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
IntrinsicTrait< Type > IT
Intrinsic trait for the vector element type.
Definition: DynamicVector.h:164
Constraint on the data type.
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
const DynamicVector & CompositeType
Data type for composite expression templates.
Definition: DynamicVector.h:175
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:79
void extend(size_t n, bool preserve=true)
Extending the size of the vector.
Definition: DynamicVector.h:1215
void move(DynamicMatrix< Type, SO > &dst, DynamicMatrix< Type, SO > &src)
Moving the contents of one dynamic matrix to another.
Definition: DynamicMatrix.h:4769
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:116
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2481
Rebind mechanism to obtain a DynamicVector with different data/element type.
Definition: DynamicVector.h:188
Header file for the isDefault shim.
System settings for the restrict keyword.
Type ElementType
Type of the vector elements.
Definition: DynamicVector.h:172
Type * Pointer
Pointer to a non-constant vector value.
Definition: DynamicVector.h:178
BLAZE_ALWAYS_INLINE bool isDefault(const NonNumericProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: NonNumericProxy.h:874
size_t capacity() const
Returns the maximum capacity of the vector.
Definition: DynamicVector.h:1073
Constraint on the data type.
BLAZE_ALWAYS_INLINE void reset(const NonNumericProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: NonNumericProxy.h:833
void reserve(size_t n)
Setting the minimum capacity of the vector.
Definition: DynamicVector.h:1233
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
void stream(size_t index, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the dense vector.
Definition: DynamicVector.h:1534
Header file for all intrinsic functionality.
Header file for the mathematical trait.
bool canAlias(const Other *alias) const
Returns whether the vector can alias with the given address alias.
Definition: DynamicVector.h:1332
Header file for the default transpose flag for all vectors of the Blaze library.
EnableIf< IsDenseMatrix< MT1 > >::Type 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
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
bool canSMPAssign() const
Returns whether the vector can be used in SMP assignments.
Definition: DynamicVector.h:1389
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T > >::Type storeu(T *address, const typename Storeu< T, sizeof(T)>::Type &value)
Unaligned store of a vector of integral values.
Definition: Storeu.h:218
IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the vector.
Definition: DynamicVector.h:1443
boost::true_type TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Iterator end()
Returns an iterator just past the last element of the dynamic vector.
Definition: DynamicVector.h:761
const size_t SMP_DVECASSIGN_THRESHOLD
SMP dense vector assignment threshold.This threshold specifies when an assignment of a simple dense v...
Definition: Thresholds.h:207
const size_t cacheSize
Cache size of the target architecture.This setting specifies the available cache size in Byte of the ...
Definition: CacheSize.h:48
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T > >::Type store(T *address, const typename Store< T, sizeof(T)>::Type &value)
Aligned store of a vector of integral values.
Definition: Store.h:225
Header file for the IsResizable type trait.
DenseIterator< const Type > ConstIterator
Iterator over constant elements.
Definition: DynamicVector.h:181
EnableIf< IsDenseVector< VT1 > >::Type 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:189
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#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
Reference operator[](size_t index)
Subscript operator for the direct access to the vector elements.
Definition: DynamicVector.h:655
DynamicVector< Type,!TF > TransposeType
Transpose type for expression template evaluations.
Definition: DynamicVector.h:171
Header file for a safe C++ NULL pointer implementation.
DynamicVector< Type, TF > This
Type of this DynamicVector instance.
Definition: DynamicVector.h:169