35 #ifndef _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_
36 #define _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_
166 template<
typename Type
197 template<
typename ET >
224 template<
typename Other >
explicit inline DynamicVector(
size_t n,
const Other* array );
226 template<
typename Other,
size_t N >
230 template<
typename VT >
inline DynamicVector(
const Vector<VT,TF>& v );
245 inline ConstReference
operator[](
size_t index )
const;
246 inline Reference
at(
size_t index );
247 inline ConstReference
at(
size_t index )
const;
248 inline Pointer
data ();
249 inline ConstPointer
data ()
const;
250 inline Iterator
begin ();
251 inline ConstIterator
begin ()
const;
252 inline ConstIterator
cbegin()
const;
253 inline Iterator
end ();
254 inline ConstIterator
end ()
const;
255 inline ConstIterator
cend ()
const;
262 template<
typename Other,
size_t N >
267 template<
typename VT >
inline DynamicVector& operator= (
const Vector<VT,TF>& rhs );
268 template<
typename VT >
inline DynamicVector& operator+=(
const Vector<VT,TF>& rhs );
269 template<
typename VT >
inline DynamicVector& operator-=(
const Vector<VT,TF>& rhs );
270 template<
typename VT >
inline DynamicVector& operator*=(
const Vector<VT,TF>& rhs );
272 template<
typename Other >
273 inline typename EnableIf< IsNumeric<Other>,
DynamicVector >::Type&
274 operator*=( Other rhs );
276 template<
typename Other >
277 inline typename EnableIf< IsNumeric<Other>,
DynamicVector >::Type&
278 operator/=( Other rhs );
285 inline size_t size()
const;
290 inline void resize(
size_t n,
bool preserve=
true );
291 inline void extend(
size_t n,
bool preserve=
true );
292 inline void reserve(
size_t n );
293 template<
typename Other >
inline DynamicVector& scale(
const Other& scalar );
301 template<
typename VT >
303 struct VectorizedAssign {
305 vectorizable && VT::vectorizable &&
306 IsSame<Type,typename VT::ElementType>::value };
313 template<
typename VT >
315 struct VectorizedAddAssign {
317 vectorizable && VT::vectorizable &&
318 IsSame<Type,typename VT::ElementType>::value &&
319 IntrinsicTrait<Type>::addition };
326 template<
typename VT >
328 struct VectorizedSubAssign {
330 vectorizable && VT::vectorizable &&
331 IsSame<Type,typename VT::ElementType>::value &&
332 IntrinsicTrait<Type>::subtraction };
339 template<
typename VT >
341 struct VectorizedMultAssign {
343 vectorizable && VT::vectorizable &&
344 IsSame<Type,typename VT::ElementType>::value &&
345 IntrinsicTrait<Type>::multiplication };
354 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
355 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
369 template<
typename VT >
370 inline typename DisableIf< VectorizedAssign<VT> >::Type
371 assign(
const DenseVector<VT,TF>& rhs );
373 template<
typename VT >
374 inline typename EnableIf< VectorizedAssign<VT> >::Type
375 assign(
const DenseVector<VT,TF>& rhs );
377 template<
typename VT >
inline void assign(
const SparseVector<VT,TF>& rhs );
379 template<
typename VT >
380 inline typename DisableIf< VectorizedAddAssign<VT> >::Type
381 addAssign(
const DenseVector<VT,TF>& rhs );
383 template<
typename VT >
384 inline typename EnableIf< VectorizedAddAssign<VT> >::Type
385 addAssign(
const DenseVector<VT,TF>& rhs );
387 template<
typename VT >
inline void addAssign(
const SparseVector<VT,TF>& rhs );
389 template<
typename VT >
390 inline typename DisableIf< VectorizedSubAssign<VT> >::Type
391 subAssign(
const DenseVector<VT,TF>& rhs );
393 template<
typename VT >
394 inline typename EnableIf< VectorizedSubAssign<VT> >::Type
395 subAssign(
const DenseVector<VT,TF>& rhs );
397 template<
typename VT >
inline void subAssign(
const SparseVector<VT,TF>& rhs );
399 template<
typename VT >
400 inline typename DisableIf< VectorizedMultAssign<VT> >::Type
401 multAssign(
const DenseVector<VT,TF>& rhs );
403 template<
typename VT >
404 inline typename EnableIf< VectorizedMultAssign<VT> >::Type
405 multAssign(
const DenseVector<VT,TF>& rhs );
407 template<
typename VT >
inline void multAssign(
const SparseVector<VT,TF>& rhs );
456 template<
typename Type
474 template<
typename Type
497 template<
typename Type
504 for(
size_t i=0UL; i<
size_; ++i )
535 template<
typename Type
537 template<
typename Other >
543 for(
size_t i=0UL; i<n; ++i )
571 template<
typename Type
573 template<
typename Other
580 for(
size_t i=0UL; i<N; ++i )
599 template<
typename Type
619 template<
typename Type
621 template<
typename VT >
623 : size_ ( (~v).
size() )
648 template<
typename Type
674 template<
typename Type
694 template<
typename Type
715 template<
typename Type
720 if( index >= size_ ) {
723 return (*
this)[index];
738 template<
typename Type
743 if( index >= size_ ) {
746 return (*
this)[index];
758 template<
typename Type
774 template<
typename Type
788 template<
typename Type
802 template<
typename Type
816 template<
typename Type
830 template<
typename Type
844 template<
typename Type
858 template<
typename Type
893 template<
typename Type
895 template<
typename Other
901 for(
size_t i=0UL; i<N; ++i )
915 template<
typename Type
919 for(
size_t i=0UL; i<size_; ++i )
935 template<
typename Type
939 if( &rhs ==
this )
return *
this;
957 template<
typename Type
959 template<
typename VT >
962 if( (~rhs).canAlias(
this ) ) {
988 template<
typename Type
990 template<
typename VT >
993 if( (~rhs).
size() != size_ ) {
997 if( (~rhs).canAlias(
this ) ) {
1021 template<
typename Type
1023 template<
typename VT >
1026 if( (~rhs).
size() != size_ ) {
1030 if( (~rhs).canAlias(
this ) ) {
1054 template<
typename Type
1056 template<
typename VT >
1059 if( (~rhs).
size() != size_ ) {
1083 template<
typename Type
1085 template<
typename Other >
1104 template<
typename Type
1106 template<
typename Other >
1131 template<
typename Type
1145 template<
typename Type
1162 template<
typename Type
1166 size_t nonzeros( 0 );
1168 for(
size_t i=0UL; i<size_; ++i ) {
1183 template<
typename Type
1188 for(
size_t i=0UL; i<size_; ++i )
1201 template<
typename Type
1239 template<
typename Type
1246 const size_t newCapacity( adjustCapacity( n ) );
1251 std::copy( v_, v_+size_, tmp );
1255 for(
size_t i=size_; i<newCapacity; ++i )
1266 for(
size_t i=n; i<size_; ++i )
1287 template<
typename Type
1291 resize( size_+n, preserve );
1305 template<
typename Type
1312 const size_t newCapacity( adjustCapacity( n ) );
1316 std::copy( v_, v_+size_, tmp );
1319 for(
size_t i=size_; i<newCapacity; ++i )
1338 template<
typename Type
1340 template<
typename Other >
1343 for(
size_t i=0UL; i<size_; ++i )
1357 template<
typename Type
1374 template<
typename Type
1379 return nextMultiple<size_t>( minCapacity,
IT::size );
1380 else return minCapacity;
1403 template<
typename Type
1405 template<
typename Other >
1408 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1423 template<
typename Type
1425 template<
typename Other >
1428 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1442 template<
typename Type
1461 template<
typename Type
1465 return (
size() > SMP_DVECASSIGN_THRESHOLD );
1483 template<
typename Type
1488 return loada( index );
1506 template<
typename Type
1520 return loada( v_+index );
1538 template<
typename Type
1550 return loadu( v_+index );
1569 template<
typename Type
1592 template<
typename Type
1605 storea( v_+index, value );
1624 template<
typename Type
1635 storeu( v_+index, value );
1654 template<
typename Type
1667 stream( v_+index, value );
1683 template<
typename Type
1685 template<
typename VT >
1691 const size_t ipos( size_ &
size_t(-2) );
1694 for(
size_t i=0UL; i<ipos; i+=2UL ) {
1695 v_[i ] = (~rhs)[i ];
1696 v_[i+1UL] = (~rhs)[i+1UL];
1698 if( ipos < (~rhs).size() )
1699 v_[ipos] = (~rhs)[ipos];
1715 template<
typename Type
1717 template<
typename VT >
1727 const size_t ipos( ( remainder )?( size_ &
size_t(-
IT::size) ):( size_ ) );
1735 stream( i, (~rhs).load(i) );
1737 for( ; remainder && i<size_; ++i ) {
1747 store( i , it.load() ); it +=
IT::size;
1753 store( i, it.load() );
1755 for( ; remainder && i<size_; ++i, ++it ) {
1774 template<
typename Type
1776 template<
typename VT >
1782 v_[element->index()] = element->value();
1798 template<
typename Type
1800 template<
typename VT >
1806 const size_t ipos( size_ &
size_t(-2) );
1809 for(
size_t i=0UL; i<ipos; i+=2UL ) {
1810 v_[i ] += (~rhs)[i ];
1811 v_[i+1UL] += (~rhs)[i+1UL];
1813 if( ipos < (~rhs).size() )
1814 v_[ipos] += (~rhs)[ipos];
1830 template<
typename Type
1832 template<
typename VT >
1842 const size_t ipos( ( remainder )?( size_ &
size_t(-
IT::size) ):( size_ ) );
1849 store( i , load(i ) + it.load() ); it +=
IT::size;
1855 store( i, load(i) + it.load() );
1857 for( ; remainder && i<size_; ++i, ++it ) {
1875 template<
typename Type
1877 template<
typename VT >
1883 v_[element->index()] += element->value();
1899 template<
typename Type
1901 template<
typename VT >
1907 const size_t ipos( size_ &
size_t(-2) );
1910 for(
size_t i=0UL; i<ipos; i+=2UL ) {
1911 v_[i ] -= (~rhs)[i ];
1912 v_[i+1UL] -= (~rhs)[i+1UL];
1914 if( ipos < (~rhs).size() )
1915 v_[ipos] -= (~rhs)[ipos];
1931 template<
typename Type
1933 template<
typename VT >
1943 const size_t ipos( ( remainder )?( size_ &
size_t(-
IT::size) ):( size_ ) );
1950 store( i , load(i ) - it.load() ); it +=
IT::size;
1956 store( i, load(i) - it.load() );
1958 for( ; remainder && i<size_; ++i, ++it ) {
1976 template<
typename Type
1978 template<
typename VT >
1984 v_[element->index()] -= element->value();
2000 template<
typename Type
2002 template<
typename VT >
2008 const size_t ipos( size_ &
size_t(-2) );
2011 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2012 v_[i ] *= (~rhs)[i ];
2013 v_[i+1UL] *= (~rhs)[i+1UL];
2015 if( ipos < (~rhs).size() )
2016 v_[ipos] *= (~rhs)[ipos];
2032 template<
typename Type
2034 template<
typename VT >
2044 const size_t ipos( ( remainder )?( size_ &
size_t(-
IT::size) ):( size_ ) );
2051 store( i , load(i ) * it.load() ); it +=
IT::size;
2057 store( i, load(i) * it.load() );
2059 for( ; remainder && i<size_; ++i, ++it ) {
2077 template<
typename Type
2079 template<
typename VT >
2089 v_[element->index()] = tmp[element->index()] * element->value();
2105 template<
typename Type,
bool TF >
2108 template<
typename Type,
bool TF >
2111 template<
typename Type,
bool TF >
2114 template<
typename Type,
bool TF >
2117 template<
typename Type,
bool TF >
2120 template<
typename Type,
bool TF >
2133 template<
typename Type
2149 template<
typename Type
2175 template<
typename Type
2179 return ( v.
size() == 0UL );
2202 template<
typename Type
2220 template<
typename Type
2238 template<
typename Type
2257 template<
typename T,
bool TF >
2258 struct HasConstDataAccess< DynamicVector<T,TF> > :
public IsTrue<true>
2274 template<
typename T,
bool TF >
2275 struct HasMutableDataAccess< DynamicVector<T,TF> > :
public IsTrue<true>
2291 template<
typename T,
bool TF >
2292 struct IsAligned< DynamicVector<T,TF> > :
public IsTrue<true>
2308 template<
typename T,
bool TF >
2309 struct IsPadded< DynamicVector<T,TF> > :
public IsTrue<usePadding>
2325 template<
typename T,
bool TF >
2326 struct IsResizable< DynamicVector<T,TF> > :
public IsTrue<true>
2342 template<
typename T1,
bool TF,
typename T2,
size_t N >
2343 struct AddTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2345 typedef StaticVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2348 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2349 struct AddTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2351 typedef StaticVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2354 template<
typename T1,
bool TF,
typename T2,
size_t N >
2355 struct AddTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2357 typedef HybridVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2360 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2361 struct AddTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2363 typedef HybridVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2366 template<
typename T1,
bool TF,
typename T2 >
2367 struct AddTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2369 typedef DynamicVector< typename AddTrait<T1,T2>::Type, TF > Type;
2385 template<
typename T1,
bool TF,
typename T2,
size_t N >
2386 struct SubTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2388 typedef StaticVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2391 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2392 struct SubTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2394 typedef StaticVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2397 template<
typename T1,
bool TF,
typename T2,
size_t N >
2398 struct SubTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2400 typedef HybridVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2403 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2404 struct SubTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2406 typedef HybridVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2409 template<
typename T1,
bool TF,
typename T2 >
2410 struct SubTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2412 typedef DynamicVector< typename SubTrait<T1,T2>::Type, TF > Type;
2428 template<
typename T1,
bool TF,
typename T2 >
2429 struct MultTrait< DynamicVector<T1,TF>, T2, typename EnableIf< IsNumeric<T2> >::Type >
2431 typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2434 template<
typename T1,
typename T2,
bool TF >
2435 struct MultTrait< T1, DynamicVector<T2,TF>, typename EnableIf< IsNumeric<T1> >::Type >
2437 typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2440 template<
typename T1,
bool TF,
typename T2,
size_t N >
2441 struct MultTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2443 typedef StaticVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2446 template<
typename T1,
typename T2,
size_t N >
2447 struct MultTrait< DynamicVector<T1,false>, StaticVector<T2,N,true> >
2449 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2452 template<
typename T1,
typename T2,
size_t N >
2453 struct MultTrait< DynamicVector<T1,true>, StaticVector<T2,N,false> >
2455 typedef typename MultTrait<T1,T2>::Type Type;
2458 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2459 struct MultTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2461 typedef StaticVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2464 template<
typename T1,
size_t N,
typename T2 >
2465 struct MultTrait< StaticVector<T1,N,false>, DynamicVector<T2,true> >
2467 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2470 template<
typename T1,
size_t N,
typename T2 >
2471 struct MultTrait< StaticVector<T1,N,true>, DynamicVector<T2,false> >
2473 typedef typename MultTrait<T1,T2>::Type Type;
2476 template<
typename T1,
bool TF,
typename T2,
size_t N >
2477 struct MultTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2479 typedef HybridVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2482 template<
typename T1,
typename T2,
size_t N >
2483 struct MultTrait< DynamicVector<T1,false>, HybridVector<T2,N,true> >
2485 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2488 template<
typename T1,
typename T2,
size_t N >
2489 struct MultTrait< DynamicVector<T1,true>, HybridVector<T2,N,false> >
2491 typedef typename MultTrait<T1,T2>::Type Type;
2494 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2495 struct MultTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2497 typedef HybridVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2500 template<
typename T1,
size_t N,
typename T2 >
2501 struct MultTrait< HybridVector<T1,N,false>, DynamicVector<T2,true> >
2503 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2506 template<
typename T1,
size_t N,
typename T2 >
2507 struct MultTrait< HybridVector<T1,N,true>, DynamicVector<T2,false> >
2509 typedef typename MultTrait<T1,T2>::Type Type;
2512 template<
typename T1,
bool TF,
typename T2 >
2513 struct MultTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2515 typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2518 template<
typename T1,
typename T2 >
2519 struct MultTrait< DynamicVector<T1,false>, DynamicVector<T2,true> >
2521 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2524 template<
typename T1,
typename T2 >
2525 struct MultTrait< DynamicVector<T1,true>, DynamicVector<T2,false> >
2527 typedef typename MultTrait<T1,T2>::Type Type;
2543 template<
typename T1,
typename T2 >
2544 struct CrossTrait< DynamicVector<T1,false>, StaticVector<T2,3UL,false> >
2547 typedef typename MultTrait<T1,T2>::Type T;
2550 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2553 template<
typename T1,
typename T2 >
2554 struct CrossTrait< StaticVector<T1,3UL,false>, DynamicVector<T2,false> >
2557 typedef typename MultTrait<T1,T2>::Type T;
2560 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2563 template<
typename T1,
typename T2,
size_t N >
2564 struct CrossTrait< DynamicVector<T1,false>, HybridVector<T2,N,false> >
2567 typedef typename MultTrait<T1,T2>::Type T;
2570 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2573 template<
typename T1,
size_t N,
typename T2 >
2574 struct CrossTrait< HybridVector<T1,N,false>, DynamicVector<T2,false> >
2577 typedef typename MultTrait<T1,T2>::Type T;
2580 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2583 template<
typename T1,
typename T2 >
2584 struct CrossTrait< DynamicVector<T1,false>, DynamicVector<T2,false> >
2587 typedef typename MultTrait<T1,T2>::Type T;
2590 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2606 template<
typename T1,
bool TF,
typename T2 >
2607 struct DivTrait< DynamicVector<T1,TF>, T2, typename EnableIf< IsNumeric<T2> >::Type >
2609 typedef DynamicVector< typename DivTrait<T1,T2>::Type, TF > Type;
2625 template<
typename T1,
bool TF,
typename T2 >
2626 struct MathTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2628 typedef DynamicVector< typename MathTrait<T1,T2>::HighType, TF > HighType;
2629 typedef DynamicVector< typename MathTrait<T1,T2>::LowType , TF > LowType;
2645 template<
typename T1,
bool TF >
2646 struct SubvectorTrait< DynamicVector<T1,TF> >
2648 typedef DynamicVector<T1,TF> Type;
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:118
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
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
DenseIterator< Type, aligned > Iterator
Iterator over non-constant elements.
Definition: DynamicVector.h:190
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:424
Header file for mathematical functions.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the alignment flag values.
Header file for the subtraction trait.
Pointer data()
Low-level data access to the vector elements.
Definition: DynamicVector.h:760
Header file for basic type definitions.
Header file for the SparseVector base class.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: DynamicVector.h:1164
BLAZE_ALWAYS_INLINE void storeu(size_t index, const IntrinsicType &value)
Unaligned store of an intrinsic element of the dense vector.
Definition: DynamicVector.h:1626
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:250
void swap(DynamicVector &v)
Swapping the contents of two vectors.
Definition: DynamicVector.h:1359
Iterator begin()
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:790
void clear()
Clearing the vector.
Definition: DynamicVector.h:1203
IT::Type IntrinsicType
Intrinsic type of the vector elements.
Definition: DynamicVector.h:181
Header file for the IsSame and IsStrictlySame type traits.
const bool useStreaming
Configuration of the streaming behavior.For large vectors and matrices non-temporal stores can provid...
Definition: Optimizations.h:68
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:507
const Type * ConstPointer
Pointer to a constant vector value.
Definition: DynamicVector.h:188
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:721
Efficient implementation of an arbitrary sized vector.The DynamicVector class template is the represe...
Definition: DynamicVector.h:168
Header file for memory allocation and deallocation functionality.
void move(CustomMatrix< Type, AF, PF, SO > &dst, CustomMatrix< Type, AF, PF, SO > &src)
Moving the contents of one custom matrix to another.
Definition: CustomMatrix.h:6085
System settings for performance optimizations.
BLAZE_ALWAYS_INLINE void stream(size_t index, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the dense vector.
Definition: DynamicVector.h:1656
EnableIf< IsBuiltin< T >, T * >::Type allocate(size_t size)
Aligned array allocation for built-in data types.
Definition: Memory.h:152
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:547
Constraint on the data type.
size_t capacity_
The current capacity of the pointer array.
Definition: CompressedMatrix.h:2751
~DynamicVector()
The destructor for DynamicVector.
Definition: DynamicVector.h:650
ConstIterator cbegin() const
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:818
DynamicVector< ET, TF > Other
The type of the other DynamicVector.
Definition: DynamicVector.h:199
DenseIterator< const Type, aligned > ConstIterator
Iterator over constant elements.
Definition: DynamicVector.h:191
Header file for the DisableIf class template.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type loadu(const T *address)
Loads a vector of 2-byte integral values.
Definition: Loadu.h:74
This ResultType
Result type for expression template evaluations.
Definition: DynamicVector.h:178
void resize(size_t n, bool preserve=true)
Changing the size of the vector.
Definition: DynamicVector.h:1241
Header file for the multiplication trait.
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for nested template disabiguation.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:4998
bool isAligned() const
Returns whether the vector is properly aligned in memory.
Definition: DynamicVector.h:1444
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type storeu(T *address, const simd_int16_t &value)
Unaligned store of a vector of 2-byte integral values.
Definition: Storeu.h:75
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
const Type & ReturnType
Return type for expression template evaluations.
Definition: DynamicVector.h:182
#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.
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:75
BLAZE_ALWAYS_INLINE void storea(size_t index, const IntrinsicType &value)
Aligned store of an intrinsic element of the vector.
Definition: DynamicVector.h:1594
BLAZE_ALWAYS_INLINE IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the vector.
Definition: DynamicVector.h:1541
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
EnableIf< IsBuiltin< T > >::Type deallocate(T *address)
Deallocation of memory for built-in data types.
Definition: Memory.h:227
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:1185
size_t size() const
Returns the current size/dimension of the vector.
Definition: DynamicVector.h:1133
Header file for the IsAligned type trait.
size_t size_
The current size/dimension of the vector.
Definition: DynamicVector.h:422
#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:185
#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:186
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:187
Compile time check for data types.This type trait tests whether or not the given template parameter i...
Definition: IsSMPAssignable.h:120
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:532
size_t adjustCapacity(size_t minCapacity) const
Adjusting the new capacity of the vector according to its data type Type.
Definition: DynamicVector.h:1376
DynamicVector()
The default constructor for DynamicVector.
Definition: DynamicVector.h:458
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:527
Header file for the IsPadded type trait.
Header file for the serial shim.
Header file for the IsVectorizable type trait.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
size_t capacity_
The maximum capacity of the vector.
Definition: DynamicVector.h:423
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type loada(const T *address)
Loads a vector of 2-byte integral values.
Definition: Loada.h:77
bool isAliased(const Other *alias) const
Returns whether the vector is aliased with the given address alias.
Definition: DynamicVector.h:1426
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t index) const
Load of an intrinsic element of the vector.
Definition: DynamicVector.h:1486
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the IsSparseVector type trait.
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
ConstIterator cend() const
Returns an iterator just past the last element of the dynamic vector.
Definition: DynamicVector.h:860
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
IntrinsicTrait< Type > IT
Intrinsic trait for the vector element type.
Definition: DynamicVector.h:172
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:183
const bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
void extend(size_t n, bool preserve=true)
Extending the size of the vector.
Definition: DynamicVector.h:1289
const bool usePadding
Configuration of the padding of dense vectors and matrices.This configuration switch enables/disables...
Definition: Optimizations.h:52
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:2591
Rebind mechanism to obtain a DynamicVector with different data/element type.
Definition: DynamicVector.h:198
Header file for the isDefault shim.
System settings for the restrict keyword.
Type ElementType
Type of the vector elements.
Definition: DynamicVector.h:180
Type * Pointer
Pointer to a non-constant vector value.
Definition: DynamicVector.h:187
size_t capacity() const
Returns the maximum capacity of the vector.
Definition: DynamicVector.h:1147
BLAZE_ALWAYS_INLINE IntrinsicType loada(size_t index) const
Aligned load of an intrinsic element of the vector.
Definition: DynamicVector.h:1509
Constraint on the data type.
Header file for the HasMutableDataAccess type trait.
void reserve(size_t n)
Setting the minimum capacity of the vector.
Definition: DynamicVector.h:1307
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b)
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:256
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:59
Header file for all intrinsic functionality.
Header file for the mathematical trait.
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
bool canAlias(const Other *alias) const
Returns whether the vector can alias with the given address alias.
Definition: DynamicVector.h:1406
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:164
Header file for the default transpose flag for all vectors of the Blaze library.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
Header file for the alignment check function.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:118
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the IsTrue value trait.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type stream(T *address, const simd_int16_t &value)
Aligned, non-temporal store of a vector of 2-byte integral values.
Definition: Stream.h:74
bool canSMPAssign() const
Returns whether the vector can be used in SMP assignments.
Definition: DynamicVector.h:1463
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:237
Header file for exception macros.
BLAZE_ALWAYS_INLINE void store(size_t index, const IntrinsicType &value)
Store of an intrinsic element of the vector.
Definition: DynamicVector.h:1571
Iterator end()
Returns an iterator just past the last element of the dynamic vector.
Definition: DynamicVector.h:832
Reference at(size_t index)
Checked access to the vector elements.
Definition: DynamicVector.h:718
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.
System settings for the inline keywords.
EnableIf< IsDenseVector< VT1 > >::Type smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:189
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Reference operator[](size_t index)
Subscript operator for the direct access to the vector elements.
Definition: DynamicVector.h:677
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type storea(T *address, const simd_int16_t &value)
Aligned store of a vector of 2-byte integral values.
Definition: Storea.h:78
DynamicVector< Type,!TF > TransposeType
Transpose type for expression template evaluations.
Definition: DynamicVector.h:179
Header file for a safe C++ NULL pointer implementation.
DynamicVector< Type, TF > This
Type of this DynamicVector instance.
Definition: DynamicVector.h:177