35 #ifndef _BLAZE_MATH_VIEWS_SUBVECTOR_SPARSE_H_ 36 #define _BLAZE_MATH_VIEWS_SUBVECTOR_SPARSE_H_ 103 class Subvector<VT,AF,TF,false,CSAs...>
104 :
public View< SparseVector< Subvector<VT,AF,TF,false,CSAs...>, TF > >
105 ,
private SubvectorData<CSAs...>
109 using DataType = SubvectorData<CSAs...>;
110 using Operand = If_t< IsExpression_v<VT>, VT, VT& >;
116 using This = Subvector<VT,AF,TF,
false,CSAs...>;
118 using BaseType = SparseVector<This,TF>;
119 using ViewedType = VT;
121 using TransposeType = TransposeType_t<ResultType>;
122 using ElementType = ElementType_t<VT>;
123 using ReturnType = ReturnType_t<VT>;
124 using CompositeType =
const Subvector&;
127 using ConstReference = ConstReference_t<VT>;
130 using Reference = If_t< IsConst_v<VT>, ConstReference, Reference_t<VT> >;
136 template<
typename VectorType
137 ,
typename IteratorType >
138 class SubvectorElement
139 :
private SparseElement
148 inline SubvectorElement( IteratorType pos,
size_t offset )
160 template<
typename T >
inline SubvectorElement& operator=(
const T& v ) {
172 template<
typename T >
inline SubvectorElement&
operator+=(
const T& v ) {
184 template<
typename T >
inline SubvectorElement&
operator-=(
const T& v ) {
196 template<
typename T >
inline SubvectorElement&
operator*=(
const T& v ) {
208 template<
typename T >
inline SubvectorElement&
operator/=(
const T& v ) {
219 inline const SubvectorElement* operator->()
const {
229 inline decltype(
auto) value()
const {
230 return pos_->value();
239 inline size_t index()
const {
240 return pos_->index() - offset_;
255 template<
typename VectorType
256 ,
typename IteratorType >
257 class SubvectorIterator
261 using IteratorCategory = std::forward_iterator_tag;
262 using ValueType = SubvectorElement<VectorType,IteratorType>;
263 using PointerType = ValueType;
264 using ReferenceType = ValueType;
265 using DifferenceType = ptrdiff_t;
268 using iterator_category = IteratorCategory;
269 using value_type = ValueType;
270 using pointer = PointerType;
271 using reference = ReferenceType;
272 using difference_type = DifferenceType;
278 inline SubvectorIterator()
290 inline SubvectorIterator( IteratorType iterator,
size_t index )
301 template<
typename VectorType2,
typename IteratorType2 >
302 inline SubvectorIterator(
const SubvectorIterator<VectorType2,IteratorType2>& it )
304 , offset_( it.offset() )
313 inline SubvectorIterator& operator++() {
324 inline const SubvectorIterator operator++(
int ) {
325 const SubvectorIterator tmp( *
this );
337 return ReferenceType( pos_, offset_ );
346 inline PointerType operator->()
const {
347 return PointerType( pos_, offset_ );
357 template<
typename VectorType2,
typename IteratorType2 >
358 inline bool operator==(
const SubvectorIterator<VectorType2,IteratorType2>& rhs )
const {
359 return base() == rhs.base();
369 template<
typename VectorType2,
typename IteratorType2 >
370 inline bool operator!=(
const SubvectorIterator<VectorType2,IteratorType2>& rhs )
const {
371 return !( *
this == rhs );
381 inline DifferenceType
operator-(
const SubvectorIterator& rhs )
const {
382 return pos_ - rhs.pos_;
391 inline IteratorType base()
const {
401 inline size_t offset() const noexcept {
416 using ConstIterator = SubvectorIterator< const VT, ConstIterator_t<VT> >;
419 using Iterator = If_t< IsConst_v<VT>, ConstIterator, SubvectorIterator< VT, Iterator_t<VT> > >;
424 static constexpr
bool smpAssignable = VT::smpAssignable;
427 static constexpr
bool compileTimeArgs = DataType::compileTimeArgs;
433 template<
typename... RSAs >
434 explicit inline Subvector( VT& vector, RSAs... args );
436 Subvector(
const Subvector& ) =
default;
443 ~Subvector() =
default;
450 inline Reference operator[](
size_t index );
451 inline ConstReference operator[](
size_t index )
const;
452 inline Reference at(
size_t index );
453 inline ConstReference at(
size_t index )
const;
454 inline Iterator
begin ();
455 inline ConstIterator
begin ()
const;
456 inline ConstIterator
cbegin()
const;
457 inline Iterator
end ();
458 inline ConstIterator
end ()
const;
459 inline ConstIterator
cend ()
const;
466 inline Subvector& operator= ( initializer_list<ElementType> list );
467 inline Subvector& operator= (
const Subvector& rhs );
468 template<
typename VT2 >
inline Subvector& operator= (
const Vector<VT2,TF>& rhs );
469 template<
typename VT2 >
inline Subvector&
operator+=(
const Vector<VT2,TF>& rhs );
470 template<
typename VT2 >
inline Subvector&
operator-=(
const Vector<VT2,TF>& rhs );
471 template<
typename VT2 >
inline Subvector&
operator*=(
const Vector<VT2,TF>& rhs );
472 template<
typename VT2 >
inline Subvector&
operator/=(
const DenseVector<VT2,TF>& rhs );
473 template<
typename VT2 >
inline Subvector& operator%=(
const Vector<VT2,TF>& rhs );
480 using DataType::offset;
483 inline VT& operand() noexcept;
484 inline const VT& operand() const noexcept;
486 inline
size_t capacity() const noexcept;
489 inline
void reserve(
size_t n );
496 inline Iterator
set (
size_t index, const ElementType& value );
497 inline Iterator insert(
size_t index, const ElementType& value );
498 inline
void append(
size_t index, const ElementType& value,
bool check=false );
505 inline
void erase(
size_t index );
506 inline Iterator erase( Iterator pos );
507 inline Iterator erase( Iterator first, Iterator last );
510 inline
void erase( Pred predicate );
512 template< typename Pred >
513 inline
void erase( Iterator first, Iterator last, Pred predicate );
520 inline Iterator find (
size_t index );
521 inline ConstIterator find (
size_t index ) const;
522 inline Iterator lowerBound(
size_t index );
523 inline ConstIterator lowerBound(
size_t index ) const;
524 inline Iterator upperBound(
size_t index );
525 inline ConstIterator upperBound(
size_t index ) const;
532 template< typename Other > inline Subvector& scale( const Other& scalar );
539 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
540 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
542 inline
bool canSMPAssign() const noexcept;
544 template< typename VT2 > inline
void assign ( const DenseVector <VT2,TF>& rhs );
545 template< typename VT2 > inline
void assign ( const SparseVector<VT2,TF>& rhs );
546 template< typename VT2 > inline
void addAssign( const DenseVector <VT2,TF>& rhs );
547 template< typename VT2 > inline
void addAssign( const SparseVector<VT2,TF>& rhs );
548 template< typename VT2 > inline
void subAssign( const DenseVector <VT2,TF>& rhs );
549 template< typename VT2 > inline
void subAssign( const SparseVector<VT2,TF>& rhs );
595 template< typename VT
599 template< typename... RSAs >
600 inline Subvector<VT,AF,TF,false,CSAs...>::Subvector( VT& vector, RSAs... args )
601 : DataType( args... )
605 if( offset() +
size() > vector.size() ) {
635 template<
typename VT
639 inline typename Subvector<VT,AF,TF,
false,CSAs...>::Reference
640 Subvector<VT,AF,TF,false,CSAs...>::operator[](
size_t index )
643 return vector_[offset()+index];
659 template<
typename VT
663 inline typename Subvector<VT,AF,TF,
false,CSAs...>::ConstReference
664 Subvector<VT,AF,TF,false,CSAs...>::operator[](
size_t index )
const 667 return const_cast<const VT&>( vector_ )[offset()+index];
684 template<
typename VT
688 inline typename Subvector<VT,AF,TF,
false,CSAs...>::Reference
689 Subvector<VT,AF,TF,false,CSAs...>::at(
size_t index )
691 if( index >=
size() ) {
694 return (*
this)[index];
711 template<
typename VT
715 inline typename Subvector<VT,AF,TF,
false,CSAs...>::ConstReference
716 Subvector<VT,AF,TF,false,CSAs...>::at(
size_t index )
const 718 if( index >=
size() ) {
721 return (*
this)[index];
735 template<
typename VT
739 inline typename Subvector<VT,AF,TF,
false,CSAs...>::Iterator
742 if( offset() == 0UL )
743 return Iterator( vector_.begin(), offset() );
745 return Iterator( vector_.lowerBound( offset() ), offset() );
759 template<
typename VT
763 inline typename Subvector<VT,AF,TF,
false,CSAs...>::ConstIterator
766 if( offset() == 0UL )
767 return ConstIterator( vector_.cbegin(), offset() );
769 return ConstIterator( vector_.lowerBound( offset() ), offset() );
783 template<
typename VT
787 inline typename Subvector<VT,AF,TF,
false,CSAs...>::ConstIterator
790 if( offset() == 0UL )
791 return ConstIterator( vector_.cbegin(), offset() );
793 return ConstIterator( vector_.lowerBound( offset() ), offset() );
807 template<
typename VT
811 inline typename Subvector<VT,AF,TF,
false,CSAs...>::Iterator
814 if( offset() +
size() == vector_.size() )
815 return Iterator( vector_.end(), offset() );
817 return Iterator( vector_.lowerBound( offset() +
size() ), offset() );
831 template<
typename VT
835 inline typename Subvector<VT,AF,TF,
false,CSAs...>::ConstIterator
838 if( offset() +
size() == vector_.size() )
839 return ConstIterator( vector_.cend(), offset() );
841 return ConstIterator( vector_.lowerBound( offset() +
size() ), offset() );
855 template<
typename VT
859 inline typename Subvector<VT,AF,TF,
false,CSAs...>::ConstIterator
862 if( offset() +
size() == vector_.size() )
863 return ConstIterator( vector_.cend(), offset() );
865 return ConstIterator( vector_.lowerBound( offset() +
size() ), offset() );
894 template<
typename VT
898 inline Subvector<VT,AF,TF,
false,CSAs...>&
899 Subvector<VT,AF,TF,false,CSAs...>::operator=( initializer_list<ElementType> list )
903 if( list.size() >
size() ) {
907 const InitializerVector<ElementType,TF> tmp( list,
size() );
909 if( !tryAssign( vector_, tmp, offset() ) ) {
913 decltype(
auto) left( derestrict( *this ) );
938 template< typename VT
942 inline Subvector<VT,AF,TF,false,CSAs...>&
943 Subvector<VT,AF,TF,false,CSAs...>::operator=( const Subvector& rhs )
950 if(
this == &rhs || ( &vector_ == &rhs.vector_ && offset() == rhs.offset() ) )
953 if(
size() != rhs.size() ) {
957 if( !tryAssign( vector_, rhs, offset() ) ) {
961 decltype(
auto) left( derestrict( *this ) );
963 if( rhs.canAlias( &vector_ ) ) {
964 const ResultType tmp( rhs );
993 template<
typename VT
997 template<
typename VT2 >
998 inline Subvector<VT,AF,TF,
false,CSAs...>&
999 Subvector<VT,AF,TF,false,CSAs...>::operator=(
const Vector<VT2,TF>& rhs )
1001 using blaze::assign;
1010 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
1011 Right right( ~rhs );
1013 if( !tryAssign( vector_, right, offset() ) ) {
1017 decltype(
auto) left( derestrict( *this ) );
1020 const ResultType_t<VT2> tmp( right );
1022 assign( left, tmp );
1026 assign( left, right );
1049 template<
typename VT
1053 template<
typename VT2 >
1054 inline Subvector<VT,AF,TF,
false,CSAs...>&
1057 using blaze::assign;
1063 using AddType = AddTrait_t< ResultType, ResultType_t<VT2> >;
1072 const AddType tmp( *
this + (~rhs) );
1074 if( !tryAssign( vector_, tmp, offset() ) ) {
1078 decltype(
auto) left( derestrict( *this ) );
1081 assign( left, tmp );
1103 template< typename VT
1107 template< typename VT2 >
1108 inline Subvector<VT,AF,TF,false,CSAs...>&
1109 Subvector<VT,AF,TF,false,CSAs...>::operator-=( const Vector<VT2,TF>& rhs )
1111 using blaze::assign;
1117 using SubType = SubTrait_t< ResultType, ResultType_t<VT2> >;
1126 const SubType tmp( *
this - (~rhs) );
1128 if( !tryAssign( vector_, tmp, offset() ) ) {
1132 decltype(
auto) left( derestrict( *this ) );
1135 assign( left, tmp );
1158 template< typename VT
1162 template< typename VT2 >
1163 inline Subvector<VT,AF,TF,false,CSAs...>&
1164 Subvector<VT,AF,TF,false,CSAs...>::operator*=( const Vector<VT2,TF>& rhs )
1166 using blaze::assign;
1172 using MultType = MultTrait_t< ResultType, ResultType_t<VT2> >;
1181 const MultType tmp( *
this * (~rhs) );
1183 if( !tryAssign( vector_, tmp, offset() ) ) {
1187 decltype(
auto) left( derestrict( *this ) );
1190 assign( left, tmp );
1212 template< typename VT
1216 template< typename VT2 >
1217 inline Subvector<VT,AF,TF,false,CSAs...>&
1218 Subvector<VT,AF,TF,false,CSAs...>::operator/=( const DenseVector<VT2,TF>& rhs )
1220 using blaze::assign;
1227 using DivType = DivTrait_t< ResultType, ResultType_t<VT2> >;
1237 const DivType tmp( *
this / (~rhs) );
1239 if( !tryAssign( vector_, tmp, offset() ) ) {
1243 decltype(
auto) left( derestrict( *this ) );
1246 assign( left, tmp );
1269 template< typename VT
1273 template< typename VT2 >
1274 inline Subvector<VT,AF,TF,false,CSAs...>&
1275 Subvector<VT,AF,TF,false,CSAs...>::operator%=( const Vector<VT2,TF>& rhs )
1277 using blaze::assign;
1282 using CrossType = CrossTrait_t< ResultType, ResultType_t<VT2> >;
1288 if(
size() != 3UL || (~rhs).
size() != 3UL ) {
1292 const CrossType tmp( *
this % (~rhs) );
1294 if( !tryAssign( vector_, tmp, offset() ) ) {
1298 decltype(
auto) left( derestrict( *this ) );
1301 assign( left, tmp );
1325 template< typename VT
1329 inline VT& Subvector<VT,AF,TF,false,CSAs...>::operand() noexcept
1343 template<
typename VT
1347 inline const VT& Subvector<VT,AF,TF,false,CSAs...>::operand() const noexcept
1361 template<
typename VT
1367 return nonZeros() + vector_.capacity() - vector_.nonZeros();
1381 template<
typename VT
1399 template<
typename VT
1405 vector_.erase( vector_.lowerBound( offset() ), vector_.lowerBound( offset() +
size() ) );
1421 template<
typename VT
1425 void Subvector<VT,AF,TF,false,CSAs...>::reserve(
size_t n )
1427 const size_t current(
capacity() );
1430 vector_.reserve( vector_.capacity() + n - current );
1457 template<
typename VT
1461 inline typename Subvector<VT,AF,TF,
false,CSAs...>::Iterator
1464 return Iterator( vector_.set( offset() + index, value ), offset() );
1483 template<
typename VT
1487 inline typename Subvector<VT,AF,TF,
false,CSAs...>::Iterator
1488 Subvector<VT,AF,TF,false,CSAs...>::insert(
size_t index,
const ElementType& value )
1490 return Iterator( vector_.insert( offset() + index, value ), offset() );
1521 template<
typename VT
1525 inline void Subvector<VT,AF,TF,false,CSAs...>::append(
size_t index,
const ElementType& value,
bool check )
1527 if( offset() +
size() == vector_.size() )
1528 vector_.append( offset() + index, value, check );
1529 else if( !check || !isDefault<strict>( value ) )
1530 vector_.insert( offset() + index, value );
1553 template<
typename VT
1557 inline void Subvector<VT,AF,TF,false,CSAs...>::erase(
size_t index )
1559 vector_.erase( offset() + index );
1574 template<
typename VT
1578 inline typename Subvector<VT,AF,TF,
false,CSAs...>::Iterator
1579 Subvector<VT,AF,TF,false,CSAs...>::erase( Iterator pos )
1581 return Iterator( vector_.erase( pos.base() ), offset() );
1597 template<
typename VT
1601 inline typename Subvector<VT,AF,TF,
false,CSAs...>::Iterator
1602 Subvector<VT,AF,TF,false,CSAs...>::erase( Iterator first, Iterator last )
1604 return Iterator( vector_.erase( first.base(), last.base() ), offset() );
1633 template<
typename VT
1637 template<
typename Pred
1639 inline void Subvector<VT,AF,TF,false,CSAs...>::erase( Pred predicate )
1641 vector_.erase(
begin().base(),
end().base(), predicate );
1673 template<
typename VT
1677 template<
typename Pred >
1678 inline void Subvector<VT,AF,TF,false,CSAs...>::erase( Iterator first, Iterator last, Pred predicate )
1680 vector_.erase( first.base(), last.base(), predicate );
1708 template<
typename VT
1712 inline typename Subvector<VT,AF,TF,
false,CSAs...>::Iterator
1713 Subvector<VT,AF,TF,false,CSAs...>::find(
size_t index )
1715 const Iterator_t<VT> pos( vector_.find( offset() + index ) );
1717 if( pos != vector_.end() )
1718 return Iterator( pos, offset() );
1740 template<
typename VT
1744 inline typename Subvector<VT,AF,TF,
false,CSAs...>::ConstIterator
1745 Subvector<VT,AF,TF,false,CSAs...>::find(
size_t index )
const 1747 const ConstIterator_t<VT> pos( vector_.find( offset() + index ) );
1749 if( pos != vector_.end() )
1750 return Iterator( pos, offset() );
1771 template<
typename VT
1775 inline typename Subvector<VT,AF,TF,
false,CSAs...>::Iterator
1776 Subvector<VT,AF,TF,false,CSAs...>::lowerBound(
size_t index )
1778 return Iterator( vector_.lowerBound( offset() + index ), offset() );
1797 template<
typename VT
1801 inline typename Subvector<VT,AF,TF,
false,CSAs...>::ConstIterator
1802 Subvector<VT,AF,TF,false,CSAs...>::lowerBound(
size_t index )
const 1804 return ConstIterator( vector_.lowerBound( offset() + index ), offset() );
1823 template<
typename VT
1827 inline typename Subvector<VT,AF,TF,
false,CSAs...>::Iterator
1828 Subvector<VT,AF,TF,false,CSAs...>::upperBound(
size_t index )
1830 return Iterator( vector_.upperBound( offset() + index ), offset() );
1849 template<
typename VT
1853 inline typename Subvector<VT,AF,TF,
false,CSAs...>::ConstIterator
1854 Subvector<VT,AF,TF,false,CSAs...>::upperBound(
size_t index )
const 1856 return ConstIterator( vector_.upperBound( offset() + index ), offset() );
1881 template<
typename VT
1885 template<
typename Other >
1886 inline Subvector<VT,AF,TF,
false,CSAs...>&
1887 Subvector<VT,AF,TF,false,CSAs...>::scale(
const Other& scalar )
1889 for( Iterator element=
begin(); element!=
end(); ++element )
1890 element->value() *= scalar;
1916 template<
typename VT
1920 template<
typename Other >
1921 inline bool Subvector<VT,AF,TF,false,CSAs...>::canAlias(
const Other* alias )
const noexcept
1923 return vector_.isAliased( alias );
1940 template<
typename VT
1944 template<
typename Other >
1945 inline bool Subvector<VT,AF,TF,false,CSAs...>::isAliased(
const Other* alias )
const noexcept
1947 return vector_.isAliased( alias );
1964 template<
typename VT
1968 inline bool Subvector<VT,AF,TF,false,CSAs...>::canSMPAssign() const noexcept
1988 template<
typename VT
1992 template<
typename VT2 >
1993 inline void Subvector<VT,AF,TF,false,CSAs...>::assign(
const DenseVector<VT2,TF>& rhs )
1998 reserve( (~rhs).
size() );
2000 for(
size_t i=0UL; i<
size(); ++i ) {
2001 append( i, (~rhs)[i],
true );
2020 template<
typename VT
2024 template<
typename VT2 >
2025 inline void Subvector<VT,AF,TF,false,CSAs...>::assign(
const SparseVector<VT2,TF>& rhs )
2032 for( ConstIterator_t<VT2> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element ) {
2033 append( element->index(), element->value(), true );
2052 template<
typename VT
2056 template<
typename VT2 >
2057 inline void Subvector<VT,AF,TF,false,CSAs...>::addAssign(
const DenseVector<VT2,TF>& rhs )
2059 using AddType = AddTrait_t< ResultType, ResultType_t<VT2> >;
2067 const AddType tmp(
serial( *
this + (~rhs) ) );
2087 template<
typename VT
2091 template<
typename VT2 >
2092 inline void Subvector<VT,AF,TF,false,CSAs...>::addAssign(
const SparseVector<VT2,TF>& rhs )
2094 using AddType = AddTrait_t< ResultType, ResultType_t<VT2> >;
2102 const AddType tmp(
serial( *
this + (~rhs) ) );
2122 template<
typename VT
2126 template<
typename VT2 >
2127 inline void Subvector<VT,AF,TF,false,CSAs...>::subAssign(
const DenseVector<VT2,TF>& rhs )
2129 using SubType = SubTrait_t< ResultType, ResultType_t<VT2> >;
2137 const SubType tmp(
serial( *
this - (~rhs) ) );
2157 template<
typename VT
2161 template<
typename VT2 >
2162 inline void Subvector<VT,AF,TF,false,CSAs...>::subAssign(
const SparseVector<VT2,TF>& rhs )
2164 using SubType = SubTrait_t< ResultType, ResultType_t<VT2> >;
2172 const SubType tmp(
serial( *
this - (~rhs) ) );
AlignmentFlag
Alignment flag for (un-)aligned vectors and matrices.Via these flags it is possible to specify subvec...
Definition: AlignmentFlag.h:62
#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.
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:432
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression,...
Definition: Assert.h:117
Header file for the alignment flag values.
Header file for the subtraction trait.
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
Header file for the SparseVector base class.
Header file for the View base class.
Header file for the serial shim.
#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
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
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
Header file for the IsIntegral type trait.
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
#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
Header file for the extended initializer_list functionality.
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
Constraint on the data type.
Header file for the DisableIf class template.
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
Header file for the implementation of a vector representation of an initializer list.
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:9091
#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.
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:370
Header file for the implementation of the SubvectorData class 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:253
Header file for the subvector trait.
constexpr bool Contains_v
Auxiliary variable template for the Contains type trait.The Contains_v variable template provides a c...
Definition: Contains.h:138
#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.
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
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.
Constraint on the data type.
typename SubvectorTrait< VT, CSAs... >::Type SubvectorTrait_t
Auxiliary alias declaration for the SubvectorTrait type trait.The SubvectorTrait_t alias declaration ...
Definition: SubvectorTrait.h:171
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:558
Header file for the IsConst type trait.
Header file for run time assertion macros.
Header file for the relaxation flag types.
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
Header file for the Unique class template.
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 isDefault shim.
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:75
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
#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
#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....
Definition: Subvector.h:81
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
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:494
constexpr bool IsIntegral_v
Auxiliary variable template for the IsIntegral type trait.The IsIntegral_v variable template provides...
Definition: IsIntegral.h:95
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.
#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,...
Definition: Assert.h:101
Header file for the IsExpression type trait class.