35 #ifndef _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_
36 #define _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_
158 template<
typename Type
194 enum { smpAssignable = 1 };
203 template<
typename Other >
explicit inline DynamicVector(
size_t n,
const Other* array );
205 template<
typename Other,
size_t N >
209 template<
typename VT >
inline DynamicVector(
const Vector<VT,TF>& v );
225 inline Type*
data ();
226 inline const Type*
data ()
const;
239 template<
typename Other,
size_t N >
244 template<
typename VT >
inline DynamicVector& operator= (
const Vector<VT,TF>& rhs );
245 template<
typename VT >
inline DynamicVector& operator+=(
const Vector<VT,TF>& rhs );
246 template<
typename VT >
inline DynamicVector& operator-=(
const Vector<VT,TF>& rhs );
247 template<
typename VT >
inline DynamicVector& operator*=(
const Vector<VT,TF>& rhs );
249 template<
typename Other >
250 inline typename EnableIf< IsNumeric<Other>,
DynamicVector >::Type&
251 operator*=( Other rhs );
253 template<
typename Other >
254 inline typename EnableIf< IsNumeric<Other>,
DynamicVector >::Type&
255 operator/=( Other rhs );
262 inline size_t size()
const;
267 inline void resize(
size_t n,
bool preserve=
true );
268 inline void extend(
size_t n,
bool preserve=
true );
269 inline void reserve(
size_t n );
270 template<
typename Other >
inline DynamicVector& scale( Other scalar );
278 template<
typename VT >
280 struct VectorizedAssign {
281 enum { value = vectorizable && VT::vectorizable &&
282 IsSame<Type,typename VT::ElementType>::value };
289 template<
typename VT >
291 struct VectorizedAddAssign {
292 enum { value = vectorizable && VT::vectorizable &&
293 IsSame<Type,typename VT::ElementType>::value &&
294 IntrinsicTrait<Type>::addition };
301 template<
typename VT >
303 struct VectorizedSubAssign {
304 enum { value = vectorizable && VT::vectorizable &&
305 IsSame<Type,typename VT::ElementType>::value &&
306 IntrinsicTrait<Type>::subtraction };
313 template<
typename VT >
315 struct VectorizedMultAssign {
316 enum { value = vectorizable && VT::vectorizable &&
317 IsSame<Type,typename VT::ElementType>::value &&
318 IntrinsicTrait<Type>::multiplication };
327 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
328 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
339 template<
typename VT >
340 inline typename DisableIf< VectorizedAssign<VT> >::Type
341 assign(
const DenseVector<VT,TF>& rhs );
343 template<
typename VT >
344 inline typename EnableIf< VectorizedAssign<VT> >::Type
345 assign(
const DenseVector<VT,TF>& rhs );
347 template<
typename VT >
inline void assign(
const SparseVector<VT,TF>& rhs );
349 template<
typename VT >
350 inline typename DisableIf< VectorizedAddAssign<VT> >::Type
351 addAssign(
const DenseVector<VT,TF>& rhs );
353 template<
typename VT >
354 inline typename EnableIf< VectorizedAddAssign<VT> >::Type
355 addAssign(
const DenseVector<VT,TF>& rhs );
357 template<
typename VT >
inline void addAssign(
const SparseVector<VT,TF>& rhs );
359 template<
typename VT >
360 inline typename DisableIf< VectorizedSubAssign<VT> >::Type
361 subAssign(
const DenseVector<VT,TF>& rhs );
363 template<
typename VT >
364 inline typename EnableIf< VectorizedSubAssign<VT> >::Type
365 subAssign(
const DenseVector<VT,TF>& rhs );
367 template<
typename VT >
inline void subAssign(
const SparseVector<VT,TF>& rhs );
369 template<
typename VT >
370 inline typename DisableIf< VectorizedMultAssign<VT> >::Type
371 multAssign(
const DenseVector<VT,TF>& rhs );
373 template<
typename VT >
374 inline typename EnableIf< VectorizedMultAssign<VT> >::Type
375 multAssign(
const DenseVector<VT,TF>& rhs );
377 template<
typename VT >
inline void multAssign(
const SparseVector<VT,TF>& rhs );
426 template<
typename Type
444 template<
typename Type
467 template<
typename Type
474 for(
size_t i=0UL; i<
size_; ++i )
505 template<
typename Type
507 template<
typename Other >
513 for(
size_t i=0UL; i<n; ++i )
541 template<
typename Type
543 template<
typename Other
550 for(
size_t i=0UL; i<N; ++i )
569 template<
typename Type
589 template<
typename Type
591 template<
typename VT >
593 : 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 );
1154 template<
typename Type
1161 const size_t newCapacity( adjustCapacity( n ) );
1166 std::copy( v_, v_+size_, tmp );
1170 for(
size_t i=size_; i<newCapacity; ++i )
1181 for(
size_t i=n; i<size_; ++i )
1202 template<
typename Type
1206 resize( size_+n, preserve );
1220 template<
typename Type
1227 const size_t newCapacity( adjustCapacity( n ) );
1231 std::copy( v_, v_+size_, tmp );
1234 for(
size_t i=size_; i<newCapacity; ++i )
1253 template<
typename Type
1255 template<
typename Other >
1258 for(
size_t i=0UL; i<size_; ++i )
1272 template<
typename Type
1289 template<
typename Type
1294 return minCapacity + ( IT::size - ( minCapacity % IT::size ) ) % IT::size;
1295 else return minCapacity;
1318 template<
typename Type
1320 template<
typename Other >
1323 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1338 template<
typename Type
1340 template<
typename Other >
1343 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1357 template<
typename Type
1376 template<
typename Type
1398 template<
typename Type
1411 return load( v_+index );
1429 template<
typename Type
1441 return loadu( v_+index );
1460 template<
typename Type
1472 store( v_+index, value );
1491 template<
typename Type
1502 storeu( v_+index, value );
1521 template<
typename Type
1533 stream( v_+index, value );
1549 template<
typename Type
1551 template<
typename VT >
1557 const size_t iend( (~rhs).size() &
size_t(-2) );
1558 for(
size_t i=0UL; i<iend; i+=2UL ) {
1559 v_[i ] = (~rhs)[i ];
1560 v_[i+1UL] = (~rhs)[i+1UL];
1562 if( iend < (~rhs).size() )
1563 v_[iend] = (~rhs)[iend];
1579 template<
typename Type
1581 template<
typename VT >
1594 for(
size_t i=0UL; i<size_; i+=IT::size ) {
1600 const size_t iend( size_ &
size_t(-IT::size*4) );
1604 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1605 store( v_+i , it.load() ); it += IT::size;
1606 store( v_+i+IT::size , it.load() ); it += IT::size;
1607 store( v_+i+IT::size*2UL, it.load() ); it += IT::size;
1608 store( v_+i+IT::size*3UL, it.load() ); it += IT::size;
1610 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1611 store( v_+i, it.load() );
1629 template<
typename Type
1631 template<
typename VT >
1636 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1637 v_[element->index()] = element->value();
1653 template<
typename Type
1655 template<
typename VT >
1661 const size_t iend( (~rhs).size() &
size_t(-2) );
1662 for(
size_t i=0UL; i<iend; i+=2UL ) {
1663 v_[i ] += (~rhs)[i ];
1664 v_[i+1UL] += (~rhs)[i+1UL];
1666 if( iend < (~rhs).size() )
1667 v_[iend] += (~rhs)[iend];
1683 template<
typename Type
1685 template<
typename VT >
1696 const size_t iend( size_ &
size_t(-IT::size*4) );
1700 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1701 store( v_+i ,
load(v_+i ) + it.load() ); it += IT::size;
1702 store( v_+i+IT::size ,
load(v_+i+IT::size ) + it.load() ); it += IT::size;
1703 store( v_+i+IT::size*2UL,
load(v_+i+IT::size*2UL) + it.load() ); it += IT::size;
1704 store( v_+i+IT::size*3UL,
load(v_+i+IT::size*3UL) + it.load() ); it += IT::size;
1706 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1724 template<
typename Type
1726 template<
typename VT >
1731 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1732 v_[element->index()] += element->value();
1748 template<
typename Type
1750 template<
typename VT >
1756 const size_t iend( (~rhs).size() &
size_t(-2) );
1757 for(
size_t i=0UL; i<iend; i+=2UL ) {
1758 v_[i ] -= (~rhs)[i ];
1759 v_[i+1UL] -= (~rhs)[i+1UL];
1761 if( iend < (~rhs).size() )
1762 v_[iend] -= (~rhs)[iend];
1778 template<
typename Type
1780 template<
typename VT >
1791 const size_t iend( size_ &
size_t(-IT::size*4) );
1795 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1796 store( v_+i ,
load(v_+i ) - it.load() ); it += IT::size;
1797 store( v_+i+IT::size ,
load(v_+i+IT::size ) - it.load() ); it += IT::size;
1798 store( v_+i+IT::size*2UL,
load(v_+i+IT::size*2UL) - it.load() ); it += IT::size;
1799 store( v_+i+IT::size*3UL,
load(v_+i+IT::size*3UL) - it.load() ); it += IT::size;
1801 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1819 template<
typename Type
1821 template<
typename VT >
1826 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1827 v_[element->index()] -= element->value();
1843 template<
typename Type
1845 template<
typename VT >
1851 const size_t iend( (~rhs).size() &
size_t(-2) );
1852 for(
size_t i=0UL; i<iend; i+=2UL ) {
1853 v_[i ] *= (~rhs)[i ];
1854 v_[i+1UL] *= (~rhs)[i+1UL];
1856 if( iend < (~rhs).size() )
1857 v_[iend] *= (~rhs)[iend];
1873 template<
typename Type
1875 template<
typename VT >
1886 const size_t iend( size_ &
size_t(-IT::size*4) );
1890 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1891 store( v_+i ,
load(v_+i ) * it.load() ); it += IT::size;
1892 store( v_+i+IT::size ,
load(v_+i+IT::size ) * it.load() ); it += IT::size;
1893 store( v_+i+IT::size*2UL,
load(v_+i+IT::size*2UL) * it.load() ); it += IT::size;
1894 store( v_+i+IT::size*3UL,
load(v_+i+IT::size*3UL) * it.load() ); it += IT::size;
1896 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1914 template<
typename Type
1916 template<
typename VT >
1925 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1926 v_[element->index()] = tmp[element->index()] * element->value();
1942 template<
typename Type,
bool TF >
1945 template<
typename Type,
bool TF >
1948 template<
typename Type,
bool TF >
1951 template<
typename Type,
bool TF >
1964 template<
typename Type
1980 template<
typename Type
2008 template<
typename Type
2012 for(
size_t i=0UL; i<v.
size(); ++i )
2028 template<
typename Type
2047 template<
typename T,
bool TF >
2048 struct IsResizable< DynamicVector<T,TF> > :
public TrueType
2054 template<
typename T,
bool TF >
2055 struct IsResizable< const DynamicVector<T,TF> > :
public TrueType
2061 template<
typename T,
bool TF >
2062 struct IsResizable< volatile DynamicVector<T,TF> > :
public TrueType
2068 template<
typename T,
bool TF >
2069 struct IsResizable< const volatile DynamicVector<T,TF> > :
public TrueType
2088 template<
typename T1,
bool TF,
typename T2,
size_t N >
2089 struct AddTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2091 typedef StaticVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2094 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2095 struct AddTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2097 typedef StaticVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2100 template<
typename T1,
bool TF,
typename T2,
size_t N >
2101 struct AddTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2103 typedef HybridVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2106 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2107 struct AddTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2109 typedef HybridVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2112 template<
typename T1,
bool TF,
typename T2 >
2113 struct AddTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2115 typedef DynamicVector< typename AddTrait<T1,T2>::Type, TF > Type;
2131 template<
typename T1,
bool TF,
typename T2,
size_t N >
2132 struct SubTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2134 typedef StaticVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2137 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2138 struct SubTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2140 typedef StaticVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2143 template<
typename T1,
bool TF,
typename T2,
size_t N >
2144 struct SubTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2146 typedef HybridVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2149 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2150 struct SubTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2152 typedef HybridVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2155 template<
typename T1,
bool TF,
typename T2 >
2156 struct SubTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2158 typedef DynamicVector< typename SubTrait<T1,T2>::Type, TF > Type;
2174 template<
typename T1,
bool TF,
typename T2 >
2175 struct MultTrait< DynamicVector<T1,TF>, T2 >
2177 typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2181 template<
typename T1,
typename T2,
bool TF >
2182 struct MultTrait< T1, DynamicVector<T2,TF> >
2184 typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2188 template<
typename T1,
bool TF,
typename T2,
size_t N >
2189 struct MultTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2191 typedef StaticVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2194 template<
typename T1,
typename T2,
size_t N >
2195 struct MultTrait< DynamicVector<T1,false>, StaticVector<T2,N,true> >
2197 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2200 template<
typename T1,
typename T2,
size_t N >
2201 struct MultTrait< DynamicVector<T1,true>, StaticVector<T2,N,false> >
2203 typedef typename MultTrait<T1,T2>::Type Type;
2206 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2207 struct MultTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2209 typedef StaticVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2212 template<
typename T1,
size_t N,
typename T2 >
2213 struct MultTrait< StaticVector<T1,N,false>, DynamicVector<T2,true> >
2215 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2218 template<
typename T1,
size_t N,
typename T2 >
2219 struct MultTrait< StaticVector<T1,N,true>, DynamicVector<T2,false> >
2221 typedef typename MultTrait<T1,T2>::Type Type;
2224 template<
typename T1,
bool TF,
typename T2,
size_t N >
2225 struct MultTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2227 typedef HybridVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2230 template<
typename T1,
typename T2,
size_t N >
2231 struct MultTrait< DynamicVector<T1,false>, HybridVector<T2,N,true> >
2233 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2236 template<
typename T1,
typename T2,
size_t N >
2237 struct MultTrait< DynamicVector<T1,true>, HybridVector<T2,N,false> >
2239 typedef typename MultTrait<T1,T2>::Type Type;
2242 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2243 struct MultTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2245 typedef HybridVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2248 template<
typename T1,
size_t N,
typename T2 >
2249 struct MultTrait< HybridVector<T1,N,false>, DynamicVector<T2,true> >
2251 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2254 template<
typename T1,
size_t N,
typename T2 >
2255 struct MultTrait< HybridVector<T1,N,true>, DynamicVector<T2,false> >
2257 typedef typename MultTrait<T1,T2>::Type Type;
2260 template<
typename T1,
bool TF,
typename T2 >
2261 struct MultTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2263 typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2266 template<
typename T1,
typename T2 >
2267 struct MultTrait< DynamicVector<T1,false>, DynamicVector<T2,true> >
2269 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2272 template<
typename T1,
typename T2 >
2273 struct MultTrait< DynamicVector<T1,true>, DynamicVector<T2,false> >
2275 typedef typename MultTrait<T1,T2>::Type Type;
2291 template<
typename T1,
typename T2 >
2292 struct CrossTrait< DynamicVector<T1,false>, StaticVector<T2,3UL,false> >
2295 typedef typename MultTrait<T1,T2>::Type T;
2298 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2301 template<
typename T1,
typename T2 >
2302 struct CrossTrait< StaticVector<T1,3UL,false>, DynamicVector<T2,false> >
2305 typedef typename MultTrait<T1,T2>::Type T;
2308 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2311 template<
typename T1,
typename T2,
size_t N >
2312 struct CrossTrait< DynamicVector<T1,false>, HybridVector<T2,N,false> >
2315 typedef typename MultTrait<T1,T2>::Type T;
2318 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2321 template<
typename T1,
size_t N,
typename T2 >
2322 struct CrossTrait< HybridVector<T1,N,false>, DynamicVector<T2,false> >
2325 typedef typename MultTrait<T1,T2>::Type T;
2328 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2331 template<
typename T1,
typename T2 >
2332 struct CrossTrait< DynamicVector<T1,false>, DynamicVector<T2,false> >
2335 typedef typename MultTrait<T1,T2>::Type T;
2338 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2354 template<
typename T1,
bool TF,
typename T2 >
2355 struct DivTrait< DynamicVector<T1,TF>, T2 >
2357 typedef DynamicVector< typename DivTrait<T1,T2>::Type, TF > Type;
2374 template<
typename T1,
bool TF,
typename T2 >
2375 struct MathTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2377 typedef DynamicVector< typename MathTrait<T1,T2>::HighType, TF > HighType;
2378 typedef DynamicVector< typename MathTrait<T1,T2>::LowType , TF > LowType;
2394 template<
typename T1,
bool TF >
2395 struct SubvectorTrait< DynamicVector<T1,TF> >
2397 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
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:98
Type *BLAZE_RESTRICT v_
The dynamically allocated vector elements.
Definition: DynamicVector.h:394
Constraint on the data type.
const size_t OPENMP_DVECASSIGN_THRESHOLD
OpenMP dense vector assignment threshold.This threshold specifies when an assignment of a plain dense...
Definition: Thresholds.h:200
void reset(DynamicMatrix< Type, SO > &m)
Resetting the given dense matrix.
Definition: DynamicMatrix.h:4579
#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 >, 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.
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:151
void swap(DynamicVector &v)
Swapping the contents of two vectors.
Definition: DynamicVector.h:1274
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:4622
IT::Type IntrinsicType
Intrinsic type of the vector elements.
Definition: DynamicVector.h:173
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
void storeu(float *address, const sse_float_t &value)
Unaligned store of a vector of 'float' values.
Definition: Storeu.h:234
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
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:1462
void clear(DynamicMatrix< Type, SO > &m)
Clearing the given dense matrix.
Definition: DynamicMatrix.h:4595
Constraint on the data type.
size_t capacity_
The current capacity of the pointer array.
Definition: CompressedMatrix.h:2530
void deallocate(T *address)
Deallocation of memory.
Definition: Memory.h:114
~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:121
void stream(float *address, const sse_float_t &value)
Aligned, non-temporal store of a vector of 'float' values.
Definition: Stream.h:233
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:1156
Header file for the multiplication trait.
Header file for the dense vector SMP implementation.
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:4558
bool isAligned() const
Returns whether the vector is properly aligned in memory.
Definition: DynamicVector.h:1359
void storeu(size_t index, const IntrinsicType &value)
Unaligned store of an intrinsic element of the dense vector.
Definition: DynamicVector.h:1493
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2388
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 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:178
size_t size_
The current size/dimension of the vector.
Definition: DynamicVector.h:392
#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
size_t adjustCapacity(size_t minCapacity) const
Adjusting the new capacity of the vector according to its data type Type.
Definition: DynamicVector.h:1291
IntrinsicType load(size_t index) const
Aligned load of an intrinsic element of the vector.
Definition: DynamicVector.h:1401
System settings for streaming (non-temporal stores)
DynamicVector()
The default constructor for DynamicVector.
Definition: DynamicVector.h:428
Header file for the EnableIf class template.
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:91
Header file for the IsNumeric type trait.
size_t capacity_
The maximum capacity of the vector.
Definition: DynamicVector.h:393
bool isAliased(const Other *alias) const
Returns whether the vector is aliased with the given address alias.
Definition: DynamicVector.h:1341
Header file for the IsSparseVector type trait.
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:4651
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:1204
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:2387
Header file for the isDefault shim.
System settings for the restrict keyword.
Type ElementType
Type of the vector elements.
Definition: DynamicVector.h:172
Type * data()
Low-level data access to the vector elements.
Definition: DynamicVector.h:680
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:1222
T * allocate(size_t size)
Aligned array allocation.
Definition: Memory.h:83
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:1523
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:1321
Header file for the default transpose flag for all vectors of the Blaze library.
Header file for the sparse vector SMP implementation.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:105
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2379
bool canSMPAssign() const
Returns whether the vector can be used in SMP assignments.
Definition: DynamicVector.h:1378
Header file for basic type definitions.
IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the vector.
Definition: DynamicVector.h:1432
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 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:179
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
void store(float *address, const sse_float_t &value)
Aligned store of a vector of 'float' values.
Definition: Store.h:242
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