35 #ifndef _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_
36 #define _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_
155 template<
typename Type
191 enum { smpAssignable = 0 };
200 template<
typename Other >
explicit inline DynamicVector(
size_t n,
const Other* array );
202 template<
typename Other,
size_t N >
206 template<
typename VT >
inline DynamicVector(
const Vector<VT,TF>& v );
222 inline Type*
data ();
223 inline const Type*
data ()
const;
236 template<
typename Other,
size_t N >
241 template<
typename VT >
inline DynamicVector& operator= (
const Vector<VT,TF>& rhs );
242 template<
typename VT >
inline DynamicVector& operator+=(
const Vector<VT,TF>& rhs );
243 template<
typename VT >
inline DynamicVector& operator-=(
const Vector<VT,TF>& rhs );
244 template<
typename VT >
inline DynamicVector& operator*=(
const Vector<VT,TF>& rhs );
246 template<
typename Other >
247 inline typename EnableIf< IsNumeric<Other>,
DynamicVector >::Type&
248 operator*=( Other rhs );
250 template<
typename Other >
251 inline typename EnableIf< IsNumeric<Other>,
DynamicVector >::Type&
252 operator/=( Other rhs );
259 inline size_t size()
const;
264 inline void resize(
size_t n,
bool preserve=
true );
265 inline void extend(
size_t n,
bool preserve=
true );
266 inline void reserve(
size_t n );
267 template<
typename Other >
inline DynamicVector& scale( Other scalar );
275 template<
typename VT >
277 struct VectorizedAssign {
278 enum { value = vectorizable && VT::vectorizable &&
279 IsSame<Type,typename VT::ElementType>::value };
286 template<
typename VT >
288 struct VectorizedAddAssign {
289 enum { value = vectorizable && VT::vectorizable &&
290 IsSame<Type,typename VT::ElementType>::value &&
291 IntrinsicTrait<Type>::addition };
298 template<
typename VT >
300 struct VectorizedSubAssign {
301 enum { value = vectorizable && VT::vectorizable &&
302 IsSame<Type,typename VT::ElementType>::value &&
303 IntrinsicTrait<Type>::subtraction };
310 template<
typename VT >
312 struct VectorizedMultAssign {
313 enum { value = vectorizable && VT::vectorizable &&
314 IsSame<Type,typename VT::ElementType>::value &&
315 IntrinsicTrait<Type>::multiplication };
324 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
325 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
333 template<
typename VT >
334 inline typename DisableIf< VectorizedAssign<VT> >::Type
335 assign(
const DenseVector<VT,TF>& rhs );
337 template<
typename VT >
338 inline typename EnableIf< VectorizedAssign<VT> >::Type
339 assign(
const DenseVector<VT,TF>& rhs );
341 template<
typename VT >
inline void assign(
const SparseVector<VT,TF>& rhs );
343 template<
typename VT >
344 inline typename DisableIf< VectorizedAddAssign<VT> >::Type
345 addAssign(
const DenseVector<VT,TF>& rhs );
347 template<
typename VT >
348 inline typename EnableIf< VectorizedAddAssign<VT> >::Type
349 addAssign(
const DenseVector<VT,TF>& rhs );
351 template<
typename VT >
inline void addAssign(
const SparseVector<VT,TF>& rhs );
353 template<
typename VT >
354 inline typename DisableIf< VectorizedSubAssign<VT> >::Type
355 subAssign(
const DenseVector<VT,TF>& rhs );
357 template<
typename VT >
358 inline typename EnableIf< VectorizedSubAssign<VT> >::Type
359 subAssign(
const DenseVector<VT,TF>& rhs );
361 template<
typename VT >
inline void subAssign(
const SparseVector<VT,TF>& rhs );
363 template<
typename VT >
364 inline typename DisableIf< VectorizedMultAssign<VT> >::Type
365 multAssign(
const DenseVector<VT,TF>& rhs );
367 template<
typename VT >
368 inline typename EnableIf< VectorizedMultAssign<VT> >::Type
369 multAssign(
const DenseVector<VT,TF>& rhs );
371 template<
typename VT >
inline void multAssign(
const SparseVector<VT,TF>& rhs );
420 template<
typename Type
438 template<
typename Type
461 template<
typename Type
468 for(
size_t i=0UL; i<
size_; ++i )
499 template<
typename Type
501 template<
typename Other >
507 for(
size_t i=0UL; i<n; ++i )
535 template<
typename Type
537 template<
typename Other
544 for(
size_t i=0UL; i<N; ++i )
563 template<
typename Type
583 template<
typename Type
585 template<
typename VT >
587 : size_ ( (~v).size() )
616 template<
typename Type
639 template<
typename Type
656 template<
typename Type
674 template<
typename Type
690 template<
typename Type
704 template<
typename Type
718 template<
typename Type
732 template<
typename Type
746 template<
typename Type
760 template<
typename Type
774 template<
typename Type
809 template<
typename Type
811 template<
typename Other
817 for(
size_t i=0UL; i<N; ++i )
831 template<
typename Type
835 for(
size_t i=0UL; i<size_; ++i )
851 template<
typename Type
855 if( &rhs ==
this )
return *
this;
857 resize( rhs.
size_,
false );
859 for(
size_t i=0UL; i<size_; ++i )
875 template<
typename Type
877 template<
typename VT >
882 if( (~rhs).canAlias(
this ) ) {
887 resize( (~rhs).size(),
false );
908 template<
typename Type
910 template<
typename VT >
915 if( (~rhs).size() != size_ )
916 throw std::invalid_argument(
"Vector sizes do not match" );
918 if( (~rhs).canAlias(
this ) ) {
942 template<
typename Type
944 template<
typename VT >
949 if( (~rhs).size() != size_ )
950 throw std::invalid_argument(
"Vector sizes do not match" );
952 if( (~rhs).canAlias(
this ) ) {
976 template<
typename Type
978 template<
typename VT >
983 if( (~rhs).size() != size_ )
984 throw std::invalid_argument(
"Vector sizes do not match" );
991 assign( *
this, *
this * (~rhs) );
1006 template<
typename Type
1008 template<
typename Other >
1014 assign( *
this, (*
this) * rhs );
1029 template<
typename Type
1031 template<
typename Other >
1039 assign( *
this, (*
this) / rhs );
1058 template<
typename Type
1072 template<
typename Type
1089 template<
typename Type
1093 size_t nonzeros( 0 );
1095 for(
size_t i=0UL; i<size_; ++i ) {
1110 template<
typename Type
1115 for(
size_t i=0UL; i<size_; ++i )
1128 template<
typename Type
1132 resize( 0UL,
false );
1164 template<
typename Type
1171 const size_t newCapacity( adjustCapacity( n ) );
1176 std::copy( v_, v_+size_, tmp );
1180 for(
size_t i=size_; i<newCapacity; ++i )
1191 for(
size_t i=n; i<size_; ++i )
1212 template<
typename Type
1216 resize( size_+n, preserve );
1230 template<
typename Type
1237 const size_t newCapacity( adjustCapacity( n ) );
1241 std::copy( v_, v_+size_, tmp );
1244 for(
size_t i=size_; i<newCapacity; ++i )
1263 template<
typename Type
1265 template<
typename Other >
1268 for(
size_t i=0UL; i<size_; ++i )
1282 template<
typename Type
1299 template<
typename Type
1304 return minCapacity + ( IT::size - ( minCapacity % IT::size ) ) % IT::size;
1305 else return minCapacity;
1328 template<
typename Type
1330 template<
typename Other >
1333 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1348 template<
typename Type
1350 template<
typename Other >
1353 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1371 template<
typename Type
1384 return load( v_+index );
1402 template<
typename Type
1414 return loadu( v_+index );
1433 template<
typename Type
1445 store( v_+index, value );
1464 template<
typename Type
1475 storeu( v_+index, value );
1494 template<
typename Type
1506 stream( v_+index, value );
1522 template<
typename Type
1524 template<
typename VT >
1530 const size_t iend( (~rhs).size() &
size_t(-2) );
1531 for(
size_t i=0UL; i<iend; i+=2UL ) {
1532 v_[i ] = (~rhs)[i ];
1533 v_[i+1UL] = (~rhs)[i+1UL];
1535 if( iend < (~rhs).size() )
1536 v_[iend] = (~rhs)[iend];
1552 template<
typename Type
1554 template<
typename VT >
1567 for(
size_t i=0UL; i<size_; i+=IT::size ) {
1573 const size_t iend( size_ &
size_t(-IT::size*4) );
1577 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1578 store( v_+i , it.load() ); it += IT::size;
1579 store( v_+i+IT::size , it.load() ); it += IT::size;
1580 store( v_+i+IT::size*2UL, it.load() ); it += IT::size;
1581 store( v_+i+IT::size*3UL, it.load() ); it += IT::size;
1583 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1584 store( v_+i, it.load() );
1602 template<
typename Type
1604 template<
typename VT >
1609 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1610 v_[element->index()] = element->value();
1626 template<
typename Type
1628 template<
typename VT >
1634 const size_t iend( (~rhs).size() &
size_t(-2) );
1635 for(
size_t i=0UL; i<iend; i+=2UL ) {
1636 v_[i ] += (~rhs)[i ];
1637 v_[i+1UL] += (~rhs)[i+1UL];
1639 if( iend < (~rhs).size() )
1640 v_[iend] += (~rhs)[iend];
1656 template<
typename Type
1658 template<
typename VT >
1669 const size_t iend( size_ &
size_t(-IT::size*4) );
1673 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1674 store( v_+i ,
load(v_+i ) + it.load() ); it += IT::size;
1675 store( v_+i+IT::size ,
load(v_+i+IT::size ) + it.load() ); it += IT::size;
1676 store( v_+i+IT::size*2UL,
load(v_+i+IT::size*2UL) + it.load() ); it += IT::size;
1677 store( v_+i+IT::size*3UL,
load(v_+i+IT::size*3UL) + it.load() ); it += IT::size;
1679 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1697 template<
typename Type
1699 template<
typename VT >
1704 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1705 v_[element->index()] += element->value();
1721 template<
typename Type
1723 template<
typename VT >
1729 const size_t iend( (~rhs).size() &
size_t(-2) );
1730 for(
size_t i=0UL; i<iend; i+=2UL ) {
1731 v_[i ] -= (~rhs)[i ];
1732 v_[i+1UL] -= (~rhs)[i+1UL];
1734 if( iend < (~rhs).size() )
1735 v_[iend] -= (~rhs)[iend];
1751 template<
typename Type
1753 template<
typename VT >
1764 const size_t iend( size_ &
size_t(-IT::size*4) );
1768 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1769 store( v_+i ,
load(v_+i ) - it.load() ); it += IT::size;
1770 store( v_+i+IT::size ,
load(v_+i+IT::size ) - it.load() ); it += IT::size;
1771 store( v_+i+IT::size*2UL,
load(v_+i+IT::size*2UL) - it.load() ); it += IT::size;
1772 store( v_+i+IT::size*3UL,
load(v_+i+IT::size*3UL) - it.load() ); it += IT::size;
1774 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1792 template<
typename Type
1794 template<
typename VT >
1799 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1800 v_[element->index()] -= element->value();
1816 template<
typename Type
1818 template<
typename VT >
1824 const size_t iend( (~rhs).size() &
size_t(-2) );
1825 for(
size_t i=0UL; i<iend; i+=2UL ) {
1826 v_[i ] *= (~rhs)[i ];
1827 v_[i+1UL] *= (~rhs)[i+1UL];
1829 if( iend < (~rhs).size() )
1830 v_[iend] *= (~rhs)[iend];
1846 template<
typename Type
1848 template<
typename VT >
1859 const size_t iend( size_ &
size_t(-IT::size*4) );
1863 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1864 store( v_+i ,
load(v_+i ) * it.load() ); it += IT::size;
1865 store( v_+i+IT::size ,
load(v_+i+IT::size ) * it.load() ); it += IT::size;
1866 store( v_+i+IT::size*2UL,
load(v_+i+IT::size*2UL) * it.load() ); it += IT::size;
1867 store( v_+i+IT::size*3UL,
load(v_+i+IT::size*3UL) * it.load() ); it += IT::size;
1869 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1887 template<
typename Type
1889 template<
typename VT >
1898 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1899 v_[element->index()] = tmp[element->index()] * element->value();
1915 template<
typename Type,
bool TF >
1918 template<
typename Type,
bool TF >
1921 template<
typename Type,
bool TF >
1924 template<
typename Type,
bool TF >
1937 template<
typename Type
1953 template<
typename Type
1981 template<
typename Type
1985 for(
size_t i=0UL; i<v.
size(); ++i )
2001 template<
typename Type
2020 template<
typename T,
bool TF >
2021 struct IsResizable< DynamicVector<T,TF> > :
public TrueType
2027 template<
typename T,
bool TF >
2028 struct IsResizable< const DynamicVector<T,TF> > :
public TrueType
2034 template<
typename T,
bool TF >
2035 struct IsResizable< volatile DynamicVector<T,TF> > :
public TrueType
2041 template<
typename T,
bool TF >
2042 struct IsResizable< const volatile DynamicVector<T,TF> > :
public TrueType
2061 template<
typename T1,
bool TF,
typename T2,
size_t N >
2062 struct AddTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2064 typedef StaticVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2067 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2068 struct AddTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2070 typedef StaticVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2073 template<
typename T1,
bool TF,
typename T2,
size_t N >
2074 struct AddTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2076 typedef HybridVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2079 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2080 struct AddTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2082 typedef HybridVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2085 template<
typename T1,
bool TF,
typename T2 >
2086 struct AddTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2088 typedef DynamicVector< typename AddTrait<T1,T2>::Type, TF > Type;
2104 template<
typename T1,
bool TF,
typename T2,
size_t N >
2105 struct SubTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2107 typedef StaticVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2110 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2111 struct SubTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2113 typedef StaticVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2116 template<
typename T1,
bool TF,
typename T2,
size_t N >
2117 struct SubTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2119 typedef HybridVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2122 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2123 struct SubTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2125 typedef HybridVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2128 template<
typename T1,
bool TF,
typename T2 >
2129 struct SubTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2131 typedef DynamicVector< typename SubTrait<T1,T2>::Type, TF > Type;
2147 template<
typename T1,
bool TF,
typename T2 >
2148 struct MultTrait< DynamicVector<T1,TF>, T2 >
2150 typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2154 template<
typename T1,
typename T2,
bool TF >
2155 struct MultTrait< T1, DynamicVector<T2,TF> >
2157 typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2161 template<
typename T1,
bool TF,
typename T2,
size_t N >
2162 struct MultTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2164 typedef StaticVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2167 template<
typename T1,
typename T2,
size_t N >
2168 struct MultTrait< DynamicVector<T1,false>, StaticVector<T2,N,true> >
2170 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2173 template<
typename T1,
typename T2,
size_t N >
2174 struct MultTrait< DynamicVector<T1,true>, StaticVector<T2,N,false> >
2176 typedef typename MultTrait<T1,T2>::Type Type;
2179 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2180 struct MultTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2182 typedef StaticVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2185 template<
typename T1,
size_t N,
typename T2 >
2186 struct MultTrait< StaticVector<T1,N,false>, DynamicVector<T2,true> >
2188 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2191 template<
typename T1,
size_t N,
typename T2 >
2192 struct MultTrait< StaticVector<T1,N,true>, DynamicVector<T2,false> >
2194 typedef typename MultTrait<T1,T2>::Type Type;
2197 template<
typename T1,
bool TF,
typename T2,
size_t N >
2198 struct MultTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2200 typedef HybridVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2203 template<
typename T1,
typename T2,
size_t N >
2204 struct MultTrait< DynamicVector<T1,false>, HybridVector<T2,N,true> >
2206 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2209 template<
typename T1,
typename T2,
size_t N >
2210 struct MultTrait< DynamicVector<T1,true>, HybridVector<T2,N,false> >
2212 typedef typename MultTrait<T1,T2>::Type Type;
2215 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2216 struct MultTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2218 typedef HybridVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2221 template<
typename T1,
size_t N,
typename T2 >
2222 struct MultTrait< HybridVector<T1,N,false>, DynamicVector<T2,true> >
2224 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2227 template<
typename T1,
size_t N,
typename T2 >
2228 struct MultTrait< HybridVector<T1,N,true>, DynamicVector<T2,false> >
2230 typedef typename MultTrait<T1,T2>::Type Type;
2233 template<
typename T1,
bool TF,
typename T2 >
2234 struct MultTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2236 typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2239 template<
typename T1,
typename T2 >
2240 struct MultTrait< DynamicVector<T1,false>, DynamicVector<T2,true> >
2242 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2245 template<
typename T1,
typename T2 >
2246 struct MultTrait< DynamicVector<T1,true>, DynamicVector<T2,false> >
2248 typedef typename MultTrait<T1,T2>::Type Type;
2264 template<
typename T1,
typename T2 >
2265 struct CrossTrait< DynamicVector<T1,false>, StaticVector<T2,3UL,false> >
2268 typedef typename MultTrait<T1,T2>::Type T;
2271 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2274 template<
typename T1,
typename T2 >
2275 struct CrossTrait< StaticVector<T1,3UL,false>, DynamicVector<T2,false> >
2278 typedef typename MultTrait<T1,T2>::Type T;
2281 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2284 template<
typename T1,
typename T2,
size_t N >
2285 struct CrossTrait< DynamicVector<T1,false>, HybridVector<T2,N,false> >
2288 typedef typename MultTrait<T1,T2>::Type T;
2291 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2294 template<
typename T1,
size_t N,
typename T2 >
2295 struct CrossTrait< HybridVector<T1,N,false>, DynamicVector<T2,false> >
2298 typedef typename MultTrait<T1,T2>::Type T;
2301 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2304 template<
typename T1,
typename T2 >
2305 struct CrossTrait< DynamicVector<T1,false>, DynamicVector<T2,false> >
2308 typedef typename MultTrait<T1,T2>::Type T;
2311 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2327 template<
typename T1,
bool TF,
typename T2 >
2328 struct DivTrait< DynamicVector<T1,TF>, T2 >
2330 typedef DynamicVector< typename DivTrait<T1,T2>::Type, TF > Type;
2347 template<
typename T1,
bool TF,
typename T2 >
2348 struct MathTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2350 typedef DynamicVector< typename MathTrait<T1,T2>::HighType, TF > HighType;
2351 typedef DynamicVector< typename MathTrait<T1,T2>::LowType , TF > LowType;
2367 template<
typename T1,
bool TF >
2368 struct SubvectorTrait< DynamicVector<T1,TF> >
2370 typedef DynamicVector<T1,TF> Type;
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:107
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:388
Constraint on the data type.
void reset(DynamicMatrix< Type, SO > &m)
Resetting the given dense matrix.
Definition: DynamicMatrix.h:4512
#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:1091
void swap(DynamicVector &v)
Swapping the contents of two vectors.
Definition: DynamicVector.h:1284
Iterator begin()
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:706
void deallocate(T *address)
Deallocation of memory.
Definition: Memory.h:113
void clear()
Clearing the vector.
Definition: DynamicVector.h:1130
bool isDefault(const DynamicMatrix< Type, SO > &m)
Returns whether the given dense matrix is in default state.
Definition: DynamicMatrix.h:4555
IT::Type IntrinsicType
Intrinsic type of the vector elements.
Definition: DynamicVector.h:170
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:157
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:1435
void clear(DynamicMatrix< Type, SO > &m)
Clearing the given dense matrix.
Definition: DynamicMatrix.h:4528
Constraint on the data type.
size_t capacity_
The current capacity of the pointer array.
Definition: CompressedMatrix.h:2513
~DynamicVector()
The destructor for DynamicVector.
Definition: DynamicVector.h:618
ConstIterator cbegin() const
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:734
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:167
void resize(size_t n, bool preserve=true)
Changing the size of the vector.
Definition: DynamicVector.h:1166
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:4541
void storeu(size_t index, const IntrinsicType &value)
Unaligned store of an intrinsic element of the dense vector.
Definition: DynamicVector.h:1466
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2379
const Type & ReturnType
Return type for expression template evaluations.
Definition: DynamicVector.h:171
#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.
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:179
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:1112
size_t size() const
Returns the current size/dimension of the vector.
Definition: DynamicVector.h:1060
DenseIterator< Type > Iterator
Iterator over non-constant elements.
Definition: DynamicVector.h:175
size_t size_
The current size/dimension of the vector.
Definition: DynamicVector.h:386
#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:173
#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:174
size_t adjustCapacity(size_t minCapacity) const
Adjusting the new capacity of the vector according to its data type Type.
Definition: DynamicVector.h:1301
IntrinsicType load(size_t index) const
Aligned load of an intrinsic element of the vector.
Definition: DynamicVector.h:1374
System settings for streaming (non-temporal stores)
DynamicVector()
The default constructor for DynamicVector.
Definition: DynamicVector.h:422
Header file for the EnableIf class template.
T * allocate(size_t size)
Aligned array allocation.
Definition: Memory.h:85
Header file for the IsVectorizable type trait.
ColumnIterator< const MT > ConstIterator
Iterator over constant elements.
Definition: DenseColumn.h:1972
Header file for the IsNumeric type trait.
size_t capacity_
The maximum capacity of the vector.
Definition: DynamicVector.h:387
bool isAliased(const Other *alias) const
Returns whether the vector is aliased with the given address alias.
Definition: DynamicVector.h:1351
Header file for the IsSparseVector type trait.
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:648
ConstIterator cend() const
Returns an iterator just past the last element of the dynamic vector.
Definition: DynamicVector.h:776
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:4584
IntrinsicTrait< Type > IT
Intrinsic trait for the vector element type.
Definition: DynamicVector.h:161
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:209
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:172
#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:1214
Header file for the reset shim.
Header file for the cache size of the target architecture.
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:239
#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:2378
Header file for the isDefault shim.
System settings for the restrict keyword.
Type ElementType
Type of the vector elements.
Definition: DynamicVector.h:169
Type * data()
Low-level data access to the vector elements.
Definition: DynamicVector.h:676
size_t capacity() const
Returns the maximum capacity of the vector.
Definition: DynamicVector.h:1074
Constraint on the data type.
void reserve(size_t n)
Setting the minimum capacity of the vector.
Definition: DynamicVector.h:1232
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:1496
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:1331
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:105
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2370
Header file for basic type definitions.
SelectType< useConst, ConstIterator, ColumnIterator< MT > >::Type Iterator
Iterator over non-constant elements.
Definition: DenseColumn.h:1980
IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the vector.
Definition: DynamicVector.h:1405
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:748
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:176
#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:642
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:168
DynamicVector< Type, TF > This
Type of this DynamicVector instance.
Definition: DynamicVector.h:166