35#ifndef _BLAZE_MATH_VIEWS_ROWS_SPARSE_H_
36#define _BLAZE_MATH_VIEWS_ROWS_SPARSE_H_
111class Rows<MT,true,false,SF,CRAs...>
112 :
public View< SparseMatrix< Rows<MT,true,false,SF,CRAs...>, false > >
113 ,
private RowsData<CRAs...>
117 using DataType = RowsData<CRAs...>;
118 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
128 using This = Rows<MT,
true,
false,SF,CRAs...>;
131 using BaseType = View< SparseMatrix<This,false> >;
133 using ViewedType = MT;
134 using ResultType = RowsTrait_t<MT,N>;
135 using OppositeType = OppositeType_t<ResultType>;
136 using TransposeType = TransposeType_t<ResultType>;
137 using ElementType = ElementType_t<MT>;
138 using ReturnType = ReturnType_t<MT>;
139 using CompositeType =
const Rows&;
142 using ConstReference = ConstReference_t<MT>;
145 using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
148 using ConstIterator = ConstIterator_t<MT>;
151 using Iterator = If_t< IsConst_v<MT>, ConstIterator, Iterator_t<MT> >;
156 static constexpr bool smpAssignable = MT::smpAssignable;
159 static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
165 template<
typename... RRAs >
166 explicit inline Rows( MT& matrix, RRAs... args );
168 Rows(
const Rows& ) =
default;
169 Rows( Rows&& ) =
default;
183 inline Reference operator()(
size_t i,
size_t j );
184 inline ConstReference operator()(
size_t i,
size_t j )
const;
185 inline Reference at(
size_t i,
size_t j );
186 inline ConstReference at(
size_t i,
size_t j )
const;
187 inline Iterator
begin (
size_t i );
188 inline ConstIterator
begin (
size_t i )
const;
189 inline ConstIterator
cbegin(
size_t i )
const;
190 inline Iterator
end (
size_t i );
191 inline ConstIterator
end (
size_t i )
const;
192 inline ConstIterator
cend (
size_t i )
const;
200 inline Rows& operator=(
const Rows& rhs );
202 template<
typename MT2,
bool SO >
inline Rows& operator= (
const Matrix<MT2,SO>& rhs );
203 template<
typename MT2,
bool SO >
inline Rows&
operator+=(
const Matrix<MT2,SO>& rhs );
204 template<
typename MT2,
bool SO >
inline Rows&
operator-=(
const Matrix<MT2,SO>& rhs );
205 template<
typename MT2,
bool SO >
inline Rows& operator%=(
const Matrix<MT2,SO>& rhs );
213 using DataType::idces;
216 inline MT& operand() noexcept;
217 inline const MT& operand() const noexcept;
219 inline
size_t columns() const noexcept;
220 inline
size_t capacity() const noexcept;
221 inline
size_t capacity(
size_t i ) const noexcept;
223 inline
size_t nonZeros(
size_t i ) const;
225 inline
void reset(
size_t i );
226 inline
void reserve(
size_t nonzeros );
227 void reserve(
size_t i,
size_t nonzeros );
229 inline
void trim(
size_t i );
236 inline Iterator
set (
size_t i,
size_t j, const ElementType& value );
237 inline Iterator insert (
size_t i,
size_t j, const ElementType& value );
238 inline
void append (
size_t i,
size_t j, const ElementType& value,
bool check=false );
239 inline
void finalize(
size_t i );
246 inline
void erase(
size_t i,
size_t j );
247 inline Iterator erase(
size_t i, Iterator pos );
248 inline Iterator erase(
size_t i, Iterator first, Iterator last );
250 template< typename Pred >
251 inline
void erase( Pred predicate );
253 template< typename Pred >
254 inline
void erase(
size_t i, Iterator first, Iterator last, Pred predicate );
261 inline Iterator
find (
size_t i,
size_t j );
262 inline ConstIterator
find (
size_t i,
size_t j ) const;
263 inline Iterator
lowerBound(
size_t i,
size_t j );
264 inline ConstIterator
lowerBound(
size_t i,
size_t j ) const;
265 inline Iterator
upperBound(
size_t i,
size_t j );
266 inline ConstIterator
upperBound(
size_t i,
size_t j ) const;
276 template< typename Other > inline Rows& scale( const Other& scalar );
283 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
284 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
286 inline
bool canSMPAssign() const noexcept;
288 template< typename MT2,
bool SO > inline
void assign ( const DenseMatrix<MT2,SO>& rhs );
289 template< typename MT2 > inline
void assign ( const SparseMatrix<MT2,false>& rhs );
290 template< typename MT2 > inline
void assign ( const SparseMatrix<MT2,true>& rhs );
291 template< typename MT2,
bool SO > inline
void addAssign ( const Matrix<MT2,SO>& rhs );
292 template< typename MT2,
bool SO > inline
void subAssign ( const Matrix<MT2,SO>& rhs );
293 template< typename MT2,
bool SO > inline
void schurAssign( const Matrix<MT2,SO>& rhs );
301 inline
size_t extendCapacity(
size_t i ) const noexcept;
351template< typename... RRAs >
352inline Rows<MT,true,false,SF,CRAs...>::Rows( MT& matrix, RRAs... args )
353 : DataType( args... )
357 for(
size_t i=0UL; i<
rows(); ++i ) {
358 if( matrix_.rows() <= idx(i) ) {
390inline typename Rows<MT,
true,
false,SF,CRAs...>::Reference
391 Rows<MT,true,false,SF,CRAs...>::operator()(
size_t i,
size_t j )
396 return matrix_(idx(i),j);
416inline typename Rows<MT,
true,
false,SF,CRAs...>::ConstReference
417 Rows<MT,true,false,SF,CRAs...>::operator()(
size_t i,
size_t j )
const
422 return const_cast<const MT&
>( matrix_ )(idx(i),j);
443inline typename Rows<MT,
true,
false,SF,CRAs...>::Reference
444 Rows<MT,true,false,SF,CRAs...>::at(
size_t i,
size_t j )
473inline typename Rows<MT,
true,
false,SF,CRAs...>::ConstReference
474 Rows<MT,true,false,SF,CRAs...>::at(
size_t i,
size_t j )
const
500inline typename Rows<MT,
true,
false,SF,CRAs...>::Iterator
505 return matrix_.begin( idx(i) );
523inline typename Rows<MT,
true,
false,SF,CRAs...>::ConstIterator
528 return matrix_.cbegin( idx(i) );
546inline typename Rows<MT,
true,
false,SF,CRAs...>::ConstIterator
551 return matrix_.cbegin( idx(i) );
569inline typename Rows<MT,
true,
false,SF,CRAs...>::Iterator
574 return matrix_.end( idx(i) );
592inline typename Rows<MT,
true,
false,SF,CRAs...>::ConstIterator
597 return matrix_.cend( idx(i) );
615inline typename Rows<MT,
true,
false,SF,CRAs...>::ConstIterator
620 return matrix_.cend( idx(i) );
653inline Rows<MT,
true,
false,SF,CRAs...>&
659 if( list.size() !=
rows() ) {
663 const InitializerMatrix<ElementType> tmp( list,
columns() );
665 if( IsRestricted_v<MT> ) {
666 for(
size_t i=0UL; i<
rows(); ++i ) {
667 if( !tryAssign( matrix_,
row( tmp, i,
unchecked ), i, 0UL ) ) {
673 decltype(
auto) left( derestrict( *
this ) );
702inline Rows<MT,
true,
false,SF,CRAs...>&
703 Rows<MT,true,false,SF,CRAs...>::operator=(
const Rows& rhs )
711 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && compareIndices( *
this, rhs ) ) )
714 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
718 if( IsRestricted_v<MT> ) {
719 for(
size_t i=0UL; i<
rows(); ++i ) {
720 if( !tryAssign( matrix_,
row( rhs, i,
unchecked ), idx(i), 0UL ) ) {
726 decltype(
auto) left( derestrict( *
this ) );
728 if( rhs.canAlias(
this ) ) {
729 const ResultType tmp( rhs );
764template<
typename MT2
766inline Rows<MT,
true,
false,SF,CRAs...>&
767 Rows<MT,true,false,SF,CRAs...>::operator=(
const Matrix<MT2,SO>& rhs )
774 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
778 using Right = CompositeType_t<MT2>;
781 if( IsRestricted_v<MT> ) {
782 for(
size_t i=0UL; i<
rows(); ++i ) {
783 if( !tryAssign( matrix_,
row( right, i,
unchecked ), idx(i), 0UL ) ) {
789 decltype(
auto) left( derestrict( *
this ) );
791 if( IsReference_v<Right> && right.canAlias(
this ) ) {
792 const ResultType_t<MT2> tmp( right );
826template<
typename MT2
828inline Rows<MT,
true,
false,SF,CRAs...>&
838 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
842 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
846 const AddType tmp( *
this + (*rhs) );
848 if( IsRestricted_v<MT> ) {
849 for(
size_t i=0UL; i<
rows(); ++i ) {
850 if( !tryAssign( matrix_,
row( tmp, i,
unchecked ), idx(i), 0UL ) ) {
856 decltype(
auto) left( derestrict( *
this ) );
886template<
typename MT2
888inline Rows<MT,
true,
false,SF,CRAs...>&
898 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
902 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
906 const SubType tmp( *
this - (*rhs) );
908 if( IsRestricted_v<MT> ) {
909 for(
size_t i=0UL; i<
rows(); ++i ) {
910 if( !tryAssign( matrix_,
row( tmp, i,
unchecked ), idx(i), 0UL ) ) {
916 decltype(
auto) left( derestrict( *
this ) );
946template<
typename MT2
948inline Rows<MT,
true,
false,SF,CRAs...>&
949 Rows<MT,true,false,SF,CRAs...>::operator%=(
const Matrix<MT2,SO>& rhs )
958 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
962 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
966 const SchurType tmp( *
this % (*rhs) );
968 if( IsRestricted_v<MT> ) {
969 for(
size_t i=0UL; i<
rows(); ++i ) {
970 if( !tryAssign( matrix_,
row( tmp, i,
unchecked ), idx(i), 0UL ) ) {
976 decltype(
auto) left( derestrict( *
this ) );
1003template<
typename MT
1005 ,
typename... CRAs >
1006inline MT& Rows<MT,true,false,SF,CRAs...>::operand() noexcept
1020template<
typename MT
1022 ,
typename... CRAs >
1023inline const MT& Rows<MT,true,false,SF,CRAs...>::operand() const noexcept
1037template<
typename MT
1039 ,
typename... CRAs >
1042 return matrix_.columns();
1054template<
typename MT
1056 ,
typename... CRAs >
1059 return nonZeros() + matrix_.capacity() - matrix_.nonZeros();
1074template<
typename MT
1076 ,
typename... CRAs >
1081 return matrix_.capacity( idx(i) );
1093template<
typename MT
1095 ,
typename... CRAs >
1098 size_t nonzeros( 0UL );
1100 for(
size_t i=0UL; i<
rows(); ++i )
1118template<
typename MT
1120 ,
typename... CRAs >
1125 return matrix_.nonZeros( idx(i) );
1137template<
typename MT
1139 ,
typename... CRAs >
1142 for(
size_t i=0UL; i<
rows(); ++i ) {
1143 matrix_.reset( idx(i) );
1160template<
typename MT
1162 ,
typename... CRAs >
1165 matrix_.reset( idx(i) );
1182template<
typename MT
1184 ,
typename... CRAs >
1185inline void Rows<MT,true,false,SF,CRAs...>::reserve(
size_t nonzeros )
1187 const size_t current(
capacity() );
1189 if( nonzeros > current ) {
1190 matrix_.reserve( matrix_.capacity() + nonzeros - current );
1210template<
typename MT
1212 ,
typename... CRAs >
1213void Rows<MT,true,false,SF,CRAs...>::reserve(
size_t i,
size_t nonzeros )
1215 matrix_.reserve( idx(i), nonzeros );
1231template<
typename MT
1233 ,
typename... CRAs >
1234void Rows<MT,true,false,SF,CRAs...>::trim()
1236 for(
size_t i=0UL; i<
rows(); ++i ) {
1255template<
typename MT
1257 ,
typename... CRAs >
1258void Rows<MT,true,false,SF,CRAs...>::trim(
size_t i )
1262 matrix_.trim( idx(i) );
1278template<
typename MT
1280 ,
typename... CRAs >
1281inline size_t Rows<MT,true,false,SF,CRAs...>::extendCapacity(
size_t i )
const noexcept
1286 size_t nonzeros( 2UL*
capacity( i )+1UL );
1287 nonzeros =
max( nonzeros, 7UL );
1319template<
typename MT
1321 ,
typename... CRAs >
1322inline typename Rows<MT,
true,
false,SF,CRAs...>::Iterator
1325 return matrix_.set( idx(i), j, value );
1345template<
typename MT
1347 ,
typename... CRAs >
1348inline typename Rows<MT,
true,
false,SF,CRAs...>::Iterator
1349 Rows<MT,true,false,SF,CRAs...>::insert(
size_t i,
size_t j,
const ElementType& value )
1351 return matrix_.insert( idx(i), j, value );
1401template<
typename MT
1403 ,
typename... CRAs >
1404inline void Rows<MT,true,false,SF,CRAs...>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
1406 if( !check || !isDefault<strict>( value ) )
1407 matrix_.insert( idx(i), j, value );
1427template<
typename MT
1429 ,
typename... CRAs >
1430inline void Rows<MT,true,false,SF,CRAs...>::finalize(
size_t i )
1458template<
typename MT
1460 ,
typename... CRAs >
1461inline void Rows<MT,true,false,SF,CRAs...>::erase(
size_t i,
size_t j )
1466 matrix_.erase( idx(i), j );
1482template<
typename MT
1484 ,
typename... CRAs >
1485inline typename Rows<MT,
true,
false,SF,CRAs...>::Iterator
1486 Rows<MT,true,false,SF,CRAs...>::erase(
size_t i, Iterator pos )
1490 return matrix_.erase( idx(i), pos );
1507template<
typename MT
1509 ,
typename... CRAs >
1510inline typename Rows<MT,
true,
false,SF,CRAs...>::Iterator
1511 Rows<MT,true,false,SF,CRAs...>::erase(
size_t i, Iterator first, Iterator last )
1515 return matrix_.erase( idx(i), first, last );
1544template<
typename MT
1546 ,
typename... CRAs >
1547template<
typename Pred >
1548inline void Rows<MT,true,false,SF,CRAs...>::erase( Pred predicate )
1550 for(
size_t i=0UL; i<
rows(); ++i ) {
1551 matrix_.erase( idx(i),
begin(i),
end(i), predicate );
1585template<
typename MT
1587 ,
typename... CRAs >
1588template<
typename Pred >
1589inline void Rows<MT,true,false,SF,CRAs...>::erase(
size_t i, Iterator first, Iterator last, Pred predicate )
1593 matrix_.erase( idx(i), first, last, predicate );
1622template<
typename MT
1624 ,
typename... CRAs >
1625inline typename Rows<MT,
true,
false,SF,CRAs...>::Iterator
1628 return matrix_.find( idx(i), j );
1649template<
typename MT
1651 ,
typename... CRAs >
1652inline typename Rows<MT,
true,
false,SF,CRAs...>::ConstIterator
1655 return matrix_.find( idx(i), j );
1675template<
typename MT
1677 ,
typename... CRAs >
1678inline typename Rows<MT,
true,
false,SF,CRAs...>::Iterator
1681 return matrix_.lowerBound( idx(i), j );
1701template<
typename MT
1703 ,
typename... CRAs >
1704inline typename Rows<MT,
true,
false,SF,CRAs...>::ConstIterator
1707 return matrix_.lowerBound( idx(i), j );
1727template<
typename MT
1729 ,
typename... CRAs >
1730inline typename Rows<MT,
true,
false,SF,CRAs...>::Iterator
1733 return matrix_.upperBound( idx(i), j );
1753template<
typename MT
1755 ,
typename... CRAs >
1756inline typename Rows<MT,
true,
false,SF,CRAs...>::ConstIterator
1759 return matrix_.upperBound( idx(i), j );
1786template<
typename MT
1788 ,
typename... CRAs >
1789inline Rows<MT,
true,
false,SF,CRAs...>&
1799 const ResultType tmp(
trans( *
this ) );
1801 if( IsRestricted_v<MT> ) {
1802 for(
size_t i=0UL; i<
rows(); ++i ) {
1803 if( !tryAssign( matrix_,
row( tmp, i,
unchecked ), idx(i), 0UL ) ) {
1809 decltype(
auto) left( derestrict( *
this ) );
1833template<
typename MT
1835 ,
typename... CRAs >
1836inline Rows<MT,
true,
false,SF,CRAs...>&
1846 const ResultType tmp(
ctrans( *
this ) );
1848 if( IsRestricted_v<MT> ) {
1849 for(
size_t i=0UL; i<
rows(); ++i ) {
1850 if( !tryAssign( matrix_,
row( tmp, i,
unchecked ), idx(i), 0UL ) ) {
1856 decltype(
auto) left( derestrict( *
this ) );
1880template<
typename MT
1882 ,
typename... CRAs >
1883template<
typename Other >
1884inline Rows<MT,
true,
false,SF,CRAs...>&
1885 Rows<MT,true,false,SF,CRAs...>::scale(
const Other& scalar )
1891 for(
size_t i=0UL; i<
rows(); ++i ) {
1892 const Iterator last(
end(i) );
1893 for( Iterator element=
begin(i); element!=last; ++element )
1894 element->value() *= scalar;
1922template<
typename MT
1924 ,
typename... CRAs >
1925template<
typename Other >
1926inline bool Rows<MT,true,false,SF,CRAs...>::canAlias(
const Other* alias )
const noexcept
1928 return matrix_.isAliased( &unview( *alias ) );
1945template<
typename MT
1947 ,
typename... CRAs >
1948template<
typename Other >
1949inline bool Rows<MT,true,false,SF,CRAs...>::isAliased(
const Other* alias )
const noexcept
1951 return matrix_.isAliased( &unview( *alias ) );
1968template<
typename MT
1970 ,
typename... CRAs >
1971inline bool Rows<MT,true,false,SF,CRAs...>::canSMPAssign() const noexcept
1991template<
typename MT
1993 ,
typename... CRAs >
1994template<
typename MT2
1996inline void Rows<MT,true,false,SF,CRAs...>::assign(
const DenseMatrix<MT2,SO>& rhs )
2005 for(
size_t i=0UL; i<
rows(); ++i )
2007 const size_t index( idx(i) );
2008 size_t remaining( matrix_.capacity( index ) );
2010 for(
size_t j=0UL; j<
columns(); ++j )
2012 if( remaining == 0UL ) {
2013 matrix_.reserve( index, extendCapacity( i ) );
2014 remaining = matrix_.capacity( index ) - matrix_.nonZeros( index );
2017 matrix_.append( index, j, (*rhs)(i,j),
true );
2038template<
typename MT
2040 ,
typename... CRAs >
2041template<
typename MT2 >
2042inline void Rows<MT,true,false,SF,CRAs...>::assign(
const SparseMatrix<MT2,false>& rhs )
2051 for(
size_t i=0UL; i<
rows(); ++i )
2053 const size_t index( idx(i) );
2054 size_t remaining( matrix_.capacity( index ) );
2056 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
2058 if( remaining == 0UL ) {
2059 matrix_.reserve( index, extendCapacity( i ) );
2060 remaining = matrix_.capacity( index ) - matrix_.nonZeros( index );
2063 matrix_.append( index, element->index(), element->value(),
true );
2084template<
typename MT
2086 ,
typename... CRAs >
2087template<
typename MT2 >
2088inline void Rows<MT,true,false,SF,CRAs...>::assign(
const SparseMatrix<MT2,true>& rhs )
2100 std::vector<size_t> rowLengths(
rows(), 0UL );
2101 for(
size_t j=0UL; j<
columns(); ++j ) {
2102 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
2103 ++rowLengths[element->index()];
2107 for(
size_t i=0UL; i<
rows(); ++i ) {
2108 reserve( i, rowLengths[i] );
2112 for(
size_t j=0UL; j<
columns(); ++j ) {
2113 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
2114 append( element->index(), j, element->value(), true );
2133template<
typename MT
2135 ,
typename... CRAs >
2136template<
typename MT2
2138inline void Rows<MT,true,false,SF,CRAs...>::addAssign(
const Matrix<MT2,SO>& rhs )
2143 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
2150 const AddType tmp(
serial( *
this + (*rhs) ) );
2170template<
typename MT
2172 ,
typename... CRAs >
2173template<
typename MT2
2175inline void Rows<MT,true,false,SF,CRAs...>::subAssign(
const Matrix<MT2,SO>& rhs )
2180 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
2187 const SubType tmp(
serial( *
this - (*rhs) ) );
2207template<
typename MT
2209 ,
typename... CRAs >
2210template<
typename MT2
2212inline void Rows<MT,true,false,SF,CRAs...>::schurAssign(
const Matrix<MT2,SO>& rhs )
2217 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
2225 const SchurType tmp(
serial( *
this % (*rhs) ) );
2253template<
typename MT
2254 ,
typename... CRAs >
2255class Rows<MT,false,false,false,CRAs...>
2256 :
public View< SparseMatrix< Rows<MT,false,false,false,CRAs...>, false > >
2257 ,
private RowsData<CRAs...>
2261 using DataType = RowsData<CRAs...>;
2262 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
2272 using This = Rows<MT,
false,
false,
false,CRAs...>;
2275 using BaseType = View< SparseMatrix<This,false> >;
2277 using ViewedType = MT;
2278 using ResultType = RowsTrait_t<MT,N>;
2279 using OppositeType = OppositeType_t<ResultType>;
2280 using TransposeType = TransposeType_t<ResultType>;
2281 using ElementType = ElementType_t<MT>;
2282 using ReturnType = ReturnType_t<MT>;
2283 using CompositeType =
const Rows&;
2286 using ConstReference = ConstReference_t<MT>;
2289 using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
2295 template<
typename MatrixType
2296 ,
typename IteratorType >
2298 :
private SparseElement
2307 inline RowsElement( IteratorType pos,
size_t column )
2319 template<
typename T >
inline RowsElement& operator=(
const T& v ) {
2331 template<
typename T >
inline RowsElement&
operator+=(
const T& v ) {
2343 template<
typename T >
inline RowsElement&
operator-=(
const T& v ) {
2355 template<
typename T >
inline RowsElement&
operator*=(
const T& v ) {
2367 template<
typename T >
inline RowsElement&
operator/=(
const T& v ) {
2378 inline const RowsElement* operator->()
const {
2388 inline decltype(
auto) value()
const {
2389 return pos_->value();
2398 inline size_t index()
const {
2414 template<
typename MatrixType
2415 ,
typename IteratorType >
2420 using IteratorCategory = std::forward_iterator_tag;
2421 using ValueType = RowsElement<MatrixType,IteratorType>;
2422 using PointerType = ValueType;
2423 using ReferenceType = ValueType;
2427 using iterator_category = IteratorCategory;
2428 using value_type = ValueType;
2429 using pointer = PointerType;
2430 using reference = ReferenceType;
2431 using difference_type = DifferenceType;
2437 inline RowsIterator()
2438 : matrix_( nullptr )
2452 inline RowsIterator( MatrixType& matrix,
size_t row,
size_t column )
2453 : matrix_( &matrix )
2458 for( ; column_<matrix_->columns(); ++column_ ) {
2459 pos_ = matrix_->find( row_, column_ );
2460 if( pos_ != matrix_->end( column_ ) )
break;
2473 inline RowsIterator( MatrixType& matrix,
size_t row,
size_t column, IteratorType pos )
2474 : matrix_( &matrix )
2488 template<
typename MatrixType2,
typename IteratorType2 >
2489 inline RowsIterator(
const RowsIterator<MatrixType2,IteratorType2>& it )
2490 : matrix_( it.matrix_ )
2492 , column_( it.column_ )
2502 inline RowsIterator& operator++() {
2504 for( ; column_<matrix_->columns(); ++column_ ) {
2505 pos_ = matrix_->find( row_, column_ );
2506 if( pos_ != matrix_->end( column_ ) )
break;
2518 inline const RowsIterator operator++(
int ) {
2519 const RowsIterator tmp( *
this );
2530 inline ReferenceType
operator*()
const {
2531 return ReferenceType( pos_, column_ );
2540 inline PointerType operator->()
const {
2541 return PointerType( pos_, column_ );
2551 template<
typename MatrixType2,
typename IteratorType2 >
2552 inline bool operator==(
const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
2553 return column_ == rhs.column_;
2563 template<
typename MatrixType2,
typename IteratorType2 >
2564 inline bool operator!=(
const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
2565 return !( *
this == rhs );
2575 inline DifferenceType
operator-(
const RowsIterator& rhs )
const {
2576 size_t counter( 0UL );
2577 for(
size_t j=rhs.column_; j<column_; ++j ) {
2578 if( matrix_->find( row_, j ) != matrix_->end( j ) )
2587 MatrixType* matrix_;
2594 template<
typename MatrixType2,
typename IteratorType2 >
friend class RowsIterator;
2595 template<
typename MT2,
bool SO2,
bool DF2,
bool SF2,
typename... CRAs2 >
friend class Rows;
2602 using ConstIterator = RowsIterator< const MT, ConstIterator_t<MT> >;
2605 using Iterator = If_t< IsConst_v<MT>, ConstIterator, RowsIterator< MT, Iterator_t<MT> > >;
2610 static constexpr bool smpAssignable = MT::smpAssignable;
2613 static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
2619 template<
typename... RRAs >
2620 explicit inline Rows( MT& matrix, RRAs... args );
2622 Rows(
const Rows& ) =
default;
2623 Rows( Rows&& ) =
default;
2637 inline Reference operator()(
size_t i,
size_t j );
2638 inline ConstReference operator()(
size_t i,
size_t j )
const;
2639 inline Reference at(
size_t i,
size_t j );
2640 inline ConstReference at(
size_t i,
size_t j )
const;
2641 inline Iterator
begin (
size_t i );
2642 inline ConstIterator
begin (
size_t i )
const;
2643 inline ConstIterator
cbegin(
size_t i )
const;
2644 inline Iterator
end (
size_t i );
2645 inline ConstIterator
end (
size_t i )
const;
2646 inline ConstIterator
cend (
size_t i )
const;
2654 inline Rows& operator=(
const Rows& rhs );
2656 template<
typename MT2,
bool SO >
inline Rows& operator= (
const Matrix<MT2,SO>& rhs );
2657 template<
typename MT2,
bool SO >
inline Rows&
operator+=(
const Matrix<MT2,SO>& rhs );
2658 template<
typename MT2,
bool SO >
inline Rows&
operator-=(
const Matrix<MT2,SO>& rhs );
2659 template<
typename MT2,
bool SO >
inline Rows& operator%=(
const Matrix<MT2,SO>& rhs );
2666 using DataType::idx;
2667 using DataType::idces;
2670 inline MT& operand() noexcept;
2671 inline const MT& operand() const noexcept;
2673 inline
size_t columns() const noexcept;
2674 inline
size_t capacity() const noexcept;
2675 inline
size_t capacity(
size_t i ) const noexcept;
2677 inline
size_t nonZeros(
size_t i ) const;
2678 inline
void reset();
2679 inline
void reset(
size_t i );
2680 inline
void reserve(
size_t nonzeros );
2681 void reserve(
size_t i,
size_t nonzeros );
2683 inline
void trim(
size_t j );
2690 inline Iterator
set (
size_t i,
size_t j, const ElementType& value );
2691 inline Iterator insert (
size_t i,
size_t j, const ElementType& value );
2692 inline
void append (
size_t i,
size_t j, const ElementType& value,
bool check=false );
2693 inline
void finalize(
size_t i );
2700 inline
void erase(
size_t i,
size_t j );
2701 inline Iterator erase(
size_t i, Iterator pos );
2702 inline Iterator erase(
size_t i, Iterator first, Iterator last );
2704 template< typename Pred >
2705 inline
void erase( Pred predicate );
2707 template< typename Pred >
2708 inline
void erase(
size_t i, Iterator first, Iterator last, Pred predicate );
2715 inline Iterator
find (
size_t i,
size_t j );
2716 inline ConstIterator
find (
size_t i,
size_t j ) const;
2717 inline Iterator
lowerBound(
size_t i,
size_t j );
2718 inline ConstIterator
lowerBound(
size_t i,
size_t j ) const;
2719 inline Iterator
upperBound(
size_t i,
size_t j );
2720 inline ConstIterator
upperBound(
size_t i,
size_t j ) const;
2730 template< typename Other > inline Rows& scale( const Other& scalar );
2737 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
2738 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
2740 inline
bool canSMPAssign() const noexcept;
2742 template< typename MT2,
bool SO > inline
void assign ( const DenseMatrix<MT2,SO>& rhs );
2743 template< typename MT2 > inline
void assign ( const SparseMatrix<MT2,true>& rhs );
2744 template< typename MT2 > inline
void assign ( const SparseMatrix<MT2,false>& rhs );
2745 template< typename MT2,
bool SO > inline
void addAssign ( const Matrix<MT2,SO>& rhs );
2746 template< typename MT2,
bool SO > inline
void subAssign ( const Matrix<MT2,SO>& rhs );
2747 template< typename MT2,
bool SO > inline
void schurAssign( const Matrix<MT2,SO>& rhs );
2796template< typename MT
2797 , typename... CRAs >
2798template< typename... RRAs >
2799inline Rows<MT,false,false,false,CRAs...>::Rows( MT& matrix, RRAs... args )
2800 : DataType( args... )
2801 , matrix_ ( matrix )
2804 for(
size_t i=0UL; i<
rows(); ++i ) {
2805 if( matrix_.rows() <= idx(i) ) {
2834template<
typename MT
2835 ,
typename... CRAs >
2836inline typename Rows<MT,
false,
false,
false,CRAs...>::Reference
2837 Rows<MT,false,false,false,CRAs...>::operator()(
size_t i,
size_t j )
2842 return matrix_(idx(i),j);
2859template<
typename MT
2860 ,
typename... CRAs >
2861inline typename Rows<MT,
false,
false,
false,CRAs...>::ConstReference
2862 Rows<MT,false,false,false,CRAs...>::operator()(
size_t i,
size_t j )
const
2867 return const_cast<const MT&
>( matrix_ )(idx(i),j);
2885template<
typename MT
2886 ,
typename... CRAs >
2887inline typename Rows<MT,
false,
false,
false,CRAs...>::Reference
2888 Rows<MT,false,false,false,CRAs...>::at(
size_t i,
size_t j )
2896 return (*
this)(i,j);
2914template<
typename MT
2915 ,
typename... CRAs >
2916inline typename Rows<MT,
false,
false,
false,CRAs...>::ConstReference
2917 Rows<MT,false,false,false,CRAs...>::at(
size_t i,
size_t j )
const
2925 return (*
this)(i,j);
2940template<
typename MT
2941 ,
typename... CRAs >
2942inline typename Rows<MT,
false,
false,
false,CRAs...>::Iterator
2947 return Iterator( matrix_, idx(i), 0UL );
2962template<
typename MT
2963 ,
typename... CRAs >
2964inline typename Rows<MT,
false,
false,
false,CRAs...>::ConstIterator
2969 return ConstIterator( matrix_, idx(i), 0UL );
2984template<
typename MT
2985 ,
typename... CRAs >
2986inline typename Rows<MT,
false,
false,
false,CRAs...>::ConstIterator
2991 return ConstIterator( matrix_, idx(i), 0UL );
3006template<
typename MT
3007 ,
typename... CRAs >
3008inline typename Rows<MT,
false,
false,
false,CRAs...>::Iterator
3013 return Iterator( matrix_, idx(i),
columns() );
3028template<
typename MT
3029 ,
typename... CRAs >
3030inline typename Rows<MT,
false,
false,
false,CRAs...>::ConstIterator
3035 return ConstIterator( matrix_, idx(i),
columns() );
3050template<
typename MT
3051 ,
typename... CRAs >
3052inline typename Rows<MT,
false,
false,
false,CRAs...>::ConstIterator
3057 return ConstIterator( matrix_, idx(i),
columns() );
3087template<
typename MT
3088 ,
typename... CRAs >
3089inline Rows<MT,
false,
false,
false,CRAs...>&
3095 if( list.size() !=
rows() ) {
3099 const InitializerMatrix<ElementType> tmp( list,
columns() );
3101 if( IsRestricted_v<MT> ) {
3102 for(
size_t i=0UL; i<
rows(); ++i ) {
3103 if( !tryAssign( matrix_,
row( tmp, i,
unchecked ), i, 0UL ) ) {
3109 decltype(
auto) left( derestrict( *
this ) );
3134template<
typename MT
3135 ,
typename... CRAs >
3136inline Rows<MT,
false,
false,
false,CRAs...>&
3137 Rows<MT,false,false,false,CRAs...>::operator=(
const Rows& rhs )
3145 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && compareIndices( *
this, rhs ) ) )
3148 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
3152 if( IsRestricted_v<MT> ) {
3153 for(
size_t i=0UL; i<
rows(); ++i ) {
3154 if( !tryAssign( matrix_,
row( rhs, i,
unchecked ), idx(i), 0UL ) ) {
3160 decltype(
auto) left( derestrict( *
this ) );
3162 if( rhs.canAlias(
this ) ) {
3163 const ResultType tmp( rhs );
3195template<
typename MT
3196 ,
typename... CRAs >
3197template<
typename MT2
3199inline Rows<MT,
false,
false,
false,CRAs...>&
3200 Rows<MT,false,false,false,CRAs...>::operator=(
const Matrix<MT2,SO>& rhs )
3207 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
3211 using Right = CompositeType_t<MT2>;
3212 Right right( *rhs );
3214 if( IsRestricted_v<MT> ) {
3215 for(
size_t i=0UL; i<
rows(); ++i ) {
3216 if( !tryAssign( matrix_,
row( right, i,
unchecked ), idx(i), 0UL ) ) {
3222 decltype(
auto) left( derestrict( *
this ) );
3224 if( IsReference_v<Right> && right.canAlias(
this ) ) {
3225 const ResultType_t<MT2> tmp( right );
3231 if( IsSparseMatrix_v<MT2> )
3258template<
typename MT
3259 ,
typename... CRAs >
3260template<
typename MT2
3262inline Rows<MT,
false,
false,
false,CRAs...>&
3272 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
3276 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
3280 const AddType tmp( *
this + (*rhs) );
3282 if( IsRestricted_v<MT> ) {
3283 for(
size_t i=0UL; i<
rows(); ++i ) {
3284 if( !tryAssign( matrix_,
row( tmp, i,
unchecked ), idx(i), 0UL ) ) {
3290 decltype(
auto) left( derestrict( *
this ) );
3292 if( IsSparseMatrix_v<AddType> ) {
3320template<
typename MT
3321 ,
typename... CRAs >
3322template<
typename MT2
3324inline Rows<MT,
false,
false,
false,CRAs...>&
3334 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
3338 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
3342 const SubType tmp( *
this - (*rhs) );
3344 if( IsRestricted_v<MT> ) {
3345 for(
size_t i=0UL; i<
rows(); ++i ) {
3346 if( !tryAssign( matrix_,
row( tmp, i,
unchecked ), idx(i), 0UL ) ) {
3352 decltype(
auto) left( derestrict( *
this ) );
3354 if( IsSparseMatrix_v<SubType> ) {
3382template<
typename MT
3383 ,
typename... CRAs >
3384template<
typename MT2
3386inline Rows<MT,
false,
false,
false,CRAs...>&
3387 Rows<MT,false,false,false,CRAs...>::operator%=(
const Matrix<MT2,SO>& rhs )
3396 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
3400 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
3404 const SchurType tmp( *
this % (*rhs) );
3406 if( IsRestricted_v<MT> ) {
3407 for(
size_t i=0UL; i<
rows(); ++i ) {
3408 if( !tryAssign( matrix_,
row( tmp, i,
unchecked ), idx(i), 0UL ) ) {
3414 decltype(
auto) left( derestrict( *
this ) );
3416 if( IsSparseMatrix_v<SchurType> ) {
3444template<
typename MT
3445 ,
typename... CRAs >
3446inline MT& Rows<MT,false,false,false,CRAs...>::operand() noexcept
3460template<
typename MT
3461 ,
typename... CRAs >
3462inline const MT& Rows<MT,false,false,false,CRAs...>::operand() const noexcept
3476template<
typename MT
3477 ,
typename... CRAs >
3480 return matrix_.columns();
3492template<
typename MT
3493 ,
typename... CRAs >
3511template<
typename MT
3512 ,
typename... CRAs >
3531template<
typename MT
3532 ,
typename... CRAs >
3535 size_t nonzeros( 0UL );
3537 for(
size_t j=0UL; j<
columns(); ++j ) {
3538 const auto end( matrix_.end( j ) );
3539 for(
size_t i=0UL; i<
rows(); ++i ) {
3540 auto pos = matrix_.find( idx(i), j );
3562template<
typename MT
3563 ,
typename... CRAs >
3568 size_t counter( 0UL );
3570 const ConstIterator last(
end(i) );
3571 for( ConstIterator element=
begin(i); element!=last; ++element ) {
3587template<
typename MT
3588 ,
typename... CRAs >
3591 for(
size_t i=0UL; i<
rows(); ++i ) {
3609template<
typename MT
3610 ,
typename... CRAs >
3613 const size_t index( idx(i) );
3615 const size_t jbegin( ( IsUpper_v<MT> )
3616 ?( ( IsUniUpper_v<MT> || IsStrictlyUpper_v<MT> )
3620 const size_t jend ( ( IsLower_v<MT> )
3621 ?( ( IsUniLower_v<MT> || IsStrictlyLower_v<MT> )
3626 for(
size_t j=jbegin; j<jend; ++j ) {
3627 matrix_.erase( index, j );
3645template<
typename MT
3646 ,
typename... CRAs >
3647inline void Rows<MT,false,false,false,CRAs...>::reserve(
size_t nonzeros )
3670template<
typename MT
3671 ,
typename... CRAs >
3672void Rows<MT,false,false,false,CRAs...>::reserve(
size_t i,
size_t nonzeros )
3692template<
typename MT
3693 ,
typename... CRAs >
3694void Rows<MT,false,false,false,CRAs...>::trim()
3713template<
typename MT
3714 ,
typename... CRAs >
3715void Rows<MT,false,false,false,CRAs...>::trim(
size_t i )
3748template<
typename MT
3749 ,
typename... CRAs >
3750inline typename Rows<MT,
false,
false,
false,CRAs...>::Iterator
3753 return Iterator( matrix_, idx(i), j, matrix_.set( idx(i), j, value ) );
3773template<
typename MT
3774 ,
typename... CRAs >
3775inline typename Rows<MT,
false,
false,
false,CRAs...>::Iterator
3776 Rows<MT,false,false,false,CRAs...>::insert(
size_t i,
size_t j,
const ElementType& value )
3778 return Iterator( matrix_, idx(i), j, matrix_.insert( idx(i), j, value ) );
3828template<
typename MT
3829 ,
typename... CRAs >
3830inline void Rows<MT,false,false,false,CRAs...>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
3832 if( !check || !isDefault<strict>( value ) )
3833 matrix_.insert( idx(i), j, value );
3853template<
typename MT
3854 ,
typename... CRAs >
3855inline void Rows<MT,false,false,false,CRAs...>::finalize(
size_t i )
3883template<
typename MT
3884 ,
typename... CRAs >
3885inline void Rows<MT,false,false,false,CRAs...>::erase(
size_t i,
size_t j )
3890 matrix_.erase( idx(i), j );
3906template<
typename MT
3907 ,
typename... CRAs >
3908inline typename Rows<MT,
false,
false,
false,CRAs...>::Iterator
3909 Rows<MT,false,false,false,CRAs...>::erase(
size_t i, Iterator pos )
3911 const size_t column( pos.column_ );
3916 matrix_.erase(
column, pos.pos_ );
3917 return Iterator( matrix_, idx(i),
column+1UL );
3934template<
typename MT
3935 ,
typename... CRAs >
3936inline typename Rows<MT,
false,
false,
false,CRAs...>::Iterator
3937 Rows<MT,false,false,false,CRAs...>::erase(
size_t i, Iterator first, Iterator last )
3943 for( ; first!=last; ++first ) {
3944 matrix_.erase( first.column_, first.pos_ );
3976template<
typename MT
3977 ,
typename... CRAs >
3978template<
typename Pred >
3979inline void Rows<MT,false,false,false,CRAs...>::erase( Pred predicate )
3981 for(
size_t i=0UL; i<
rows(); ++i ) {
3982 for( Iterator element=
begin(i); element!=
end(i); ++element ) {
3983 if( predicate( element->value() ) )
3984 matrix_.erase( element.column_, element.pos_ );
4019template<
typename MT
4020 ,
typename... CRAs >
4021template<
typename Pred >
4022inline void Rows<MT,false,false,false,CRAs...>::erase(
size_t i, Iterator first, Iterator last, Pred predicate )
4028 for( ; first!=last; ++first ) {
4029 if( predicate( first->value() ) )
4030 matrix_.erase( first.column_, first.pos_ );
4060template<
typename MT
4061 ,
typename... CRAs >
4062inline typename Rows<MT,
false,
false,
false,CRAs...>::Iterator
4065 const size_t index( idx(i) );
4066 const Iterator_t<MT> pos( matrix_.find( index, j ) );
4068 if( pos != matrix_.end( j ) )
4069 return Iterator( matrix_, index, j, pos );
4092template<
typename MT
4093 ,
typename... CRAs >
4094inline typename Rows<MT,
false,
false,
false,CRAs...>::ConstIterator
4097 const size_t index( idx(i) );
4098 const ConstIterator_t<MT> pos( matrix_.find( index, j ) );
4100 if( pos != matrix_.end( j ) )
4101 return ConstIterator( matrix_, index, j, pos );
4123template<
typename MT
4124 ,
typename... CRAs >
4125inline typename Rows<MT,
false,
false,
false,CRAs...>::Iterator
4128 const size_t index( idx(i) );
4132 const Iterator_t<MT> pos( matrix_.find( index, j ) );
4134 if( pos != matrix_.end( j ) )
4135 return Iterator( matrix_, index, j, pos );
4158template<
typename MT
4159 ,
typename... CRAs >
4160inline typename Rows<MT,
false,
false,
false,CRAs...>::ConstIterator
4163 const size_t index( idx(i) );
4167 const ConstIterator_t<MT> pos( matrix_.find( index, j ) );
4169 if( pos != matrix_.end( j ) )
4170 return ConstIterator( matrix_, index, j, pos );
4193template<
typename MT
4194 ,
typename... CRAs >
4195inline typename Rows<MT,
false,
false,
false,CRAs...>::Iterator
4218template<
typename MT
4219 ,
typename... CRAs >
4220inline typename Rows<MT,
false,
false,
false,CRAs...>::ConstIterator
4250template<
typename MT
4251 ,
typename... CRAs >
4252inline Rows<MT,
false,
false,
false,CRAs...>&
4262 const ResultType tmp(
trans( *
this ) );
4264 if( IsRestricted_v<MT> ) {
4265 for(
size_t i=0UL; i<
rows(); ++i ) {
4266 if( !tryAssign( matrix_,
row( tmp, i,
unchecked ), idx(i), 0UL ) ) {
4272 decltype(
auto) left( derestrict( *
this ) );
4296template<
typename MT
4297 ,
typename... CRAs >
4298inline Rows<MT,
false,
false,
false,CRAs...>&
4308 const ResultType tmp(
ctrans( *
this ) );
4310 if( IsRestricted_v<MT> ) {
4311 for(
size_t i=0UL; i<
rows(); ++i ) {
4312 if( !tryAssign( matrix_,
row( tmp, i,
unchecked ), idx(i), 0UL ) ) {
4318 decltype(
auto) left( derestrict( *
this ) );
4342template<
typename MT
4343 ,
typename... CRAs >
4344template<
typename Other >
4345inline Rows<MT,
false,
false,
false,CRAs...>&
4346 Rows<MT,false,false,false,CRAs...>::scale(
const Other& scalar )
4352 for(
size_t j=0UL; j<
columns(); ++j ) {
4353 const auto end( matrix_.end( j ) );
4354 for(
size_t i=0UL; i<
rows(); ++i ) {
4355 auto pos = matrix_.find( idx(i), j );
4357 pos->value() *= scalar;
4387template<
typename MT
4388 ,
typename... CRAs >
4389template<
typename Other >
4390inline bool Rows<MT,false,false,false,CRAs...>::canAlias(
const Other* alias )
const noexcept
4392 return matrix_.isAliased( &unview( *alias ) );
4409template<
typename MT
4410 ,
typename... CRAs >
4411template<
typename Other >
4412inline bool Rows<MT,false,false,false,CRAs...>::isAliased(
const Other* alias )
const noexcept
4414 return matrix_.isAliased( &unview( *alias ) );
4431template<
typename MT
4432 ,
typename... CRAs >
4433inline bool Rows<MT,false,false,false,CRAs...>::canSMPAssign() const noexcept
4453template<
typename MT
4454 ,
typename... CRAs >
4455template<
typename MT2
4457inline void Rows<MT,false,false,false,CRAs...>::assign(
const DenseMatrix<MT2,SO>& rhs )
4462 using RT = If_t< IsComputation_v<MT2>, ElementType_t<MT>,
const ElementType_t<MT2>& >;
4467 for(
size_t j=0UL; j<
columns(); ++j ) {
4468 for(
size_t i=0UL; i<
rows(); ++i ) {
4469 RT value( (*rhs)(i,j) );
4470 if( !isDefault<strict>( value ) )
4471 matrix_.set( idx(i), j, std::move( value ) );
4472 else matrix_.erase( idx(i), j );
4492template<
typename MT
4493 ,
typename... CRAs >
4494template<
typename MT2 >
4495inline void Rows<MT,false,false,false,CRAs...>::assign(
const SparseMatrix<MT2,false>& rhs )
4500 using RT = If_t< IsComputation_v<MT2>, ElementType_t<MT>,
const ElementType_t<MT2>& >;
4506 for(
size_t i=0UL; i<
rows(); ++i ) {
4507 const size_t index( idx(i) );
4508 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element ) {
4509 RT value( element->value() );
4510 if( !isDefault<strict>( value ) )
4511 matrix_.set( index, element->index(), std::move( value ) );
4512 else matrix_.erase( index, element->index() );
4532template<
typename MT
4533 ,
typename... CRAs >
4534template<
typename MT2 >
4535inline void Rows<MT,false,false,false,CRAs...>::assign(
const SparseMatrix<MT2,true>& rhs )
4542 using RT = If_t< IsComputation_v<MT2>, ElementType_t<MT>,
const ElementType_t<MT2>& >;
4548 for(
size_t j=0UL; j<
columns(); ++j ) {
4549 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element ) {
4550 RT value( element->value() );
4551 if( !isDefault<strict>( value ) )
4552 matrix_.set( idx( element->index() ), j, std::move( value ) );
4553 else matrix_.erase( idx( element->index() ), j );
4573template<
typename MT
4574 ,
typename... CRAs >
4575template<
typename MT2
4577inline void Rows<MT,false,false,false,CRAs...>::addAssign(
const Matrix<MT2,SO>& rhs )
4582 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
4589 const AddType tmp(
serial( *
this + (*rhs) ) );
4609template<
typename MT
4610 ,
typename... CRAs >
4611template<
typename MT2
4613inline void Rows<MT,false,false,false,CRAs...>::subAssign(
const Matrix<MT2,SO>& rhs )
4618 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
4625 const SubType tmp(
serial( *
this - (*rhs) ) );
4645template<
typename MT
4646 ,
typename... CRAs >
4647template<
typename MT2
4649inline void Rows<MT,false,false,false,CRAs...>::schurAssign(
const Matrix<MT2,SO>& rhs )
4654 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
4662 const SchurType tmp(
serial( *
this % (*rhs) ) );
4690template<
typename MT
4691 ,
typename... CRAs >
4692class Rows<MT,false,false,true,CRAs...>
4693 :
public View< SparseMatrix< Rows<MT,false,false,true,CRAs...>, false > >
4694 ,
private RowsData<CRAs...>
4698 using DataType = RowsData<CRAs...>;
4699 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
4709 using This = Rows<MT,
false,
false,
true,CRAs...>;
4712 using BaseType = View< SparseMatrix<This,false> >;
4714 using ViewedType = MT;
4715 using ResultType = RowsTrait_t<MT,N>;
4716 using OppositeType = OppositeType_t<ResultType>;
4717 using TransposeType = TransposeType_t<ResultType>;
4718 using ElementType = ElementType_t<MT>;
4719 using ReturnType = ReturnType_t<MT>;
4720 using CompositeType =
const Rows&;
4723 using ConstReference = ConstReference_t<MT>;
4726 using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
4729 using ConstIterator = ConstIterator_t<MT>;
4732 using Iterator = If_t< IsConst_v<MT>, ConstIterator, Iterator_t<MT> >;
4737 static constexpr bool smpAssignable = MT::smpAssignable;
4740 static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
4746 template<
typename... RRAs >
4747 explicit inline Rows( MT& matrix, RRAs... args );
4749 Rows(
const Rows& ) =
default;
4750 Rows( Rows&& ) =
default;
4764 inline Reference operator()(
size_t i,
size_t j );
4765 inline ConstReference operator()(
size_t i,
size_t j )
const;
4766 inline Reference at(
size_t i,
size_t j );
4767 inline ConstReference at(
size_t i,
size_t j )
const;
4768 inline Iterator
begin (
size_t i );
4769 inline ConstIterator
begin (
size_t i )
const;
4770 inline ConstIterator
cbegin(
size_t i )
const;
4771 inline Iterator
end (
size_t i );
4772 inline ConstIterator
end (
size_t i )
const;
4773 inline ConstIterator
cend (
size_t i )
const;
4780 Rows& operator=(
const Rows& ) =
delete;
4787 using DataType::idx;
4788 using DataType::idces;
4791 inline MT& operand() noexcept;
4792 inline const MT& operand() const noexcept;
4794 inline
size_t columns() const noexcept;
4795 inline
size_t capacity() const noexcept;
4796 inline
size_t capacity(
size_t i ) const noexcept;
4798 inline
size_t nonZeros(
size_t i ) const;
4799 inline
void reset();
4800 inline
void reset(
size_t i );
4801 inline
void reserve(
size_t nonzeros );
4802 void reserve(
size_t i,
size_t nonzeros );
4804 inline
void trim(
size_t i );
4811 inline Iterator
set (
size_t i,
size_t j, const ElementType& value );
4812 inline Iterator insert (
size_t i,
size_t j, const ElementType& value );
4813 inline
void append (
size_t i,
size_t j, const ElementType& value,
bool check=false );
4814 inline
void finalize(
size_t i );
4821 inline
void erase(
size_t i,
size_t j );
4822 inline Iterator erase(
size_t i, Iterator pos );
4823 inline Iterator erase(
size_t i, Iterator first, Iterator last );
4825 template< typename Pred >
4826 inline
void erase( Pred predicate );
4828 template< typename Pred >
4829 inline
void erase(
size_t i, Iterator first, Iterator last, Pred predicate );
4836 inline Iterator
find (
size_t i,
size_t j );
4837 inline ConstIterator
find (
size_t i,
size_t j ) const;
4838 inline Iterator
lowerBound(
size_t i,
size_t j );
4839 inline ConstIterator
lowerBound(
size_t i,
size_t j ) const;
4840 inline Iterator
upperBound(
size_t i,
size_t j );
4841 inline ConstIterator
upperBound(
size_t i,
size_t j ) const;
4848 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
4849 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
4851 inline
bool canSMPAssign() const noexcept;
4900template< typename MT
4901 , typename... CRAs >
4902template< typename... RRAs >
4903inline Rows<MT,false,false,true,CRAs...>::Rows( MT& matrix, RRAs... args )
4904 : DataType( args... )
4905 , matrix_ ( matrix )
4908 for(
size_t i=0UL; i<
rows(); ++i ) {
4909 if( matrix_.rows() <= idx(i) ) {
4938template<
typename MT
4939 ,
typename... CRAs >
4940inline typename Rows<MT,
false,
false,
true,CRAs...>::Reference
4941 Rows<MT,false,false,true,CRAs...>::operator()(
size_t i,
size_t j )
4946 return matrix_(j,idx(i));
4963template<
typename MT
4964 ,
typename... CRAs >
4965inline typename Rows<MT,
false,
false,
true,CRAs...>::ConstReference
4966 Rows<MT,false,false,true,CRAs...>::operator()(
size_t i,
size_t j )
const
4971 return const_cast<const MT&
>( matrix_ )(j,idx(i));
4989template<
typename MT
4990 ,
typename... CRAs >
4991inline typename Rows<MT,
false,
false,
true,CRAs...>::Reference
4992 Rows<MT,false,false,true,CRAs...>::at(
size_t i,
size_t j )
5000 return (*
this)(i,j);
5018template<
typename MT
5019 ,
typename... CRAs >
5020inline typename Rows<MT,
false,
false,
true,CRAs...>::ConstReference
5021 Rows<MT,false,false,true,CRAs...>::at(
size_t i,
size_t j )
const
5029 return (*
this)(i,j);
5044template<
typename MT
5045 ,
typename... CRAs >
5046inline typename Rows<MT,
false,
false,
true,CRAs...>::Iterator
5051 return matrix_.begin( idx(i) );
5066template<
typename MT
5067 ,
typename... CRAs >
5068inline typename Rows<MT,
false,
false,
true,CRAs...>::ConstIterator
5073 return matrix_.cbegin( idx(i) );
5088template<
typename MT
5089 ,
typename... CRAs >
5090inline typename Rows<MT,
false,
false,
true,CRAs...>::ConstIterator
5095 return matrix_.cbegin( idx(i) );
5110template<
typename MT
5111 ,
typename... CRAs >
5112inline typename Rows<MT,
false,
false,
true,CRAs...>::Iterator
5117 return matrix_.end( idx(i) );
5132template<
typename MT
5133 ,
typename... CRAs >
5134inline typename Rows<MT,
false,
false,
true,CRAs...>::ConstIterator
5139 return matrix_.cend( idx(i) );
5154template<
typename MT
5155 ,
typename... CRAs >
5156inline typename Rows<MT,
false,
false,
true,CRAs...>::ConstIterator
5161 return matrix_.cend( idx(i) );
5181template<
typename MT
5182 ,
typename... CRAs >
5183inline MT& Rows<MT,false,false,true,CRAs...>::operand() noexcept
5197template<
typename MT
5198 ,
typename... CRAs >
5199inline const MT& Rows<MT,false,false,true,CRAs...>::operand() const noexcept
5213template<
typename MT
5214 ,
typename... CRAs >
5217 return matrix_.columns();
5229template<
typename MT
5230 ,
typename... CRAs >
5233 return nonZeros() + matrix_.capacity() - matrix_.nonZeros();
5248template<
typename MT
5249 ,
typename... CRAs >
5254 return matrix_.capacity( idx(i) );
5266template<
typename MT
5267 ,
typename... CRAs >
5270 size_t nonzeros( 0UL );
5272 for(
size_t i=0UL; i<
rows(); ++i )
5290template<
typename MT
5291 ,
typename... CRAs >
5296 return matrix_.nonZeros( idx(i) );
5308template<
typename MT
5309 ,
typename... CRAs >
5312 for(
size_t i=0UL; i<
rows(); ++i ) {
5313 matrix_.reset( idx(i) );
5330template<
typename MT
5331 ,
typename... CRAs >
5334 matrix_.reset( idx(i) );
5351template<
typename MT
5352 ,
typename... CRAs >
5353inline void Rows<MT,false,false,true,CRAs...>::reserve(
size_t nonzeros )
5355 const size_t current(
capacity() );
5357 if( nonzeros > current ) {
5358 matrix_.reserve( matrix_.capacity() + nonzeros - current );
5378template<
typename MT
5379 ,
typename... CRAs >
5380void Rows<MT,false,false,true,CRAs...>::reserve(
size_t i,
size_t nonzeros )
5382 matrix_.reserve( idx(i), nonzeros );
5398template<
typename MT
5399 ,
typename... CRAs >
5400void Rows<MT,false,false,true,CRAs...>::trim()
5402 for(
size_t i=0UL; i<
rows(); ++i ) {
5421template<
typename MT
5422 ,
typename... CRAs >
5423void Rows<MT,false,false,true,CRAs...>::trim(
size_t i )
5427 matrix_.trim( idx(i) );
5454template<
typename MT
5455 ,
typename... CRAs >
5456inline typename Rows<MT,
false,
false,
true,CRAs...>::Iterator
5459 return matrix_.set( j, idx(i), value );
5479template<
typename MT
5480 ,
typename... CRAs >
5481inline typename Rows<MT,
false,
false,
true,CRAs...>::Iterator
5482 Rows<MT,false,false,true,CRAs...>::insert(
size_t i,
size_t j,
const ElementType& value )
5484 return matrix_.insert( j, idx(i), value );
5534template<
typename MT
5535 ,
typename... CRAs >
5536inline void Rows<MT,false,false,true,CRAs...>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
5538 if( !check || !isDefault<strict>( value ) )
5539 matrix_.insert( j, idx(i), value );
5559template<
typename MT
5560 ,
typename... CRAs >
5561inline void Rows<MT,false,false,true,CRAs...>::finalize(
size_t i )
5589template<
typename MT
5590 ,
typename... CRAs >
5591inline void Rows<MT,false,false,true,CRAs...>::erase(
size_t i,
size_t j )
5596 matrix_.erase( j, idx(i) );
5612template<
typename MT
5613 ,
typename... CRAs >
5614inline typename Rows<MT,
false,
false,
true,CRAs...>::Iterator
5615 Rows<MT,false,false,true,CRAs...>::erase(
size_t i, Iterator pos )
5619 return matrix_.erase( idx(i), pos );
5636template<
typename MT
5637 ,
typename... CRAs >
5638inline typename Rows<MT,
false,
false,
true,CRAs...>::Iterator
5639 Rows<MT,false,false,true,CRAs...>::erase(
size_t i, Iterator first, Iterator last )
5643 return matrix_.erase( idx(i), first, last );
5672template<
typename MT
5673 ,
typename... CRAs >
5674template<
typename Pred >
5675inline void Rows<MT,false,false,true,CRAs...>::erase( Pred predicate )
5677 for(
size_t i=0UL; i<
rows(); ++i ) {
5678 matrix_.erase( idx(i),
begin(i),
end(i), predicate );
5712template<
typename MT
5713 ,
typename... CRAs >
5714template<
typename Pred >
5715inline void Rows<MT,false,false,true,CRAs...>::erase(
size_t i, Iterator first, Iterator last, Pred predicate )
5719 matrix_.erase( idx(i), first, last, predicate );
5748template<
typename MT
5749 ,
typename... CRAs >
5750inline typename Rows<MT,
false,
false,
true,CRAs...>::Iterator
5753 return matrix_.find( j, idx(i) );
5774template<
typename MT
5775 ,
typename... CRAs >
5776inline typename Rows<MT,
false,
false,
true,CRAs...>::ConstIterator
5779 return matrix_.find( j, idx(i) );
5799template<
typename MT
5800 ,
typename... CRAs >
5801inline typename Rows<MT,
false,
false,
true,CRAs...>::Iterator
5804 return matrix_.lowerBound( j, idx(i) );
5824template<
typename MT
5825 ,
typename... CRAs >
5826inline typename Rows<MT,
false,
false,
true,CRAs...>::ConstIterator
5829 return matrix_.lowerBound( j, idx(i) );
5849template<
typename MT
5850 ,
typename... CRAs >
5851inline typename Rows<MT,
false,
false,
true,CRAs...>::Iterator
5854 return matrix_.upperBound( j, idx(i) );
5874template<
typename MT
5875 ,
typename... CRAs >
5876inline typename Rows<MT,
false,
false,
true,CRAs...>::ConstIterator
5879 return matrix_.upperBound( j, idx(i) );
5904template<
typename MT
5905 ,
typename... CRAs >
5906template<
typename Other >
5907inline bool Rows<MT,false,false,true,CRAs...>::canAlias(
const Other* alias )
const noexcept
5909 return matrix_.isAliased( &unview( *alias ) );
5926template<
typename MT
5927 ,
typename... CRAs >
5928template<
typename Other >
5929inline bool Rows<MT,false,false,true,CRAs...>::isAliased(
const Other* alias )
const noexcept
5931 return matrix_.isAliased( &unview( *alias ) );
5948template<
typename MT
5949 ,
typename... CRAs >
5950inline bool Rows<MT,false,false,true,CRAs...>::canSMPAssign() const noexcept
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.
Constraints on the storage order of matrix types.
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
Constraint on the data type.
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 isDefault shim.
Header file for the IsExpression type trait class.
Header file for the IsLower type trait.
Header file for the IsReference type trait.
Header file for the IsRestricted type trait.
Header file for the IsSparseMatrix type trait.
Header file for the IsStrictlyLower type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsUniLower type trait.
Header file for the IsUniUpper type trait.
Header file for the IsUpper type trait.
Header file for the MAYBE_UNUSED function template.
Constraint on the data type.
Constraint on the data type.
Constraints on the storage order of matrix types.
Header file for the implementation of the RowsData class template.
Header file for the rows trait.
Header file for the Schur product trait.
Header file for the subtraction trait.
Constraint on the data type.
Constraint on the data type.
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.
Header file for the implementation of a matrix representation of an initializer list.
Header file for the SparseMatrix base class.
Header file for the View base class.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:137
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.
Definition: Pointer.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.
Definition: Reference.h:79
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
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1339
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1375
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1501
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766
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
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: RowMajorMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition: RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Hermitian.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.
Definition: TransExpr.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SUBMATRIX_TYPE(T)
Constraint on the data type.
Definition: Submatrix.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:60
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: SparseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_ROWS_TYPE(T)
Constraint on the data type.
Definition: Rows.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: UniTriangular.h:81
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: ColumnMajorMatrix.h:61
constexpr bool IsSparseMatrix_v
Auxiliary variable template for the IsSparseMatrix type trait.
Definition: IsSparseMatrix.h:124
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
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:644
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
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:660
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
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:1221
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
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:1195
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:137
#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
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
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 void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
#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
#define BLAZE_THROW_LOGIC_ERROR(MESSAGE)
Macro for the emission of a std::logic_error exception.
Definition: Exception.h:187
constexpr bool isChecked(const Ts &... args)
Extracting blaze::Check arguments from a given list of arguments.
Definition: Check.h:225
constexpr Unchecked unchecked
Global Unchecked instance.
Definition: Check.h:146
Header file for the exception macros of the math module.
Header file for the extended initializer_list functionality.
Header file for the SparseElement base class.
Header file for basic type definitions.
Header file for the generic max algorithm.
Header file for the generic min algorithm.
Header file for the implementation of the Rows base template.