35 #ifndef _BLAZE_MATH_VIEWS_SUBVECTOR_SPARSE_H_ 36 #define _BLAZE_MATH_VIEWS_SUBVECTOR_SPARSE_H_ 100 class Subvector<VT,AF,TF,false>
101 :
public SparseVector< Subvector<VT,AF,TF,false>, TF >
107 typedef If_< IsExpression<VT>, VT, VT& > Operand;
112 typedef Subvector<VT,AF,TF,false>
This;
113 typedef SparseVector<This,TF>
BaseType;
130 template<
typename VectorType
131 ,
typename IteratorType >
132 class SubvectorElement :
private SparseElement
142 enum :
bool { returnConst = IsConst<VectorType>::value };
147 typedef typename std::iterator_traits<IteratorType>::value_type SET;
149 typedef Reference_<SET> RT;
150 typedef ConstReference_<SET> CRT;
155 typedef ValueType_<SET> ValueType;
156 typedef size_t IndexType;
157 typedef IfTrue_<returnConst,CRT,RT>
Reference;
167 inline SubvectorElement( IteratorType pos,
size_t offset )
179 template<
typename T >
inline SubvectorElement& operator=(
const T& v ) {
191 template<
typename T >
inline SubvectorElement&
operator+=(
const T& v ) {
203 template<
typename T >
inline SubvectorElement&
operator-=(
const T& v ) {
215 template<
typename T >
inline SubvectorElement&
operator*=(
const T& v ) {
227 template<
typename T >
inline SubvectorElement&
operator/=(
const T& v ) {
238 inline const SubvectorElement* operator->()
const {
248 inline Reference value()
const {
249 return pos_->value();
258 inline IndexType index()
const {
259 return pos_->index() - offset_;
274 template<
typename VectorType
275 ,
typename IteratorType >
276 class SubvectorIterator
280 typedef std::forward_iterator_tag IteratorCategory;
281 typedef SubvectorElement<VectorType,IteratorType> ValueType;
282 typedef ValueType PointerType;
283 typedef ValueType ReferenceType;
284 typedef ptrdiff_t DifferenceType;
287 typedef IteratorCategory iterator_category;
288 typedef ValueType value_type;
289 typedef PointerType pointer;
290 typedef ReferenceType reference;
291 typedef DifferenceType difference_type;
297 inline SubvectorIterator()
309 inline SubvectorIterator( IteratorType iterator,
size_t index )
320 template<
typename VectorType2,
typename IteratorType2 >
321 inline SubvectorIterator(
const SubvectorIterator<VectorType2,IteratorType2>& it )
323 , offset_( it.offset() )
332 inline SubvectorIterator& operator++() {
343 inline const SubvectorIterator operator++(
int ) {
344 const SubvectorIterator tmp( *
this );
356 return ReferenceType( pos_, offset_ );
365 inline PointerType operator->()
const {
366 return PointerType( pos_, offset_ );
376 template<
typename VectorType2,
typename IteratorType2 >
377 inline bool operator==(
const SubvectorIterator<VectorType2,IteratorType2>& rhs )
const {
378 return base() == rhs.base();
388 template<
typename VectorType2,
typename IteratorType2 >
389 inline bool operator!=(
const SubvectorIterator<VectorType2,IteratorType2>& rhs )
const {
390 return !( *
this == rhs );
400 inline DifferenceType
operator-(
const SubvectorIterator& rhs )
const {
401 return pos_ - rhs.pos_;
410 inline IteratorType base()
const {
420 inline size_t offset() const noexcept {
435 typedef SubvectorIterator< const VT, ConstIterator_<VT> >
ConstIterator;
443 enum :
bool { smpAssignable = VT::smpAssignable };
449 explicit inline Subvector( Operand vector,
size_t index,
size_t n );
461 inline Reference operator[](
size_t index );
462 inline ConstReference operator[](
size_t index )
const;
463 inline Reference at(
size_t index );
464 inline ConstReference at(
size_t index )
const;
465 inline Iterator
begin ();
466 inline ConstIterator
begin ()
const;
467 inline ConstIterator
cbegin()
const;
468 inline Iterator
end ();
469 inline ConstIterator
end ()
const;
470 inline ConstIterator
cend ()
const;
477 inline Subvector& operator= (
const Subvector& rhs );
478 template<
typename VT2 >
inline Subvector& operator= (
const Vector<VT2,TF>& rhs );
479 template<
typename VT2 >
inline Subvector&
operator+=(
const Vector<VT2,TF>& rhs );
480 template<
typename VT2 >
inline Subvector&
operator-=(
const Vector<VT2,TF>& rhs );
481 template<
typename VT2 >
inline Subvector&
operator*=(
const Vector<VT2,TF>& rhs );
482 template<
typename VT2 >
inline Subvector&
operator/=(
const DenseVector<VT2,TF>& rhs );
484 template<
typename Other >
485 inline EnableIf_<IsNumeric<Other>, Subvector >&
operator*=( Other rhs );
487 template<
typename Other >
488 inline EnableIf_<IsNumeric<Other>, Subvector >&
operator/=( Other rhs );
495 inline size_t size() const noexcept;
496 inline
size_t capacity() const noexcept;
499 inline
void reserve(
size_t n );
506 inline Iterator
set (
size_t index, const ElementType& value );
507 inline Iterator insert(
size_t index, const ElementType& value );
508 inline
void append(
size_t index, const ElementType& value,
bool check=false );
515 inline
void erase(
size_t index );
516 inline Iterator erase( Iterator pos );
517 inline Iterator erase( Iterator first, Iterator last );
519 template< typename Pred, typename =
DisableIf_< IsIntegral<Pred> > >
520 inline
void erase( Pred predicate );
522 template< typename Pred >
523 inline
void erase( Iterator first, Iterator last, Pred predicate );
530 inline Iterator find (
size_t index );
531 inline ConstIterator find (
size_t index ) const;
532 inline Iterator lowerBound(
size_t index );
533 inline ConstIterator lowerBound(
size_t index ) const;
534 inline Iterator upperBound(
size_t index );
535 inline ConstIterator upperBound(
size_t index ) const;
542 template< typename Other > inline Subvector& scale( const Other& scalar );
549 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
550 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
552 inline
bool canSMPAssign() const noexcept;
554 template< typename VT2 > inline
void assign ( const DenseVector <VT2,TF>& rhs );
555 template< typename VT2 > inline
void assign ( const SparseVector<VT2,TF>& rhs );
556 template< typename VT2 > inline
void addAssign( const DenseVector <VT2,TF>& rhs );
557 template< typename VT2 > inline
void addAssign( const SparseVector<VT2,TF>& rhs );
558 template< typename VT2 > inline
void subAssign( const DenseVector <VT2,TF>& rhs );
559 template< typename VT2 > inline
void subAssign( const SparseVector<VT2,TF>& rhs );
568 const
size_t offset_;
574 template<
bool AF1, typename VT2,
bool AF2,
bool TF2,
bool DF2 >
575 friend const Subvector<VT2,AF1,TF2,DF2>
576 subvector( const Subvector<VT2,AF2,TF2,DF2>& sv,
size_t index,
size_t size );
578 template< typename VT2,
bool AF2,
bool TF2,
bool DF2 >
579 friend
bool isIntact( const Subvector<VT2,AF2,TF2,DF2>& sv ) noexcept;
581 template< typename VT2,
bool AF2,
bool TF2,
bool DF2 >
582 friend
bool isSame( const Subvector<VT2,AF2,TF2,DF2>& a, const Vector<VT2,TF2>& b ) noexcept;
584 template< typename VT2,
bool AF2,
bool TF2,
bool DF2 >
585 friend
bool isSame( const Vector<VT2,TF2>& a, const Subvector<VT2,AF2,TF2,DF2>& b ) noexcept;
587 template< typename VT2,
bool AF2,
bool TF2,
bool DF2 >
588 friend
bool isSame( const Subvector<VT2,AF2,TF2,DF2>& a, const Subvector<VT2,AF2,TF2,DF2>& b ) noexcept;
590 template< typename VT2,
bool AF2,
bool TF2,
bool DF2, typename VT3 >
591 friend
bool tryAssign( const Subvector<VT2,AF2,TF2,DF2>& lhs, const Vector<VT3,TF2>& rhs,
size_t index );
593 template< typename VT2,
bool AF2,
bool TF2,
bool DF2, typename VT3 >
594 friend
bool tryAddAssign( const Subvector<VT2,AF2,TF2,DF2>& lhs, const Vector<VT3,TF2>& rhs,
size_t index );
596 template< typename VT2,
bool AF2,
bool TF2,
bool DF2, typename VT3 >
597 friend
bool trySubAssign( const Subvector<VT2,AF2,TF2,DF2>& lhs, const Vector<VT3,TF2>& rhs,
size_t index );
599 template< typename VT2,
bool AF2,
bool TF2,
bool DF2, typename VT3 >
600 friend
bool tryMultAssign( const Subvector<VT2,AF2,TF2,DF2>& lhs, const Vector<VT3,TF2>& rhs,
size_t index );
602 template< typename VT2,
bool AF2,
bool TF2,
bool DF2 >
603 friend
DerestrictTrait_< Subvector<VT2,AF2,TF2,DF2> > derestrict( Subvector<VT2,AF2,TF2,DF2>& sv );
639 template< typename VT
642 inline Subvector<VT,AF,TF,false>::Subvector( Operand vector,
size_t index,
size_t n )
647 if( index + n > vector.size() ) {
673 template<
typename VT
677 Subvector<VT,AF,TF,false>::operator[](
size_t index )
680 return vector_[offset_+index];
696 template<
typename VT
700 Subvector<VT,AF,TF,false>::operator[](
size_t index )
const 703 return const_cast<const VT&
>( vector_ )[offset_+index];
720 template<
typename VT
724 Subvector<VT,AF,TF,false>::at(
size_t index )
726 if( index >=
size() ) {
729 return (*
this)[index];
746 template<
typename VT
750 Subvector<VT,AF,TF,false>::at(
size_t index )
const 752 if( index >=
size() ) {
755 return (*
this)[index];
769 template<
typename VT
775 return Iterator( vector_.begin(), offset_ );
777 return Iterator( vector_.lowerBound( offset_ ), offset_ );
791 template<
typename VT
799 return ConstIterator( vector_.lowerBound( offset_ ), offset_ );
813 template<
typename VT
821 return ConstIterator( vector_.lowerBound( offset_ ), offset_ );
835 template<
typename VT
840 if( offset_ + size_ == vector_.size() )
841 return Iterator( vector_.end(), offset_ );
843 return Iterator( vector_.lowerBound( offset_ + size_ ), offset_ );
857 template<
typename VT
862 if( offset_ + size_ == vector_.size() )
865 return ConstIterator( vector_.lowerBound( offset_ + size_ ), offset_ );
879 template<
typename VT
884 if( offset_ + size_ == vector_.size() )
887 return ConstIterator( vector_.lowerBound( offset_ + size_ ), offset_ );
913 template<
typename VT
916 inline Subvector<VT,AF,TF,false>&
917 Subvector<VT,AF,TF,false>::operator=(
const Subvector& rhs )
924 if(
this == &rhs || ( &vector_ == &rhs.vector_ && offset_ == rhs.offset_ ) )
927 if(
size() != rhs.size() ) {
931 if( !tryAssign( vector_, rhs, offset_ ) ) {
935 DerestrictTrait_<This> left( derestrict( *
this ) );
937 if( rhs.canAlias( &vector_ ) ) {
938 const ResultType tmp( rhs );
967 template<
typename VT
970 template<
typename VT2 >
971 inline Subvector<VT,AF,TF,false>&
972 Subvector<VT,AF,TF,false>::operator=(
const Vector<VT2,TF>& rhs )
983 typedef If_< IsRestricted<VT>, CompositeType_<VT2>,
const VT2& > Right;
986 if( !tryAssign( vector_, right, offset_ ) ) {
990 DerestrictTrait_<This> left( derestrict( *
this ) );
992 if( IsReference<Right>::value || right.canAlias( &vector_ ) ) {
993 const ResultType_<VT2> tmp( right );
999 assign( left, right );
1022 template<
typename VT
1025 template<
typename VT2 >
1026 inline Subvector<VT,AF,TF,false>&
1029 using blaze::assign;
1035 typedef AddTrait_< ResultType, ResultType_<VT2> > AddType;
1044 const AddType tmp( *
this + (~rhs) );
1046 if( !tryAssign( vector_, tmp, offset_ ) ) {
1050 DerestrictTrait_<This> left( derestrict( *
this ) );
1053 assign( left, tmp );
1075 template<
typename VT
1078 template<
typename VT2 >
1079 inline Subvector<VT,AF,TF,false>&
1082 using blaze::assign;
1088 typedef SubTrait_< ResultType, ResultType_<VT2> > SubType;
1097 const SubType tmp( *
this - (~rhs) );
1099 if( !tryAssign( vector_, tmp, offset_ ) ) {
1103 DerestrictTrait_<This> left( derestrict( *
this ) );
1106 assign( left, tmp );
1129 template<
typename VT
1132 template<
typename VT2 >
1133 inline Subvector<VT,AF,TF,false>&
1136 using blaze::assign;
1142 typedef MultTrait_< ResultType, ResultType_<VT2> > MultType;
1151 const MultType tmp( *
this * (~rhs) );
1153 if( !tryAssign( vector_, tmp, offset_ ) ) {
1157 DerestrictTrait_<This> left( derestrict( *
this ) );
1160 assign( left, tmp );
1182 template<
typename VT
1185 template<
typename VT2 >
1186 inline Subvector<VT,AF,TF,false>&
1189 using blaze::assign;
1196 typedef DivTrait_< ResultType, ResultType_<VT2> > DivType;
1206 const DivType tmp( *
this / (~rhs) );
1208 if( !tryAssign( vector_, tmp, offset_ ) ) {
1212 DerestrictTrait_<This> left( derestrict( *
this ) );
1215 assign( left, tmp );
1237 template<
typename VT
1240 template<
typename Other >
1241 inline EnableIf_<IsNumeric<Other>, Subvector<VT,AF,TF,false> >&
1244 const Iterator last(
end() );
1245 for( Iterator element=
begin(); element!=last; ++element )
1246 element->value() *= rhs;
1266 template<
typename VT
1269 template<
typename Other >
1270 inline EnableIf_<IsNumeric<Other>, Subvector<VT,AF,TF,false> >&
1275 typedef DivTrait_<ElementType,Other> DT;
1276 typedef If_< IsNumeric<DT>, DT, Other > Tmp;
1278 const Iterator last(
end() );
1282 if( IsNumeric<DT>::value && IsFloatingPoint<DT>::value ) {
1283 const Tmp tmp( Tmp(1)/static_cast<Tmp>( rhs ) );
1284 for( Iterator element=
begin(); element!=last; ++element )
1285 element->value() *= tmp;
1288 for( Iterator element=
begin(); element!=last; ++element )
1289 element->value() /= rhs;
1312 template<
typename VT
1329 template<
typename VT
1334 return nonZeros() + vector_.capacity() - vector_.nonZeros();
1348 template<
typename VT
1365 template<
typename VT
1370 vector_.erase( vector_.lowerBound( offset_ ), vector_.lowerBound( offset_ + size_ ) );
1386 template<
typename VT
1389 void Subvector<VT,AF,TF,false>::reserve(
size_t n )
1391 const size_t current(
capacity() );
1394 vector_.reserve( vector_.capacity() + n - current );
1421 template<
typename VT
1427 return Iterator( vector_.set( offset_ + index, value ), offset_ );
1446 template<
typename VT
1450 Subvector<VT,AF,TF,false>::insert(
size_t index,
const ElementType& value )
1452 return Iterator( vector_.insert( offset_ + index, value ), offset_ );
1483 template<
typename VT
1486 inline void Subvector<VT,AF,TF,false>::append(
size_t index,
const ElementType& value,
bool check )
1488 if( offset_ + size_ == vector_.size() )
1489 vector_.append( offset_ + index, value, check );
1490 else if( !check || !
isDefault( value ) )
1491 vector_.insert( offset_ + index, value );
1514 template<
typename VT
1517 inline void Subvector<VT,AF,TF,false>::erase(
size_t index )
1519 vector_.erase( offset_ + index );
1534 template<
typename VT
1539 return Iterator( vector_.erase( pos.base() ), offset_ );
1555 template<
typename VT
1559 Subvector<VT,AF,TF,false>::erase( Iterator first, Iterator last )
1561 return Iterator( vector_.erase( first.base(), last.base() ), offset_ );
1590 template<
typename VT
1593 template<
typename Pred
1595 inline void Subvector<VT,AF,TF,false>::erase( Pred predicate )
1597 vector_.erase(
begin().base(),
end().base(), predicate );
1629 template<
typename VT
1632 template<
typename Pred >
1633 inline void Subvector<VT,AF,TF,false>::erase( Iterator first, Iterator last, Pred predicate )
1635 vector_.erase( first.base(), last.base(), predicate );
1663 template<
typename VT
1667 Subvector<VT,AF,TF,false>::find(
size_t index )
1669 const Iterator_<VT> pos( vector_.find( offset_ + index ) );
1671 if( pos != vector_.end() )
1694 template<
typename VT
1698 Subvector<VT,AF,TF,false>::find(
size_t index )
const 1700 const ConstIterator_<VT> pos( vector_.find( offset_ + index ) );
1702 if( pos != vector_.end() )
1724 template<
typename VT
1728 Subvector<VT,AF,TF,false>::lowerBound(
size_t index )
1730 return Iterator( vector_.lowerBound( offset_ + index ), offset_ );
1749 template<
typename VT
1753 Subvector<VT,AF,TF,false>::lowerBound(
size_t index )
const 1755 return ConstIterator( vector_.lowerBound( offset_ + index ), offset_ );
1774 template<
typename VT
1778 Subvector<VT,AF,TF,false>::upperBound(
size_t index )
1780 return Iterator( vector_.upperBound( offset_ + index ), offset_ );
1799 template<
typename VT
1803 Subvector<VT,AF,TF,false>::upperBound(
size_t index )
const 1805 return ConstIterator( vector_.upperBound( offset_ + index ), offset_ );
1826 template<
typename VT
1829 template<
typename Other >
1830 inline Subvector<VT,AF,TF,false>& Subvector<VT,AF,TF,false>::scale(
const Other& scalar )
1832 for( Iterator element=
begin(); element!=
end(); ++element )
1833 element->value() *= scalar;
1859 template<
typename VT
1862 template<
typename Other >
1863 inline bool Subvector<VT,AF,TF,false>::canAlias(
const Other* alias )
const noexcept
1865 return vector_.isAliased( alias );
1882 template<
typename VT
1885 template<
typename Other >
1886 inline bool Subvector<VT,AF,TF,false>::isAliased(
const Other* alias )
const noexcept
1888 return vector_.isAliased( alias );
1905 template<
typename VT
1908 inline bool Subvector<VT,AF,TF,false>::canSMPAssign() const noexcept
1928 template<
typename VT
1931 template<
typename VT2 >
1932 inline void Subvector<VT,AF,TF,false>::assign(
const DenseVector<VT2,TF>& rhs )
1937 reserve( (~rhs).
size() );
1939 for(
size_t i=0UL; i<
size(); ++i ) {
1940 append( i, (~rhs)[i],
true );
1959 template<
typename VT
1962 template<
typename VT2 >
1963 inline void Subvector<VT,AF,TF,false>::assign(
const SparseVector<VT2,TF>& rhs )
1970 for( ConstIterator_<VT2> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element ) {
1971 append( element->index(), element->value(), true );
1990 template<
typename VT
1993 template<
typename VT2 >
1994 inline void Subvector<VT,AF,TF,false>::addAssign(
const DenseVector<VT2,TF>& rhs )
1996 typedef AddTrait_< ResultType, ResultType_<VT2> > AddType;
2004 const AddType tmp(
serial( *
this + (~rhs) ) );
2024 template<
typename VT
2027 template<
typename VT2 >
2028 inline void Subvector<VT,AF,TF,false>::addAssign(
const SparseVector<VT2,TF>& rhs )
2030 typedef AddTrait_< ResultType, ResultType_<VT2> > AddType;
2038 const AddType tmp(
serial( *
this + (~rhs) ) );
2058 template<
typename VT
2061 template<
typename VT2 >
2062 inline void Subvector<VT,AF,TF,false>::subAssign(
const DenseVector<VT2,TF>& rhs )
2064 typedef SubTrait_< ResultType, ResultType_<VT2> > SubType;
2072 const SubType tmp(
serial( *
this - (~rhs) ) );
2092 template<
typename VT
2095 template<
typename VT2 >
2096 inline void Subvector<VT,AF,TF,false>::subAssign(
const SparseVector<VT2,TF>& rhs )
2098 typedef SubTrait_< ResultType, ResultType_<VT2> > SubType;
2106 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.
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:352
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:721
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:261
#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:194
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:2935
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
Header file for the IsIntegral type trait.
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2928
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
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:390
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:304
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:238
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 DisableIf class template.
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:2939
#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.
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:250
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:2932
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:260
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:2933
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:290
Constraint on the data type.
Constraint on the data type.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2937
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:2934
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:2938
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.
Header file for the RemoveReference 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:2929
#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
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2930
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:249
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2936
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.
const DMatDMatMultExpr< T1, T2, false, false, false, false > 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:7505
#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.