35 #ifndef _BLAZE_MATH_VIEWS_SUBVECTOR_SPARSE_H_
36 #define _BLAZE_MATH_VIEWS_SUBVECTOR_SPARSE_H_
97 class Subvector<VT,AF,TF,false>
98 :
public SparseVector< Subvector<VT,AF,TF,false>, TF >
104 typedef If_< IsExpression<VT>, VT, VT& > Operand;
109 typedef Subvector<VT,AF,TF,false>
This;
110 typedef SparseVector<This,TF>
BaseType;
127 template<
typename VectorType
128 ,
typename IteratorType >
129 class SubvectorElement :
private SparseElement
139 enum :
bool { returnConst = IsConst<VectorType>::value };
144 typedef typename std::iterator_traits<IteratorType>::value_type SET;
146 typedef Reference_<SET> RT;
147 typedef ConstReference_<SET> CRT;
152 typedef ValueType_<SET> ValueType;
153 typedef size_t IndexType;
154 typedef IfTrue_<returnConst,CRT,RT>
Reference;
164 inline SubvectorElement( IteratorType pos,
size_t offset )
176 template<
typename T >
inline SubvectorElement& operator=(
const T& v ) {
188 template<
typename T >
inline SubvectorElement&
operator+=(
const T& v ) {
200 template<
typename T >
inline SubvectorElement&
operator-=(
const T& v ) {
212 template<
typename T >
inline SubvectorElement&
operator*=(
const T& v ) {
224 template<
typename T >
inline SubvectorElement&
operator/=(
const T& v ) {
235 inline const SubvectorElement* operator->()
const {
245 inline Reference value()
const {
246 return pos_->value();
255 inline IndexType index()
const {
256 return pos_->index() - offset_;
271 template<
typename VectorType
272 ,
typename IteratorType >
273 class SubvectorIterator
277 typedef std::forward_iterator_tag IteratorCategory;
278 typedef SubvectorElement<VectorType,IteratorType> ValueType;
279 typedef ValueType PointerType;
280 typedef ValueType ReferenceType;
281 typedef ptrdiff_t DifferenceType;
284 typedef IteratorCategory iterator_category;
285 typedef ValueType value_type;
286 typedef PointerType pointer;
287 typedef ReferenceType reference;
288 typedef DifferenceType difference_type;
294 inline SubvectorIterator()
306 inline SubvectorIterator( IteratorType iterator,
size_t index )
317 template<
typename VectorType2,
typename IteratorType2 >
318 inline SubvectorIterator(
const SubvectorIterator<VectorType2,IteratorType2>& it )
320 , offset_( it.offset() )
329 inline SubvectorIterator& operator++() {
340 inline const SubvectorIterator operator++(
int ) {
341 const SubvectorIterator tmp( *
this );
353 return ReferenceType( pos_, offset_ );
362 inline PointerType operator->()
const {
363 return PointerType( pos_, offset_ );
373 template<
typename VectorType2,
typename IteratorType2 >
374 inline bool operator==(
const SubvectorIterator<VectorType2,IteratorType2>& rhs )
const {
375 return base() == rhs.base();
385 template<
typename VectorType2,
typename IteratorType2 >
386 inline bool operator!=(
const SubvectorIterator<VectorType2,IteratorType2>& rhs )
const {
387 return !( *
this == rhs );
397 inline DifferenceType
operator-(
const SubvectorIterator& rhs )
const {
398 return pos_ - rhs.pos_;
407 inline IteratorType base()
const {
417 inline size_t offset() const noexcept {
432 typedef SubvectorIterator< const VT, ConstIterator_<VT> >
ConstIterator;
440 enum :
bool { smpAssignable = VT::smpAssignable };
446 explicit inline Subvector( Operand vector,
size_t index,
size_t n );
458 inline Reference operator[](
size_t index );
459 inline ConstReference operator[](
size_t index )
const;
460 inline Reference at(
size_t index );
461 inline ConstReference at(
size_t index )
const;
462 inline Iterator
begin ();
463 inline ConstIterator
begin ()
const;
464 inline ConstIterator
cbegin()
const;
465 inline Iterator
end ();
466 inline ConstIterator
end ()
const;
467 inline ConstIterator
cend ()
const;
474 inline Subvector& operator= (
const Subvector& rhs );
475 template<
typename VT2 >
inline Subvector& operator= (
const Vector<VT2,TF>& rhs );
476 template<
typename VT2 >
inline Subvector&
operator+=(
const Vector<VT2,TF>& rhs );
477 template<
typename VT2 >
inline Subvector&
operator-=(
const Vector<VT2,TF>& rhs );
478 template<
typename VT2 >
inline Subvector&
operator*=(
const Vector<VT2,TF>& rhs );
479 template<
typename VT2 >
inline Subvector&
operator/=(
const DenseVector<VT2,TF>& rhs );
481 template<
typename Other >
482 inline EnableIf_<IsNumeric<Other>, Subvector >&
operator*=( Other rhs );
484 template<
typename Other >
485 inline EnableIf_<IsNumeric<Other>, Subvector >&
operator/=( Other rhs );
492 inline size_t size() const noexcept;
493 inline
size_t capacity() const noexcept;
496 inline Iterator
set (
size_t index, const ElementType& value );
497 inline Iterator insert (
size_t index, const ElementType& value );
498 inline
void erase (
size_t index );
499 inline Iterator erase ( Iterator pos );
500 inline Iterator erase ( Iterator first, Iterator last );
501 inline
void reserve(
size_t n );
502 template< typename Other > inline Subvector& scale ( const Other& scalar );
509 inline Iterator find (
size_t index );
510 inline ConstIterator find (
size_t index ) const;
511 inline Iterator lowerBound(
size_t index );
512 inline ConstIterator lowerBound(
size_t index ) const;
513 inline Iterator upperBound(
size_t index );
514 inline ConstIterator upperBound(
size_t index ) const;
521 inline
void append(
size_t index, const ElementType& value,
bool check=false );
528 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
529 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
531 inline
bool canSMPAssign() const noexcept;
533 template< typename VT2 > inline
void assign ( const DenseVector <VT2,TF>& rhs );
534 template< typename VT2 > inline
void assign ( const SparseVector<VT2,TF>& rhs );
535 template< typename VT2 > inline
void addAssign( const DenseVector <VT2,TF>& rhs );
536 template< typename VT2 > inline
void addAssign( const SparseVector<VT2,TF>& rhs );
537 template< typename VT2 > inline
void subAssign( const DenseVector <VT2,TF>& rhs );
538 template< typename VT2 > inline
void subAssign( const SparseVector<VT2,TF>& rhs );
547 const
size_t offset_;
553 template<
bool AF1, typename VT2,
bool AF2,
bool TF2,
bool DF2 >
554 friend const Subvector<VT2,AF1,TF2,DF2>
555 subvector( const Subvector<VT2,AF2,TF2,DF2>& sv,
size_t index,
size_t size );
557 template< typename VT2,
bool AF2,
bool TF2,
bool DF2 >
558 friend
bool isIntact( const Subvector<VT2,AF2,TF2,DF2>& sv ) noexcept;
560 template< typename VT2,
bool AF2,
bool TF2,
bool DF2 >
561 friend
bool isSame( const Subvector<VT2,AF2,TF2,DF2>& a, const Vector<VT2,TF2>& b ) noexcept;
563 template< typename VT2,
bool AF2,
bool TF2,
bool DF2 >
564 friend
bool isSame( const Vector<VT2,TF2>& a, const Subvector<VT2,AF2,TF2,DF2>& b ) noexcept;
566 template< typename VT2,
bool AF2,
bool TF2,
bool DF2 >
567 friend
bool isSame( const Subvector<VT2,AF2,TF2,DF2>& a, const Subvector<VT2,AF2,TF2,DF2>& b ) noexcept;
569 template< typename VT2,
bool AF2,
bool TF2,
bool DF2, typename VT3 >
570 friend
bool tryAssign( const Subvector<VT2,AF2,TF2,DF2>& lhs, const Vector<VT3,TF2>& rhs,
size_t index );
572 template< typename VT2,
bool AF2,
bool TF2,
bool DF2, typename VT3 >
573 friend
bool tryAddAssign( const Subvector<VT2,AF2,TF2,DF2>& lhs, const Vector<VT3,TF2>& rhs,
size_t index );
575 template< typename VT2,
bool AF2,
bool TF2,
bool DF2, typename VT3 >
576 friend
bool trySubAssign( const Subvector<VT2,AF2,TF2,DF2>& lhs, const Vector<VT3,TF2>& rhs,
size_t index );
578 template< typename VT2,
bool AF2,
bool TF2,
bool DF2, typename VT3 >
579 friend
bool tryMultAssign( const Subvector<VT2,AF2,TF2,DF2>& lhs, const Vector<VT3,TF2>& rhs,
size_t index );
581 template< typename VT2,
bool AF2,
bool TF2,
bool DF2 >
582 friend
DerestrictTrait_< Subvector<VT2,AF2,TF2,DF2> > derestrict( Subvector<VT2,AF2,TF2,DF2>& sv );
618 template< typename VT
621 inline Subvector<VT,AF,TF,false>::Subvector( Operand vector,
size_t index,
size_t n )
626 if( index + n > vector.size() ) {
652 template<
typename VT
656 Subvector<VT,AF,TF,false>::operator[](
size_t index )
659 return vector_[offset_+index];
675 template<
typename VT
679 Subvector<VT,AF,TF,false>::operator[](
size_t index )
const
682 return const_cast<const VT&
>( vector_ )[offset_+index];
699 template<
typename VT
703 Subvector<VT,AF,TF,false>::at(
size_t index )
705 if( index >=
size() ) {
708 return (*
this)[index];
725 template<
typename VT
729 Subvector<VT,AF,TF,false>::at(
size_t index )
const
731 if( index >=
size() ) {
734 return (*
this)[index];
748 template<
typename VT
754 return Iterator( vector_.begin(), offset_ );
756 return Iterator( vector_.lowerBound( offset_ ), offset_ );
770 template<
typename VT
778 return ConstIterator( vector_.lowerBound( offset_ ), offset_ );
792 template<
typename VT
800 return ConstIterator( vector_.lowerBound( offset_ ), offset_ );
814 template<
typename VT
819 if( offset_ + size_ == vector_.size() )
820 return Iterator( vector_.end(), offset_ );
822 return Iterator( vector_.lowerBound( offset_ + size_ ), offset_ );
836 template<
typename VT
841 if( offset_ + size_ == vector_.size() )
844 return ConstIterator( vector_.lowerBound( offset_ + size_ ), offset_ );
858 template<
typename VT
863 if( offset_ + size_ == vector_.size() )
866 return ConstIterator( vector_.lowerBound( offset_ + size_ ), offset_ );
892 template<
typename VT
895 inline Subvector<VT,AF,TF,false>&
896 Subvector<VT,AF,TF,false>::operator=(
const Subvector& rhs )
903 if(
this == &rhs || ( &vector_ == &rhs.vector_ && offset_ == rhs.offset_ ) )
906 if(
size() != rhs.size() ) {
910 if( !tryAssign( vector_, rhs, offset_ ) ) {
914 DerestrictTrait_<This> left( derestrict( *
this ) );
916 if( rhs.canAlias( &vector_ ) ) {
917 const ResultType tmp( rhs );
946 template<
typename VT
949 template<
typename VT2 >
950 inline Subvector<VT,AF,TF,false>&
951 Subvector<VT,AF,TF,false>::operator=(
const Vector<VT2,TF>& rhs )
962 typedef If_< IsRestricted<VT>, CompositeType_<VT2>,
const VT2& > Right;
965 if( !tryAssign( vector_, right, offset_ ) ) {
969 DerestrictTrait_<This> left( derestrict( *
this ) );
971 if( IsReference<Right>::value || right.canAlias( &vector_ ) ) {
972 const ResultType_<VT2> tmp( right );
978 assign( left, right );
1001 template<
typename VT
1004 template<
typename VT2 >
1005 inline Subvector<VT,AF,TF,false>&
1008 using blaze::assign;
1014 typedef AddTrait_< ResultType, ResultType_<VT2> > AddType;
1023 const AddType tmp( *
this + (~rhs) );
1025 if( !tryAssign( vector_, tmp, offset_ ) ) {
1029 DerestrictTrait_<This> left( derestrict( *
this ) );
1032 assign( left, tmp );
1054 template<
typename VT
1057 template<
typename VT2 >
1058 inline Subvector<VT,AF,TF,false>&
1061 using blaze::assign;
1067 typedef SubTrait_< ResultType, ResultType_<VT2> > SubType;
1076 const SubType tmp( *
this - (~rhs) );
1078 if( !tryAssign( vector_, tmp, offset_ ) ) {
1082 DerestrictTrait_<This> left( derestrict( *
this ) );
1085 assign( left, tmp );
1108 template<
typename VT
1111 template<
typename VT2 >
1112 inline Subvector<VT,AF,TF,false>&
1115 using blaze::assign;
1121 typedef MultTrait_< ResultType, ResultType_<VT2> > MultType;
1130 const MultType tmp( *
this * (~rhs) );
1132 if( !tryAssign( vector_, tmp, offset_ ) ) {
1136 DerestrictTrait_<This> left( derestrict( *
this ) );
1139 assign( left, tmp );
1161 template<
typename VT
1164 template<
typename VT2 >
1165 inline Subvector<VT,AF,TF,false>&
1168 using blaze::assign;
1175 typedef DivTrait_< ResultType, ResultType_<VT2> > DivType;
1185 const DivType tmp( *
this / (~rhs) );
1187 if( !tryAssign( vector_, tmp, offset_ ) ) {
1191 DerestrictTrait_<This> left( derestrict( *
this ) );
1194 assign( left, tmp );
1216 template<
typename VT
1219 template<
typename Other >
1220 inline EnableIf_<IsNumeric<Other>, Subvector<VT,AF,TF,false> >&
1223 const Iterator last(
end() );
1224 for( Iterator element=
begin(); element!=last; ++element )
1225 element->value() *= rhs;
1245 template<
typename VT
1248 template<
typename Other >
1249 inline EnableIf_<IsNumeric<Other>, Subvector<VT,AF,TF,false> >&
1254 typedef DivTrait_<ElementType,Other> DT;
1255 typedef If_< IsNumeric<DT>, DT, Other > Tmp;
1257 const Iterator last(
end() );
1261 if( IsNumeric<DT>::value && IsFloatingPoint<DT>::value ) {
1262 const Tmp tmp( Tmp(1)/static_cast<Tmp>( rhs ) );
1263 for( Iterator element=
begin(); element!=last; ++element )
1264 element->value() *= tmp;
1267 for( Iterator element=
begin(); element!=last; ++element )
1268 element->value() /= rhs;
1291 template<
typename VT
1308 template<
typename VT
1313 return nonZeros() + vector_.capacity() - vector_.nonZeros();
1327 template<
typename VT
1344 template<
typename VT
1349 vector_.erase( vector_.lowerBound( offset_ ), vector_.lowerBound( offset_ + size_ ) );
1367 template<
typename VT
1373 return Iterator( vector_.set( offset_ + index, value ), offset_ );
1392 template<
typename VT
1396 Subvector<VT,AF,TF,false>::insert(
size_t index,
const ElementType& value )
1398 return Iterator( vector_.insert( offset_ + index, value ), offset_ );
1413 template<
typename VT
1416 inline void Subvector<VT,AF,TF,false>::erase(
size_t index )
1418 vector_.erase( offset_ + index );
1433 template<
typename VT
1438 return Iterator( vector_.erase( pos.base() ), offset_ );
1454 template<
typename VT
1458 Subvector<VT,AF,TF,false>::erase( Iterator first, Iterator last )
1460 return Iterator( vector_.erase( first.base(), last.base() ), offset_ );
1476 template<
typename VT
1479 void Subvector<VT,AF,TF,false>::reserve(
size_t n )
1481 const size_t current(
capacity() );
1484 vector_.reserve( vector_.capacity() + n - current );
1498 template<
typename VT
1501 template<
typename Other >
1502 inline Subvector<VT,AF,TF,false>& Subvector<VT,AF,TF,false>::scale(
const Other& scalar )
1504 for( Iterator element=
begin(); element!=
end(); ++element )
1505 element->value() *= scalar;
1534 template<
typename VT
1538 Subvector<VT,AF,TF,false>::find(
size_t index )
1540 const Iterator_<VT> pos( vector_.find( offset_ + index ) );
1542 if( pos != vector_.end() )
1565 template<
typename VT
1569 Subvector<VT,AF,TF,false>::find(
size_t index )
const
1571 const ConstIterator_<VT> pos( vector_.find( offset_ + index ) );
1573 if( pos != vector_.end() )
1595 template<
typename VT
1599 Subvector<VT,AF,TF,false>::lowerBound(
size_t index )
1601 return Iterator( vector_.lowerBound( offset_ + index ), offset_ );
1620 template<
typename VT
1624 Subvector<VT,AF,TF,false>::lowerBound(
size_t index )
const
1626 return ConstIterator( vector_.lowerBound( offset_ + index ), offset_ );
1645 template<
typename VT
1649 Subvector<VT,AF,TF,false>::upperBound(
size_t index )
1651 return Iterator( vector_.upperBound( offset_ + index ), offset_ );
1670 template<
typename VT
1674 Subvector<VT,AF,TF,false>::upperBound(
size_t index )
const
1676 return ConstIterator( vector_.upperBound( offset_ + index ), offset_ );
1715 template<
typename VT
1718 inline void Subvector<VT,AF,TF,false>::append(
size_t index,
const ElementType& value,
bool check )
1720 if( offset_ + size_ == vector_.size() )
1721 vector_.append( offset_ + index, value, check );
1722 else if( !check || !
isDefault( value ) )
1723 vector_.insert( offset_ + index, value );
1748 template<
typename VT
1751 template<
typename Other >
1752 inline bool Subvector<VT,AF,TF,false>::canAlias(
const Other* alias )
const noexcept
1754 return vector_.isAliased( alias );
1771 template<
typename VT
1774 template<
typename Other >
1775 inline bool Subvector<VT,AF,TF,false>::isAliased(
const Other* alias )
const noexcept
1777 return vector_.isAliased( alias );
1794 template<
typename VT
1797 inline bool Subvector<VT,AF,TF,false>::canSMPAssign() const noexcept
1817 template<
typename VT
1820 template<
typename VT2 >
1821 inline void Subvector<VT,AF,TF,false>::assign(
const DenseVector<VT2,TF>& rhs )
1826 reserve( (~rhs).
size() );
1828 for(
size_t i=0UL; i<
size(); ++i ) {
1829 append( i, (~rhs)[i],
true );
1848 template<
typename VT
1851 template<
typename VT2 >
1852 inline void Subvector<VT,AF,TF,false>::assign(
const SparseVector<VT2,TF>& rhs )
1859 for( ConstIterator_<VT2> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element ) {
1860 append( element->index(), element->value(), true );
1879 template<
typename VT
1882 template<
typename VT2 >
1883 inline void Subvector<VT,AF,TF,false>::addAssign(
const DenseVector<VT2,TF>& rhs )
1885 typedef AddTrait_< ResultType, ResultType_<VT2> > AddType;
1893 const AddType tmp(
serial( *
this + (~rhs) ) );
1913 template<
typename VT
1916 template<
typename VT2 >
1917 inline void Subvector<VT,AF,TF,false>::addAssign(
const SparseVector<VT2,TF>& rhs )
1919 typedef AddTrait_< ResultType, ResultType_<VT2> > AddType;
1927 const AddType tmp(
serial( *
this + (~rhs) ) );
1947 template<
typename VT
1950 template<
typename VT2 >
1951 inline void Subvector<VT,AF,TF,false>::subAssign(
const DenseVector<VT2,TF>& rhs )
1953 typedef SubTrait_< ResultType, ResultType_<VT2> > SubType;
1961 const SubType tmp(
serial( *
this - (~rhs) ) );
1981 template<
typename VT
1984 template<
typename VT2 >
1985 inline void Subvector<VT,AF,TF,false>::subAssign(
const SparseVector<VT2,TF>& rhs )
1987 typedef SubTrait_< ResultType, ResultType_<VT2> > SubType;
1995 const SubType tmp(
serial( *
this - (~rhs) ) );
#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.
typename DerestrictTrait< T >::Type DerestrictTrait_
Auxiliary alias declaration for the DerestrictTrait type trait.The DerestrictTrait_ alias declaration...
Definition: DerestrictTrait.h:110
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the alignment flag values.
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7800
Header file for the subtraction trait.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:346
BLAZE_ALWAYS_INLINE bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b) noexcept
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:653
Header file for basic type definitions.
Header file for the SparseVector base class.
Header file for the View base class.
Header file for the serial shim.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
#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
BLAZE_ALWAYS_INLINE T1 & operator/=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Division assignment operator for the division of two SIMD packs.
Definition: BasicTypes.h:1339
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:188
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2643
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2636
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
BLAZE_ALWAYS_INLINE size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:384
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:731
#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 T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1321
BLAZE_ALWAYS_INLINE 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:298
BLAZE_ALWAYS_INLINE 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:232
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Constraint on the data type.
SubvectorExprTrait_< VT, unaligned > subvector(Vector< VT, TF > &vector, size_t index, size_t size)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:152
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Header file for the IsFloatingPoint type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
#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 implementation of the Subvector base template.
Header file for the subvector trait.
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional vector type...
Definition: SparseVector.h:61
Constraint on the data type.
Header file for the SparseElement base class.
Constraint on the data type.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2640
Constraint on the data type.
Header file for the exception macros of the math module.
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:254
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2641
Constraint on the data type.
Constraint on the data type.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2645
Header file for the EnableIf class template.
Header file for the DerestrictTrait class template.
Header file for the IsNumeric type trait.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:76
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2642
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:1285
Header file for run time assertion macros.
Header file for the addition trait.
Header file for the division trait.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2646
Header file for the isDefault shim.
#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
Header file for the IsReference type trait.
#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
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2637
#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
bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2638
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2644
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:1303
Header file for the IsRestricted type trait.
#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
#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
Header file for the IsExpression type trait class.