35 #ifndef _BLAZE_MATH_VIEWS_SUBVECTOR_DENSE_H_ 36 #define _BLAZE_MATH_VIEWS_SUBVECTOR_DENSE_H_ 109 template<
typename VT
112 class Subvector<VT,
unaligned,TF,true,CSAs...>
113 :
public View< DenseVector< Subvector<VT,unaligned,TF,true,CSAs...>, TF > >
114 ,
private SubvectorData<CSAs...>
118 using DataType = SubvectorData<CSAs...>;
119 using Operand = If_t< IsExpression_v<VT>, VT, VT& >;
127 using BaseType = DenseVector<This,TF>;
128 using ViewedType = VT;
132 using SIMDType = SIMDTrait_t<ElementType>;
143 using ConstPointer = ConstPointer_t<VT>;
146 using Pointer = If_t< IsConst_v<VT> || !HasMutableDataAccess_v<VT>, ConstPointer, Pointer_t<VT> >;
152 template<
typename IteratorType >
153 class SubvectorIterator
158 using IteratorCategory =
typename std::iterator_traits<IteratorType>::iterator_category;
161 using ValueType =
typename std::iterator_traits<IteratorType>::value_type;
164 using PointerType =
typename std::iterator_traits<IteratorType>::pointer;
167 using ReferenceType =
typename std::iterator_traits<IteratorType>::reference;
170 using DifferenceType =
typename std::iterator_traits<IteratorType>::difference_type;
173 using iterator_category = IteratorCategory;
174 using value_type = ValueType;
175 using pointer = PointerType;
176 using reference = ReferenceType;
177 using difference_type = DifferenceType;
183 inline SubvectorIterator()
185 , isAligned_( false )
195 inline SubvectorIterator( IteratorType iterator,
bool isMemoryAligned )
196 : iterator_ ( iterator )
197 , isAligned_( isMemoryAligned )
206 template<
typename IteratorType2 >
207 inline SubvectorIterator(
const SubvectorIterator<IteratorType2>& it )
208 : iterator_ ( it.base() )
209 , isAligned_( it.isAligned() )
219 inline SubvectorIterator&
operator+=(
size_t inc ) {
231 inline SubvectorIterator&
operator-=(
size_t dec ) {
242 inline SubvectorIterator& operator++() {
253 inline const SubvectorIterator operator++(
int ) {
254 return SubvectorIterator( iterator_++, isAligned_ );
263 inline SubvectorIterator& operator--() {
274 inline const SubvectorIterator operator--(
int ) {
275 return SubvectorIterator( iterator_--, isAligned_ );
294 inline IteratorType operator->()
const {
309 inline SIMDType load()
const {
329 inline SIMDType
loada()
const {
330 return iterator_.loada();
344 inline SIMDType
loadu()
const {
345 return iterator_.loadu();
360 inline void store(
const SIMDType& value )
const {
381 inline void storea(
const SIMDType& value )
const {
382 iterator_.storea( value );
397 inline void storeu(
const SIMDType& value )
const {
398 iterator_.storeu( value );
413 inline void stream(
const SIMDType& value )
const {
414 iterator_.stream( value );
424 inline bool operator==(
const SubvectorIterator& rhs )
const {
425 return iterator_ == rhs.iterator_;
435 inline bool operator!=(
const SubvectorIterator& rhs )
const {
436 return iterator_ != rhs.iterator_;
446 inline bool operator<(
const SubvectorIterator& rhs )
const {
447 return iterator_ < rhs.iterator_;
457 inline bool operator>(
const SubvectorIterator& rhs )
const {
458 return iterator_ > rhs.iterator_;
468 inline bool operator<=(
const SubvectorIterator& rhs )
const {
469 return iterator_ <= rhs.iterator_;
479 inline bool operator>=(
const SubvectorIterator& rhs )
const {
480 return iterator_ >= rhs.iterator_;
490 inline DifferenceType
operator-(
const SubvectorIterator& rhs )
const {
491 return iterator_ - rhs.iterator_;
502 friend inline const SubvectorIterator
operator+(
const SubvectorIterator& it,
size_t inc ) {
503 return SubvectorIterator( it.iterator_ + inc, it.isAligned_ );
514 friend inline const SubvectorIterator
operator+(
size_t inc,
const SubvectorIterator& it ) {
515 return SubvectorIterator( it.iterator_ + inc, it.isAligned_ );
526 friend inline const SubvectorIterator
operator-(
const SubvectorIterator& it,
size_t dec ) {
527 return SubvectorIterator( it.iterator_ - dec, it.isAligned_ );
536 inline IteratorType base()
const {
546 inline bool isAligned()
const {
553 IteratorType iterator_;
561 using ConstIterator = SubvectorIterator< ConstIterator_t<VT> >;
569 static constexpr
bool simdEnabled = VT::simdEnabled;
578 template<
typename... RSAs >
579 explicit inline Subvector( VT& vector, RSAs... args );
581 Subvector(
const Subvector& ) =
default;
588 ~Subvector() =
default;
595 inline Reference operator[](
size_t index );
599 inline Pointer
data () noexcept;
600 inline ConstPointer
data () const noexcept;
613 inline Subvector& operator= ( const
ElementType& rhs );
614 inline Subvector& operator= ( initializer_list<
ElementType> list );
615 inline Subvector& operator= ( const Subvector& rhs );
616 template< typename VT2 > inline Subvector& operator= ( const Vector<VT2,TF>& rhs );
617 template< typename VT2 > inline Subvector& operator+=( const Vector<VT2,TF>& rhs );
618 template< typename VT2 > inline Subvector& operator-=( const Vector<VT2,TF>& rhs );
619 template< typename VT2 > inline Subvector& operator*=( const Vector<VT2,TF>& rhs );
620 template< typename VT2 > inline Subvector& operator/=( const DenseVector<VT2,TF>& rhs );
621 template< typename VT2 > inline Subvector& operator%=( const Vector<VT2,TF>& rhs );
628 using DataType::offset;
629 using DataType::
size;
631 inline VT& operand() noexcept;
632 inline const VT& operand() const noexcept;
634 inline
size_t spacing() const noexcept;
635 inline
size_t capacity() const noexcept;
644 template< typename Other > inline Subvector& scale( const Other& scalar );
651 template< typename VT2 >
652 static constexpr
bool VectorizedAssign_v =
653 ( useOptimizedKernels &&
654 simdEnabled && VT2::simdEnabled &&
660 template< typename VT2 >
661 static constexpr
bool VectorizedAddAssign_v =
662 ( useOptimizedKernels &&
663 simdEnabled && VT2::simdEnabled &&
670 template< typename VT2 >
671 static constexpr
bool VectorizedSubAssign_v =
672 ( useOptimizedKernels &&
673 simdEnabled && VT2::simdEnabled &&
680 template< typename VT2 >
681 static constexpr
bool VectorizedMultAssign_v =
682 ( useOptimizedKernels &&
683 simdEnabled && VT2::simdEnabled &&
690 template< typename VT2 >
691 static constexpr
bool VectorizedDivAssign_v =
692 ( useOptimizedKernels &&
693 simdEnabled && VT2::simdEnabled &&
707 template< typename Other >
708 inline
bool canAlias( const Other* alias ) const noexcept;
710 template< typename VT2,
AlignmentFlag AF2,
bool TF2,
size_t... CSAs2 >
711 inline
bool canAlias( const Subvector<VT2,AF2,TF2,true,CSAs2...>* alias ) const noexcept;
713 template< typename Other >
714 inline
bool isAliased( const Other* alias ) const noexcept;
716 template< typename VT2,
AlignmentFlag AF2,
bool TF2,
size_t... CSAs2 >
717 inline
bool isAliased( const Subvector<VT2,AF2,TF2,true,CSAs2...>* alias ) const noexcept;
719 inline
bool isAligned () const noexcept;
720 inline
bool canSMPAssign() const noexcept;
731 template< typename VT2 >
732 inline auto assign( const DenseVector <VT2,TF>& rhs ) ->
DisableIf_t< VectorizedAssign_v<VT2> >;
734 template< typename VT2 >
735 inline auto assign( const DenseVector <VT2,TF>& rhs ) ->
EnableIf_t< VectorizedAssign_v<VT2> >;
737 template< typename VT2 > inline
void assign( const SparseVector<VT2,TF>& rhs );
739 template< typename VT2 >
740 inline auto addAssign( const DenseVector <VT2,TF>& rhs ) ->
DisableIf_t< VectorizedAddAssign_v<VT2> >;
742 template< typename VT2 >
743 inline auto addAssign ( const DenseVector <VT2,TF>& rhs ) ->
EnableIf_t< VectorizedAddAssign_v<VT2> >;
745 template< typename VT2 > inline
void addAssign( const SparseVector<VT2,TF>& rhs );
747 template< typename VT2 >
748 inline auto subAssign( const DenseVector <VT2,TF>& rhs ) ->
DisableIf_t< VectorizedSubAssign_v<VT2> >;
750 template< typename VT2 >
751 inline auto subAssign( const DenseVector <VT2,TF>& rhs ) ->
EnableIf_t< VectorizedSubAssign_v<VT2> >;
753 template< typename VT2 > inline
void subAssign( const SparseVector<VT2,TF>& rhs );
755 template< typename VT2 >
756 inline auto multAssign( const DenseVector <VT2,TF>& rhs ) ->
DisableIf_t< VectorizedMultAssign_v<VT2> >;
758 template< typename VT2 >
759 inline auto multAssign( const DenseVector <VT2,TF>& rhs ) ->
EnableIf_t< VectorizedMultAssign_v<VT2> >;
761 template< typename VT2 > inline
void multAssign( const SparseVector<VT2,TF>& rhs );
763 template< typename VT2 >
764 inline auto divAssign( const DenseVector <VT2,TF>& rhs ) ->
DisableIf_t< VectorizedDivAssign_v<VT2> >;
766 template< typename VT2 >
767 inline auto divAssign( const DenseVector <VT2,TF>& rhs ) ->
EnableIf_t< VectorizedDivAssign_v<VT2> >;
776 const
bool isAligned_;
787 template< typename VT2,
AlignmentFlag AF2,
bool TF2,
bool DF2,
size_t... CSAs2 > friend class Subvector;
824 template< typename VT
827 template< typename... RSAs >
828 inline Subvector<VT,
unaligned,TF,true,CSAs...>::Subvector( VT& vector, RSAs... args )
829 : DataType ( args... )
835 if( offset() +
size() > vector.size() ) {
865 template<
typename VT
869 Subvector<VT,unaligned,TF,true,CSAs...>::operator[](
size_t index )
872 return vector_[offset()+index];
888 template<
typename VT
892 Subvector<VT,unaligned,TF,true,CSAs...>::operator[](
size_t index )
const 895 return const_cast<const VT&
>( vector_ )[offset()+index];
912 template<
typename VT
916 Subvector<VT,unaligned,TF,true,CSAs...>::at(
size_t index )
918 if( index >=
size() ) {
921 return (*
this)[index];
938 template<
typename VT
942 Subvector<VT,unaligned,TF,true,CSAs...>::at(
size_t index )
const 944 if( index >=
size() ) {
947 return (*
this)[index];
961 template<
typename VT
964 inline typename Subvector<VT,
unaligned,TF,
true,CSAs...>::Pointer
967 return vector_.data() + offset();
981 template<
typename VT
984 inline typename Subvector<VT,
unaligned,TF,
true,CSAs...>::ConstPointer
987 return vector_.data() + offset();
1001 template<
typename VT
1007 return Iterator( vector_.begin() + offset(), isAligned_ );
1021 template<
typename VT
1027 return ConstIterator( vector_.cbegin() + offset(), isAligned_ );
1041 template<
typename VT
1047 return ConstIterator( vector_.cbegin() + offset(), isAligned_ );
1061 template<
typename VT
1067 return Iterator( vector_.begin() + offset() +
size(), isAligned_ );
1081 template<
typename VT
1101 template<
typename VT
1128 template<
typename VT
1131 inline Subvector<VT,
unaligned,TF,
true,CSAs...>&
1132 Subvector<VT,unaligned,TF,true,CSAs...>::operator=(
const ElementType& rhs )
1134 const size_t iend( offset() +
size() );
1135 decltype(
auto) left( derestrict( vector_ ) );
1137 for(
size_t i=offset(); i<iend; ++i ) {
1138 if( !IsRestricted_v<VT> || trySet( vector_, i, rhs ) )
1164 template<
typename VT
1167 inline Subvector<VT,
unaligned,TF,
true,CSAs...>&
1168 Subvector<VT,unaligned,TF,true,CSAs...>::operator=( initializer_list<ElementType> list )
1170 if( list.size() >
size() ) {
1174 if( IsRestricted_v<VT> ) {
1175 const InitializerVector<ElementType,TF> tmp( list,
size() );
1176 if( !tryAssign( vector_, tmp, offset() ) ) {
1181 decltype(
auto) left( derestrict( *this ) );
1205 template< typename VT
1208 inline Subvector<VT,
unaligned,TF,true,CSAs...>&
1209 Subvector<VT,
unaligned,TF,true,CSAs...>::operator=( const Subvector& rhs )
1214 if( &rhs ==
this || ( &vector_ == &rhs.vector_ && offset() == rhs.offset() ) )
1217 if(
size() != rhs.size() ) {
1221 if( !tryAssign( vector_, rhs, offset() ) ) {
1225 decltype(
auto) left( derestrict( *this ) );
1227 if( rhs.canAlias( &vector_ ) ) {
1255 template<
typename VT
1258 template<
typename VT2 >
1259 inline Subvector<VT,
unaligned,TF,
true,CSAs...>&
1260 Subvector<VT,unaligned,TF,true,CSAs...>::operator=(
const Vector<VT2,TF>& rhs )
1269 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
1270 Right right( ~rhs );
1272 if( !tryAssign( vector_, right, offset() ) ) {
1276 decltype(
auto) left( derestrict( *this ) );
1279 const ResultType_t<VT2> tmp( right );
1283 if( IsSparseVector_v<VT2> )
1308 template<
typename VT
1311 template<
typename VT2 >
1312 inline Subvector<VT,
unaligned,TF,
true,CSAs...>&
1322 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
1323 Right right( ~rhs );
1325 if( !tryAddAssign( vector_, right, offset() ) ) {
1329 decltype(
auto) left( derestrict( *this ) );
1332 const ResultType_t<VT2> tmp( right );
1359 template<
typename VT
1362 template<
typename VT2 >
1363 inline Subvector<VT,
unaligned,TF,
true,CSAs...>&
1373 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
1374 Right right( ~rhs );
1376 if( !trySubAssign( vector_, right, offset() ) ) {
1380 decltype(
auto) left( derestrict( *this ) );
1383 const ResultType_t<VT2> tmp( right );
1411 template<
typename VT
1414 template<
typename VT2 >
1415 inline Subvector<VT,
unaligned,TF,
true,CSAs...>&
1425 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
1426 Right right( ~rhs );
1428 if( !tryMultAssign( vector_, right, offset() ) ) {
1432 decltype(
auto) left( derestrict( *this ) );
1435 const ResultType_t<VT2> tmp( right );
1462 template<
typename VT
1465 template<
typename VT2 >
1466 inline Subvector<VT,
unaligned,TF,
true,CSAs...>&
1476 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
1477 Right right( ~rhs );
1479 if( !tryDivAssign( vector_, right, offset() ) ) {
1483 decltype(
auto) left( derestrict( *this ) );
1486 const ResultType_t<VT2> tmp( right );
1514 template<
typename VT
1517 template<
typename VT2 >
1518 inline Subvector<VT,
unaligned,TF,
true,CSAs...>&
1519 Subvector<VT,unaligned,TF,true,CSAs...>::operator%=(
const Vector<VT2,TF>& rhs )
1521 using blaze::assign;
1526 using CrossType = CrossTrait_t< ResultType, ResultType_t<VT2> >;
1532 if(
size() != 3UL || (~rhs).
size() != 3UL ) {
1536 const CrossType tmp( *
this % (~rhs) );
1538 if( !tryAssign( vector_, tmp, offset() ) ) {
1542 decltype(
auto) left( derestrict( *this ) );
1544 assign( left, tmp );
1568 template< typename VT
1571 inline VT& Subvector<VT,
unaligned,TF,true,CSAs...>::operand() noexcept
1585 template<
typename VT
1588 inline const VT& Subvector<VT,unaligned,TF,true,CSAs...>::operand() const noexcept
1605 template<
typename VT
1610 return vector_.spacing() - offset();
1622 template<
typename VT
1627 return vector_.capacity() - offset();
1642 template<
typename VT
1647 size_t nonzeros( 0 );
1649 const size_t iend( offset() +
size() );
1650 for(
size_t i=offset(); i<iend; ++i ) {
1667 template<
typename VT
1674 const size_t iend( offset() +
size() );
1675 for(
size_t i=offset(); i<iend; ++i )
1676 clear( vector_[i] );
1701 template<
typename VT
1704 template<
typename Other >
1705 inline Subvector<VT,
unaligned,TF,
true,CSAs...>&
1706 Subvector<VT,unaligned,TF,true,CSAs...>::scale(
const Other& scalar )
1708 const size_t iend( offset() +
size() );
1709 for(
size_t i=offset(); i<iend; ++i )
1710 vector_[i] *= scalar;
1736 template<
typename VT
1739 template<
typename Other >
1740 inline bool Subvector<VT,unaligned,TF,true,CSAs...>::canAlias(
const Other* alias )
const noexcept
1742 return vector_.isAliased( alias );
1759 template<
typename VT
1762 template<
typename VT2
1767 Subvector<VT,unaligned,TF,true,CSAs...>::canAlias(
const Subvector<VT2,AF2,TF2,true,CSAs2...>* alias )
const noexcept
1769 return ( vector_.isAliased( &alias->vector_ ) &&
1770 ( offset() +
size() > alias->offset() ) &&
1771 ( offset() < alias->offset() + alias->size() ) );
1788 template<
typename VT
1791 template<
typename Other >
1792 inline bool Subvector<VT,unaligned,TF,true,CSAs...>::isAliased(
const Other* alias )
const noexcept
1794 return vector_.isAliased( alias );
1811 template<
typename VT
1814 template<
typename VT2
1819 Subvector<VT,unaligned,TF,true,CSAs...>::isAliased(
const Subvector<VT2,AF2,TF2,true,CSAs2...>* alias )
const noexcept
1821 return ( vector_.isAliased( &alias->vector_ ) &&
1822 ( offset() +
size() > alias->offset() ) &&
1823 ( offset() < alias->offset() + alias->size() ) );
1839 template<
typename VT
1842 inline bool Subvector<VT,unaligned,TF,true,CSAs...>::isAligned() const noexcept
1861 template<
typename VT
1864 inline bool Subvector<VT,unaligned,TF,true,CSAs...>::canSMPAssign() const noexcept
1866 return (
size() > SMP_DVECASSIGN_THRESHOLD );
1886 template<
typename VT
1890 Subvector<VT,unaligned,TF,true,CSAs...>::load(
size_t index )
const noexcept
1893 return loada( index );
1895 return loadu( index );
1915 template<
typename VT
1927 return vector_.loada( offset()+index );
1947 template<
typename VT
1959 return vector_.loadu( offset()+index );
1980 template<
typename VT
1984 Subvector<VT,unaligned,TF,true,CSAs...>::store(
size_t index,
const SIMDType& value ) noexcept
2010 template<
typename VT
2022 vector_.storea( offset()+index, value );
2043 template<
typename VT
2055 vector_.storeu( offset()+index, value );
2076 template<
typename VT
2089 vector_.stream( offset()+index, value );
2091 vector_.storeu( offset()+index, value );
2109 template<
typename VT
2112 template<
typename VT2 >
2113 inline auto Subvector<VT,unaligned,TF,true,CSAs...>::assign(
const DenseVector<VT2,TF>& rhs )
2114 -> DisableIf_t< VectorizedAssign_v<VT2> >
2118 const size_t ipos(
size() &
size_t(-2) );
2119 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2120 vector_[offset()+i ] = (~rhs)[i ];
2121 vector_[offset()+i+1UL] = (~rhs)[i+1UL];
2123 if( ipos <
size() ) {
2124 vector_[offset()+ipos] = (~rhs)[ipos];
2143 template<
typename VT
2146 template<
typename VT2 >
2147 inline auto Subvector<VT,unaligned,TF,true,CSAs...>::assign(
const DenseVector<VT2,TF>& rhs )
2148 -> EnableIf_t< VectorizedAssign_v<VT2> >
2154 const size_t ipos(
size() &
size_t(-SIMDSIZE) );
2159 ConstIterator_t<VT2> right( (~rhs).
begin() );
2161 if( useStreaming && isAligned_ &&
2163 !(~rhs).isAliased( &vector_ ) )
2165 for( ; i<ipos; i+=SIMDSIZE ) {
2166 left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2168 for( ; i<
size(); ++i ) {
2174 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2175 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2176 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2177 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2178 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2180 for( ; i<ipos; i+=SIMDSIZE ) {
2181 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2183 for( ; i<
size(); ++i ) {
2184 *left = *right; ++left; ++right;
2204 template<
typename VT
2207 template<
typename VT2 >
2208 inline void Subvector<VT,unaligned,TF,true,CSAs...>::assign(
const SparseVector<VT2,TF>& rhs )
2212 for( ConstIterator_t<VT2> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2213 vector_[offset()+element->index()] = element->value();
2231 template<
typename VT
2234 template<
typename VT2 >
2235 inline auto Subvector<VT,unaligned,TF,true,CSAs...>::addAssign(
const DenseVector<VT2,TF>& rhs )
2236 -> DisableIf_t< VectorizedAddAssign_v<VT2> >
2240 const size_t ipos(
size() &
size_t(-2) );
2241 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2242 vector_[offset()+i ] += (~rhs)[i ];
2243 vector_[offset()+i+1UL] += (~rhs)[i+1UL];
2245 if( ipos <
size() ) {
2246 vector_[offset()+ipos] += (~rhs)[ipos];
2265 template<
typename VT
2268 template<
typename VT2 >
2269 inline auto Subvector<VT,unaligned,TF,true,CSAs...>::addAssign(
const DenseVector<VT2,TF>& rhs )
2270 -> EnableIf_t< VectorizedAddAssign_v<VT2> >
2276 const size_t ipos(
size() &
size_t(-SIMDSIZE) );
2281 ConstIterator_t<VT2> right( (~rhs).
begin() );
2283 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2284 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2285 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2286 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2287 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2289 for( ; i<ipos; i+=SIMDSIZE ) {
2290 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2292 for( ; i<
size(); ++i ) {
2293 *left += *right; ++left; ++right;
2312 template<
typename VT
2315 template<
typename VT2 >
2316 inline void Subvector<VT,unaligned,TF,true,CSAs...>::addAssign(
const SparseVector<VT2,TF>& rhs )
2320 for( ConstIterator_t<VT2> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2321 vector_[offset()+element->index()] += element->value();
2339 template<
typename VT
2342 template<
typename VT2 >
2343 inline auto Subvector<VT,unaligned,TF,true,CSAs...>::subAssign(
const DenseVector<VT2,TF>& rhs )
2344 -> DisableIf_t< VectorizedSubAssign_v<VT2> >
2348 const size_t ipos(
size() &
size_t(-2) );
2349 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2350 vector_[offset()+i ] -= (~rhs)[i ];
2351 vector_[offset()+i+1UL] -= (~rhs)[i+1UL];
2353 if( ipos <
size() ) {
2354 vector_[offset()+ipos] -= (~rhs)[ipos];
2373 template<
typename VT
2376 template<
typename VT2 >
2377 inline auto Subvector<VT,unaligned,TF,true,CSAs...>::subAssign(
const DenseVector<VT2,TF>& rhs )
2378 -> EnableIf_t< VectorizedSubAssign_v<VT2> >
2384 const size_t ipos(
size() &
size_t(-SIMDSIZE) );
2389 ConstIterator_t<VT2> right( (~rhs).
begin() );
2391 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2392 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2393 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2394 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2395 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2397 for( ; i<ipos; i+=SIMDSIZE ) {
2398 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2400 for( ; i<
size(); ++i ) {
2401 *left -= *right; ++left; ++right;
2420 template<
typename VT
2423 template<
typename VT2 >
2424 inline void Subvector<VT,unaligned,TF,true,CSAs...>::subAssign(
const SparseVector<VT2,TF>& rhs )
2428 for( ConstIterator_t<VT2> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2429 vector_[offset()+element->index()] -= element->value();
2447 template<
typename VT
2450 template<
typename VT2 >
2451 inline auto Subvector<VT,unaligned,TF,true,CSAs...>::multAssign(
const DenseVector<VT2,TF>& rhs )
2452 -> DisableIf_t< VectorizedMultAssign_v<VT2> >
2456 const size_t ipos(
size() &
size_t(-2) );
2457 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2458 vector_[offset()+i ] *= (~rhs)[i ];
2459 vector_[offset()+i+1UL] *= (~rhs)[i+1UL];
2461 if( ipos <
size() ) {
2462 vector_[offset()+ipos] *= (~rhs)[ipos];
2481 template<
typename VT
2484 template<
typename VT2 >
2485 inline auto Subvector<VT,unaligned,TF,true,CSAs...>::multAssign(
const DenseVector<VT2,TF>& rhs )
2486 -> EnableIf_t< VectorizedMultAssign_v<VT2> >
2492 const size_t ipos(
size() &
size_t(-SIMDSIZE) );
2497 ConstIterator_t<VT2> right( (~rhs).
begin() );
2499 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2500 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2501 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2502 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2503 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2505 for( ; i<ipos; i+=SIMDSIZE ) {
2506 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2508 for( ; i<
size(); ++i ) {
2509 *left *= *right; ++left; ++right;
2528 template<
typename VT
2531 template<
typename VT2 >
2532 inline void Subvector<VT,unaligned,TF,true,CSAs...>::multAssign(
const SparseVector<VT2,TF>& rhs )
2540 for( ConstIterator_t<VT2> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element ) {
2541 const size_t index( element->index() );
2542 for( ; i<index; ++i )
2543 reset( vector_[offset()+i] );
2544 vector_[offset()+i] *= element->value();
2548 for( ; i<
size(); ++i ) {
2549 reset( vector_[offset()+i] );
2568 template<
typename VT
2571 template<
typename VT2 >
2572 inline auto Subvector<VT,unaligned,TF,true,CSAs...>::divAssign(
const DenseVector<VT2,TF>& rhs )
2573 -> DisableIf_t< VectorizedDivAssign_v<VT2> >
2577 const size_t ipos(
size() &
size_t(-2) );
2578 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2579 vector_[offset()+i ] /= (~rhs)[i ];
2580 vector_[offset()+i+1UL] /= (~rhs)[i+1UL];
2582 if( ipos <
size() ) {
2583 vector_[offset()+ipos] /= (~rhs)[ipos];
2602 template<
typename VT
2605 template<
typename VT2 >
2606 inline auto Subvector<VT,unaligned,TF,true,CSAs...>::divAssign(
const DenseVector<VT2,TF>& rhs )
2607 -> EnableIf_t< VectorizedDivAssign_v<VT2> >
2613 const size_t ipos(
size() &
size_t(-SIMDSIZE) );
2618 ConstIterator_t<VT2> right( (~rhs).
begin() );
2620 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2621 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2622 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2623 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2624 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2626 for( ; i<ipos; i+=SIMDSIZE ) {
2627 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2629 for( ; i<
size(); ++i ) {
2630 *left /= *right; ++left; ++right;
2657 template<
typename VT
2660 class Subvector<VT,
aligned,TF,true,CSAs...>
2661 :
public View< DenseVector< Subvector<VT,aligned,TF,true,CSAs...>, TF > >
2662 ,
private SubvectorData<CSAs...>
2666 using DataType = SubvectorData<CSAs...>;
2667 using Operand = If_t< IsExpression_v<VT>, VT, VT& >;
2673 using This = Subvector<VT,
aligned,TF,
true,CSAs...>;
2675 using BaseType = DenseVector<This,TF>;
2676 using ViewedType = VT;
2680 using SIMDType = SIMDTrait_t<ElementType>;
2691 using ConstPointer = ConstPointer_t<VT>;
2694 using Pointer = If_t< IsConst_v<VT> || !HasMutableDataAccess_v<VT>, ConstPointer, Pointer_t<VT> >;
2705 static constexpr
bool simdEnabled = VT::simdEnabled;
2714 template<
typename... RSAs >
2715 explicit inline Subvector( VT& vector, RSAs... args );
2717 Subvector(
const Subvector& ) =
default;
2724 ~Subvector() =
default;
2731 inline Reference operator[](
size_t index );
2735 inline Pointer
data () noexcept;
2736 inline ConstPointer
data () const noexcept;
2749 inline Subvector& operator= ( const
ElementType& rhs );
2750 inline Subvector& operator= ( initializer_list<
ElementType> list );
2751 inline Subvector& operator= ( const Subvector& rhs );
2752 template< typename VT2 > inline Subvector& operator= ( const Vector<VT2,TF>& rhs );
2753 template< typename VT2 > inline Subvector& operator+=( const Vector<VT2,TF>& rhs );
2754 template< typename VT2 > inline Subvector& operator-=( const Vector<VT2,TF>& rhs );
2755 template< typename VT2 > inline Subvector& operator*=( const Vector<VT2,TF>& rhs );
2756 template< typename VT2 > inline Subvector& operator/=( const DenseVector<VT2,TF>& rhs );
2757 template< typename VT2 > inline Subvector& operator%=( const Vector<VT2,TF>& rhs );
2764 using DataType::offset;
2765 using DataType::
size;
2767 inline VT& operand() noexcept;
2768 inline const VT& operand() const noexcept;
2770 inline
size_t spacing() const noexcept;
2771 inline
size_t capacity() const noexcept;
2773 inline
void reset();
2780 template< typename Other > inline Subvector& scale( const Other& scalar );
2787 template< typename VT2 >
2788 static constexpr
bool VectorizedAssign_v =
2789 ( useOptimizedKernels &&
2790 simdEnabled && VT2::simdEnabled &&
2796 template< typename VT2 >
2797 static constexpr
bool VectorizedAddAssign_v =
2798 ( useOptimizedKernels &&
2799 simdEnabled && VT2::simdEnabled &&
2806 template< typename VT2 >
2807 static constexpr
bool VectorizedSubAssign_v =
2808 ( useOptimizedKernels &&
2809 simdEnabled && VT2::simdEnabled &&
2816 template< typename VT2 >
2817 static constexpr
bool VectorizedMultAssign_v =
2818 ( useOptimizedKernels &&
2819 simdEnabled && VT2::simdEnabled &&
2826 template< typename VT2 >
2827 static constexpr
bool VectorizedDivAssign_v =
2828 ( useOptimizedKernels &&
2829 simdEnabled && VT2::simdEnabled &&
2843 template< typename Other >
2844 inline
bool canAlias( const Other* alias ) const noexcept;
2846 template< typename VT2,
AlignmentFlag AF2,
bool TF2,
size_t... CSAs2 >
2847 inline
bool canAlias( const Subvector<VT2,AF2,TF2,true,CSAs2...>* alias ) const noexcept;
2849 template< typename Other >
2850 inline
bool isAliased( const Other* alias ) const noexcept;
2852 template< typename VT2,
AlignmentFlag AF2,
bool TF2,
size_t... CSAs2 >
2853 inline
bool isAliased( const Subvector<VT2,AF2,TF2,true,CSAs2...>* alias ) const noexcept;
2855 inline
bool isAligned () const noexcept;
2856 inline
bool canSMPAssign() const noexcept;
2867 template< typename VT2 >
2868 inline auto assign( const DenseVector <VT2,TF>& rhs ) ->
DisableIf_t< VectorizedAssign_v<VT2> >;
2870 template< typename VT2 >
2871 inline auto assign( const DenseVector <VT2,TF>& rhs ) ->
EnableIf_t< VectorizedAssign_v<VT2> >;
2873 template< typename VT2 > inline
void assign( const SparseVector<VT2,TF>& rhs );
2875 template< typename VT2 >
2876 inline auto addAssign( const DenseVector <VT2,TF>& rhs ) ->
DisableIf_t< VectorizedAddAssign_v<VT2> >;
2878 template< typename VT2 >
2879 inline auto addAssign ( const DenseVector <VT2,TF>& rhs ) ->
EnableIf_t< VectorizedAddAssign_v<VT2> >;
2881 template< typename VT2 > inline
void addAssign( const SparseVector<VT2,TF>& rhs );
2883 template< typename VT2 >
2884 inline auto subAssign ( const DenseVector <VT2,TF>& rhs ) ->
DisableIf_t< VectorizedSubAssign_v<VT2> >;
2886 template< typename VT2 >
2887 inline auto subAssign( const DenseVector <VT2,TF>& rhs ) ->
EnableIf_t< VectorizedSubAssign_v<VT2> >;
2889 template< typename VT2 > inline
void subAssign( const SparseVector<VT2,TF>& rhs );
2891 template< typename VT2 >
2892 inline auto multAssign( const DenseVector <VT2,TF>& rhs ) ->
DisableIf_t< VectorizedMultAssign_v<VT2> >;
2894 template< typename VT2 >
2895 inline auto multAssign( const DenseVector <VT2,TF>& rhs ) ->
EnableIf_t< VectorizedMultAssign_v<VT2> >;
2897 template< typename VT2 > inline
void multAssign( const SparseVector<VT2,TF>& rhs );
2899 template< typename VT2 >
2900 inline auto divAssign( const DenseVector <VT2,TF>& rhs ) ->
DisableIf_t< VectorizedDivAssign_v<VT2> >;
2902 template< typename VT2 >
2903 inline auto divAssign( const DenseVector <VT2,TF>& rhs ) ->
EnableIf_t< VectorizedDivAssign_v<VT2> >;
2916 template< typename VT2,
AlignmentFlag AF2,
bool TF2,
bool DF2,
size_t... CSAs2 > friend class Subvector;
2953 template< typename VT
2956 template< typename... RSAs >
2957 inline Subvector<VT,
aligned,TF,true,CSAs...>::Subvector( VT& vector, RSAs... args )
2958 : DataType( args... )
2959 , vector_ ( vector )
2963 if( offset() +
size() > vector.size() ) {
2996 template<
typename VT
3000 Subvector<VT,aligned,TF,true,CSAs...>::operator[](
size_t index )
3003 return vector_[offset()+index];
3016 template<
typename VT
3020 Subvector<VT,aligned,TF,true,CSAs...>::operator[](
size_t index )
const 3023 return const_cast<const VT&
>( vector_ )[offset()+index];
3040 template<
typename VT
3044 Subvector<VT,aligned,TF,true,CSAs...>::at(
size_t index )
3046 if( index >=
size() ) {
3049 return (*
this)[index];
3066 template<
typename VT
3070 Subvector<VT,aligned,TF,true,CSAs...>::at(
size_t index )
const 3072 if( index >=
size() ) {
3075 return (*
this)[index];
3089 template<
typename VT
3092 inline typename Subvector<VT,
aligned,TF,
true,CSAs...>::Pointer
3095 return vector_.data() + offset();
3109 template<
typename VT
3112 inline typename Subvector<VT,
aligned,TF,
true,CSAs...>::ConstPointer
3115 return vector_.data() + offset();
3129 template<
typename VT
3135 return ( vector_.begin() + offset() );
3149 template<
typename VT
3155 return ( vector_.cbegin() + offset() );
3169 template<
typename VT
3175 return ( vector_.cbegin() + offset() );
3189 template<
typename VT
3195 return ( vector_.begin() + offset() +
size() );
3209 template<
typename VT
3215 return ( vector_.cbegin() + offset() +
size() );
3229 template<
typename VT
3235 return ( vector_.cbegin() + offset() +
size() );
3256 template<
typename VT
3259 inline Subvector<VT,
aligned,TF,
true,CSAs...>&
3260 Subvector<VT,aligned,TF,true,CSAs...>::operator=(
const ElementType& rhs )
3262 const size_t iend( offset() +
size() );
3263 decltype(
auto) left( derestrict( vector_ ) );
3265 for(
size_t i=offset(); i<iend; ++i ) {
3266 if( !IsRestricted_v<VT> || trySet( vector_, i, rhs ) )
3289 template<
typename VT
3292 inline Subvector<VT,
aligned,TF,
true,CSAs...>&
3293 Subvector<VT,aligned,TF,true,CSAs...>::operator=( initializer_list<ElementType> list )
3295 if( list.size() >
size() ) {
3299 if( IsRestricted_v<VT> ) {
3300 const InitializerVector<ElementType,TF> tmp( list,
size() );
3301 if( !tryAssign( vector_, tmp, offset() ) ) {
3306 decltype(
auto) left( derestrict( *this ) );
3330 template< typename VT
3333 inline Subvector<VT,
aligned,TF,true,CSAs...>&
3334 Subvector<VT,
aligned,TF,true,CSAs...>::operator=( const Subvector& rhs )
3339 if( &rhs ==
this || ( &vector_ == &rhs.vector_ && offset() == rhs.offset() ) )
3342 if(
size() != rhs.size() ) {
3346 if( !tryAssign( vector_, rhs, offset() ) ) {
3350 decltype(
auto) left( derestrict( *this ) );
3352 if( rhs.canAlias( &vector_ ) ) {
3380 template<
typename VT
3383 template<
typename VT2 >
3384 inline Subvector<VT,
aligned,TF,
true,CSAs...>&
3385 Subvector<VT,aligned,TF,true,CSAs...>::operator=(
const Vector<VT2,TF>& rhs )
3394 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
3395 Right right( ~rhs );
3397 if( !tryAssign( vector_, right, offset() ) ) {
3401 decltype(
auto) left( derestrict( *this ) );
3404 const ResultType_t<VT2> tmp( right );
3408 if( IsSparseVector_v<VT2> )
3433 template<
typename VT
3436 template<
typename VT2 >
3437 inline Subvector<VT,
aligned,TF,
true,CSAs...>&
3447 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
3448 Right right( ~rhs );
3450 if( !tryAddAssign( vector_, right, offset() ) ) {
3454 decltype(
auto) left( derestrict( *this ) );
3457 const ResultType_t<VT2> tmp( right );
3484 template<
typename VT
3487 template<
typename VT2 >
3488 inline Subvector<VT,
aligned,TF,
true,CSAs...>&
3498 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
3499 Right right( ~rhs );
3501 if( !trySubAssign( vector_, right, offset() ) ) {
3505 decltype(
auto) left( derestrict( *this ) );
3508 const ResultType_t<VT2> tmp( right );
3536 template<
typename VT
3539 template<
typename VT2 >
3540 inline Subvector<VT,
aligned,TF,
true,CSAs...>&
3550 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
3551 Right right( ~rhs );
3553 if( !tryMultAssign( vector_, right, offset() ) ) {
3557 decltype(
auto) left( derestrict( *this ) );
3560 const ResultType_t<VT2> tmp( right );
3587 template<
typename VT
3590 template<
typename VT2 >
3591 inline Subvector<VT,
aligned,TF,
true,CSAs...>&
3601 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
3602 Right right( ~rhs );
3604 if( !tryDivAssign( vector_, right, offset() ) ) {
3608 decltype(
auto) left( derestrict( *this ) );
3611 const ResultType_t<VT2> tmp( right );
3639 template<
typename VT
3642 template<
typename VT2 >
3643 inline Subvector<VT,
aligned,TF,
true,CSAs...>&
3644 Subvector<VT,aligned,TF,true,CSAs...>::operator%=(
const Vector<VT2,TF>& rhs )
3646 using blaze::assign;
3651 using CrossType = CrossTrait_t< ResultType, ResultType_t<VT2> >;
3657 if(
size() != 3UL || (~rhs).
size() != 3UL ) {
3661 const CrossType tmp( *
this % (~rhs) );
3663 if( !tryAssign( vector_, tmp, offset() ) ) {
3667 decltype(
auto) left( derestrict( *this ) );
3669 assign( left, tmp );
3693 template< typename VT
3696 inline VT& Subvector<VT,
aligned,TF,true,CSAs...>::operand() noexcept
3710 template<
typename VT
3713 inline const VT& Subvector<VT,aligned,TF,true,CSAs...>::operand() const noexcept
3730 template<
typename VT
3735 return vector_.spacing() - offset();
3747 template<
typename VT
3752 return vector_.capacity() - offset();
3767 template<
typename VT
3772 size_t nonzeros( 0 );
3774 const size_t iend( offset() +
size() );
3775 for(
size_t i=offset(); i<iend; ++i ) {
3792 template<
typename VT
3799 const size_t iend( offset() +
size() );
3800 for(
size_t i=offset(); i<iend; ++i )
3801 clear( vector_[i] );
3826 template<
typename VT
3829 template<
typename Other >
3830 inline Subvector<VT,
aligned,TF,
true,CSAs...>&
3831 Subvector<VT,aligned,TF,true,CSAs...>::scale(
const Other& scalar )
3833 const size_t iend( offset() +
size() );
3834 for(
size_t i=offset(); i<iend; ++i )
3835 vector_[i] *= scalar;
3861 template<
typename VT
3864 template<
typename Other >
3865 inline bool Subvector<VT,aligned,TF,true,CSAs...>::canAlias(
const Other* alias )
const noexcept
3867 return vector_.isAliased( alias );
3884 template<
typename VT
3887 template<
typename VT2
3892 Subvector<VT,aligned,TF,true,CSAs...>::canAlias(
const Subvector<VT2,AF2,TF2,true,CSAs2...>* alias )
const noexcept
3894 return ( vector_.isAliased( &alias->vector_ ) &&
3895 ( offset() +
size() > alias->offset() ) &&
3896 ( offset() < alias->offset() + alias->size() ) );
3913 template<
typename VT
3916 template<
typename Other >
3917 inline bool Subvector<VT,aligned,TF,true,CSAs...>::isAliased(
const Other* alias )
const noexcept
3919 return vector_.isAliased( alias );
3936 template<
typename VT
3939 template<
typename VT2
3944 Subvector<VT,aligned,TF,true,CSAs...>::isAliased(
const Subvector<VT2,AF2,TF2,true,CSAs2...>* alias )
const noexcept
3946 return ( vector_.isAliased( &alias->vector_ ) &&
3947 ( offset() +
size() > alias->offset() ) &&
3948 ( offset() < alias->offset() + alias->size() ) );
3964 template<
typename VT
3967 inline bool Subvector<VT,aligned,TF,true,CSAs...>::isAligned() const noexcept
3986 template<
typename VT
3989 inline bool Subvector<VT,aligned,TF,true,CSAs...>::canSMPAssign() const noexcept
3991 return (
size() > SMP_DVECASSIGN_THRESHOLD );
4011 template<
typename VT
4015 Subvector<VT,aligned,TF,true,CSAs...>::load(
size_t index )
const noexcept
4017 return loada( index );
4037 template<
typename VT
4049 return vector_.loada( offset()+index );
4069 template<
typename VT
4081 return vector_.loadu( offset()+index );
4102 template<
typename VT
4106 Subvector<VT,aligned,TF,true,CSAs...>::store(
size_t index,
const SIMDType& value ) noexcept
4129 template<
typename VT
4141 vector_.storea( offset()+index, value );
4162 template<
typename VT
4174 vector_.storeu( offset()+index, value );
4195 template<
typename VT
4207 vector_.stream( offset()+index, value );
4225 template<
typename VT
4228 template<
typename VT2 >
4229 inline auto Subvector<VT,aligned,TF,true,CSAs...>::assign(
const DenseVector<VT2,TF>& rhs )
4230 -> DisableIf_t< VectorizedAssign_v<VT2> >
4234 const size_t ipos(
size() &
size_t(-2) );
4235 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4236 vector_[offset()+i ] = (~rhs)[i ];
4237 vector_[offset()+i+1UL] = (~rhs)[i+1UL];
4239 if( ipos <
size() ) {
4240 vector_[offset()+ipos] = (~rhs)[ipos];
4259 template<
typename VT
4262 template<
typename VT2 >
4263 inline auto Subvector<VT,aligned,TF,true,CSAs...>::assign(
const DenseVector<VT2,TF>& rhs )
4264 -> EnableIf_t< VectorizedAssign_v<VT2> >
4270 const size_t ipos(
size() &
size_t(-SIMDSIZE) );
4275 ConstIterator_t<VT2> right( (~rhs).
begin() );
4277 if( useStreaming &&
size() > ( cacheSize/(
sizeof(
ElementType) * 3UL ) ) && !(~rhs).isAliased( &vector_ ) )
4279 for( ; i<ipos; i+=SIMDSIZE ) {
4280 left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4282 for( ; i<
size(); ++i ) {
4283 *left = *right; ++left; ++right;
4288 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
4289 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4290 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4291 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4292 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4294 for( ; i<ipos; i+=SIMDSIZE ) {
4295 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4297 for( ; i<
size(); ++i ) {
4298 *left = *right; ++left; ++right;
4318 template<
typename VT
4321 template<
typename VT2 >
4322 inline void Subvector<VT,aligned,TF,true,CSAs...>::assign(
const SparseVector<VT2,TF>& rhs )
4326 for( ConstIterator_t<VT2> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
4327 vector_[offset()+element->index()] = element->value();
4345 template<
typename VT
4348 template<
typename VT2 >
4349 inline auto Subvector<VT,aligned,TF,true,CSAs...>::addAssign(
const DenseVector<VT2,TF>& rhs )
4350 -> DisableIf_t< VectorizedAddAssign_v<VT2> >
4354 const size_t ipos(
size() &
size_t(-2) );
4355 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4356 vector_[offset()+i ] += (~rhs)[i ];
4357 vector_[offset()+i+1UL] += (~rhs)[i+1UL];
4359 if( ipos <
size() ) {
4360 vector_[offset()+ipos] += (~rhs)[ipos];
4379 template<
typename VT
4382 template<
typename VT2 >
4383 inline auto Subvector<VT,aligned,TF,true,CSAs...>::addAssign(
const DenseVector<VT2,TF>& rhs )
4384 -> EnableIf_t< VectorizedAddAssign_v<VT2> >
4390 const size_t ipos(
size() &
size_t(-SIMDSIZE) );
4395 ConstIterator_t<VT2> right( (~rhs).
begin() );
4397 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
4398 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4399 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4400 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4401 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4403 for( ; i<ipos; i+=SIMDSIZE ) {
4404 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4406 for( ; i<
size(); ++i ) {
4407 *left += *right; ++left; ++right;
4426 template<
typename VT
4429 template<
typename VT2 >
4430 inline void Subvector<VT,aligned,TF,true,CSAs...>::addAssign(
const SparseVector<VT2,TF>& rhs )
4434 for( ConstIterator_t<VT2> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
4435 vector_[offset()+element->index()] += element->value();
4453 template<
typename VT
4456 template<
typename VT2 >
4457 inline auto Subvector<VT,aligned,TF,true,CSAs...>::subAssign(
const DenseVector<VT2,TF>& rhs )
4458 -> DisableIf_t< VectorizedSubAssign_v<VT2> >
4462 const size_t ipos(
size() &
size_t(-2) );
4463 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4464 vector_[offset()+i ] -= (~rhs)[i ];
4465 vector_[offset()+i+1UL] -= (~rhs)[i+1UL];
4467 if( ipos <
size() ) {
4468 vector_[offset()+ipos] -= (~rhs)[ipos];
4487 template<
typename VT
4490 template<
typename VT2 >
4491 inline auto Subvector<VT,aligned,TF,true,CSAs...>::subAssign(
const DenseVector<VT2,TF>& rhs )
4492 -> EnableIf_t< VectorizedSubAssign_v<VT2> >
4498 const size_t ipos(
size() &
size_t(-SIMDSIZE) );
4503 ConstIterator_t<VT2> right( (~rhs).
begin() );
4505 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
4506 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4507 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4508 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4509 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4511 for( ; i<ipos; i+=SIMDSIZE ) {
4512 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4514 for( ; i<
size(); ++i ) {
4515 *left -= *right; ++left; ++right;
4534 template<
typename VT
4537 template<
typename VT2 >
4538 inline void Subvector<VT,aligned,TF,true,CSAs...>::subAssign(
const SparseVector<VT2,TF>& rhs )
4542 for( ConstIterator_t<VT2> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
4543 vector_[offset()+element->index()] -= element->value();
4561 template<
typename VT
4564 template<
typename VT2 >
4565 inline auto Subvector<VT,aligned,TF,true,CSAs...>::multAssign(
const DenseVector<VT2,TF>& rhs )
4566 -> DisableIf_t< VectorizedMultAssign_v<VT2> >
4570 const size_t ipos(
size() &
size_t(-2) );
4571 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4572 vector_[offset()+i ] *= (~rhs)[i ];
4573 vector_[offset()+i+1UL] *= (~rhs)[i+1UL];
4575 if( ipos <
size() ) {
4576 vector_[offset()+ipos] *= (~rhs)[ipos];
4595 template<
typename VT
4598 template<
typename VT2 >
4599 inline auto Subvector<VT,aligned,TF,true,CSAs...>::multAssign(
const DenseVector<VT2,TF>& rhs )
4600 -> EnableIf_t< VectorizedMultAssign_v<VT2> >
4606 const size_t ipos(
size() &
size_t(-SIMDSIZE) );
4611 ConstIterator_t<VT2> right( (~rhs).
begin() );
4613 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
4614 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4615 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4616 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4617 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4619 for( ; i<ipos; i+=SIMDSIZE ) {
4620 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4622 for( ; i<
size(); ++i ) {
4623 *left *= *right; ++left; ++right;
4642 template<
typename VT
4645 template<
typename VT2 >
4646 inline void Subvector<VT,aligned,TF,true,CSAs...>::multAssign(
const SparseVector<VT2,TF>& rhs )
4654 for( ConstIterator_t<VT2> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element ) {
4655 const size_t index( element->index() );
4656 for( ; i<index; ++i )
4657 reset( vector_[offset()+i] );
4658 vector_[offset()+i] *= element->value();
4662 for( ; i<
size(); ++i ) {
4663 reset( vector_[offset()+i] );
4682 template<
typename VT
4685 template<
typename VT2 >
4686 inline auto Subvector<VT,aligned,TF,true,CSAs...>::divAssign(
const DenseVector<VT2,TF>& rhs )
4687 -> DisableIf_t< VectorizedDivAssign_v<VT2> >
4691 const size_t ipos(
size() &
size_t(-2) );
4692 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4693 vector_[offset()+i ] /= (~rhs)[i ];
4694 vector_[offset()+i+1UL] /= (~rhs)[i+1UL];
4696 if( ipos <
size() ) {
4697 vector_[offset()+ipos] /= (~rhs)[ipos];
4716 template<
typename VT
4719 template<
typename VT2 >
4720 inline auto Subvector<VT,aligned,TF,true,CSAs...>::divAssign(
const DenseVector<VT2,TF>& rhs )
4721 -> EnableIf_t< VectorizedDivAssign_v<VT2> >
4727 const size_t ipos(
size() &
size_t(-SIMDSIZE) );
4732 ConstIterator_t<VT2> right( (~rhs).
begin() );
4734 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
4735 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4736 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4737 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4738 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4740 for( ; i<ipos; i+=SIMDSIZE ) {
4741 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
4743 for( ; i<
size(); ++i ) {
4744 *left /= *right; ++left; ++right;
4771 template<
typename VT1
4775 class Subvector< DVecDVecCrossExpr<VT1,VT2,TF>,
unaligned, TF, true, CSAs... >
4776 :
public View< DenseVector< Subvector< DVecDVecCrossExpr<VT1,VT2,TF>, unaligned, TF, true, CSAs... >, TF > >
4777 ,
private SubvectorData<CSAs...>
4781 using CPE = DVecDVecCrossExpr<VT1,VT2,TF>;
4782 using RT = ResultType_t<CPE>;
4783 using DataType = SubvectorData<CSAs...>;
4791 using BaseType = DenseVector<This,TF>;
4792 using ViewedType = CPE;
4802 static constexpr
bool simdEnabled =
false;
4815 template<
typename... RSAs >
4816 explicit inline Subvector(
const CPE& vector, RSAs... args )
4817 : DataType( args... )
4818 , vector_ ( vector )
4821 if( offset() +
size() > vector.size() ) {
4837 inline ReturnType operator[](
size_t index )
const {
4839 return vector_[offset()+index];
4851 if( index >=
size() ) {
4854 return (*
this)[index];
4859 using DataType::offset;
4868 inline CPE operand() const noexcept {
4879 template<
typename T >
4880 inline bool canAlias(
const T* alias )
const noexcept {
4881 return vector_.canAlias( alias );
4891 template<
typename T >
4892 inline bool isAliased(
const T* alias )
const noexcept {
4893 return vector_.isAliased( alias );
4926 template<
typename VT1
4930 class Subvector< DVecSVecCrossExpr<VT1,VT2,TF>,
unaligned, TF, true, CSAs... >
4931 :
public View< DenseVector< Subvector< DVecSVecCrossExpr<VT1,VT2,TF>, unaligned, TF, true, CSAs... >, TF > >
4932 ,
private SubvectorData<CSAs...>
4936 using CPE = DVecSVecCrossExpr<VT1,VT2,TF>;
4937 using RT = ResultType_t<CPE>;
4938 using DataType = SubvectorData<CSAs...>;
4946 using BaseType = DenseVector<This,TF>;
4947 using ViewedType = CPE;
4957 static constexpr
bool simdEnabled =
false;
4970 template<
typename... RSAs >
4971 explicit inline Subvector(
const CPE& vector, RSAs... args )
4972 : DataType( args... )
4973 , vector_ ( vector )
4976 if( offset() +
size() > vector.size() ) {
4992 inline ReturnType operator[](
size_t index )
const {
4994 return vector_[offset()+index];
5006 if( index >=
size() ) {
5009 return (*
this)[index];
5014 using DataType::offset;
5023 inline CPE operand() const noexcept {
5034 template<
typename T >
5035 inline bool canAlias(
const T* alias )
const noexcept {
5036 return vector_.canAlias( alias );
5046 template<
typename T >
5047 inline bool isAliased(
const T* alias )
const noexcept {
5048 return vector_.isAliased( alias );
5081 template<
typename VT1
5085 class Subvector< SVecDVecCrossExpr<VT1,VT2,TF>,
unaligned, TF, true, CSAs... >
5086 :
public View< DenseVector< Subvector< SVecDVecCrossExpr<VT1,VT2,TF>, unaligned, TF, true, CSAs... >, TF > >
5087 ,
private SubvectorData<CSAs...>
5091 using CPE = SVecDVecCrossExpr<VT1,VT2,TF>;
5092 using RT = ResultType_t<CPE>;
5093 using DataType = SubvectorData<CSAs...>;
5101 using BaseType = DenseVector<This,TF>;
5102 using ViewedType = CPE;
5112 static constexpr
bool simdEnabled =
false;
5125 template<
typename... RSAs >
5126 explicit inline Subvector(
const CPE& vector, RSAs... args )
5127 : DataType( args... )
5128 , vector_ ( vector )
5131 if( offset() +
size() > vector.size() ) {
5147 inline ReturnType operator[](
size_t index )
const {
5149 return vector_[offset()+index];
5161 if( index >=
size() ) {
5164 return (*
this)[index];
5169 using DataType::offset;
5178 inline CPE operand() const noexcept {
5189 template<
typename T >
5190 inline bool canAlias(
const T* alias )
const noexcept {
5191 return vector_.canAlias( alias );
5201 template<
typename T >
5202 inline bool isAliased(
const T* alias )
const noexcept {
5203 return vector_.isAliased( alias );
5236 template<
typename VT1
5240 class Subvector< SVecSVecCrossExpr<VT1,VT2,TF>,
unaligned, TF, true, CSAs... >
5241 :
public View< DenseVector< Subvector< SVecSVecCrossExpr<VT1,VT2,TF>, unaligned, TF, true, CSAs... >, TF > >
5242 ,
private SubvectorData<CSAs...>
5246 using CPE = SVecSVecCrossExpr<VT1,VT2,TF>;
5247 using RT = ResultType_t<CPE>;
5248 using DataType = SubvectorData<CSAs...>;
5256 using BaseType = DenseVector<This,TF>;
5257 using ViewedType = CPE;
5267 static constexpr
bool simdEnabled =
false;
5280 template<
typename... RSAs >
5281 explicit inline Subvector(
const CPE& vector, RSAs... args )
5282 : DataType( args... )
5283 , vector_ ( vector )
5286 if( offset() +
size() > vector.size() ) {
5302 inline ReturnType operator[](
size_t index )
const {
5304 return vector_[offset()+index];
5316 if( index >=
size() ) {
5319 return (*
this)[index];
5324 using DataType::offset;
5333 inline CPE operand() const noexcept {
5344 template<
typename T >
5345 inline bool canAlias(
const T* alias )
const noexcept {
5346 return vector_.canAlias( alias );
5356 template<
typename T >
5357 inline bool isAliased(
const T* alias )
const {
5358 return vector_.isAliased( alias );
AlignmentFlag
Alignment flag for (un-)aligned vectors and matrices.Via these flags it is possible to specify subvec...
Definition: AlignmentFlag.h:62
Constraint on the data type.
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Constraint on the data type.
Header file for auxiliary alias declarations.
Header file for the blaze::checked and blaze::unchecked instances.
constexpr bool IsContiguous_v
Auxiliary variable template for the IsContiguous type trait.The IsContiguous_v variable template prov...
Definition: IsContiguous.h:145
#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
auto operator/=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:354
Header file for the alignment flag values.
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:546
Header file for basic type definitions.
constexpr const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:750
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:169
Header file for the View base class.
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.The HasSIMDSub_v variable template provides...
Definition: HasSIMDSub.h:188
#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:81
constexpr bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:332
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3077
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3079
Header file for the DenseVector base class.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3084
constexpr bool IsReference_v
Auxiliary variable template for the IsReference type trait.The IsReference_v variable template provid...
Definition: IsReference.h:95
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
Header file for the Computation base class.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
#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:81
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:75
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:482
MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:416
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
auto smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:220
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:252
Constraint on the data type.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Header file for the DisableIf class template.
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.The IsSIMDCombinable_v variable templ...
Definition: IsSIMDCombinable.h:137
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3083
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the If class template.
Header file for the implementation of a vector representation of an initializer list.
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.The HasSIMDMult_v variable template provid...
Definition: HasSIMDMult.h:189
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3080
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the HasSIMDAdd type trait.
constexpr bool HasSIMDDiv_v
Auxiliary variable template for the HasSIMDDiv type trait.The HasSIMDDiv_v variable template provides...
Definition: HasSIMDDiv.h:172
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:370
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:446
Header file for the implementation of the Subvector base template.
Header file for the implementation of the SubvectorData class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:253
Header file for the subvector trait.
Header file for all SIMD functionality.
constexpr bool Contains_v
Auxiliary variable template for the Contains type trait.The Contains_v variable template provides a c...
Definition: Contains.h:139
Constraint on the data type.
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:78
Constraint on the data type.
#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:61
Constraint on the data type.
Header file for the exception macros of the math module.
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:438
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8908
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
Constraint on the data type.
Header file for all forward declarations for expression class templates.
typename SubvectorTrait< VT, CSAs... >::Type SubvectorTrait_t
Auxiliary alias declaration for the SubvectorTrait type trait.The SubvectorTrait_t alias declaration ...
Definition: SubvectorTrait.h:171
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:611
Header file for the CrossExpr base class.
Flag for aligned vectors and matrices.
Definition: AlignmentFlag.h:65
Header file for the IsSIMDCombinable type trait.
Header file for the IsSparseVector type trait.
Header file for the HasSIMDMult type trait.
Header file for the IsConst type trait.
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Header file for the cross product trait.
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
Header file for the Unique class template.
Header file for the IsContiguous type trait.
Check< false > Unchecked
Type of the blaze::unchecked instance.blaze::Unchecked is the type of the blaze::unchecked instance...
Definition: Check.h:96
Header file for the cache size of the target architecture.
Header file for the isDefault shim.
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
Header file for the HasSIMDSub type trait.
constexpr bool operator<=(const NegativeAccuracy< A > &, const T &rhs)
Less-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:408
Header file for the HasMutableDataAccess type trait.
#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:81
constexpr const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:718
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:74
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
#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:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SUBVECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is a subvector type (i.e. a dense or sparse subvector), a compilation error is created.
Definition: Subvector.h:81
Header file for the HasSIMDDiv type trait.
Flag for unaligned vectors and matrices.
Definition: AlignmentFlag.h:64
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3082
Header file for the alignment check function.
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.The HasSIMDAdd_v variable template provides...
Definition: HasSIMDAdd.h:188
auto operator*=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:290
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:631
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
Header file for the IsRestricted type trait.
System settings for the inline keywords.
#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:63
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
auto smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:191
Header file for the clear shim.
Header file for the IsExpression type trait class.