35#ifndef _BLAZE_MATH_VIEWS_ELEMENTS_SPARSE_H_
36#define _BLAZE_MATH_VIEWS_ELEMENTS_SPARSE_H_
101class Elements<VT,TF,false,CEAs...>
102 :
public View< SparseVector< Elements<VT,TF,false,CEAs...>, TF > >
103 ,
private ElementsData<CEAs...>
107 using DataType = ElementsData<CEAs...>;
108 using Operand = If_t< IsExpression_v<VT>, VT, VT& >;
118 using This = Elements<VT,TF,
false,CEAs...>;
121 using BaseType = View< SparseVector<This,TF> >;
123 using ViewedType = VT;
124 using ResultType = ElementsTrait_t<VT,N>;
125 using TransposeType = TransposeType_t<ResultType>;
126 using ElementType = ElementType_t<VT>;
127 using ReturnType = ReturnType_t<VT>;
128 using CompositeType =
const Elements&;
131 using ConstReference = ConstReference_t<VT>;
134 using Reference = If_t< IsConst_v<VT>, ConstReference, Reference_t<VT> >;
140 template<
typename IteratorType >
141 class ElementsElement
142 :
private SparseElement
151 inline ElementsElement( IteratorType pos,
size_t index )
163 template<
typename T >
inline ElementsElement& operator=(
const T& v ) {
175 template<
typename T >
inline ElementsElement&
operator+=(
const T& v ) {
187 template<
typename T >
inline ElementsElement&
operator-=(
const T& v ) {
199 template<
typename T >
inline ElementsElement&
operator*=(
const T& v ) {
211 template<
typename T >
inline ElementsElement&
operator/=(
const T& v ) {
222 inline const ElementsElement* operator->()
const {
232 inline decltype(
auto) value()
const {
233 return pos_->value();
242 inline size_t index()
const {
258 template<
typename ET
259 ,
typename IteratorType >
260 class ElementsIterator
264 using IteratorCategory = std::forward_iterator_tag;
265 using ValueType = ElementsElement<IteratorType>;
266 using PointerType = ValueType;
267 using ReferenceType = ValueType;
271 using iterator_category = IteratorCategory;
272 using value_type = ValueType;
273 using pointer = PointerType;
274 using reference = ReferenceType;
275 using difference_type = DifferenceType;
281 inline ElementsIterator()
282 : elements_( nullptr )
294 inline ElementsIterator( ET*
elements,
size_t index )
299 for( ; index_<elements_->size(); ++index_ ) {
300 pos_ = elements_->operand().find( elements_->idx(index_) );
301 if( pos_ != elements_->operand().end() )
break;
313 inline ElementsIterator( ET*
elements,
size_t index, IteratorType pos )
325 template<
typename ET2,
typename IteratorType2 >
326 inline ElementsIterator(
const ElementsIterator<ET2,IteratorType2>& it )
327 : elements_( it.elements_ )
328 , index_ ( it.index_ )
338 inline ElementsIterator& operator++() {
340 for( ; index_<elements_->size(); ++index_ ) {
341 pos_ = elements_->operand().find( elements_->idx(index_) );
342 if( pos_ != elements_->operand().end() )
break;
353 inline const ElementsIterator operator++(
int ) {
354 const ElementsIterator tmp( *
this );
366 return ReferenceType( pos_, index_ );
375 inline PointerType operator->()
const {
376 return PointerType( pos_, index_ );
386 inline bool operator==(
const ElementsIterator& rhs )
const {
387 return index_ == rhs.index_;
397 inline bool operator!=(
const ElementsIterator& rhs )
const {
398 return index_ != rhs.index_;
408 inline DifferenceType
operator-(
const ElementsIterator& rhs )
const {
409 size_t counter( 0UL );
410 for(
size_t j=rhs.index_; j<index_; ++j ) {
411 if( elements_->find( j ) != elements_->end() )
426 template<
typename VT2,
bool TF2,
bool DF2,
typename... CEAs2 >
friend class Elements;
427 template<
typename ET2,
typename IteratorType2 >
friend class ElementsIterator;
434 using ConstIterator = ElementsIterator< const This, ConstIterator_t<VT> >;
437 using Iterator = If_t< IsConst_v<VT>, ConstIterator, ElementsIterator< This, Iterator_t<VT> > >;
442 static constexpr bool smpAssignable =
false;
445 static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
451 template<
typename... REAs >
452 explicit inline Elements( VT& vector, REAs... args );
454 Elements(
const Elements& ) =
default;
455 Elements( Elements&& ) =
default;
462 ~Elements() =
default;
469 inline Reference operator[](
size_t index );
470 inline ConstReference operator[](
size_t index )
const;
471 inline Reference at(
size_t index );
472 inline ConstReference at(
size_t index )
const;
473 inline Iterator
begin ();
474 inline ConstIterator
begin ()
const;
475 inline ConstIterator
cbegin()
const;
476 inline Iterator
end ();
477 inline ConstIterator
end ()
const;
478 inline ConstIterator
cend ()
const;
486 inline Elements& operator= (
const Elements& rhs );
487 template<
typename VT2 >
inline Elements& operator= (
const Vector<VT2,TF>& rhs );
488 template<
typename VT2 >
inline Elements&
operator+=(
const Vector<VT2,TF>& rhs );
489 template<
typename VT2 >
inline Elements&
operator-=(
const Vector<VT2,TF>& rhs );
490 template<
typename VT2 >
inline Elements&
operator*=(
const Vector<VT2,TF>& rhs );
491 template<
typename VT2 >
inline Elements&
operator/=(
const DenseVector<VT2,TF>& rhs );
492 template<
typename VT2 >
inline Elements& operator%=(
const Vector<VT2,TF>& rhs );
499 using DataType::idces;
503 inline VT& operand() noexcept;
504 inline const VT& operand() const noexcept;
506 inline
size_t capacity() const noexcept;
509 inline
void reserve(
size_t n );
516 inline Iterator
set (
size_t index, const ElementType& value );
517 inline Iterator insert(
size_t index, const ElementType& value );
518 inline
void append(
size_t index, const ElementType& value,
bool check=false );
525 inline
void erase(
size_t index );
526 inline Iterator erase( Iterator pos );
527 inline Iterator erase( Iterator first, Iterator last );
530 inline
void erase( Pred predicate );
532 template< typename Pred >
533 inline
void erase( Iterator first, Iterator last, Pred predicate );
540 inline Iterator
find (
size_t index );
541 inline ConstIterator
find (
size_t index ) const;
543 inline ConstIterator
lowerBound(
size_t index ) const;
545 inline ConstIterator
upperBound(
size_t index ) const;
552 template< typename Other > inline Elements& scale( const Other& scalar );
559 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
560 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
562 inline
bool canSMPAssign() const noexcept;
564 template< typename VT2 > inline
void assign ( const DenseVector <VT2,TF>& rhs );
565 template< typename VT2 > inline
void assign ( const SparseVector<VT2,TF>& rhs );
566 template< typename VT2 > inline
void addAssign( const Vector<VT2,TF>& rhs );
567 template< typename VT2 > inline
void subAssign( const Vector<VT2,TF>& rhs );
616template< typename... REAs >
617inline Elements<VT,TF,false,CEAs...>::Elements( VT& vector, REAs... args )
618 : DataType( args... )
622 for(
size_t i=0UL; i<
size(); ++i ) {
623 if( vector_.size() <= idx(i) ) {
654inline typename Elements<VT,TF,
false,CEAs...>::Reference
655 Elements<VT,TF,false,CEAs...>::operator[](
size_t index )
658 return vector_[idx(index)];
677inline typename Elements<VT,TF,
false,CEAs...>::ConstReference
678 Elements<VT,TF,false,CEAs...>::operator[](
size_t index )
const
681 return const_cast<const VT&
>( vector_ )[idx(index)];
701inline typename Elements<VT,TF,
false,CEAs...>::Reference
702 Elements<VT,TF,false,CEAs...>::at(
size_t index )
704 if( index >=
size() ) {
707 return (*
this)[index];
727inline typename Elements<VT,TF,
false,CEAs...>::ConstReference
728 Elements<VT,TF,false,CEAs...>::at(
size_t index )
const
730 if( index >=
size() ) {
733 return (*
this)[index];
750inline typename Elements<VT,TF,
false,CEAs...>::Iterator
753 return Iterator(
this, 0UL );
770inline typename Elements<VT,TF,
false,CEAs...>::ConstIterator
773 return ConstIterator(
this, 0UL );
790inline typename Elements<VT,TF,
false,CEAs...>::ConstIterator
793 return ConstIterator(
this, 0UL );
810inline typename Elements<VT,TF,
false,CEAs...>::Iterator
813 return Iterator(
this,
size() );
830inline typename Elements<VT,TF,
false,CEAs...>::ConstIterator
833 return ConstIterator(
this,
size() );
850inline typename Elements<VT,TF,
false,CEAs...>::ConstIterator
853 return ConstIterator(
this,
size() );
886inline Elements<VT,TF,
false,CEAs...>&
891 if( list.size() >
size() ) {
895 const InitializerVector<ElementType,TF> tmp( list,
size() );
897 if( IsRestricted_v<VT> ) {
898 for(
size_t i=0UL; i<
size(); ++i ) {
899 if( !trySet( vector_, idx(i), tmp[i] ) ) {
905 decltype(
auto) left( derestrict( *
this ) );
932inline Elements<VT,TF,
false,CEAs...>&
933 Elements<VT,TF,false,CEAs...>::operator=(
const Elements& rhs )
940 if( &rhs ==
this || ( &vector_ == &rhs.vector_ && compareIndices( *
this, rhs ) ) )
943 if(
size() != rhs.size() ) {
947 if( IsRestricted_v<VT> ) {
948 for(
size_t i=0UL; i<
size(); ++i ) {
949 if( !trySet( vector_, idx(i), rhs[i] ) ) {
955 decltype(
auto) left( derestrict( *
this ) );
957 if( rhs.canAlias(
this ) ) {
958 const ResultType tmp( rhs );
988template<
typename VT2 >
989inline Elements<VT,TF,
false,CEAs...>&
990 Elements<VT,TF,false,CEAs...>::operator=(
const Vector<VT2,TF>& rhs )
997 if(
size() != (*rhs).size() ) {
1001 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
1002 Right right( *rhs );
1004 if( IsRestricted_v<VT> ) {
1005 for(
size_t i=0UL; i<
size(); ++i ) {
1006 if( !trySet( vector_, idx(i), right[i] ) ) {
1012 decltype(
auto) left( derestrict( *
this ) );
1014 if( IsReference_v<Right> || right.canAlias(
this ) ) {
1015 const ResultType_t<VT2> tmp( right );
1016 assign( left, tmp );
1019 assign( left, right );
1042template<
typename VT
1044 ,
typename... CEAs >
1045template<
typename VT2 >
1046inline Elements<VT,TF,
false,CEAs...>&
1049 using blaze::addAssign;
1054 if(
size() != (*rhs).size() ) {
1058 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
1059 Right right( *rhs );
1061 if( IsRestricted_v<VT> ) {
1062 for(
size_t i=0UL; i<
size(); ++i ) {
1063 if( !tryAdd( vector_, idx(i), right[i] ) ) {
1069 decltype(
auto) left( derestrict( *
this ) );
1071 if( IsReference_v<Right> && right.canAlias(
this ) ) {
1072 const ResultType_t<VT2> tmp( right );
1073 addAssign( left, tmp );
1076 addAssign( left, right );
1099template<
typename VT
1101 ,
typename... CEAs >
1102template<
typename VT2 >
1103inline Elements<VT,TF,
false,CEAs...>&
1106 using blaze::subAssign;
1111 if(
size() != (*rhs).size() ) {
1115 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
1116 Right right( *rhs );
1118 if( IsRestricted_v<VT> ) {
1119 for(
size_t i=0UL; i<
size(); ++i ) {
1120 if( !trySub( vector_, idx(i), right[i] ) ) {
1126 decltype(
auto) left( derestrict( *
this ) );
1128 if( IsReference_v<Right> && right.canAlias(
this ) ) {
1129 const ResultType_t<VT2> tmp( right );
1130 subAssign( left, tmp );
1133 subAssign( left, right );
1157template<
typename VT
1159 ,
typename... CEAs >
1160template<
typename VT2 >
1161inline Elements<VT,TF,
false,CEAs...>&
1164 using blaze::assign;
1170 using MultType = MultTrait_t< ResultType, ResultType_t<VT2> >;
1175 if(
size() != (*rhs).size() ) {
1179 const MultType tmp( *
this * (*rhs) );
1181 if( IsRestricted_v<VT> ) {
1182 for(
size_t i=0UL; i<
size(); ++i ) {
1183 if( !trySet( vector_, idx(i), tmp[i] ) ) {
1189 decltype(
auto) left( derestrict( *
this ) );
1191 assign( left, tmp );
1213template<
typename VT
1215 ,
typename... CEAs >
1216template<
typename VT2 >
1217inline Elements<VT,TF,
false,CEAs...>&
1220 using blaze::assign;
1227 using DivType = DivTrait_t< ResultType, ResultType_t<VT2> >;
1233 if(
size() != (*rhs).size() ) {
1237 const DivType tmp( *
this / (*rhs) );
1239 if( IsRestricted_v<VT> ) {
1240 for(
size_t i=0UL; i<
size(); ++i ) {
1241 if( !trySet( vector_, idx(i), tmp[i] ) ) {
1247 decltype(
auto) left( derestrict( *
this ) );
1249 assign( left, tmp );
1272template<
typename VT
1274 ,
typename... CEAs >
1275template<
typename VT2 >
1276inline Elements<VT,TF,
false,CEAs...>&
1277 Elements<VT,TF,false,CEAs...>::operator%=(
const Vector<VT2,TF>& rhs )
1279 using blaze::assign;
1284 using CrossType = CrossTrait_t< ResultType, ResultType_t<VT2> >;
1290 if(
size() != 3UL || (*rhs).size() != 3UL ) {
1294 const CrossType tmp( *
this % (*rhs) );
1296 if( IsRestricted_v<VT> ) {
1297 for(
size_t i=0UL; i<
size(); ++i ) {
1298 if( !trySet( vector_, idx(i), tmp[i] ) ) {
1304 decltype(
auto) left( derestrict( *
this ) );
1306 assign( left, tmp );
1330template<
typename VT
1332 ,
typename... CEAs >
1333inline VT& Elements<VT,TF,false,CEAs...>::operand() noexcept
1347template<
typename VT
1349 ,
typename... CEAs >
1350inline const VT& Elements<VT,TF,false,CEAs...>::operand() const noexcept
1364template<
typename VT
1366 ,
typename... CEAs >
1369 return nonZeros() + vector_.capacity() - vector_.nonZeros();
1384template<
typename VT
1386 ,
typename... CEAs >
1389 size_t counter( 0UL );
1390 for( ConstIterator element=
begin(); element!=
end(); ++element ) {
1405template<
typename VT
1407 ,
typename... CEAs >
1410 for(
size_t i=0UL; i<
size(); ++i )
1411 vector_.erase( idx(i) );
1427template<
typename VT
1429 ,
typename... CEAs >
1430void Elements<VT,TF,false,CEAs...>::reserve(
size_t n )
1432 const size_t current(
capacity() );
1435 vector_.reserve( vector_.capacity() + n - current );
1462template<
typename VT
1464 ,
typename... CEAs >
1465inline typename Elements<VT,TF,
false,CEAs...>::Iterator
1468 return Iterator(
this, index, vector_.set( idx(index), value ) );
1487template<
typename VT
1489 ,
typename... CEAs >
1490inline typename Elements<VT,TF,
false,CEAs...>::Iterator
1491 Elements<VT,TF,false,CEAs...>::insert(
size_t index,
const ElementType& value )
1493 return Iterator(
this, index, vector_.insert( idx(index), value ) );
1524template<
typename VT
1526 ,
typename... CEAs >
1527inline void Elements<VT,TF,false,CEAs...>::append(
size_t index,
const ElementType& value,
bool check )
1529 if( !check || !isDefault<strict>( value ) )
1530 vector_.insert( idx(index), value );
1553template<
typename VT
1555 ,
typename... CEAs >
1556inline void Elements<VT,TF,false,CEAs...>::erase(
size_t index )
1558 vector_.erase( idx(index) );
1573template<
typename VT
1575 ,
typename... CEAs >
1576inline typename Elements<VT,TF,
false,CEAs...>::Iterator
1577 Elements<VT,TF,false,CEAs...>::erase( Iterator pos )
1579 const size_t index( pos.index_ );
1581 if( index ==
size() )
1584 vector_.erase( pos.pos_ );
1585 return Iterator(
this, index+1UL );
1601template<
typename VT
1603 ,
typename... CEAs >
1604inline typename Elements<VT,TF,
false,CEAs...>::Iterator
1605 Elements<VT,TF,false,CEAs...>::erase( Iterator first, Iterator last )
1607 for( ; first!=last; ++first ) {
1608 vector_.erase( first.pos_ );
1611 return Iterator(
this, last.index_ );
1640template<
typename VT
1642 ,
typename... CEAs >
1643template<
typename Pred
1645inline void Elements<VT,TF,false,CEAs...>::erase( Pred predicate )
1647 erase(
begin(),
end(), predicate );
1679template<
typename VT
1681 ,
typename... CEAs >
1682template<
typename Pred >
1683inline void Elements<VT,TF,false,CEAs...>::erase( Iterator first, Iterator last, Pred predicate )
1685 for( ; first!=last; ++first ) {
1686 if( predicate( first->value() ) )
1687 vector_.erase( first.pos_ );
1716template<
typename VT
1718 ,
typename... CEAs >
1719inline typename Elements<VT,TF,
false,CEAs...>::Iterator
1722 const Iterator_t<VT> pos( vector_.find( idx(index) ) );
1724 if( pos != vector_.end() )
1725 return Iterator(
this, index, pos );
1747template<
typename VT
1749 ,
typename... CEAs >
1750inline typename Elements<VT,TF,
false,CEAs...>::ConstIterator
1753 const ConstIterator_t<VT> pos( vector_.find( idx(index) ) );
1755 if( pos != vector_.end() )
1756 return ConstIterator(
this, index, pos );
1777template<
typename VT
1779 ,
typename... CEAs >
1780inline typename Elements<VT,TF,
false,CEAs...>::Iterator
1783 for( ; index<
size(); ++index ) {
1784 const Iterator_t<VT> pos( vector_.find( idx(index) ) );
1785 if( pos != vector_.end() )
1786 return Iterator(
this, index, pos );
1807template<
typename VT
1809 ,
typename... CEAs >
1810inline typename Elements<VT,TF,
false,CEAs...>::ConstIterator
1813 for( ; index<
size(); ++index ) {
1814 const ConstIterator_t<VT> pos( vector_.find( idx(index) ) );
1815 if( pos != vector_.end() )
1816 return ConstIterator(
this, index, pos );
1837template<
typename VT
1839 ,
typename... CEAs >
1840inline typename Elements<VT,TF,
false,CEAs...>::Iterator
1843 while( (++index) <
size() ) {
1844 const Iterator_t<VT> pos( vector_.find( idx(index) ) );
1845 if( pos != vector_.end() )
1846 return Iterator(
this, index, pos );
1867template<
typename VT
1869 ,
typename... CEAs >
1870inline typename Elements<VT,TF,
false,CEAs...>::ConstIterator
1873 while( (++index) <
size() ) {
1874 const ConstIterator_t<VT> pos( vector_.find( idx(index) ) );
1875 if( pos != vector_.end() )
1876 return ConstIterator(
this, index, pos );
1903template<
typename VT
1905 ,
typename... CEAs >
1906template<
typename Other >
1907inline Elements<VT,TF,
false,CEAs...>&
1908 Elements<VT,TF,false,CEAs...>::scale(
const Other& scalar )
1910 for( Iterator element=
begin(); element!=
end(); ++element )
1911 element->value() *= scalar;
1937template<
typename VT
1939 ,
typename... CEAs >
1940template<
typename Other >
1941inline bool Elements<VT,TF,false,CEAs...>::canAlias(
const Other* alias )
const noexcept
1943 return vector_.isAliased( &unview( *alias ) );
1960template<
typename VT
1962 ,
typename... CEAs >
1963template<
typename Other >
1964inline bool Elements<VT,TF,false,CEAs...>::isAliased(
const Other* alias )
const noexcept
1966 return vector_.isAliased( &unview( *alias ) );
1984template<
typename VT
1986 ,
typename... CEAs >
1987template<
typename VT2 >
1988inline void Elements<VT,TF,false,CEAs...>::assign(
const DenseVector<VT2,TF>& rhs )
1992 using RT = If_t< IsComputation_v<VT2>, ElementType_t<VT>,
const ElementType_t<VT2>& >;
1994 reserve( (*rhs).size() );
1996 for(
size_t i=0UL; i<
size(); ++i ) {
1997 RT value( (*rhs)[i] );
1998 if( !isDefault<strict>( value ) )
1999 vector_.set( idx(i), std::move( value ) );
2000 else vector_.erase( idx(i) );
2019template<
typename VT
2021 ,
typename... CEAs >
2022template<
typename VT2 >
2023inline void Elements<VT,TF,false,CEAs...>::assign(
const SparseVector<VT2,TF>& rhs )
2027 using RT = If_t< IsComputation_v<VT2>, ElementType_t<VT>,
const ElementType_t<VT2>& >;
2031 for( ConstIterator_t<VT2> element=(*rhs).begin(); element!=(*rhs).end(); ++element ) {
2032 for( ; i<element->index(); ++i )
2033 vector_.erase( idx(i) );
2034 RT value( element->value() );
2035 if( !isDefault<strict>( value ) )
2036 vector_.set( idx(i), std::move( value ) );
2037 else vector_.erase( idx(i) );
2040 for( ; i<
size(); ++i ) {
2041 vector_.erase( idx(i) );
2060template<
typename VT
2062 ,
typename... CEAs >
2063template<
typename VT2 >
2064inline void Elements<VT,TF,false,CEAs...>::addAssign(
const Vector<VT2,TF>& rhs )
2066 using AddType = AddTrait_t< ResultType, ResultType_t<VT2> >;
2073 const AddType tmp(
serial( *
this + (*rhs) ) );
2092template<
typename VT
2094 ,
typename... CEAs >
2095template<
typename VT2 >
2096inline void Elements<VT,TF,false,CEAs...>::subAssign(
const Vector<VT2,TF>& rhs )
2098 using SubType = SubTrait_t< ResultType, ResultType_t<VT2> >;
2105 const SubType tmp(
serial( *
this - (*rhs) ) );
Header file for the addition trait.
Header file for auxiliary alias declarations.
Header file for run time assertion macros.
Header file for the blaze::checked and blaze::unchecked instances.
Header file for the cross product trait.
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:751
Header file for the division trait.
Header file for the implementation of the ElementsData class template.
Header file for the elements trait.
Header file for the EnableIf class template.
Header file for the If class template.
Header file for the IsComputation type trait class.
Header file for the IsConst type trait.
Header file for the IsExpression type trait class.
Header file for the IsIntegral type trait.
Header file for the IsReference type trait.
Header file for the IsRestricted type trait.
Deactivation of problematic macros.
Header file for the multiplication trait.
Header file for the subtraction trait.
Initializer list type of the Blaze library.
Pointer difference type of the Blaze library.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of a vector representation of an initializer list.
Header file for the SparseVector base class.
Header file for the View base class.
auto operator/=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Division assignment operator for the division of a dense matrix by a scalar value ( ).
Definition: DenseMatrix.h:574
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:386
auto operator*=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:510
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:812
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:9640
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:448
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:207
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition: Elements.h:143
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition: RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.
Definition: TransExpr.h:81
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.
Definition: TransposeFlag.h:63
#define BLAZE_CONSTRAINT_MUST_NOT_BE_ELEMENTS_TYPE(T)
Constraint on the data type.
Definition: Elements.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.
Definition: SparseVector.h:61
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.
Definition: DenseVector.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SUBVECTOR_TYPE(T)
Constraint on the data type.
Definition: Subvector.h:81
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
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
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:628
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:730
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:562
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:692
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition: Matrix.h:806
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:584
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:518
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:676
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.
Definition: Assert.h:117
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
MT::Iterator upperBound(SparseMatrix< MT, SO > &sm, size_t i, size_t j)
Returns an iterator to the first index greater than the given index.
Definition: SparseMatrix.h:244
MT::Iterator lowerBound(SparseMatrix< MT, SO > &sm, size_t i, size_t j)
Returns an iterator to the first index not less than the given index.
Definition: SparseMatrix.h:194
MT::Iterator find(SparseMatrix< MT, SO > &sm, size_t i, size_t j)
Searches for a specific matrix element.
Definition: SparseMatrix.h:144
constexpr bool IsIntegral_v
Auxiliary variable template for the IsIntegral type trait.
Definition: IsIntegral.h:95
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition: Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:175
constexpr bool isChecked(const Ts &... args)
Extracting blaze::Check arguments from a given list of arguments.
Definition: Check.h:225
Header file for the exception macros of the math module.
Header file for the extended initializer_list functionality.
Constraint on the data type.
Header file for all forward declarations for expression class templates.
Header file for the serial shim.
Header file for the SparseElement base class.
Header file for basic type definitions.
Header file for the implementation of the Elements base template.