35 #ifndef _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_
36 #define _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_
158 template<
typename Type
205 template<
typename Other >
explicit inline DynamicVector(
size_t n,
const Other* array );
207 template<
typename Other,
size_t N >
211 template<
typename VT >
inline DynamicVector(
const Vector<VT,TF>& v );
241 template<
typename Other,
size_t N >
246 template<
typename VT >
inline DynamicVector& operator= (
const Vector<VT,TF>& rhs );
247 template<
typename VT >
inline DynamicVector& operator+=(
const Vector<VT,TF>& rhs );
248 template<
typename VT >
inline DynamicVector& operator-=(
const Vector<VT,TF>& rhs );
249 template<
typename VT >
inline DynamicVector& operator*=(
const Vector<VT,TF>& rhs );
251 template<
typename Other >
252 inline typename EnableIf< IsNumeric<Other>,
DynamicVector >::Type&
253 operator*=( Other rhs );
255 template<
typename Other >
256 inline typename EnableIf< IsNumeric<Other>,
DynamicVector >::Type&
257 operator/=( Other rhs );
264 inline size_t size()
const;
269 inline void resize(
size_t n,
bool preserve=
true );
270 inline void extend(
size_t n,
bool preserve=
true );
271 inline void reserve(
size_t n );
272 template<
typename Other >
inline DynamicVector& scale( Other scalar );
280 template<
typename VT >
282 struct VectorizedAssign {
283 enum { value = vectorizable && VT::vectorizable &&
284 IsSame<Type,typename VT::ElementType>::value };
291 template<
typename VT >
293 struct VectorizedAddAssign {
294 enum { value = vectorizable && VT::vectorizable &&
295 IsSame<Type,typename VT::ElementType>::value &&
296 IntrinsicTrait<Type>::addition };
303 template<
typename VT >
305 struct VectorizedSubAssign {
306 enum { value = vectorizable && VT::vectorizable &&
307 IsSame<Type,typename VT::ElementType>::value &&
308 IntrinsicTrait<Type>::subtraction };
315 template<
typename VT >
317 struct VectorizedMultAssign {
318 enum { value = vectorizable && VT::vectorizable &&
319 IsSame<Type,typename VT::ElementType>::value &&
320 IntrinsicTrait<Type>::multiplication };
329 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
330 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
341 template<
typename VT >
342 inline typename DisableIf< VectorizedAssign<VT> >::Type
343 assign(
const DenseVector<VT,TF>& rhs );
345 template<
typename VT >
346 inline typename EnableIf< VectorizedAssign<VT> >::Type
347 assign(
const DenseVector<VT,TF>& rhs );
349 template<
typename VT >
inline void assign(
const SparseVector<VT,TF>& rhs );
351 template<
typename VT >
352 inline typename DisableIf< VectorizedAddAssign<VT> >::Type
353 addAssign(
const DenseVector<VT,TF>& rhs );
355 template<
typename VT >
356 inline typename EnableIf< VectorizedAddAssign<VT> >::Type
357 addAssign(
const DenseVector<VT,TF>& rhs );
359 template<
typename VT >
inline void addAssign(
const SparseVector<VT,TF>& rhs );
361 template<
typename VT >
362 inline typename DisableIf< VectorizedSubAssign<VT> >::Type
363 subAssign(
const DenseVector<VT,TF>& rhs );
365 template<
typename VT >
366 inline typename EnableIf< VectorizedSubAssign<VT> >::Type
367 subAssign(
const DenseVector<VT,TF>& rhs );
369 template<
typename VT >
inline void subAssign(
const SparseVector<VT,TF>& rhs );
371 template<
typename VT >
372 inline typename DisableIf< VectorizedMultAssign<VT> >::Type
373 multAssign(
const DenseVector<VT,TF>& rhs );
375 template<
typename VT >
376 inline typename EnableIf< VectorizedMultAssign<VT> >::Type
377 multAssign(
const DenseVector<VT,TF>& rhs );
379 template<
typename VT >
inline void multAssign(
const SparseVector<VT,TF>& rhs );
428 template<
typename Type
446 template<
typename Type
469 template<
typename Type
476 for(
size_t i=0UL; i<
size_; ++i )
507 template<
typename Type
509 template<
typename Other >
515 for(
size_t i=0UL; i<n; ++i )
543 template<
typename Type
545 template<
typename Other
552 for(
size_t i=0UL; i<N; ++i )
571 template<
typename Type
591 template<
typename Type
593 template<
typename VT >
595 : size_ ( (~v).size() )
620 template<
typename Type
643 template<
typename Type
660 template<
typename Type
678 template<
typename Type
694 template<
typename Type
708 template<
typename Type
722 template<
typename Type
736 template<
typename Type
750 template<
typename Type
764 template<
typename Type
778 template<
typename Type
813 template<
typename Type
815 template<
typename Other
821 for(
size_t i=0UL; i<N; ++i )
835 template<
typename Type
839 for(
size_t i=0UL; i<size_; ++i )
855 template<
typename Type
859 if( &rhs ==
this )
return *
this;
861 resize( rhs.
size_,
false );
877 template<
typename Type
879 template<
typename VT >
882 if( (~rhs).canAlias(
this ) ) {
887 resize( (~rhs).size(),
false );
908 template<
typename Type
910 template<
typename VT >
913 if( (~rhs).size() != size_ )
914 throw std::invalid_argument(
"Vector sizes do not match" );
916 if( (~rhs).canAlias(
this ) ) {
940 template<
typename Type
942 template<
typename VT >
945 if( (~rhs).size() != size_ )
946 throw std::invalid_argument(
"Vector sizes do not match" );
948 if( (~rhs).canAlias(
this ) ) {
972 template<
typename Type
974 template<
typename VT >
977 if( (~rhs).size() != size_ )
978 throw std::invalid_argument(
"Vector sizes do not match" );
1000 template<
typename Type
1002 template<
typename Other >
1021 template<
typename Type
1023 template<
typename Other >
1048 template<
typename Type
1062 template<
typename Type
1079 template<
typename Type
1083 size_t nonzeros( 0 );
1085 for(
size_t i=0UL; i<size_; ++i ) {
1100 template<
typename Type
1105 for(
size_t i=0UL; i<size_; ++i )
1118 template<
typename Type
1122 resize( 0UL,
false );
1156 template<
typename Type
1163 const size_t newCapacity( adjustCapacity( n ) );
1168 std::copy( v_, v_+size_, tmp );
1172 for(
size_t i=size_; i<newCapacity; ++i )
1183 for(
size_t i=n; i<size_; ++i )
1204 template<
typename Type
1208 resize( size_+n, preserve );
1222 template<
typename Type
1229 const size_t newCapacity( adjustCapacity( n ) );
1233 std::copy( v_, v_+size_, tmp );
1236 for(
size_t i=size_; i<newCapacity; ++i )
1255 template<
typename Type
1257 template<
typename Other >
1260 for(
size_t i=0UL; i<size_; ++i )
1274 template<
typename Type
1291 template<
typename Type
1296 return minCapacity + ( IT::size - ( minCapacity % IT::size ) ) % IT::size;
1297 else return minCapacity;
1320 template<
typename Type
1322 template<
typename Other >
1325 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1340 template<
typename Type
1342 template<
typename Other >
1345 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1359 template<
typename Type
1378 template<
typename Type
1400 template<
typename Type
1413 return load( v_+index );
1431 template<
typename Type
1443 return loadu( v_+index );
1462 template<
typename Type
1474 store( v_+index, value );
1493 template<
typename Type
1504 storeu( v_+index, value );
1523 template<
typename Type
1535 stream( v_+index, value );
1551 template<
typename Type
1553 template<
typename VT >
1559 const size_t iend( (~rhs).size() &
size_t(-2) );
1560 for(
size_t i=0UL; i<iend; i+=2UL ) {
1561 v_[i ] = (~rhs)[i ];
1562 v_[i+1UL] = (~rhs)[i+1UL];
1564 if( iend < (~rhs).size() )
1565 v_[iend] = (~rhs)[iend];
1581 template<
typename Type
1583 template<
typename VT >
1596 for(
size_t i=0UL; i<size_; i+=IT::size ) {
1602 const size_t iend( size_ &
size_t(-IT::size*4) );
1606 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1607 store( v_+i , it.load() ); it += IT::size;
1608 store( v_+i+IT::size , it.load() ); it += IT::size;
1609 store( v_+i+IT::size*2UL, it.load() ); it += IT::size;
1610 store( v_+i+IT::size*3UL, it.load() ); it += IT::size;
1612 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1613 store( v_+i, it.load() );
1631 template<
typename Type
1633 template<
typename VT >
1638 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1639 v_[element->index()] = element->value();
1655 template<
typename Type
1657 template<
typename VT >
1663 const size_t iend( (~rhs).size() &
size_t(-2) );
1664 for(
size_t i=0UL; i<iend; i+=2UL ) {
1665 v_[i ] += (~rhs)[i ];
1666 v_[i+1UL] += (~rhs)[i+1UL];
1668 if( iend < (~rhs).size() )
1669 v_[iend] += (~rhs)[iend];
1685 template<
typename Type
1687 template<
typename VT >
1698 const size_t iend( size_ &
size_t(-IT::size*4) );
1702 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1703 store( v_+i ,
load(v_+i ) + it.load() ); it += IT::size;
1704 store( v_+i+IT::size ,
load(v_+i+IT::size ) + it.load() ); it += IT::size;
1705 store( v_+i+IT::size*2UL,
load(v_+i+IT::size*2UL) + it.load() ); it += IT::size;
1706 store( v_+i+IT::size*3UL,
load(v_+i+IT::size*3UL) + it.load() ); it += IT::size;
1708 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1726 template<
typename Type
1728 template<
typename VT >
1733 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1734 v_[element->index()] += element->value();
1750 template<
typename Type
1752 template<
typename VT >
1758 const size_t iend( (~rhs).size() &
size_t(-2) );
1759 for(
size_t i=0UL; i<iend; i+=2UL ) {
1760 v_[i ] -= (~rhs)[i ];
1761 v_[i+1UL] -= (~rhs)[i+1UL];
1763 if( iend < (~rhs).size() )
1764 v_[iend] -= (~rhs)[iend];
1780 template<
typename Type
1782 template<
typename VT >
1793 const size_t iend( size_ &
size_t(-IT::size*4) );
1797 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1798 store( v_+i ,
load(v_+i ) - it.load() ); it += IT::size;
1799 store( v_+i+IT::size ,
load(v_+i+IT::size ) - it.load() ); it += IT::size;
1800 store( v_+i+IT::size*2UL,
load(v_+i+IT::size*2UL) - it.load() ); it += IT::size;
1801 store( v_+i+IT::size*3UL,
load(v_+i+IT::size*3UL) - it.load() ); it += IT::size;
1803 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1821 template<
typename Type
1823 template<
typename VT >
1828 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1829 v_[element->index()] -= element->value();
1845 template<
typename Type
1847 template<
typename VT >
1853 const size_t iend( (~rhs).size() &
size_t(-2) );
1854 for(
size_t i=0UL; i<iend; i+=2UL ) {
1855 v_[i ] *= (~rhs)[i ];
1856 v_[i+1UL] *= (~rhs)[i+1UL];
1858 if( iend < (~rhs).size() )
1859 v_[iend] *= (~rhs)[iend];
1875 template<
typename Type
1877 template<
typename VT >
1888 const size_t iend( size_ &
size_t(-IT::size*4) );
1892 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1893 store( v_+i ,
load(v_+i ) * it.load() ); it += IT::size;
1894 store( v_+i+IT::size ,
load(v_+i+IT::size ) * it.load() ); it += IT::size;
1895 store( v_+i+IT::size*2UL,
load(v_+i+IT::size*2UL) * it.load() ); it += IT::size;
1896 store( v_+i+IT::size*3UL,
load(v_+i+IT::size*3UL) * it.load() ); it += IT::size;
1898 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1916 template<
typename Type
1918 template<
typename VT >
1927 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1928 v_[element->index()] = tmp[element->index()] * element->value();
1944 template<
typename Type,
bool TF >
1947 template<
typename Type,
bool TF >
1950 template<
typename Type,
bool TF >
1953 template<
typename Type,
bool TF >
1966 template<
typename Type
1982 template<
typename Type
2010 template<
typename Type
2014 for(
size_t i=0UL; i<v.
size(); ++i )
2030 template<
typename Type
2049 template<
typename T,
bool TF >
2050 struct IsResizable< DynamicVector<T,TF> > :
public TrueType
2056 template<
typename T,
bool TF >
2057 struct IsResizable< const DynamicVector<T,TF> > :
public TrueType
2063 template<
typename T,
bool TF >
2064 struct IsResizable< volatile DynamicVector<T,TF> > :
public TrueType
2070 template<
typename T,
bool TF >
2071 struct IsResizable< const volatile DynamicVector<T,TF> > :
public TrueType
2090 template<
typename T1,
bool TF,
typename T2,
size_t N >
2091 struct AddTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2093 typedef StaticVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2096 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2097 struct AddTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2099 typedef StaticVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2102 template<
typename T1,
bool TF,
typename T2,
size_t N >
2103 struct AddTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2105 typedef HybridVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2108 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2109 struct AddTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2111 typedef HybridVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2114 template<
typename T1,
bool TF,
typename T2 >
2115 struct AddTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2117 typedef DynamicVector< typename AddTrait<T1,T2>::Type, TF > Type;
2133 template<
typename T1,
bool TF,
typename T2,
size_t N >
2134 struct SubTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2136 typedef StaticVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2139 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2140 struct SubTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2142 typedef StaticVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2145 template<
typename T1,
bool TF,
typename T2,
size_t N >
2146 struct SubTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2148 typedef HybridVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2151 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2152 struct SubTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2154 typedef HybridVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2157 template<
typename T1,
bool TF,
typename T2 >
2158 struct SubTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2160 typedef DynamicVector< typename SubTrait<T1,T2>::Type, TF > Type;
2176 template<
typename T1,
bool TF,
typename T2 >
2177 struct MultTrait< DynamicVector<T1,TF>, T2 >
2179 typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2183 template<
typename T1,
typename T2,
bool TF >
2184 struct MultTrait< T1, DynamicVector<T2,TF> >
2186 typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2190 template<
typename T1,
bool TF,
typename T2,
size_t N >
2191 struct MultTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2193 typedef StaticVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2196 template<
typename T1,
typename T2,
size_t N >
2197 struct MultTrait< DynamicVector<T1,false>, StaticVector<T2,N,true> >
2199 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2202 template<
typename T1,
typename T2,
size_t N >
2203 struct MultTrait< DynamicVector<T1,true>, StaticVector<T2,N,false> >
2205 typedef typename MultTrait<T1,T2>::Type Type;
2208 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2209 struct MultTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2211 typedef StaticVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2214 template<
typename T1,
size_t N,
typename T2 >
2215 struct MultTrait< StaticVector<T1,N,false>, DynamicVector<T2,true> >
2217 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2220 template<
typename T1,
size_t N,
typename T2 >
2221 struct MultTrait< StaticVector<T1,N,true>, DynamicVector<T2,false> >
2223 typedef typename MultTrait<T1,T2>::Type Type;
2226 template<
typename T1,
bool TF,
typename T2,
size_t N >
2227 struct MultTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2229 typedef HybridVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2232 template<
typename T1,
typename T2,
size_t N >
2233 struct MultTrait< DynamicVector<T1,false>, HybridVector<T2,N,true> >
2235 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2238 template<
typename T1,
typename T2,
size_t N >
2239 struct MultTrait< DynamicVector<T1,true>, HybridVector<T2,N,false> >
2241 typedef typename MultTrait<T1,T2>::Type Type;
2244 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2245 struct MultTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2247 typedef HybridVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2250 template<
typename T1,
size_t N,
typename T2 >
2251 struct MultTrait< HybridVector<T1,N,false>, DynamicVector<T2,true> >
2253 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2256 template<
typename T1,
size_t N,
typename T2 >
2257 struct MultTrait< HybridVector<T1,N,true>, DynamicVector<T2,false> >
2259 typedef typename MultTrait<T1,T2>::Type Type;
2262 template<
typename T1,
bool TF,
typename T2 >
2263 struct MultTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2265 typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2268 template<
typename T1,
typename T2 >
2269 struct MultTrait< DynamicVector<T1,false>, DynamicVector<T2,true> >
2271 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2274 template<
typename T1,
typename T2 >
2275 struct MultTrait< DynamicVector<T1,true>, DynamicVector<T2,false> >
2277 typedef typename MultTrait<T1,T2>::Type Type;
2293 template<
typename T1,
typename T2 >
2294 struct CrossTrait< DynamicVector<T1,false>, StaticVector<T2,3UL,false> >
2297 typedef typename MultTrait<T1,T2>::Type T;
2300 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2303 template<
typename T1,
typename T2 >
2304 struct CrossTrait< StaticVector<T1,3UL,false>, DynamicVector<T2,false> >
2307 typedef typename MultTrait<T1,T2>::Type T;
2310 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2313 template<
typename T1,
typename T2,
size_t N >
2314 struct CrossTrait< DynamicVector<T1,false>, HybridVector<T2,N,false> >
2317 typedef typename MultTrait<T1,T2>::Type T;
2320 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2323 template<
typename T1,
size_t N,
typename T2 >
2324 struct CrossTrait< HybridVector<T1,N,false>, DynamicVector<T2,false> >
2327 typedef typename MultTrait<T1,T2>::Type T;
2330 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2333 template<
typename T1,
typename T2 >
2334 struct CrossTrait< DynamicVector<T1,false>, DynamicVector<T2,false> >
2337 typedef typename MultTrait<T1,T2>::Type T;
2340 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2356 template<
typename T1,
bool TF,
typename T2 >
2357 struct DivTrait< DynamicVector<T1,TF>, T2 >
2359 typedef DynamicVector< typename DivTrait<T1,T2>::Type, TF > Type;
2376 template<
typename T1,
bool TF,
typename T2 >
2377 struct MathTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2379 typedef DynamicVector< typename MathTrait<T1,T2>::HighType, TF > HighType;
2380 typedef DynamicVector< typename MathTrait<T1,T2>::LowType , TF > LowType;
2396 template<
typename T1,
bool TF >
2397 struct SubvectorTrait< DynamicVector<T1,TF> >
2399 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:396
Constraint on the data type.
void reset(DynamicMatrix< Type, SO > &m)
Resetting the given dense matrix.
Definition: DynamicMatrix.h:4599
#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
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:223
EnableIf< IsIntegral< T >, Load< T, sizeof(T)> >::Type::Type load(const T *address)
Loads a vector of integral values.
Definition: Load.h:222
Header file for the subtraction trait.
Pointer data()
Low-level data access to the vector elements.
Definition: DynamicVector.h:680
Header file for the SparseVector base class.
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: DynamicVector.h:1081
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:152
void swap(DynamicVector &v)
Swapping the contents of two vectors.
Definition: DynamicVector.h:1276
Iterator begin()
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:710
void clear()
Clearing the vector.
Definition: DynamicVector.h:1120
bool isDefault(const DynamicMatrix< Type, SO > &m)
Returns whether the given dense matrix is in default state.
Definition: DynamicMatrix.h:4642
IT::Type IntrinsicType
Intrinsic type of the vector elements.
Definition: DynamicVector.h:173
void smpMultAssign(DenseVector< 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:179
EnableIf< IsIntegral< T >, Loadu< T, sizeof(T)> >::Type::Type loadu(const T *address)
Loads a vector of integral values.
Definition: Loadu.h:219
Header file for the IsSame and IsStrictlySame type traits.
const blaze::Null NULL
Global NULL pointer.This instance of the Null class replaces the NULL macro to ensure a type-safe NUL...
Definition: Null.h:300
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
Header file for a safe C++ NULL pointer implementation.
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:690
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:1464
void clear(DynamicMatrix< Type, SO > &m)
Clearing the given dense matrix.
Definition: DynamicMatrix.h:4615
Constraint on the data type.
size_t capacity_
The current capacity of the pointer array.
Definition: CompressedMatrix.h:2557
void deallocate(T *address)
Deallocation of memory.
Definition: Memory.h:115
~DynamicVector()
The destructor for DynamicVector.
Definition: DynamicVector.h:622
ConstIterator cbegin() const
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:738
void smpAddAssign(DenseMatrix< 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:122
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:1158
Header file for the multiplication trait.
Header file for nested template disabiguation.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
Swapping the contents of two sparse matrices.
Definition: CompressedMatrix.h:4605
bool isAligned() const
Returns whether the vector is properly aligned in memory.
Definition: DynamicVector.h:1361
void storeu(size_t index, const IntrinsicType &value)
Unaligned store of an intrinsic element of the dense vector.
Definition: DynamicVector.h:1495
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2412
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.
Header file for the DenseIterator class template.
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:1102
size_t size() const
Returns the current size/dimension of the vector.
Definition: DynamicVector.h:1050
DenseIterator< Type > Iterator
Iterator over non-constant elements.
Definition: DynamicVector.h:180
size_t size_
The current size/dimension of the vector.
Definition: DynamicVector.h:394
#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
Compile time check for data types.This type trait tests whether or not the given template parameter i...
Definition: IsSMPAssignable.h:120
size_t adjustCapacity(size_t minCapacity) const
Adjusting the new capacity of the vector according to its data type Type.
Definition: DynamicVector.h:1293
IntrinsicType load(size_t index) const
Aligned load of an intrinsic element of the vector.
Definition: DynamicVector.h:1403
System settings for streaming (non-temporal stores)
DynamicVector()
The default constructor for DynamicVector.
Definition: DynamicVector.h:430
Header file for the EnableIf class template.
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:216
Header file for the serial shim.
Header file for the IsVectorizable type trait.
void smpAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:92
Header file for the IsNumeric type trait.
size_t capacity_
The maximum capacity of the vector.
Definition: DynamicVector.h:395
bool isAliased(const Other *alias) const
Returns whether the vector is aliased with the given address alias.
Definition: DynamicVector.h:1343
Header file for the IsSparseVector type trait.
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:218
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:748
ConstIterator cend() const
Returns an iterator just past the last element of the dynamic vector.
Definition: DynamicVector.h:780
Header file for run time assertion macros.
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
void swap(DynamicMatrix< Type, SO > &a, DynamicMatrix< Type, SO > &b)
Swapping the contents of two matrices.
Definition: DynamicMatrix.h:4671
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:1206
Header file for the reset shim.
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:2411
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
size_t capacity() const
Returns the maximum capacity of the vector.
Definition: DynamicVector.h:1064
Constraint on the data type.
void reserve(size_t n)
Setting the minimum capacity of the vector.
Definition: DynamicVector.h:1224
T * allocate(size_t size)
Aligned array allocation.
Definition: Memory.h:84
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:1525
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:1323
Header file for the default transpose flag for all vectors of the Blaze library.
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:2403
bool canSMPAssign() const
Returns whether the vector can be used in SMP assignments.
Definition: DynamicVector.h:1380
Header file for basic type definitions.
IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the vector.
Definition: DynamicVector.h:1434
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:752
const size_t SMP_DVECASSIGN_THRESHOLD
SMP dense vector assignment threshold.This threshold specifies when an assignment of a plain dense ve...
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
Header file for the IsResizable type trait.
DenseIterator< const Type > ConstIterator
Iterator over constant elements.
Definition: DynamicVector.h:181
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:646
DynamicVector< Type,!TF > TransposeType
Transpose type for expression template evaluations.
Definition: DynamicVector.h:171
DynamicVector< Type, TF > This
Type of this DynamicVector instance.
Definition: DynamicVector.h:169