35 #ifndef _BLAZE_MATH_VIEWS_DENSESUBVECTOR_H_
36 #define _BLAZE_MATH_VIEWS_DENSESUBVECTOR_H_
288 template<
typename VT
289 ,
bool TF = IsRowVector<VT>::value >
339 template<
typename IteratorType >
348 typedef typename std::iterator_traits<IteratorType>::value_type
ValueType;
351 typedef typename std::iterator_traits<IteratorType>::pointer
PointerType;
354 typedef typename std::iterator_traits<IteratorType>::reference
ReferenceType;
357 typedef typename std::iterator_traits<IteratorType>::difference_type
DifferenceType;
375 explicit inline SubvectorIterator( IteratorType iterator, IteratorType
final,
size_t rest,
bool aligned )
493 for(
size_t j=0UL; j<
rest_; ++j )
633 enum { vectorizable = VT::vectorizable };
636 enum { smpAssignable = VT::smpAssignable };
642 explicit inline DenseSubvector( VT& vector,
size_t index,
size_t n );
673 template<
typename VT2 >
inline DenseSubvector& operator+=(
const Vector<VT2,TF>& rhs );
674 template<
typename VT2 >
inline DenseSubvector& operator-=(
const Vector<VT2,TF>& rhs );
675 template<
typename VT2 >
inline DenseSubvector& operator*=(
const Vector<VT2,TF>& rhs );
677 template<
typename Other >
678 inline typename EnableIf< IsNumeric<Other>,
DenseSubvector >::Type&
679 operator*=( Other rhs );
681 template<
typename Other >
682 inline typename EnableIf< IsNumeric<Other>,
DenseSubvector >::Type&
683 operator/=( Other rhs );
690 inline size_t size()
const;
694 template<
typename Other >
inline DenseSubvector& scale(
const Other& scalar );
701 template<
typename VT2 >
703 struct VectorizedAssign {
704 enum { value = vectorizable && VT2::vectorizable &&
705 IsSame<ElementType,typename VT2::ElementType>::value };
712 template<
typename VT2 >
714 struct VectorizedAddAssign {
715 enum { value = vectorizable && VT2::vectorizable &&
716 IsSame<ElementType,typename VT2::ElementType>::value &&
717 IntrinsicTrait<ElementType>::addition };
724 template<
typename VT2 >
726 struct VectorizedSubAssign {
727 enum { value = vectorizable && VT2::vectorizable &&
728 IsSame<ElementType,typename VT2::ElementType>::value &&
729 IntrinsicTrait<ElementType>::subtraction };
736 template<
typename VT2 >
738 struct VectorizedMultAssign {
739 enum { value = vectorizable && VT2::vectorizable &&
740 IsSame<ElementType,typename VT2::ElementType>::value &&
741 IntrinsicTrait<ElementType>::multiplication };
750 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
751 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
759 template<
typename VT2 >
760 inline typename DisableIf< VectorizedAssign<VT2> >::Type
761 assign(
const DenseVector <VT2,TF>& rhs );
763 template<
typename VT2 >
764 inline typename EnableIf< VectorizedAssign<VT2> >::Type
765 assign(
const DenseVector <VT2,TF>& rhs );
767 template<
typename VT2 >
inline void assign(
const SparseVector<VT2,TF>& rhs );
769 template<
typename VT2 >
770 inline typename DisableIf< VectorizedAddAssign<VT2> >::Type
771 addAssign(
const DenseVector <VT2,TF>& rhs );
773 template<
typename VT2 >
774 inline typename EnableIf< VectorizedAddAssign<VT2> >::Type
775 addAssign (
const DenseVector <VT2,TF>& rhs );
777 template<
typename VT2 >
inline void addAssign(
const SparseVector<VT2,TF>& rhs );
779 template<
typename VT2 >
780 inline typename DisableIf< VectorizedSubAssign<VT2> >::Type
781 subAssign (
const DenseVector <VT2,TF>& rhs );
783 template<
typename VT2 >
784 inline typename EnableIf< VectorizedSubAssign<VT2> >::Type
785 subAssign(
const DenseVector <VT2,TF>& rhs );
787 template<
typename VT2 >
inline void subAssign(
const SparseVector<VT2,TF>& rhs );
789 template<
typename VT2 >
790 inline typename DisableIf< VectorizedMultAssign<VT2> >::Type
791 multAssign(
const DenseVector <VT2,TF>& rhs );
793 template<
typename VT2 >
794 inline typename EnableIf< VectorizedMultAssign<VT2> >::Type
795 multAssign(
const DenseVector <VT2,TF>& rhs );
797 template<
typename VT2 >
inline void multAssign(
const SparseVector<VT2,TF>& rhs );
829 template<
typename VT2,
bool TF2 >
866 template<
typename VT
875 ( index + n == vector.size() || n %
IT::size == 0UL ) )
877 if( index + n > vector.size() )
878 throw std::invalid_argument(
"Invalid subvector specification" );
897 template<
typename VT
903 return vector_[offset_+index];
914 template<
typename VT
920 return const_cast<const VT&
>( vector_ )[offset_+index];
932 template<
typename VT
936 return vector_.data() + offset_;
948 template<
typename VT
952 return vector_.data() + offset_;
964 template<
typename VT
968 const typename VT::Iterator first( vector_.begin() + offset_ );
981 template<
typename VT
998 template<
typename VT
1015 template<
typename VT
1019 const typename VT::Iterator last( vector_.begin() + offset_ + size_ );
1032 template<
typename VT
1049 template<
typename VT
1073 template<
typename VT
1077 const size_t iend( offset_ + size_ );
1079 for(
size_t i=offset_; i<iend; ++i )
1097 template<
typename VT
1106 if( &rhs ==
this || ( &vector_ == &rhs.
vector_ && offset_ == rhs.
offset_ ) )
1109 if( size() != rhs.
size() )
1110 throw std::invalid_argument(
"Subvector sizes do not match" );
1135 template<
typename VT
1137 template<
typename VT2 >
1145 if( size() != (~rhs).size() )
1146 throw std::invalid_argument(
"Vector sizes do not match" );
1148 if( (~rhs).canAlias( &vector_ ) ) {
1173 template<
typename VT
1175 template<
typename VT2 >
1183 if( size() != (~rhs).size() )
1184 throw std::invalid_argument(
"Vector sizes do not match" );
1186 if( (~rhs).canAlias( &vector_ ) ) {
1209 template<
typename VT
1211 template<
typename VT2 >
1219 if( size() != (~rhs).size() )
1220 throw std::invalid_argument(
"Vector sizes do not match" );
1222 if( (~rhs).canAlias( &vector_ ) ) {
1246 template<
typename VT
1248 template<
typename VT2 >
1256 if( size() != (~rhs).size() )
1257 throw std::invalid_argument(
"Vector sizes do not match" );
1279 template<
typename VT
1281 template<
typename Other >
1285 return operator=( (*
this) * rhs );
1299 template<
typename VT
1301 template<
typename Other >
1307 return operator=( (*
this) / rhs );
1325 template<
typename VT
1339 template<
typename VT
1343 return vector_.capacity() - offset_;
1356 template<
typename VT
1360 size_t nonzeros( 0 );
1362 const size_t iend( offset_ + size_ );
1363 for(
size_t i=offset_; i<iend; ++i ) {
1378 template<
typename VT
1384 const size_t iend( offset_ + size_ );
1385 for(
size_t i=offset_; i<iend; ++i )
1386 reset( vector_[i] );
1397 template<
typename VT
1399 template<
typename Other >
1402 const size_t iend( offset_ + size_ );
1403 for(
size_t i=offset_; i<iend; ++i )
1404 vector_[i] *= scalar;
1428 template<
typename VT
1430 template<
typename Other >
1433 return static_cast<const void*
>( &vector_ ) == static_cast<const void*>( alias );
1448 template<
typename VT
1450 template<
typename Other >
1453 return static_cast<const void*
>( &vector_ ) == static_cast<const void*>( alias );
1471 template<
typename VT
1476 return loadu( index );
1494 template<
typename VT
1505 return vector_.loadu( offset_+index );
1509 for(
size_t j=0UL; j<
rest_; ++j )
1510 value[j] = vector_[offset_+index+j];
1531 template<
typename VT
1554 template<
typename VT
1564 vector_.storeu( offset_+index, value );
1567 for(
size_t j=0UL; j<
rest_; ++j )
1568 vector_[offset_+index+j] = value[j];
1588 template<
typename VT
1608 template<
typename VT
1610 template<
typename VT2 >
1616 const size_t iend( size() &
size_t(-2) );
1617 for(
size_t i=0UL; i<iend; i+=2UL ) {
1618 vector_[i+offset_ ] = (~rhs)[i ];
1619 vector_[i+offset_+1UL] = (~rhs)[i+1UL];
1621 if( iend < size() ) {
1622 vector_[iend+offset_] = (~rhs)[iend];
1639 template<
typename VT
1641 template<
typename VT2 >
1651 !(~rhs).isAliased( &vector_ ) )
1653 for(
size_t i=0UL; i<size(); i+=IT::size ) {
1654 vector_.stream( offset_+i, (~rhs).
load(i) );
1659 const size_t iend( size_ &
size_t(-IT::size*4) );
1663 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1664 vector_.storeu( offset_+i , it.load() ); it += IT::size;
1665 vector_.storeu( offset_+i+IT::size , it.load() ); it += IT::size;
1666 vector_.storeu( offset_+i+IT::size*2UL, it.load() ); it += IT::size;
1667 vector_.storeu( offset_+i+IT::size*3UL, it.load() ); it += IT::size;
1669 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1688 template<
typename VT
1690 template<
typename VT2 >
1695 for(
typename VT2::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1696 vector_[element->index()+offset_] = element->value();
1712 template<
typename VT
1714 template<
typename VT2 >
1720 const size_t iend( size() &
size_t(-2) );
1721 for(
size_t i=0UL; i<iend; i+=2UL ) {
1722 vector_[i+offset_ ] += (~rhs)[i ];
1723 vector_[i+offset_+1UL] += (~rhs)[i+1UL];
1725 if( iend < size() ) {
1726 vector_[iend+offset_] += (~rhs)[iend];
1743 template<
typename VT
1745 template<
typename VT2 >
1753 const size_t iend( size_ &
size_t(-IT::size*4) );
1757 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1758 vector_.storeu( offset_+i ,
load(i ) + it.load() ); it += IT::size;
1759 vector_.storeu( offset_+i+IT::size ,
load(i+IT::size ) + it.load() ); it += IT::size;
1760 vector_.storeu( offset_+i+IT::size*2UL,
load(i+IT::size*2UL) + it.load() ); it += IT::size;
1761 vector_.storeu( offset_+i+IT::size*3UL,
load(i+IT::size*3UL) + it.load() ); it += IT::size;
1763 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1781 template<
typename VT
1783 template<
typename VT2 >
1788 for(
typename VT2::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1789 vector_[element->index()+offset_] += element->value();
1805 template<
typename VT
1807 template<
typename VT2 >
1813 const size_t iend( size() &
size_t(-2) );
1814 for(
size_t i=0UL; i<iend; i+=2UL ) {
1815 vector_[i+offset_ ] -= (~rhs)[i ];
1816 vector_[i+offset_+1UL] -= (~rhs)[i+1UL];
1818 if( iend < size() ) {
1819 vector_[iend+offset_] -= (~rhs)[iend];
1836 template<
typename VT
1838 template<
typename VT2 >
1846 const size_t iend( size_ &
size_t(-IT::size*4) );
1850 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1851 vector_.storeu( offset_+i ,
load(i ) - it.load() ); it += IT::size;
1852 vector_.storeu( offset_+i+IT::size ,
load(i+IT::size ) - it.load() ); it += IT::size;
1853 vector_.storeu( offset_+i+IT::size*2UL,
load(i+IT::size*2UL) - it.load() ); it += IT::size;
1854 vector_.storeu( offset_+i+IT::size*3UL,
load(i+IT::size*3UL) - it.load() ); it += IT::size;
1856 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1874 template<
typename VT
1876 template<
typename VT2 >
1881 for(
typename VT2::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1882 vector_[element->index()+offset_] -= element->value();
1898 template<
typename VT
1900 template<
typename VT2 >
1906 const size_t iend( size() &
size_t(-2) );
1907 for(
size_t i=0UL; i<iend; i+=2UL ) {
1908 vector_[i+offset_ ] *= (~rhs)[i ];
1909 vector_[i+offset_+1UL] *= (~rhs)[i+1UL];
1911 if( iend < size() ) {
1912 vector_[iend+offset_] *= (~rhs)[iend];
1929 template<
typename VT
1931 template<
typename VT2 >
1939 const size_t iend( size_ &
size_t(-IT::size*4) );
1943 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1944 vector_.storeu( offset_+i ,
load(i ) * it.load() ); it += IT::size;
1945 vector_.storeu( offset_+i+IT::size ,
load(i+IT::size ) * it.load() ); it += IT::size;
1946 vector_.storeu( offset_+i+IT::size*2UL,
load(i+IT::size*2UL) * it.load() ); it += IT::size;
1947 vector_.storeu( offset_+i+IT::size*3UL,
load(i+IT::size*3UL) * it.load() ); it += IT::size;
1949 for(
size_t i=iend; i<size_; i+=IT::size, it+=IT::size ) {
1967 template<
typename VT
1969 template<
typename VT2 >
1978 for(
typename VT2::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1979 vector_[element->index()+offset_] = tmp[element->index()] * element->value();
2004 template<
typename VT1
2007 :
public DenseVector< DenseSubvector< DVecDVecCrossExpr<VT1,VT2>, false >, false >
2028 enum { vectorizable = 0 };
2038 explicit inline DenseSubvector(
const CPE& vector,
size_t index,
size_t n )
2062 inline size_t size()
const {
2073 template<
typename T >
2074 inline bool canAlias(
const T* alias )
const {
2075 return vector_.canAlias( alias );
2085 template<
typename T >
2086 inline bool isAliased(
const T* alias )
const {
2087 return vector_.isAliased( alias );
2102 template<
typename VT,
bool TF >
2103 friend DenseSubvector<VT,TF>
subvector(
const DenseSubvector<VT,TF>& dv,
size_t index,
size_t size );
2130 template<
typename VT1
2132 class DenseSubvector< DVecSVecCrossExpr<VT1,VT2>, false >
2133 :
public DenseVector< DenseSubvector< DVecSVecCrossExpr<VT1,VT2>, false >, false >
2138 typedef DVecSVecCrossExpr<VT1,VT2> CPE;
2144 typedef DenseSubvector<CPE,false>
This;
2145 typedef typename SubvectorTrait<RT>::Type
ResultType;
2154 enum { vectorizable = 0 };
2164 explicit inline DenseSubvector(
const CPE& vector,
size_t index,
size_t n )
2188 inline size_t size()
const {
2199 template<
typename T >
2200 inline bool canAlias(
const T* alias )
const {
2201 return vector_.canAlias( alias );
2211 template<
typename T >
2212 inline bool isAliased(
const T* alias )
const {
2213 return vector_.isAliased( alias );
2228 template<
typename VT,
bool TF >
2229 friend DenseSubvector<VT,TF>
subvector(
const DenseSubvector<VT,TF>& dv,
size_t index,
size_t size );
2256 template<
typename VT1
2258 class DenseSubvector< SVecDVecCrossExpr<VT1,VT2>, false >
2259 :
public DenseVector< DenseSubvector< SVecDVecCrossExpr<VT1,VT2>, false >, false >
2264 typedef SVecDVecCrossExpr<VT1,VT2> CPE;
2270 typedef DenseSubvector<CPE,false>
This;
2271 typedef typename SubvectorTrait<RT>::Type
ResultType;
2280 enum { vectorizable = 0 };
2290 explicit inline DenseSubvector(
const CPE& vector,
size_t index,
size_t n )
2314 inline size_t size()
const {
2325 template<
typename T >
2326 inline bool canAlias(
const T* alias )
const {
2327 return vector_.canAlias( alias );
2337 template<
typename T >
2338 inline bool isAliased(
const T* alias )
const {
2339 return vector_.isAliased( alias );
2354 template<
typename VT,
bool TF >
2355 friend DenseSubvector<VT,TF>
subvector(
const DenseSubvector<VT,TF>& dv,
size_t index,
size_t size );
2382 template<
typename VT1
2384 class DenseSubvector< SVecSVecCrossExpr<VT1,VT2>, false >
2385 :
public DenseVector< DenseSubvector< SVecSVecCrossExpr<VT1,VT2>, false >, false >
2390 typedef SVecSVecCrossExpr<VT1,VT2> CPE;
2396 typedef DenseSubvector<CPE,false>
This;
2397 typedef typename SubvectorTrait<RT>::Type
ResultType;
2406 enum { vectorizable = 0 };
2416 explicit inline DenseSubvector(
const CPE& vector,
size_t index,
size_t n )
2440 inline size_t size()
const {
2451 template<
typename T >
2452 inline bool canAlias(
const T* alias )
const {
2453 return vector_.canAlias( alias );
2463 template<
typename T >
2464 inline bool isAliased(
const T* alias )
const {
2465 return vector_.isAliased( alias );
2480 template<
typename VT,
bool TF >
2481 friend DenseSubvector<VT,TF>
subvector(
const DenseSubvector<VT,TF>& dv,
size_t index,
size_t size );
2503 template<
typename VT,
bool TF >
2504 inline void reset( DenseSubvector<VT,TF>& dv );
2506 template<
typename VT,
bool TF >
2507 inline void clear( DenseSubvector<VT,TF>& dv );
2509 template<
typename VT,
bool TF >
2510 inline bool isDefault(
const DenseSubvector<VT,TF>& dv );
2522 template<
typename VT
2538 template<
typename VT
2566 template<
typename VT
2570 for(
size_t i=0UL; i<dv.size(); ++i )
2613 template<
typename VT
2615 inline typename DisableIf< Or< IsComputation<VT>, IsTransExpr<VT> >, DenseSubvector<VT> >::Type
2653 template<
typename VT
2655 inline typename DisableIf< Or< IsComputation<VT>, IsTransExpr<VT> >, DenseSubvector<const VT> >::Type
2686 template<
typename VT
2688 inline DenseSubvector<VT,TF>
2689 subvector(
const DenseSubvector<VT,TF>& dv,
size_t index,
size_t size )
2693 return DenseSubvector<VT,TF>( dv.vector_, dv.offset_ + index, size );
2712 template<
typename VT
2714 inline typename EnableIf< IsCrossExpr<VT>, DenseSubvector<VT> >::Type
2715 subvector(
const DenseVector<VT,TF>& dv,
size_t index,
size_t size )
2719 return DenseSubvector<VT>( ~dv, index, size );
2735 template<
typename VT,
bool TF >
2736 struct SubvectorTrait< DenseSubvector<VT,TF> >
2754 template<
typename VT,
bool TF >
2755 struct SubvectorExprTrait< DenseSubvector<VT,TF> >
2757 typedef DenseSubvector<VT,TF> Type;
2765 template<
typename VT,
bool TF >
2766 struct SubvectorExprTrait< const DenseSubvector<VT,TF> >
2768 typedef DenseSubvector<VT,TF> Type;
2776 template<
typename VT,
bool TF >
2777 struct SubvectorExprTrait< volatile DenseSubvector<VT,TF> >
2779 typedef DenseSubvector<VT,TF> Type;
2787 template<
typename VT,
bool TF >
2788 struct SubvectorExprTrait< const volatile DenseSubvector<VT,TF> >
2790 typedef DenseSubvector<VT,TF> Type;
2798 template<
typename VT1,
typename VT2 >
2799 struct SubvectorExprTrait< DVecDVecCrossExpr<VT1,VT2> >
2803 typedef DenseSubvector< DVecDVecCrossExpr<VT1,VT2>,
false > Type;
2812 template<
typename VT1,
typename VT2 >
2813 struct SubvectorExprTrait< DVecSVecCrossExpr<VT1,VT2> >
2817 typedef DenseSubvector< DVecSVecCrossExpr<VT1,VT2>,
false > Type;
2826 template<
typename VT1,
typename VT2 >
2827 struct SubvectorExprTrait< SVecDVecCrossExpr<VT1,VT2> >
2831 typedef DenseSubvector< SVecDVecCrossExpr<VT1,VT2>,
false > Type;
2840 template<
typename VT1,
typename VT2 >
2841 struct SubvectorExprTrait< SVecSVecCrossExpr<VT1,VT2> >
2845 typedef DenseSubvector< SVecSVecCrossExpr<VT1,VT2>,
false > Type;
ValueType value_type
Type of the underlying elements.
Definition: DenseSubvector.h:361
Constraint on the data type.
const size_t rest_
The number of remaining elements in an unaligned intrinsic operation.
Definition: DenseSubmatrix.h:2797
Constraint on the data type.
DenseSubvector(VT &vector, size_t index, size_t n)
The constructor for DenseSubvector.
Definition: DenseSubvector.h:868
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
SelectType< useConst, ConstPointer, ElementType * >::Type Pointer
Pointer to a constant subvector value.
Definition: DenseSubvector.h:333
SelectType< useConst, ConstIterator, SubvectorIterator< typename VT::Iterator > >::Type Iterator
Iterator over non-constant elements.
Definition: DenseSubvector.h:628
Header file for the View base class.
Header file for the IsCrossExpr type trait class.
bool operator<(const SubvectorIterator &rhs) const
Less-than comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:528
void reset()
Reset to the default initial values.
Definition: DenseSubvector.h:1380
bool isDefault(const DynamicMatrix< Type, SO > &m)
Returns whether the given dense matrix is in default state.
Definition: DynamicMatrix.h:4555
VT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DenseSubvector.h:320
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:196
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i...
Definition: Computation.h:118
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.
SubvectorIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DenseSubvector.h:401
const bool useStreaming
Configuration of the streaming behavior.For large vectors and matrices non-temporal stores can provid...
Definition: Streaming.h:50
Header file for the IsRowVector type trait.
void storeu(float *address, const sse_float_t &value)
Unaligned store of a vector of 'float' values.
Definition: Storeu.h:234
Header file for the DenseVector base class.
Header file for the IsTransExpr type trait class.
const size_t offset_
The offset of the subvector within the dense vector.
Definition: DenseSubvector.h:806
Expression object for dense vector-dense vector cross products.The DVecDVecCrossExpr class represents...
Definition: DVecDVecCrossExpr.h:81
Header file for the Computation base class.
const bool aligned_
Memory alignment flag.
Definition: DenseSubvector.h:814
bool canAlias(const Other *alias) const
Returns whether the dense subvector can alias with the given address alias.
Definition: DenseSubvector.h:1431
const size_t final_
The final index for unaligned intrinsic operations.
Definition: DenseSubmatrix.h:2798
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a transposition expression (i...
Definition: TransExpr.h:118
Header file for the RequiresEvaluation type trait.
Iterator begin()
Returns an iterator to the first element of the subvector.
Definition: DenseSubvector.h:966
void clear(DynamicMatrix< Type, SO > &m)
Clearing the given dense matrix.
Definition: DynamicMatrix.h:4528
VT::ConstReference ConstReference
Reference to a constant subvector value.
Definition: DenseSubvector.h:324
const SubvectorIterator operator++(int)
Post-increment operator.
Definition: DenseSubvector.h:423
Base template for the SubvectorTrait class.
Definition: SubvectorTrait.h:122
ConstIterator cend() const
Returns an iterator just past the last element of the subvector.
Definition: DenseSubvector.h:1051
VT::ElementType ElementType
Type of the subvector elements.
Definition: DenseSubvector.h:318
const SubvectorIterator operator--(int)
Post-decrement operator.
Definition: DenseSubvector.h:444
bool operator<=(const SubvectorIterator &rhs) const
Less-than comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:550
std::iterator_traits< IteratorType >::iterator_category IteratorCategory
The iterator category.
Definition: DenseSubvector.h:345
bool operator==(const SubvectorIterator &rhs) const
Equality comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:506
IntrinsicType load() const
Aligned load of an intrinsic element of the dense subvector.
Definition: DenseSubvector.h:469
Pointer data()
Low-level data access to the subvector elements.
Definition: DenseSubvector.h:934
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the DisableIf class template.
std::iterator_traits< IteratorType >::value_type ValueType
Type of the underlying elements.
Definition: DenseSubvector.h:348
DifferenceType operator-(const SubvectorIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DenseSubvector.h:572
Header file for nested template disabiguation.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2379
SubvectorIterator & operator--()
Pre-decrement operator.
Definition: DenseSubvector.h:433
Header file for the Or class template.
std::iterator_traits< IteratorType >::pointer PointerType
Pointer return type.
Definition: DenseSubvector.h:351
friend const SubvectorIterator operator-(const SubvectorIterator &it, size_t dec)
Subtraction between a SubvectorIterator and an integral value.
Definition: DenseSubvector.h:608
const ElementType * ConstPointer
Pointer to a constant subvector value.
Definition: DenseSubvector.h:330
std::iterator_traits< IteratorType >::reference ReferenceType
Reference return type.
Definition: DenseSubvector.h:354
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
Iterator end()
Returns an iterator just past the last element of the subvector.
Definition: DenseSubvector.h:1017
friend const SubvectorIterator operator+(size_t inc, const SubvectorIterator &it)
Addition between an integral value and a SubvectorIterator.
Definition: DenseSubvector.h:596
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
Constraint on the data type.
SubvectorIterator & operator++()
Pre-increment operator.
Definition: DenseSubvector.h:412
bool aligned_
Memory alignment flag.
Definition: DenseSubvector.h:618
Constraint on the data type.
SelectType< useConst, ConstReference, typename VT::Reference >::Type Reference
Reference to a non-constant subvector value.
Definition: DenseSubvector.h:327
#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
Constraint on the data type.
size_t nonZeros() const
Returns the number of non-zero elements in the subvector.
Definition: DenseSubvector.h:1358
bool operator!=(const SubvectorIterator &rhs) const
Inequality comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:517
Reference operator[](size_t index)
Subscript operator for the direct access to the subvector elements.
Definition: DenseSubvector.h:900
SubvectorIterator(IteratorType iterator, IteratorType final, size_t rest, bool aligned)
Constructor for the SubvectorIterator class.
Definition: DenseSubvector.h:375
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2373
void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:269
Operand vector_
The dense vector containing the subvector.
Definition: DenseSubvector.h:805
Constraint on the data type.
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2377
size_t rest_
The number of remaining elements beyond the final iterator.
Definition: DenseSubvector.h:617
System settings for streaming (non-temporal stores)
Header file for the EnableIf class template.
size_t capacity() const
Returns the maximum capacity of the dense subvector.
Definition: DenseSubvector.h:1341
bool operator>=(const SubvectorIterator &rhs) const
Greater-than comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:561
IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the dense subvector.
Definition: DenseSubvector.h:1497
ColumnIterator< const MT > ConstIterator
Iterator over constant elements.
Definition: DenseColumn.h:1972
Header file for the CrossExpr base class.
Header file for the IsNumeric type trait.
ConstIterator cbegin() const
Returns an iterator to the first element of the subvector.
Definition: DenseSubvector.h:1000
ReferenceType reference
Reference return type.
Definition: DenseSubvector.h:363
IT::Type IntrinsicType
Intrinsic type of the subvector elements.
Definition: DenseSubvector.h:319
Header file for the IsSparseVector type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2374
Header file for the IsConst type trait.
const size_t size_
The size of the subvector.
Definition: DenseSubvector.h:807
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:648
const size_t final_
The final index for unaligned intrinsic operations.
Definition: DenseSubvector.h:809
IteratorType iterator_
Iterator to the current subvector element.
Definition: DenseSubvector.h:615
Header file for run time assertion macros.
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
View on a specific subvector of a dense vector.The DenseSubvector template represents a view on a spe...
Definition: DenseSubvector.h:290
DifferenceType difference_type
Difference between two iterators.
Definition: DenseSubvector.h:364
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
bool isAliased(const Other *alias) const
Returns whether the dense subvector is aliased with the given address alias.
Definition: DenseSubvector.h:1451
Header file for the reset shim.
IntrinsicTrait< typename VT::ElementType > IT
Intrinsic trait for the vector element type.
Definition: DenseSubvector.h:299
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
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2378
Header file for the isDefault shim.
SubvectorTrait< VT >::Type ResultType
Result type for expression template evaluations.
Definition: DenseSubvector.h:316
size_t size() const
Returns the current size/dimension of the dense subvector.
Definition: DenseSubvector.h:1327
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
SelectType< IsExpression< VT >::value, VT, VT & >::Type Operand
Composite data type of the dense vector expression.
Definition: DenseSubvector.h:296
IntrinsicType loadu() const
Unaligned load of an intrinsic element of the dense subvector.
Definition: DenseSubvector.h:484
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
Compile time check for constant data types.The IsConst type trait tests whether or not the given temp...
Definition: IsConst.h:94
Header file for all intrinsic functionality.
DenseSubvector< VT, TF > This
Type of this DenseSubvector instance.
Definition: DenseSubvector.h:315
friend const SubvectorIterator operator+(const SubvectorIterator &it, size_t inc)
Addition between a SubvectorIterator and an integral value.
Definition: DenseSubvector.h:584
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:79
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DenseSubvector.h:317
void store(size_t index, const IntrinsicType &value)
Aligned store of an intrinsic element of the subvector.
Definition: DenseSubvector.h:1533
const DenseSubvector & CompositeType
Data type for composite expression templates.
Definition: DenseSubvector.h:321
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:147
Base class for all views.The View class serves as a tag for all views (subvectors, submatrices, rows, columns, ...). All classes that represent a view and that are used within the expression template environment of the Blaze library have to derive from this class in order to qualify as a view. Only in case a class is derived from the View base class, the IsView type trait recognizes the class as valid view.
Definition: View.h:64
Header file for the IsComputation type trait class.
CompressedMatrix< Type,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:247
const bool aligned_
Memory alignment flag.
Definition: DenseSubmatrix.h:2803
PointerType pointer
Pointer return type.
Definition: DenseSubvector.h:362
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:105
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2370
IteratorCategory iterator_category
The iterator category.
Definition: DenseSubvector.h:360
Header file for basic type definitions.
Header file for the SubvectorExprTrait class template.
void stream(size_t index, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the subvector.
Definition: DenseSubvector.h:1590
Iterator over the elements of the sparse subvector.
Definition: DenseSubvector.h:340
void storeu(size_t index, const IntrinsicType &value)
Unaligned store of an intrinsic element of the subvector.
Definition: DenseSubvector.h:1556
SelectType< useConst, ConstIterator, ColumnIterator< MT > >::Type Iterator
Iterator over non-constant elements.
Definition: DenseColumn.h:1980
SubvectorIterator< typename VT::ConstIterator > ConstIterator
Iterator over constant elements.
Definition: DenseSubvector.h:625
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
bool operator>(const SubvectorIterator &rhs) const
Greater-than comparison between two SubvectorIterator objects.
Definition: DenseSubvector.h:539
SubvectorIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DenseSubvector.h:389
DenseSubvector & operator=(const ElementType &rhs)
Homogenous assignment to all subvector elements.
Definition: DenseSubvector.h:1075
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:238
std::iterator_traits< IteratorType >::difference_type DifferenceType
Difference between two iterators.
Definition: DenseSubvector.h:357
IntrinsicType load(size_t index) const
Aligned load of an intrinsic element of the dense subvector.
Definition: DenseSubvector.h:1474
#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
DisableIf< Or< IsComputation< VT >, IsTransExpr< VT > >, DenseSubvector< VT > >::Type subvector(DenseVector< VT, TF > &dv, size_t index, size_t size)
Creating a view on a specific subvector of the given dense vector.
Definition: DenseSubvector.h:2616
const size_t rest_
The number of remaining elements in an unaligned intrinsic operation.
Definition: DenseSubvector.h:808
IteratorType final_
The final iterator for intrinsic operations.
Definition: DenseSubvector.h:616
ReferenceType operator*() const
Direct access to the element at the current iterator position.
Definition: DenseSubvector.h:454
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.