26 #ifndef _BLAZE_MATH_DENSE_HYBRIDVECTOR_H_
27 #define _BLAZE_MATH_DENSE_HYBRIDVECTOR_H_
163 template<
typename Type
166 class HybridVector :
public DenseVector< HybridVector<Type,N,TF>, TF >
200 template<
typename ET >
218 enum { smpAssignable = 0 };
226 explicit inline HybridVector(
size_t n,
const Type& init );
227 template<
typename Other >
explicit inline HybridVector(
size_t n,
const Other* array );
229 template<
typename Other,
size_t M >
230 explicit inline HybridVector(
const Other (&array)[M] );
233 template<
typename VT >
inline HybridVector(
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 M >
263 inline HybridVector& operator=(
const Other (&array)[M] );
267 template<
typename VT >
inline HybridVector& operator= (
const Vector<VT,TF>& rhs );
268 template<
typename VT >
inline HybridVector& operator+=(
const Vector<VT,TF>& rhs );
269 template<
typename VT >
inline HybridVector& operator-=(
const Vector<VT,TF>& rhs );
270 template<
typename VT >
inline HybridVector& operator*=(
const Vector<VT,TF>& rhs );
272 template<
typename Other >
273 inline typename EnableIf< IsNumeric<Other>,
HybridVector >::Type&
274 operator*=( Other rhs );
276 template<
typename Other >
277 inline typename EnableIf< IsNumeric<Other>,
HybridVector >::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 template<
typename Other >
inline HybridVector& scale(
const Other& scalar );
300 static inline void*
operator new ( std::size_t
size );
301 static inline void*
operator new[]( std::size_t
size );
302 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
303 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
305 static inline void operator delete (
void* ptr );
306 static inline void operator delete[](
void* ptr );
307 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
308 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
315 template<
typename VT >
317 struct VectorizedAssign {
319 vectorizable && VT::vectorizable &&
320 IsSame<Type,typename VT::ElementType>::value };
327 template<
typename VT >
329 struct VectorizedAddAssign {
331 vectorizable && VT::vectorizable &&
332 IsSame<Type,typename VT::ElementType>::value &&
333 IntrinsicTrait<Type>::addition };
340 template<
typename VT >
342 struct VectorizedSubAssign {
344 vectorizable && VT::vectorizable &&
345 IsSame<Type,typename VT::ElementType>::value &&
346 IntrinsicTrait<Type>::subtraction };
353 template<
typename VT >
355 struct VectorizedMultAssign {
357 vectorizable && VT::vectorizable &&
358 IsSame<Type,typename VT::ElementType>::value &&
359 IntrinsicTrait<Type>::multiplication };
368 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
369 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
382 template<
typename VT >
383 inline typename DisableIf< VectorizedAssign<VT> >::Type
384 assign(
const DenseVector<VT,TF>& rhs );
386 template<
typename VT >
387 inline typename EnableIf< VectorizedAssign<VT> >::Type
388 assign(
const DenseVector<VT,TF>& rhs );
390 template<
typename VT >
inline void assign(
const SparseVector<VT,TF>& rhs );
392 template<
typename VT >
393 inline typename DisableIf< VectorizedAddAssign<VT> >::Type
394 addAssign(
const DenseVector<VT,TF>& rhs );
396 template<
typename VT >
397 inline typename EnableIf< VectorizedAddAssign<VT> >::Type
398 addAssign(
const DenseVector<VT,TF>& rhs );
400 template<
typename VT >
inline void addAssign(
const SparseVector<VT,TF>& rhs );
402 template<
typename VT >
403 inline typename DisableIf< VectorizedSubAssign<VT> >::Type
404 subAssign(
const DenseVector<VT,TF>& rhs );
406 template<
typename VT >
407 inline typename EnableIf< VectorizedSubAssign<VT> >::Type
408 subAssign(
const DenseVector<VT,TF>& rhs );
410 template<
typename VT >
inline void subAssign(
const SparseVector<VT,TF>& rhs );
412 template<
typename VT >
413 inline typename DisableIf< VectorizedMultAssign<VT> >::Type
414 multAssign(
const DenseVector<VT,TF>& rhs );
416 template<
typename VT >
417 inline typename EnableIf< VectorizedMultAssign<VT> >::Type
418 multAssign(
const DenseVector<VT,TF>& rhs );
420 template<
typename VT >
inline void multAssign(
const SparseVector<VT,TF>& rhs );
465 template<
typename Type
475 for(
size_t i=0UL; i<
NN; ++i )
492 template<
typename Type
506 for(
size_t i=0UL; i<
NN; ++i )
524 template<
typename Type
537 for(
size_t i=0UL; i<n; ++i )
541 for(
size_t i=n; i<
NN; ++i )
571 template<
typename Type
574 template<
typename Other >
585 for(
size_t i=0UL; i<n; ++i )
589 for(
size_t i=n; i<
NN; ++i )
614 template<
typename Type
617 template<
typename Other
626 for(
size_t i=0UL; i<M; ++i )
630 for(
size_t i=M; i<
NN; ++i )
644 template<
typename Type
653 for(
size_t i=0UL; i<
size_; ++i )
657 for(
size_t i=size_; i<
NN; ++i )
674 template<
typename Type
677 template<
typename VT >
680 , size_( (~v).
size() )
686 if( (~v).
size() > N ) {
691 i<( IsNumeric<Type>::value ? NN :
size_ ); ++i ) {
717 template<
typename Type
738 template<
typename Type
760 template<
typename Type
766 if( index >= size_ ) {
769 return (*
this)[index];
784 template<
typename Type
790 if( index >= size_ ) {
793 return (*
this)[index];
805 template<
typename Type
822 template<
typename Type
837 template<
typename Type
852 template<
typename Type
867 template<
typename Type
882 template<
typename Type
898 template<
typename Type
914 template<
typename Type
952 template<
typename Type
955 template<
typename Other
963 for(
size_t i=0UL; i<M; ++i )
977 template<
typename Type
984 for(
size_t i=0UL; i<size_; ++i )
999 template<
typename Type
1004 using blaze::assign;
1009 assign( *
this, ~rhs );
1026 template<
typename Type
1029 template<
typename VT >
1032 using blaze::assign;
1034 if( (~rhs).
size() > N ) {
1038 if( (~rhs).canAlias(
this ) ) {
1046 assign( *
this, ~rhs );
1064 template<
typename Type
1067 template<
typename VT >
1070 using blaze::addAssign;
1072 if( (~rhs).
size() != size_ ) {
1076 if( (~rhs).canAlias(
this ) ) {
1078 addAssign( *
this, tmp );
1081 addAssign( *
this, ~rhs );
1099 template<
typename Type
1102 template<
typename VT >
1105 using blaze::subAssign;
1107 if( (~rhs).
size() != size_ ) {
1111 if( (~rhs).canAlias(
this ) ) {
1113 subAssign( *
this, tmp );
1116 subAssign( *
this, ~rhs );
1135 template<
typename Type
1138 template<
typename VT >
1141 using blaze::multAssign;
1143 if( (~rhs).
size() != size_ ) {
1149 this->operator=( tmp );
1152 multAssign( *
this, ~rhs );
1167 template<
typename Type
1170 template<
typename Other >
1174 using blaze::assign;
1176 assign( *
this, (*
this) * rhs );
1191 template<
typename Type
1194 template<
typename Other >
1198 using blaze::assign;
1202 assign( *
this, (*
this) / rhs );
1221 template<
typename Type
1236 template<
typename Type
1254 template<
typename Type
1259 size_t nonzeros( 0 );
1261 for(
size_t i=0UL; i<size_; ++i ) {
1276 template<
typename Type
1282 for(
size_t i=0UL; i<size_; ++i )
1295 template<
typename Type
1336 template<
typename Type
1348 for(
size_t i=n; i<size_; ++i )
1371 template<
typename Type
1388 template<
typename Type
1391 template<
typename Other >
1394 for(
size_t i=0; i<size_; ++i )
1408 template<
typename Type
1415 const size_t maxsize(
max( size_, v.size_ ) );
1416 for(
size_t i=0UL; i<maxsize; ++i )
1417 swap( v_[i], v.v_[i] );
1418 swap( size_, v.size_ );
1441 template<
typename Type
1450 return allocate<HybridVector>( 1UL );
1465 template<
typename Type
1488 template<
typename Type
1497 return allocate<HybridVector>( 1UL );
1512 template<
typename Type
1520 return allocate<HybridVector>( size/
sizeof(
HybridVector) );
1531 template<
typename Type
1536 deallocate( static_cast<HybridVector*>( ptr ) );
1547 template<
typename Type
1552 deallocate( static_cast<HybridVector*>( ptr ) );
1563 template<
typename Type
1568 deallocate( static_cast<HybridVector*>( ptr ) );
1579 template<
typename Type
1584 deallocate( static_cast<HybridVector*>( ptr ) );
1607 template<
typename Type
1610 template<
typename Other >
1613 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1628 template<
typename Type
1631 template<
typename Other >
1634 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1648 template<
typename Type
1671 template<
typename Type
1677 return loada( index );
1695 template<
typename Type
1710 return loada( &v_[index] );
1728 template<
typename Type
1741 return loadu( &v_[index] );
1760 template<
typename Type
1784 template<
typename Type
1798 storea( &v_[index], value );
1817 template<
typename Type
1829 storeu( &v_[index], value );
1848 template<
typename Type
1862 stream( &v_[index], value );
1878 template<
typename Type
1881 template<
typename VT >
1887 for(
size_t i=0UL; i<size_; ++i )
1904 template<
typename Type
1907 template<
typename VT >
1917 const size_t ipos( ( remainder )?( size_ &
size_t(-
IT::size) ):( size_ ) );
1923 store( i, (~rhs).load(i) );
1925 for( ; remainder && i<size_; ++i ) {
1943 template<
typename Type
1946 template<
typename VT >
1952 v_[element->index()] = element->value();
1968 template<
typename Type
1971 template<
typename VT >
1977 for(
size_t i=0UL; i<size_; ++i )
1994 template<
typename Type
1997 template<
typename VT >
2007 const size_t ipos( ( remainder )?( size_ &
size_t(-
IT::size) ):( size_ ) );
2013 store( i, load(i) + (~rhs).load(i) );
2015 for( ; remainder && i<size_; ++i ) {
2033 template<
typename Type
2036 template<
typename VT >
2042 v_[element->index()] += element->value();
2058 template<
typename Type
2061 template<
typename VT >
2067 for(
size_t i=0UL; i<size_; ++i )
2084 template<
typename Type
2087 template<
typename VT >
2097 const size_t ipos( ( remainder )?( size_ &
size_t(-
IT::size) ):( size_ ) );
2103 store( i, load(i) - (~rhs).load(i) );
2105 for( ; remainder && i<size_; ++i ) {
2123 template<
typename Type
2126 template<
typename VT >
2132 v_[element->index()] -= element->value();
2148 template<
typename Type
2151 template<
typename VT >
2157 for(
size_t i=0UL; i<size_; ++i )
2174 template<
typename Type
2177 template<
typename VT >
2187 const size_t ipos( ( remainder )?( size_ &
size_t(-
IT::size) ):( size_ ) );
2193 store( i, load(i) * (~rhs).load(i) );
2195 for( ; remainder && i<size_; ++i ) {
2213 template<
typename Type
2216 template<
typename VT >
2226 v_[element->index()] = tmp[element->index()] * element->value();
2251 template<
typename Type
2273 template<
typename Type,
size_t N,
bool TF >
2276 template<
typename Type,
size_t N,
bool TF >
2279 template<
typename Type,
size_t N,
bool TF >
2282 template<
typename Type,
size_t N,
bool TF >
2285 template<
typename Type,
size_t N,
bool TF >
2288 template<
typename Type,
size_t N,
bool TF >
2301 template<
typename Type
2318 template<
typename Type
2345 template<
typename Type
2350 return ( v.size() == 0UL );
2373 template<
typename Type
2378 return ( v.size() <= N );
2392 template<
typename Type
2411 template<
typename Type
2431 template<
typename T,
size_t N,
bool TF >
2432 struct HasConstDataAccess< HybridVector<T,N,TF> > :
public IsTrue<true>
2448 template<
typename T,
size_t N,
bool TF >
2449 struct HasMutableDataAccess< HybridVector<T,N,TF> > :
public IsTrue<true>
2465 template<
typename T,
size_t N,
bool TF >
2466 struct IsAligned< HybridVector<T,N,TF> > :
public IsTrue<true>
2482 template<
typename T,
size_t N,
bool TF >
2483 struct IsPadded< HybridVector<T,N,TF> > :
public IsTrue<usePadding>
2499 template<
typename T,
size_t N,
bool TF >
2500 struct IsResizable< HybridVector<T,N,TF> > :
public IsTrue<true>
2516 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2517 struct AddTrait< HybridVector<T1,M,TF>, StaticVector<T2,N,TF> >
2519 typedef StaticVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2522 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2523 struct AddTrait< StaticVector<T1,M,TF>, HybridVector<T2,N,TF> >
2525 typedef StaticVector< typename AddTrait<T1,T2>::Type, M, TF > Type;
2528 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2529 struct AddTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
2531 typedef HybridVector< typename AddTrait<T1,T2>::Type, ( M < N )?( M ):( N ), TF > Type;
2547 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2548 struct SubTrait< HybridVector<T1,M,TF>, StaticVector<T2,N,TF> >
2550 typedef StaticVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2553 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2554 struct SubTrait< StaticVector<T1,M,TF>, HybridVector<T2,N,TF> >
2556 typedef StaticVector< typename SubTrait<T1,T2>::Type, M, TF > Type;
2559 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2560 struct SubTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
2562 typedef HybridVector< typename SubTrait<T1,T2>::Type, ( M < N )?( M ):( N ), TF > Type;
2578 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2579 struct MultTrait< HybridVector<T1,N,TF>, T2, typename EnableIf< IsNumeric<T2> >::Type >
2581 typedef HybridVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2584 template<
typename T1,
typename T2,
size_t N,
bool TF >
2585 struct MultTrait< T1, HybridVector<T2,N,TF>, typename EnableIf< IsNumeric<T1> >::Type >
2587 typedef HybridVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2590 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2591 struct MultTrait< HybridVector<T1,M,TF>, StaticVector<T2,N,TF> >
2593 typedef StaticVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2596 template<
typename T1,
size_t M,
typename T2,
size_t N >
2597 struct MultTrait< HybridVector<T1,M,false>, StaticVector<T2,N,true> >
2599 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2602 template<
typename T1,
size_t M,
typename T2,
size_t N >
2603 struct MultTrait< HybridVector<T1,M,true>, StaticVector<T2,N,false> >
2605 typedef typename MultTrait<T1,T2>::Type Type;
2608 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2609 struct MultTrait< StaticVector<T1,M,TF>, HybridVector<T2,N,TF> >
2611 typedef StaticVector< typename MultTrait<T1,T2>::Type, M, TF > Type;
2614 template<
typename T1,
size_t M,
typename T2,
size_t N >
2615 struct MultTrait< StaticVector<T1,M,false>, HybridVector<T2,N,true> >
2617 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2620 template<
typename T1,
size_t M,
typename T2,
size_t N >
2621 struct MultTrait< StaticVector<T1,M,true>, HybridVector<T2,N,false> >
2623 typedef typename MultTrait<T1,T2>::Type Type;
2626 template<
typename T1,
size_t M,
bool TF,
typename T2,
size_t N >
2627 struct MultTrait< HybridVector<T1,M,TF>, HybridVector<T2,N,TF> >
2629 typedef HybridVector< typename MultTrait<T1,T2>::Type, ( M < N )?( M ):( N ), TF > Type;
2632 template<
typename T1,
size_t M,
typename T2,
size_t N >
2633 struct MultTrait< HybridVector<T1,M,false>, HybridVector<T2,N,true> >
2635 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2638 template<
typename T1,
size_t M,
typename T2,
size_t N >
2639 struct MultTrait< HybridVector<T1,M,true>, HybridVector<T2,N,false> >
2641 typedef typename MultTrait<T1,T2>::Type Type;
2657 template<
typename T1,
size_t N,
typename T2 >
2658 struct CrossTrait< HybridVector<T1,N,false>, StaticVector<T2,3UL,false> >
2661 typedef typename MultTrait<T1,T2>::Type T;
2664 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2667 template<
typename T1,
typename T2,
size_t N >
2668 struct CrossTrait< StaticVector<T1,3UL,false>, HybridVector<T2,N,false> >
2671 typedef typename MultTrait<T1,T2>::Type T;
2674 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2677 template<
typename T1,
size_t M,
typename T2,
size_t N >
2678 struct CrossTrait< HybridVector<T1,M,false>, HybridVector<T2,N,false> >
2681 typedef typename MultTrait<T1,T2>::Type T;
2684 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2700 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2701 struct DivTrait< HybridVector<T1,N,TF>, T2, typename EnableIf< IsNumeric<T2> >::Type >
2703 typedef HybridVector< typename DivTrait<T1,T2>::Type, N, TF > Type;
2719 template<
typename T1,
size_t N,
bool TF,
typename T2 >
2720 struct MathTrait< HybridVector<T1,N,TF>, HybridVector<T2,N,TF> >
2722 typedef StaticVector< typename MathTrait<T1,T2>::HighType, N, TF > HighType;
2723 typedef StaticVector< typename MathTrait<T1,T2>::LowType , N, TF > LowType;
2739 template<
typename T1,
size_t N,
bool TF >
2740 struct SubvectorTrait< HybridVector<T1,N,TF> >
2742 typedef HybridVector<T1,N,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
IntrinsicTrait< Type > IT
Intrinsic trait for the vector element type.
Definition: HybridVector.h:170
const MT::ElementType max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1729
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
Header file for mathematical functions.
Header file for the NextMultiple class template.
#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
void extend(size_t n, bool preserve=true)
Extending the size of the vector.
Definition: HybridVector.h:1374
Header file for the alignment flag values.
Header file for the UNUSED_PARAMETER function template.
HybridVector()
The default constructor for HybridVector.
Definition: HybridVector.h:468
Header file for the subtraction trait.
Header file for basic type definitions.
Header file for the SparseVector base class.
BLAZE_ALWAYS_INLINE void stream(size_t index, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the vector.
Definition: HybridVector.h:1851
AlignedArray< Type, NN > v_
The statically allocated vector elements.
Definition: HybridVector.h:428
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 capacity() const
Returns the maximum capacity of the vector.
Definition: HybridVector.h:1239
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
BLAZE_ALWAYS_INLINE IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the vector.
Definition: HybridVector.h:1732
Header file for the IsSame and IsStrictlySame type traits.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:507
bool isAligned() const
Returns whether the vector is properly aligned in memory.
Definition: HybridVector.h:1651
Type ElementType
Type of the vector elements.
Definition: HybridVector.h:183
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
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
Header file for the SizeT class template.
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: HybridVector.h:1257
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.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:547
Constraint on the data type.
Iterator begin()
Returns an iterator to the first element of the hybrid vector.
Definition: HybridVector.h:840
Efficient implementation of a dynamically sized vector with static memory.The HybridVector class temp...
Definition: Forward.h:59
HybridVector< Type, N,!TF > TransposeType
Transpose type for expression template evaluations.
Definition: HybridVector.h:182
Rebind mechanism to obtain a HybridVector with different data/element type.
Definition: HybridVector.h:201
ConstIterator cbegin() const
Returns an iterator to the first element of the hybrid vector.
Definition: HybridVector.h:870
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
HybridVector< ET, N, TF > Other
The type of the other HybridVector.
Definition: HybridVector.h:202
Header file for the multiplication trait.
ConstIterator cend() const
Returns an iterator just past the last element of the hybrid vector.
Definition: HybridVector.h:917
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
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
#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
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:75
size_t size() const
Returns the current size/dimension of the vector.
Definition: HybridVector.h:1224
DenseIterator< Type, aligned > Iterator
Iterator over non-constant elements.
Definition: HybridVector.h:193
#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.
BLAZE_ALWAYS_INLINE void store(size_t index, const IntrinsicType &value)
Store of an intrinsic element of the vector.
Definition: HybridVector.h:1763
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
Header file for the IsAligned type trait.
BLAZE_ALWAYS_INLINE void storea(size_t index, const IntrinsicType &value)
Aligned store of an intrinsic element of the vector.
Definition: HybridVector.h:1787
#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
Reference operator[](size_t index)
Subscript operator for the direct access to the vector elements.
Definition: HybridVector.h:721
BLAZE_ALWAYS_INLINE IntrinsicType loada(size_t index) const
Aligned load of an intrinsic element of the vector.
Definition: HybridVector.h:1699
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
static const size_t NN
Alignment adjustment.
Definition: HybridVector.h:175
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
const Type * ConstPointer
Pointer to a constant vector value.
Definition: HybridVector.h:191
DenseIterator< const Type, aligned > ConstIterator
Iterator over constant elements.
Definition: HybridVector.h:194
void clear()
Clearing the vector.
Definition: HybridVector.h:1298
const Type & ReturnType
Return type for expression template evaluations.
Definition: HybridVector.h:185
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.
void resize(size_t n, bool preserve=true)
Changing the size of the vector.
Definition: HybridVector.h:1339
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
size_t size_
The current size/dimension of the vector.
Definition: HybridVector.h:434
BLAZE_ALWAYS_INLINE void storeu(size_t index, const IntrinsicType &value)
Unaligned store of an intrinsic element of the vector.
Definition: HybridVector.h:1820
Header file for the IsSparseVector type trait.
Compile time integral constant wrapper for size_t.The SizeT class template represents an integral wra...
Definition: SizeT.h:72
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
const HybridVector & CompositeType
Data type for composite expression templates.
Definition: HybridVector.h:186
Header file for run time assertion macros.
Type * Pointer
Pointer to a non-constant vector value.
Definition: HybridVector.h:190
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
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 bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
Header file for the AlignedArray implementation.
const bool usePadding
Configuration of the padding of dense vectors and matrices.This configuration switch enables/disables...
Definition: Optimizations.h:52
#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
Header file for the isDefault shim.
Constraint on the data type.
Header file for the HasMutableDataAccess type trait.
Pointer data()
Low-level data access to the vector elements.
Definition: HybridVector.h:808
void swap(HybridVector &v)
Swapping the contents of two hybrid vectors.
Definition: HybridVector.h:1411
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
bool isAliased(const Other *alias) const
Returns whether the vector is aliased with the given address alias.
Definition: HybridVector.h:1632
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
Type & Reference
Reference to a non-constant vector value.
Definition: HybridVector.h:188
void reset()
Reset to the default initial values.
Definition: HybridVector.h:1279
Reference at(size_t index)
Checked access to the vector elements.
Definition: HybridVector.h:764
HybridVector< Type, N, TF > This
Type of this HybridVector instance.
Definition: HybridVector.h:180
Iterator end()
Returns an iterator just past the last element of the hybrid vector.
Definition: HybridVector.h:885
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:164
const Type & ConstReference
Reference to a constant vector value.
Definition: HybridVector.h:189
bool canAlias(const Other *alias) const
Returns whether the vector can alias with the given address alias.
Definition: HybridVector.h:1611
Header file for the default transpose flag for all vectors of the Blaze library.
IT::Type IntrinsicType
Intrinsic type of the vector elements.
Definition: HybridVector.h:184
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 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 IntrinsicType load(size_t index) const
Load of an intrinsic element of the vector.
Definition: HybridVector.h:1675
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:143
Header file for the IsResizable type trait.
System settings for the inline keywords.
#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
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
This ResultType
Result type for expression template evaluations.
Definition: HybridVector.h:181
Compile time integral round up operation.The NextMultiple class template rounds up the given template...
Definition: NextMultiple.h:81