35#ifndef _BLAZE_MATH_VIEWS_COLUMNS_SPARSE_H_
36#define _BLAZE_MATH_VIEWS_COLUMNS_SPARSE_H_
111class Columns<MT,true,false,SF,CCAs...>
112 :
public View< SparseMatrix< Columns<MT,true,false,SF,CCAs...>, true > >
113 ,
private ColumnsData<CCAs...>
117 using DataType = ColumnsData<CCAs...>;
118 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
128 using This = Columns<MT,
true,
false,SF,CCAs...>;
131 using BaseType = View< SparseMatrix<This,true> >;
133 using ViewedType = MT;
134 using ResultType = ColumnsTrait_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 Columns&;
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... RCAs >
166 explicit inline Columns( MT& matrix, RCAs... args );
168 Columns(
const Columns& ) =
default;
169 Columns( Columns&& ) =
default;
176 ~Columns() =
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 j );
188 inline ConstIterator
begin (
size_t j )
const;
189 inline ConstIterator
cbegin(
size_t j )
const;
190 inline Iterator
end (
size_t j );
191 inline ConstIterator
end (
size_t j )
const;
192 inline ConstIterator
cend (
size_t j )
const;
200 inline Columns& operator=(
const Columns& rhs );
202 template<
typename MT2,
bool SO >
inline Columns& operator= (
const Matrix<MT2,SO>& rhs );
203 template<
typename MT2,
bool SO >
inline Columns&
operator+=(
const Matrix<MT2,SO>& rhs );
204 template<
typename MT2,
bool SO >
inline Columns&
operator-=(
const Matrix<MT2,SO>& rhs );
205 template<
typename MT2,
bool SO >
inline Columns& 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 rows() const noexcept;
220 inline
size_t capacity() const noexcept;
221 inline
size_t capacity(
size_t j ) const noexcept;
223 inline
size_t nonZeros(
size_t j ) const;
225 inline
void reset(
size_t j );
226 inline
void reserve(
size_t nonzeros );
227 void reserve(
size_t j,
size_t nonzeros );
229 inline
void trim(
size_t j );
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 j );
246 inline
void erase(
size_t i,
size_t j );
247 inline Iterator erase(
size_t j, Iterator pos );
248 inline Iterator erase(
size_t j, Iterator first, Iterator last );
250 template< typename Pred >
251 inline
void erase( Pred predicate );
253 template< typename Pred >
254 inline
void erase(
size_t j, 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 Columns& 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,true>& rhs );
290 template< typename MT2 > inline
void assign ( const SparseMatrix<MT2,false>& 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 j ) const noexcept;
351template< typename... RCAs >
352inline Columns<MT,true,false,SF,CCAs...>::Columns( MT& matrix, RCAs... args )
353 : DataType( args... )
357 for(
size_t j=0UL; j<
columns(); ++j ) {
358 if( matrix_.columns() <= idx(j) ) {
390inline typename Columns<MT,
true,
false,SF,CCAs...>::Reference
391 Columns<MT,true,false,SF,CCAs...>::operator()(
size_t i,
size_t j )
396 return matrix_(i,idx(j));
416inline typename Columns<MT,
true,
false,SF,CCAs...>::ConstReference
417 Columns<MT,true,false,SF,CCAs...>::operator()(
size_t i,
size_t j )
const
422 return const_cast<const MT&
>( matrix_ )(i,idx(j));
443inline typename Columns<MT,
true,
false,SF,CCAs...>::Reference
444 Columns<MT,true,false,SF,CCAs...>::at(
size_t i,
size_t j )
473inline typename Columns<MT,
true,
false,SF,CCAs...>::ConstReference
474 Columns<MT,true,false,SF,CCAs...>::at(
size_t i,
size_t j )
const
500inline typename Columns<MT,
true,
false,SF,CCAs...>::Iterator
505 return matrix_.begin( idx(j) );
523inline typename Columns<MT,
true,
false,SF,CCAs...>::ConstIterator
528 return matrix_.cbegin( idx(j) );
546inline typename Columns<MT,
true,
false,SF,CCAs...>::ConstIterator
551 return matrix_.cbegin( idx(j) );
569inline typename Columns<MT,
true,
false,SF,CCAs...>::Iterator
574 return matrix_.end( idx(j) );
592inline typename Columns<MT,
true,
false,SF,CCAs...>::ConstIterator
597 return matrix_.cend( idx(j) );
615inline typename Columns<MT,
true,
false,SF,CCAs...>::ConstIterator
620 return matrix_.cend( idx(j) );
653inline Columns<MT,
true,
false,SF,CCAs...>&
659 if( list.size() !=
rows() ) {
663 const InitializerMatrix<ElementType> tmp( list,
columns() );
665 if( IsRestricted_v<MT> ) {
666 for(
size_t j=0UL; j<
columns(); ++j ) {
673 decltype(
auto) left( derestrict( *
this ) );
702inline Columns<MT,
true,
false,SF,CCAs...>&
703 Columns<MT,true,false,SF,CCAs...>::operator=(
const Columns& 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 j=0UL; j<
columns(); ++j ) {
720 if( !tryAssign( matrix_,
column( rhs, j,
unchecked ), 0UL, idx(j) ) ) {
726 decltype(
auto) left( derestrict( *
this ) );
728 if( rhs.canAlias(
this ) ) {
729 const ResultType tmp( rhs );
764template<
typename MT2
766inline Columns<MT,
true,
false,SF,CCAs...>&
767 Columns<MT,true,false,SF,CCAs...>::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 j=0UL; j<
columns(); ++j ) {
783 if( !tryAssign( matrix_,
column( right, j,
unchecked ), 0UL, idx(j) ) ) {
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 Columns<MT,
true,
false,SF,CCAs...>&
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 j=0UL; j<
columns(); ++j ) {
850 if( !tryAssign( matrix_,
column( tmp, j,
unchecked ), 0UL, idx(j) ) ) {
856 decltype(
auto) left( derestrict( *
this ) );
886template<
typename MT2
888inline Columns<MT,
true,
false,SF,CCAs...>&
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 j=0UL; j<
columns(); ++j ) {
910 if( !tryAssign( matrix_,
column( tmp, j,
unchecked ), 0UL, idx(j) ) ) {
916 decltype(
auto) left( derestrict( *
this ) );
946template<
typename MT2
948inline Columns<MT,
true,
false,SF,CCAs...>&
949 Columns<MT,true,false,SF,CCAs...>::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 j=0UL; j<
columns(); ++j ) {
970 if( !tryAssign( matrix_,
column( tmp, j,
unchecked ), 0UL, idx(j) ) ) {
976 decltype(
auto) left( derestrict( *
this ) );
1003template<
typename MT
1005 ,
typename... CCAs >
1006inline MT& Columns<MT,true,false,SF,CCAs...>::operand() noexcept
1020template<
typename MT
1022 ,
typename... CCAs >
1023inline const MT& Columns<MT,true,false,SF,CCAs...>::operand() const noexcept
1037template<
typename MT
1039 ,
typename... CCAs >
1042 return matrix_.rows();
1054template<
typename MT
1056 ,
typename... CCAs >
1059 return nonZeros() + matrix_.capacity() - matrix_.nonZeros();
1074template<
typename MT
1076 ,
typename... CCAs >
1081 return matrix_.capacity( idx(j) );
1093template<
typename MT
1095 ,
typename... CCAs >
1098 size_t nonzeros( 0UL );
1100 for(
size_t j=0UL; j<
columns(); ++j )
1118template<
typename MT
1120 ,
typename... CCAs >
1125 return matrix_.nonZeros( idx(j) );
1137template<
typename MT
1139 ,
typename... CCAs >
1142 for(
size_t j=0UL; j<
columns(); ++j ) {
1143 matrix_.reset( idx(j) );
1160template<
typename MT
1162 ,
typename... CCAs >
1165 matrix_.reset( idx(j) );
1182template<
typename MT
1184 ,
typename... CCAs >
1185inline void Columns<MT,true,false,SF,CCAs...>::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... CCAs >
1213void Columns<MT,true,false,SF,CCAs...>::reserve(
size_t j,
size_t nonzeros )
1215 matrix_.reserve( idx(j), nonzeros );
1231template<
typename MT
1233 ,
typename... CCAs >
1234void Columns<MT,true,false,SF,CCAs...>::trim()
1236 for(
size_t j=0UL; j<
columns(); ++j ) {
1255template<
typename MT
1257 ,
typename... CCAs >
1258void Columns<MT,true,false,SF,CCAs...>::trim(
size_t j )
1262 matrix_.trim( idx(j) );
1278template<
typename MT
1280 ,
typename... CCAs >
1281inline size_t Columns<MT,true,false,SF,CCAs...>::extendCapacity(
size_t j )
const noexcept
1286 size_t nonzeros( 2UL*
capacity( j )+1UL );
1287 nonzeros =
max( nonzeros, 7UL );
1288 nonzeros =
min( nonzeros,
rows() );
1319template<
typename MT
1321 ,
typename... CCAs >
1322inline typename Columns<MT,
true,
false,SF,CCAs...>::Iterator
1325 return matrix_.set( i, idx(j), value );
1345template<
typename MT
1347 ,
typename... CCAs >
1348inline typename Columns<MT,
true,
false,SF,CCAs...>::Iterator
1349 Columns<MT,true,false,SF,CCAs...>::insert(
size_t i,
size_t j,
const ElementType& value )
1351 return matrix_.insert( i, idx(j), value );
1401template<
typename MT
1403 ,
typename... CCAs >
1404inline void Columns<MT,true,false,SF,CCAs...>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
1406 if( !check || !isDefault<strict>( value ) )
1407 matrix_.insert( i, idx(j), value );
1427template<
typename MT
1429 ,
typename... CCAs >
1430inline void Columns<MT,true,false,SF,CCAs...>::finalize(
size_t j )
1458template<
typename MT
1460 ,
typename... CCAs >
1461inline void Columns<MT,true,false,SF,CCAs...>::erase(
size_t i,
size_t j )
1466 matrix_.erase( i, idx(j) );
1482template<
typename MT
1484 ,
typename... CCAs >
1485inline typename Columns<MT,
true,
false,SF,CCAs...>::Iterator
1486 Columns<MT,true,false,SF,CCAs...>::erase(
size_t j, Iterator pos )
1490 return matrix_.erase( idx(j), pos );
1507template<
typename MT
1509 ,
typename... CCAs >
1510inline typename Columns<MT,
true,
false,SF,CCAs...>::Iterator
1511 Columns<MT,true,false,SF,CCAs...>::erase(
size_t j, Iterator first, Iterator last )
1515 return matrix_.erase( idx(j), first, last );
1544template<
typename MT
1546 ,
typename... CCAs >
1547template<
typename Pred >
1548inline void Columns<MT,true,false,SF,CCAs...>::erase( Pred predicate )
1550 for(
size_t j=0UL; j<
columns(); ++j ) {
1551 matrix_.erase( idx(j),
begin(j),
end(j), predicate );
1585template<
typename MT
1587 ,
typename... CCAs >
1588template<
typename Pred >
1589inline void Columns<MT,true,false,SF,CCAs...>::erase(
size_t j, Iterator first, Iterator last, Pred predicate )
1593 matrix_.erase( idx(j), first, last, predicate );
1622template<
typename MT
1624 ,
typename... CCAs >
1625inline typename Columns<MT,
true,
false,SF,CCAs...>::Iterator
1628 return matrix_.find( i, idx(j) );
1649template<
typename MT
1651 ,
typename... CCAs >
1652inline typename Columns<MT,
true,
false,SF,CCAs...>::ConstIterator
1655 return matrix_.find( i, idx(j) );
1675template<
typename MT
1677 ,
typename... CCAs >
1678inline typename Columns<MT,
true,
false,SF,CCAs...>::Iterator
1681 return matrix_.lowerBound( i, idx(j) );
1701template<
typename MT
1703 ,
typename... CCAs >
1704inline typename Columns<MT,
true,
false,SF,CCAs...>::ConstIterator
1707 return matrix_.lowerBound( i, idx(j) );
1727template<
typename MT
1729 ,
typename... CCAs >
1730inline typename Columns<MT,
true,
false,SF,CCAs...>::Iterator
1733 return matrix_.upperBound( i, idx(j) );
1753template<
typename MT
1755 ,
typename... CCAs >
1756inline typename Columns<MT,
true,
false,SF,CCAs...>::ConstIterator
1759 return matrix_.upperBound( i, idx(j) );
1786template<
typename MT
1788 ,
typename... CCAs >
1789inline Columns<MT,
true,
false,SF,CCAs...>&
1796 const ResultType tmp(
trans( *
this ) );
1798 if( IsRestricted_v<MT> ) {
1799 for(
size_t j=0UL; j<
columns(); ++j ) {
1800 if( !tryAssign( matrix_,
column( tmp, j,
unchecked ), 0UL, idx(j) ) ) {
1806 decltype(
auto) left( derestrict( *
this ) );
1830template<
typename MT
1832 ,
typename... CCAs >
1833inline Columns<MT,
true,
false,SF,CCAs...>&
1840 const ResultType tmp(
ctrans( *
this ) );
1842 if( IsRestricted_v<MT> ) {
1843 for(
size_t j=0UL; j<
columns(); ++j ) {
1844 if( !tryAssign( matrix_,
column( tmp, j,
unchecked ), 0UL, idx(j) ) ) {
1850 decltype(
auto) left( derestrict( *
this ) );
1874template<
typename MT
1876 ,
typename... CCAs >
1877template<
typename Other >
1878inline Columns<MT,
true,
false,SF,CCAs...>&
1879 Columns<MT,true,false,SF,CCAs...>::scale(
const Other& scalar )
1883 for(
size_t j=0UL; j<
columns(); ++j ) {
1884 const Iterator last(
end(j) );
1885 for( Iterator element=
begin(j); element!=last; ++element )
1886 element->value() *= scalar;
1914template<
typename MT
1916 ,
typename... CCAs >
1917template<
typename Other >
1918inline bool Columns<MT,true,false,SF,CCAs...>::canAlias(
const Other* alias )
const noexcept
1920 return matrix_.isAliased( &unview( *alias ) );
1937template<
typename MT
1939 ,
typename... CCAs >
1940template<
typename Other >
1941inline bool Columns<MT,true,false,SF,CCAs...>::isAliased(
const Other* alias )
const noexcept
1943 return matrix_.isAliased( &unview( *alias ) );
1960template<
typename MT
1962 ,
typename... CCAs >
1963inline bool Columns<MT,true,false,SF,CCAs...>::canSMPAssign() const noexcept
1983template<
typename MT
1985 ,
typename... CCAs >
1986template<
typename MT2
1988inline void Columns<MT,true,false,SF,CCAs...>::assign(
const DenseMatrix<MT2,SO>& rhs )
1997 for(
size_t j=0UL; j<
columns(); ++j )
1999 const size_t index( idx(j) );
2000 size_t remaining( matrix_.capacity( index ) );
2002 for(
size_t i=0UL; i<
rows(); ++i )
2004 if( remaining == 0UL ) {
2005 matrix_.reserve( index, extendCapacity( j ) );
2006 remaining = matrix_.capacity( index ) - matrix_.nonZeros( index );
2009 matrix_.append( i, index, (*rhs)(i,j),
true );
2030template<
typename MT
2032 ,
typename... CCAs >
2033template<
typename MT2 >
2034inline void Columns<MT,true,false,SF,CCAs...>::assign(
const SparseMatrix<MT2,true>& rhs )
2043 for(
size_t j=0UL; j<
columns(); ++j )
2045 const size_t index( idx(j) );
2046 size_t remaining( matrix_.capacity( index ) );
2048 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
2050 if( remaining == 0UL ) {
2051 matrix_.reserve( index, extendCapacity( j ) );
2052 remaining = matrix_.capacity( index ) - matrix_.nonZeros( index );
2055 matrix_.append( element->index(), index, element->value(),
true );
2076template<
typename MT
2078 ,
typename... CCAs >
2079template<
typename MT2 >
2080inline void Columns<MT,true,false,SF,CCAs...>::assign(
const SparseMatrix<MT2,false>& rhs )
2092 std::vector<size_t> columnLengths(
columns(), 0UL );
2093 for(
size_t i=0UL; i<
rows(); ++i ) {
2094 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
2095 ++columnLengths[element->index()];
2099 for(
size_t j=0UL; j<
columns(); ++j ) {
2100 reserve( j, columnLengths[j] );
2104 for(
size_t i=0UL; i<
rows(); ++i ) {
2105 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
2106 append( i, element->index(), element->value(), true );
2125template<
typename MT
2127 ,
typename... CCAs >
2128template<
typename MT2
2130inline void Columns<MT,true,false,SF,CCAs...>::addAssign(
const Matrix<MT2,SO>& rhs )
2135 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
2142 const AddType tmp(
serial( *
this + (*rhs) ) );
2162template<
typename MT
2164 ,
typename... CCAs >
2165template<
typename MT2
2167inline void Columns<MT,true,false,SF,CCAs...>::subAssign(
const Matrix<MT2,SO>& rhs )
2172 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
2179 const SubType tmp(
serial( *
this - (*rhs) ) );
2199template<
typename MT
2201 ,
typename... CCAs >
2202template<
typename MT2
2204inline void Columns<MT,true,false,SF,CCAs...>::schurAssign(
const Matrix<MT2,SO>& rhs )
2209 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
2217 const SchurType tmp(
serial( *
this % (*rhs) ) );
2245template<
typename MT
2246 ,
typename... CCAs >
2247class Columns<MT,false,false,false,CCAs...>
2248 :
public View< SparseMatrix< Columns<MT,false,false,false,CCAs...>, true > >
2249 ,
private ColumnsData<CCAs...>
2253 using DataType = ColumnsData<CCAs...>;
2254 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
2264 using This = Columns<MT,
false,
false,
false,CCAs...>;
2267 using BaseType = View< SparseMatrix<This,true> >;
2269 using ViewedType = MT;
2270 using ResultType = ColumnsTrait_t<MT,N>;
2271 using OppositeType = OppositeType_t<ResultType>;
2272 using TransposeType = TransposeType_t<ResultType>;
2273 using ElementType = ElementType_t<MT>;
2274 using ReturnType = ReturnType_t<MT>;
2275 using CompositeType =
const Columns&;
2278 using ConstReference = ConstReference_t<MT>;
2281 using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
2287 template<
typename MatrixType
2288 ,
typename IteratorType >
2289 class ColumnsElement
2290 :
private SparseElement
2299 inline ColumnsElement( IteratorType pos,
size_t row )
2311 template<
typename T >
inline ColumnsElement& operator=(
const T& v ) {
2323 template<
typename T >
inline ColumnsElement&
operator+=(
const T& v ) {
2335 template<
typename T >
inline ColumnsElement&
operator-=(
const T& v ) {
2347 template<
typename T >
inline ColumnsElement&
operator*=(
const T& v ) {
2359 template<
typename T >
inline ColumnsElement&
operator/=(
const T& v ) {
2370 inline const ColumnsElement* operator->()
const {
2380 inline decltype(
auto) value()
const {
2381 return pos_->value();
2390 inline size_t index()
const {
2406 template<
typename MatrixType
2407 ,
typename IteratorType >
2408 class ColumnsIterator
2412 using IteratorCategory = std::forward_iterator_tag;
2413 using ValueType = ColumnsElement<MatrixType,IteratorType>;
2414 using PointerType = ValueType;
2415 using ReferenceType = ValueType;
2419 using iterator_category = IteratorCategory;
2420 using value_type = ValueType;
2421 using pointer = PointerType;
2422 using reference = ReferenceType;
2423 using difference_type = DifferenceType;
2429 inline ColumnsIterator()
2430 : matrix_( nullptr )
2444 inline ColumnsIterator( MatrixType& matrix,
size_t row,
size_t column )
2445 : matrix_( &matrix )
2450 for( ; row_<matrix_->rows(); ++row_ ) {
2451 pos_ = matrix_->find( row_, column_ );
2452 if( pos_ != matrix_->end( row_ ) )
break;
2465 inline ColumnsIterator( MatrixType& matrix,
size_t row,
size_t column, IteratorType pos )
2466 : matrix_( &matrix )
2480 template<
typename MatrixType2,
typename IteratorType2 >
2481 inline ColumnsIterator(
const ColumnsIterator<MatrixType2,IteratorType2>& it )
2482 : matrix_( it.matrix_ )
2484 , column_( it.column_ )
2494 inline ColumnsIterator& operator++() {
2496 for( ; row_<matrix_->rows(); ++row_ ) {
2497 pos_ = matrix_->find( row_, column_ );
2498 if( pos_ != matrix_->end( row_ ) )
break;
2510 inline const ColumnsIterator operator++(
int ) {
2511 const ColumnsIterator tmp( *
this );
2522 inline ReferenceType
operator*()
const {
2523 return ReferenceType( pos_, row_ );
2532 inline PointerType operator->()
const {
2533 return PointerType( pos_, row_ );
2543 template<
typename MatrixType2,
typename IteratorType2 >
2544 inline bool operator==(
const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
2545 return row_ == rhs.row_;
2555 template<
typename MatrixType2,
typename IteratorType2 >
2556 inline bool operator!=(
const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
2557 return !( *
this == rhs );
2567 inline DifferenceType
operator-(
const ColumnsIterator& rhs )
const {
2568 size_t counter( 0UL );
2569 for(
size_t i=rhs.row_; i<row_; ++i ) {
2570 if( matrix_->find( i, column_ ) != matrix_->end( i ) )
2579 MatrixType* matrix_;
2586 template<
typename MatrixType2,
typename IteratorType2 >
friend class ColumnsIterator;
2587 template<
typename MT2,
bool SO2,
bool DF2,
bool SF2,
typename... CCAs2 >
friend class Columns;
2594 using ConstIterator = ColumnsIterator< const MT, ConstIterator_t<MT> >;
2597 using Iterator = If_t< IsConst_v<MT>, ConstIterator, ColumnsIterator< MT, Iterator_t<MT> > >;
2602 static constexpr bool smpAssignable = MT::smpAssignable;
2605 static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
2611 template<
typename... RCAs >
2612 explicit inline Columns( MT& matrix, RCAs... args );
2614 Columns(
const Columns& ) =
default;
2615 Columns( Columns&& ) =
default;
2622 ~Columns() =
default;
2629 inline Reference operator()(
size_t i,
size_t j );
2630 inline ConstReference operator()(
size_t i,
size_t j )
const;
2631 inline Reference at(
size_t i,
size_t j );
2632 inline ConstReference at(
size_t i,
size_t j )
const;
2633 inline Iterator
begin (
size_t j );
2634 inline ConstIterator
begin (
size_t j )
const;
2635 inline ConstIterator
cbegin(
size_t j )
const;
2636 inline Iterator
end (
size_t j );
2637 inline ConstIterator
end (
size_t j )
const;
2638 inline ConstIterator
cend (
size_t j )
const;
2646 inline Columns& operator=(
const Columns& rhs );
2648 template<
typename MT2,
bool SO >
inline Columns& operator= (
const Matrix<MT2,SO>& rhs );
2649 template<
typename MT2,
bool SO >
inline Columns&
operator+=(
const Matrix<MT2,SO>& rhs );
2650 template<
typename MT2,
bool SO >
inline Columns&
operator-=(
const Matrix<MT2,SO>& rhs );
2651 template<
typename MT2,
bool SO >
inline Columns& operator%=(
const Matrix<MT2,SO>& rhs );
2658 using DataType::idx;
2659 using DataType::idces;
2662 inline MT& operand() noexcept;
2663 inline const MT& operand() const noexcept;
2665 inline
size_t rows() const noexcept;
2666 inline
size_t capacity() const noexcept;
2667 inline
size_t capacity(
size_t j ) const noexcept;
2669 inline
size_t nonZeros(
size_t j ) const;
2670 inline
void reset();
2671 inline
void reset(
size_t j );
2672 inline
void reserve(
size_t nonzeros );
2673 void reserve(
size_t j,
size_t nonzeros );
2675 inline
void trim(
size_t j );
2682 inline Iterator
set (
size_t i,
size_t j, const ElementType& value );
2683 inline Iterator insert (
size_t i,
size_t j, const ElementType& value );
2684 inline
void append (
size_t i,
size_t j, const ElementType& value,
bool check=false );
2685 inline
void finalize(
size_t j );
2692 inline
void erase(
size_t i,
size_t j );
2693 inline Iterator erase(
size_t j, Iterator pos );
2694 inline Iterator erase(
size_t j, Iterator first, Iterator last );
2696 template< typename Pred >
2697 inline
void erase( Pred predicate );
2699 template< typename Pred >
2700 inline
void erase(
size_t j, Iterator first, Iterator last, Pred predicate );
2707 inline Iterator
find (
size_t i,
size_t j );
2708 inline ConstIterator
find (
size_t i,
size_t j ) const;
2709 inline Iterator
lowerBound(
size_t i,
size_t j );
2710 inline ConstIterator
lowerBound(
size_t i,
size_t j ) const;
2711 inline Iterator
upperBound(
size_t i,
size_t j );
2712 inline ConstIterator
upperBound(
size_t i,
size_t j ) const;
2722 template< typename Other > inline Columns& scale( const Other& scalar );
2729 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
2730 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
2732 inline
bool canSMPAssign() const noexcept;
2734 template< typename MT2,
bool SO > inline
void assign ( const DenseMatrix<MT2,SO>& rhs );
2735 template< typename MT2 > inline
void assign ( const SparseMatrix<MT2,false>& rhs );
2736 template< typename MT2 > inline
void assign ( const SparseMatrix<MT2,true>& rhs );
2737 template< typename MT2,
bool SO > inline
void addAssign ( const Matrix<MT2,SO>& rhs );
2738 template< typename MT2,
bool SO > inline
void subAssign ( const Matrix<MT2,SO>& rhs );
2739 template< typename MT2,
bool SO > inline
void schurAssign( const Matrix<MT2,SO>& rhs );
2788template< typename MT
2789 , typename... CCAs >
2790template< typename... RCAs >
2791inline Columns<MT,false,false,false,CCAs...>::Columns( MT& matrix, RCAs... args )
2792 : DataType( args... )
2793 , matrix_ ( matrix )
2796 for(
size_t j=0UL; j<
columns(); ++j ) {
2797 if( matrix_.columns() <= idx(j) ) {
2826template<
typename MT
2827 ,
typename... CCAs >
2828inline typename Columns<MT,
false,
false,
false,CCAs...>::Reference
2829 Columns<MT,false,false,false,CCAs...>::operator()(
size_t i,
size_t j )
2834 return matrix_(i,idx(j));
2851template<
typename MT
2852 ,
typename... CCAs >
2853inline typename Columns<MT,
false,
false,
false,CCAs...>::ConstReference
2854 Columns<MT,false,false,false,CCAs...>::operator()(
size_t i,
size_t j )
const
2859 return const_cast<const MT&
>( matrix_ )(i,idx(j));
2877template<
typename MT
2878 ,
typename... CCAs >
2879inline typename Columns<MT,
false,
false,
false,CCAs...>::Reference
2880 Columns<MT,false,false,false,CCAs...>::at(
size_t i,
size_t j )
2888 return (*
this)(i,j);
2906template<
typename MT
2907 ,
typename... CCAs >
2908inline typename Columns<MT,
false,
false,
false,CCAs...>::ConstReference
2909 Columns<MT,false,false,false,CCAs...>::at(
size_t i,
size_t j )
const
2917 return (*
this)(i,j);
2932template<
typename MT
2933 ,
typename... CCAs >
2934inline typename Columns<MT,
false,
false,
false,CCAs...>::Iterator
2939 return Iterator( matrix_, 0UL, idx(j) );
2954template<
typename MT
2955 ,
typename... CCAs >
2956inline typename Columns<MT,
false,
false,
false,CCAs...>::ConstIterator
2961 return ConstIterator( matrix_, 0UL, idx(j) );
2976template<
typename MT
2977 ,
typename... CCAs >
2978inline typename Columns<MT,
false,
false,
false,CCAs...>::ConstIterator
2983 return ConstIterator( matrix_, 0UL, idx(j) );
2998template<
typename MT
2999 ,
typename... CCAs >
3000inline typename Columns<MT,
false,
false,
false,CCAs...>::Iterator
3005 return Iterator( matrix_,
rows(), idx(j) );
3020template<
typename MT
3021 ,
typename... CCAs >
3022inline typename Columns<MT,
false,
false,
false,CCAs...>::ConstIterator
3027 return ConstIterator( matrix_,
rows(), idx(j) );
3042template<
typename MT
3043 ,
typename... CCAs >
3044inline typename Columns<MT,
false,
false,
false,CCAs...>::ConstIterator
3049 return ConstIterator( matrix_,
rows(), idx(j) );
3079template<
typename MT
3080 ,
typename... CCAs >
3081inline Columns<MT,
false,
false,
false,CCAs...>&
3087 if( list.size() !=
rows() ) {
3091 const InitializerMatrix<ElementType> tmp( list,
columns() );
3093 if( IsRestricted_v<MT> ) {
3094 for(
size_t j=0UL; j<
columns(); ++j ) {
3101 decltype(
auto) left( derestrict( *
this ) );
3126template<
typename MT
3127 ,
typename... CCAs >
3128inline Columns<MT,
false,
false,
false,CCAs...>&
3129 Columns<MT,false,false,false,CCAs...>::operator=(
const Columns& rhs )
3137 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && compareIndices( *
this, rhs ) ) )
3140 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
3144 if( IsRestricted_v<MT> ) {
3145 for(
size_t j=0UL; j<
columns(); ++j ) {
3146 if( !tryAssign( matrix_,
column( rhs, j,
unchecked ), 0UL, idx(j) ) ) {
3152 decltype(
auto) left( derestrict( *
this ) );
3154 if( rhs.canAlias(
this ) ) {
3155 const ResultType tmp( rhs );
3187template<
typename MT
3188 ,
typename... CCAs >
3189template<
typename MT2
3191inline Columns<MT,
false,
false,
false,CCAs...>&
3192 Columns<MT,false,false,false,CCAs...>::operator=(
const Matrix<MT2,SO>& rhs )
3199 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
3203 using Right = CompositeType_t<MT2>;
3204 Right right( *rhs );
3206 if( IsRestricted_v<MT> ) {
3207 for(
size_t j=0UL; j<
columns(); ++j ) {
3208 if( !tryAssign( matrix_,
column( right, j,
unchecked ), 0UL, idx(j) ) ) {
3214 decltype(
auto) left( derestrict( *
this ) );
3216 if( IsReference_v<Right> && right.canAlias(
this ) ) {
3217 const ResultType_t<MT2> tmp( right );
3223 if( IsSparseMatrix_v<MT2> )
3250template<
typename MT
3251 ,
typename... CCAs >
3252template<
typename MT2
3254inline Columns<MT,
false,
false,
false,CCAs...>&
3264 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
3268 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
3272 const AddType tmp( *
this + (*rhs) );
3274 if( IsRestricted_v<MT> ) {
3275 for(
size_t j=0UL; j<
columns(); ++j ) {
3276 if( !tryAssign( matrix_,
column( tmp, j,
unchecked ), 0UL, idx(j) ) ) {
3282 decltype(
auto) left( derestrict( *
this ) );
3284 if( IsSparseMatrix_v<AddType> ) {
3312template<
typename MT
3313 ,
typename... CCAs >
3314template<
typename MT2
3316inline Columns<MT,
false,
false,
false,CCAs...>&
3326 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
3330 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
3334 const SubType tmp( *
this - (*rhs) );
3336 if( IsRestricted_v<MT> ) {
3337 for(
size_t j=0UL; j<
columns(); ++j ) {
3338 if( !tryAssign( matrix_,
column( tmp, j,
unchecked ), 0UL, idx(j) ) ) {
3344 decltype(
auto) left( derestrict( *
this ) );
3346 if( IsSparseMatrix_v<SubType> ) {
3374template<
typename MT
3375 ,
typename... CCAs >
3376template<
typename MT2
3378inline Columns<MT,
false,
false,
false,CCAs...>&
3379 Columns<MT,false,false,false,CCAs...>::operator%=(
const Matrix<MT2,SO>& rhs )
3388 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
3392 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
3396 const SchurType tmp( *
this % (*rhs) );
3398 if( IsRestricted_v<MT> ) {
3399 for(
size_t j=0UL; j<
columns(); ++j ) {
3400 if( !tryAssign( matrix_,
column( tmp, j,
unchecked ), 0UL, idx(j) ) ) {
3406 decltype(
auto) left( derestrict( *
this ) );
3408 if( IsSparseMatrix_v<SchurType> ) {
3436template<
typename MT
3437 ,
typename... CCAs >
3438inline MT& Columns<MT,false,false,false,CCAs...>::operand() noexcept
3452template<
typename MT
3453 ,
typename... CCAs >
3454inline const MT& Columns<MT,false,false,false,CCAs...>::operand() const noexcept
3468template<
typename MT
3469 ,
typename... CCAs >
3472 return matrix_.rows();
3484template<
typename MT
3485 ,
typename... CCAs >
3503template<
typename MT
3504 ,
typename... CCAs >
3523template<
typename MT
3524 ,
typename... CCAs >
3527 size_t nonzeros( 0UL );
3529 for(
size_t i=0UL; i<
rows(); ++i ) {
3530 const auto end( matrix_.end( i ) );
3531 for(
size_t j=0UL; j<
columns(); ++j ) {
3532 auto pos = matrix_.find( i, idx(j) );
3554template<
typename MT
3555 ,
typename... CCAs >
3560 size_t counter( 0UL );
3562 const ConstIterator last(
end(j) );
3563 for( ConstIterator element=
begin(j); element!=last; ++element ) {
3579template<
typename MT
3580 ,
typename... CCAs >
3583 for(
size_t j=0UL; j<
columns(); ++j ) {
3601template<
typename MT
3602 ,
typename... CCAs >
3605 const size_t index( idx(j) );
3607 const size_t ibegin( ( IsLower_v<MT> )
3608 ?( ( IsUniLower_v<MT> || IsStrictlyLower_v<MT> )
3612 const size_t iend ( ( IsUpper_v<MT> )
3613 ?( ( IsUniUpper_v<MT> || IsStrictlyUpper_v<MT> )
3618 for(
size_t i=ibegin; i<iend; ++i ) {
3619 matrix_.erase( i, index );
3637template<
typename MT
3638 ,
typename... CCAs >
3639inline void Columns<MT,false,false,false,CCAs...>::reserve(
size_t nonzeros )
3662template<
typename MT
3663 ,
typename... CCAs >
3664void Columns<MT,false,false,false,CCAs...>::reserve(
size_t j,
size_t nonzeros )
3684template<
typename MT
3685 ,
typename... CCAs >
3686void Columns<MT,false,false,false,CCAs...>::trim()
3705template<
typename MT
3706 ,
typename... CCAs >
3707void Columns<MT,false,false,false,CCAs...>::trim(
size_t j )
3740template<
typename MT
3741 ,
typename... CCAs >
3742inline typename Columns<MT,
false,
false,
false,CCAs...>::Iterator
3745 return Iterator( matrix_, i, idx(j), matrix_.set( i, idx(j), value ) );
3765template<
typename MT
3766 ,
typename... CCAs >
3767inline typename Columns<MT,
false,
false,
false,CCAs...>::Iterator
3768 Columns<MT,false,false,false,CCAs...>::insert(
size_t i,
size_t j,
const ElementType& value )
3770 return Iterator( matrix_, i, idx(j), matrix_.insert( i, idx(j), value ) );
3820template<
typename MT
3821 ,
typename... CCAs >
3822inline void Columns<MT,false,false,false,CCAs...>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
3824 if( !check || !isDefault<strict>( value ) )
3825 matrix_.insert( i, idx(j), value );
3845template<
typename MT
3846 ,
typename... CCAs >
3847inline void Columns<MT,false,false,false,CCAs...>::finalize(
size_t j )
3875template<
typename MT
3876 ,
typename... CCAs >
3877inline void Columns<MT,false,false,false,CCAs...>::erase(
size_t i,
size_t j )
3882 matrix_.erase( i, idx(j) );
3898template<
typename MT
3899 ,
typename... CCAs >
3900inline typename Columns<MT,
false,
false,
false,CCAs...>::Iterator
3901 Columns<MT,false,false,false,CCAs...>::erase(
size_t j, Iterator pos )
3903 const size_t row( pos.row_ );
3908 matrix_.erase(
row, pos.pos_ );
3909 return Iterator( matrix_,
row+1UL, idx(j) );
3926template<
typename MT
3927 ,
typename... CCAs >
3928inline typename Columns<MT,
false,
false,
false,CCAs...>::Iterator
3929 Columns<MT,false,false,false,CCAs...>::erase(
size_t j, Iterator first, Iterator last )
3935 for( ; first!=last; ++first ) {
3936 matrix_.erase( first.row_, first.pos_ );
3968template<
typename MT
3969 ,
typename... CCAs >
3970template<
typename Pred >
3971inline void Columns<MT,false,false,false,CCAs...>::erase( Pred predicate )
3973 for(
size_t j=0UL; j<
columns(); ++j ) {
3974 for( Iterator element=
begin(j); element!=
end(j); ++element ) {
3975 if( predicate( element->value() ) )
3976 matrix_.erase( element.row_, element.pos_ );
4011template<
typename MT
4012 ,
typename... CCAs >
4013template<
typename Pred >
4014inline void Columns<MT,false,false,false,CCAs...>::erase(
size_t j, Iterator first, Iterator last, Pred predicate )
4020 for( ; first!=last; ++first ) {
4021 if( predicate( first->value() ) )
4022 matrix_.erase( first.row_, first.pos_ );
4052template<
typename MT
4053 ,
typename... CCAs >
4054inline typename Columns<MT,
false,
false,
false,CCAs...>::Iterator
4057 const size_t index( idx(j) );
4058 const Iterator_t<MT> pos( matrix_.find( i, index ) );
4060 if( pos != matrix_.end( i ) )
4061 return Iterator( matrix_, i, index, pos );
4084template<
typename MT
4085 ,
typename... CCAs >
4086inline typename Columns<MT,
false,
false,
false,CCAs...>::ConstIterator
4089 const size_t index( idx(j) );
4090 const ConstIterator_t<MT> pos( matrix_.find( i, index ) );
4092 if( pos != matrix_.end( i ) )
4093 return ConstIterator( matrix_, i, index, pos );
4115template<
typename MT
4116 ,
typename... CCAs >
4117inline typename Columns<MT,
false,
false,
false,CCAs...>::Iterator
4120 const size_t index( idx(j) );
4122 for( ; i<
rows(); ++i )
4124 const Iterator_t<MT> pos( matrix_.find( i, index ) );
4126 if( pos != matrix_.end( i ) )
4127 return Iterator( matrix_, i, index, pos );
4150template<
typename MT
4151 ,
typename... CCAs >
4152inline typename Columns<MT,
false,
false,
false,CCAs...>::ConstIterator
4155 const size_t index( idx(j) );
4157 for( ; i<
rows(); ++i )
4159 const ConstIterator_t<MT> pos( matrix_.find( i, index ) );
4161 if( pos != matrix_.end( i ) )
4162 return ConstIterator( matrix_, i, index, pos );
4185template<
typename MT
4186 ,
typename... CCAs >
4187inline typename Columns<MT,
false,
false,
false,CCAs...>::Iterator
4210template<
typename MT
4211 ,
typename... CCAs >
4212inline typename Columns<MT,
false,
false,
false,CCAs...>::ConstIterator
4242template<
typename MT
4243 ,
typename... CCAs >
4244inline Columns<MT,
false,
false,
false,CCAs...>&
4254 const ResultType tmp(
trans( *
this ) );
4256 if( IsRestricted_v<MT> ) {
4257 for(
size_t j=0UL; j<
columns(); ++j ) {
4258 if( !tryAssign( matrix_,
column( tmp, j,
unchecked ), 0UL, idx(j) ) ) {
4264 decltype(
auto) left( derestrict( *
this ) );
4288template<
typename MT
4289 ,
typename... CCAs >
4290inline Columns<MT,
false,
false,
false,CCAs...>&
4300 const ResultType tmp(
ctrans( *
this ) );
4302 if( IsRestricted_v<MT> ) {
4303 for(
size_t j=0UL; j<
columns(); ++j ) {
4304 if( !tryAssign( matrix_,
column( tmp, j,
unchecked ), 0UL, idx(j) ) ) {
4310 decltype(
auto) left( derestrict( *
this ) );
4334template<
typename MT
4335 ,
typename... CCAs >
4336template<
typename Other >
4337inline Columns<MT,
false,
false,
false,CCAs...>&
4338 Columns<MT,false,false,false,CCAs...>::scale(
const Other& scalar )
4344 for(
size_t i=0UL; i<
rows(); ++i ) {
4345 const auto end( matrix_.end( i ) );
4346 for(
size_t j=0UL; j<
columns(); ++j ) {
4347 auto pos = matrix_.find( i, idx(j) );
4349 pos->value() *= scalar;
4379template<
typename MT
4380 ,
typename... CCAs >
4381template<
typename Other >
4382inline bool Columns<MT,false,false,false,CCAs...>::canAlias(
const Other* alias )
const noexcept
4384 return matrix_.isAliased( &unview( *alias ) );
4401template<
typename MT
4402 ,
typename... CCAs >
4403template<
typename Other >
4404inline bool Columns<MT,false,false,false,CCAs...>::isAliased(
const Other* alias )
const noexcept
4406 return matrix_.isAliased( &unview( *alias ) );
4423template<
typename MT
4424 ,
typename... CCAs >
4425inline bool Columns<MT,false,false,false,CCAs...>::canSMPAssign() const noexcept
4445template<
typename MT
4446 ,
typename... CCAs >
4447template<
typename MT2
4449inline void Columns<MT,false,false,false,CCAs...>::assign(
const DenseMatrix<MT2,SO>& rhs )
4454 using RT = If_t< IsComputation_v<MT2>, ElementType_t<MT>,
const ElementType_t<MT2>& >;
4459 for(
size_t i=0UL; i<
rows(); ++i ) {
4460 for(
size_t j=0UL; j<
columns(); ++j ) {
4461 RT value( (*rhs)(i,j) );
4462 if( !isDefault<strict>( value ) )
4463 matrix_.set( i, idx(j), std::move( value ) );
4464 else matrix_.erase( i, idx(j) );
4484template<
typename MT
4485 ,
typename... CCAs >
4486template<
typename MT2 >
4487inline void Columns<MT,false,false,false,CCAs...>::assign(
const SparseMatrix<MT2,false>& rhs )
4494 using RT = If_t< IsComputation_v<MT2>, ElementType_t<MT>,
const ElementType_t<MT2>& >;
4500 for(
size_t i=0UL; i<
rows(); ++i ) {
4501 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element ) {
4502 RT value( element->value() );
4503 if( !isDefault<strict>( value ) )
4504 matrix_.set( i, idx( element->index() ), std::move( value ) );
4505 else matrix_.erase( i, idx( element->index() ) );
4525template<
typename MT
4526 ,
typename... CCAs >
4527template<
typename MT2 >
4528inline void Columns<MT,false,false,false,CCAs...>::assign(
const SparseMatrix<MT2,true>& rhs )
4533 using RT = If_t< IsComputation_v<MT2>, ElementType_t<MT>,
const ElementType_t<MT2>& >;
4539 for(
size_t j=0UL; j<
columns(); ++j ) {
4540 const size_t index( idx(j) );
4541 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element ) {
4542 RT value( element->value() );
4543 if( !isDefault<strict>( value ) )
4544 matrix_.set( element->index(), index, std::move( value ) );
4545 else matrix_.erase( element->index(), index );
4565template<
typename MT
4566 ,
typename... CCAs >
4567template<
typename MT2
4569inline void Columns<MT,false,false,false,CCAs...>::addAssign(
const Matrix<MT2,SO>& rhs )
4574 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
4581 const AddType tmp(
serial( *
this + (*rhs) ) );
4601template<
typename MT
4602 ,
typename... CCAs >
4603template<
typename MT2
4605inline void Columns<MT,false,false,false,CCAs...>::subAssign(
const Matrix<MT2,SO>& rhs )
4610 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
4617 const SubType tmp(
serial( *
this - (*rhs) ) );
4637template<
typename MT
4638 ,
typename... CCAs >
4639template<
typename MT2
4641inline void Columns<MT,false,false,false,CCAs...>::schurAssign(
const Matrix<MT2,SO>& rhs )
4646 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
4654 const SchurType tmp(
serial( *
this % (*rhs) ) );
4682template<
typename MT
4683 ,
typename... CCAs >
4684class Columns<MT,false,false,true,CCAs...>
4685 :
public View< SparseMatrix< Columns<MT,false,false,true,CCAs...>, true > >
4686 ,
private ColumnsData<CCAs...>
4690 using DataType = ColumnsData<CCAs...>;
4691 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
4701 using This = Columns<MT,
false,
false,
true,CCAs...>;
4704 using BaseType = View< SparseMatrix<This,true> >;
4706 using ViewedType = MT;
4707 using ResultType = ColumnsTrait_t<MT,N>;
4708 using OppositeType = OppositeType_t<ResultType>;
4709 using TransposeType = TransposeType_t<ResultType>;
4710 using ElementType = ElementType_t<MT>;
4711 using ReturnType = ReturnType_t<MT>;
4712 using CompositeType =
const Columns&;
4715 using ConstReference = ConstReference_t<MT>;
4718 using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
4721 using ConstIterator = ConstIterator_t<MT>;
4724 using Iterator = If_t< IsConst_v<MT>, ConstIterator, Iterator_t<MT> >;
4729 static constexpr bool smpAssignable = MT::smpAssignable;
4732 static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
4738 template<
typename... RCAs >
4739 explicit inline Columns( MT& matrix, RCAs... args );
4741 Columns(
const Columns& ) =
default;
4742 Columns( Columns&& ) =
default;
4749 ~Columns() =
default;
4756 inline Reference operator()(
size_t i,
size_t j );
4757 inline ConstReference operator()(
size_t i,
size_t j )
const;
4758 inline Reference at(
size_t i,
size_t j );
4759 inline ConstReference at(
size_t i,
size_t j )
const;
4760 inline Iterator
begin (
size_t j );
4761 inline ConstIterator
begin (
size_t j )
const;
4762 inline ConstIterator
cbegin(
size_t j )
const;
4763 inline Iterator
end (
size_t j );
4764 inline ConstIterator
end (
size_t j )
const;
4765 inline ConstIterator
cend (
size_t j )
const;
4772 Columns& operator=(
const Columns& ) =
delete;
4779 using DataType::idx;
4780 using DataType::idces;
4783 inline MT& operand() noexcept;
4784 inline const MT& operand() const noexcept;
4786 inline
size_t rows() const noexcept;
4787 inline
size_t capacity() const noexcept;
4788 inline
size_t capacity(
size_t j ) const noexcept;
4790 inline
size_t nonZeros(
size_t j ) const;
4791 inline
void reset();
4792 inline
void reset(
size_t j );
4793 inline
void reserve(
size_t nonzeros );
4794 void reserve(
size_t j,
size_t nonzeros );
4796 inline
void trim(
size_t j );
4803 inline Iterator
set (
size_t i,
size_t j, const ElementType& value );
4804 inline Iterator insert (
size_t i,
size_t j, const ElementType& value );
4805 inline
void append (
size_t i,
size_t j, const ElementType& value,
bool check=false );
4806 inline
void finalize(
size_t j );
4813 inline
void erase(
size_t i,
size_t j );
4814 inline Iterator erase(
size_t j, Iterator pos );
4815 inline Iterator erase(
size_t j, Iterator first, Iterator last );
4817 template< typename Pred >
4818 inline
void erase( Pred predicate );
4820 template< typename Pred >
4821 inline
void erase(
size_t j, Iterator first, Iterator last, Pred predicate );
4828 inline Iterator
find (
size_t i,
size_t j );
4829 inline ConstIterator
find (
size_t i,
size_t j ) const;
4830 inline Iterator
lowerBound(
size_t i,
size_t j );
4831 inline ConstIterator
lowerBound(
size_t i,
size_t j ) const;
4832 inline Iterator
upperBound(
size_t i,
size_t j );
4833 inline ConstIterator
upperBound(
size_t i,
size_t j ) const;
4840 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
4841 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
4843 inline
bool canSMPAssign() const noexcept;
4892template< typename MT
4893 , typename... CCAs >
4894template< typename... RCAs >
4895inline Columns<MT,false,false,true,CCAs...>::Columns( MT& matrix, RCAs... args )
4896 : DataType( args... )
4897 , matrix_ ( matrix )
4900 for(
size_t j=0UL; j<
columns(); ++j ) {
4901 if( matrix_.columns() <= idx(j) ) {
4930template<
typename MT
4931 ,
typename... CCAs >
4932inline typename Columns<MT,
false,
false,
true,CCAs...>::Reference
4933 Columns<MT,false,false,true,CCAs...>::operator()(
size_t i,
size_t j )
4938 return matrix_(idx(j),i);
4955template<
typename MT
4956 ,
typename... CCAs >
4957inline typename Columns<MT,
false,
false,
true,CCAs...>::ConstReference
4958 Columns<MT,false,false,true,CCAs...>::operator()(
size_t i,
size_t j )
const
4963 return const_cast<const MT&
>( matrix_ )(idx(j),i);
4981template<
typename MT
4982 ,
typename... CCAs >
4983inline typename Columns<MT,
false,
false,
true,CCAs...>::Reference
4984 Columns<MT,false,false,true,CCAs...>::at(
size_t i,
size_t j )
4992 return (*
this)(i,j);
5010template<
typename MT
5011 ,
typename... CCAs >
5012inline typename Columns<MT,
false,
false,
true,CCAs...>::ConstReference
5013 Columns<MT,false,false,true,CCAs...>::at(
size_t i,
size_t j )
const
5021 return (*
this)(i,j);
5036template<
typename MT
5037 ,
typename... CCAs >
5038inline typename Columns<MT,
false,
false,
true,CCAs...>::Iterator
5043 return matrix_.begin( idx(j) );
5058template<
typename MT
5059 ,
typename... CCAs >
5060inline typename Columns<MT,
false,
false,
true,CCAs...>::ConstIterator
5065 return matrix_.cbegin( idx(j) );
5080template<
typename MT
5081 ,
typename... CCAs >
5082inline typename Columns<MT,
false,
false,
true,CCAs...>::ConstIterator
5087 return matrix_.cbegin( idx(j) );
5102template<
typename MT
5103 ,
typename... CCAs >
5104inline typename Columns<MT,
false,
false,
true,CCAs...>::Iterator
5109 return matrix_.end( idx(j) );
5124template<
typename MT
5125 ,
typename... CCAs >
5126inline typename Columns<MT,
false,
false,
true,CCAs...>::ConstIterator
5131 return matrix_.cend( idx(j) );
5146template<
typename MT
5147 ,
typename... CCAs >
5148inline typename Columns<MT,
false,
false,
true,CCAs...>::ConstIterator
5153 return matrix_.cend( idx(j) );
5173template<
typename MT
5174 ,
typename... CCAs >
5175inline MT& Columns<MT,false,false,true,CCAs...>::operand() noexcept
5189template<
typename MT
5190 ,
typename... CCAs >
5191inline const MT& Columns<MT,false,false,true,CCAs...>::operand() const noexcept
5205template<
typename MT
5206 ,
typename... CCAs >
5209 return matrix_.rows();
5221template<
typename MT
5222 ,
typename... CCAs >
5225 return nonZeros() + matrix_.capacity() - matrix_.nonZeros();
5240template<
typename MT
5241 ,
typename... CCAs >
5246 return matrix_.capacity( idx(j) );
5258template<
typename MT
5259 ,
typename... CCAs >
5262 size_t nonzeros( 0UL );
5264 for(
size_t j=0UL; j<
columns(); ++j )
5282template<
typename MT
5283 ,
typename... CCAs >
5288 return matrix_.nonZeros( idx(j) );
5300template<
typename MT
5301 ,
typename... CCAs >
5304 for(
size_t j=0UL; j<
columns(); ++j ) {
5305 matrix_.reset( idx(j) );
5322template<
typename MT
5323 ,
typename... CCAs >
5326 matrix_.reset( idx(j) );
5343template<
typename MT
5344 ,
typename... CCAs >
5345inline void Columns<MT,false,false,true,CCAs...>::reserve(
size_t nonzeros )
5347 const size_t current(
capacity() );
5349 if( nonzeros > current ) {
5350 matrix_.reserve( matrix_.capacity() + nonzeros - current );
5369template<
typename MT
5370 ,
typename... CCAs >
5371void Columns<MT,false,false,true,CCAs...>::reserve(
size_t j,
size_t nonzeros )
5373 matrix_.reserve( idx(j), nonzeros );
5389template<
typename MT
5390 ,
typename... CCAs >
5391void Columns<MT,false,false,true,CCAs...>::trim()
5393 for(
size_t j=0UL; j<
columns(); ++j ) {
5412template<
typename MT
5413 ,
typename... CCAs >
5414void Columns<MT,false,false,true,CCAs...>::trim(
size_t j )
5418 matrix_.trim( idx(j) );
5445template<
typename MT
5446 ,
typename... CCAs >
5447inline typename Columns<MT,
false,
false,
true,CCAs...>::Iterator
5450 return matrix_.set( idx(j), i, value );
5470template<
typename MT
5471 ,
typename... CCAs >
5472inline typename Columns<MT,
false,
false,
true,CCAs...>::Iterator
5473 Columns<MT,false,false,true,CCAs...>::insert(
size_t i,
size_t j,
const ElementType& value )
5475 return matrix_.insert( idx(j), i, value );
5525template<
typename MT
5526 ,
typename... CCAs >
5527inline void Columns<MT,false,false,true,CCAs...>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
5529 if( !check || !isDefault<strict>( value ) )
5530 matrix_.insert( idx(j), i, value );
5550template<
typename MT
5551 ,
typename... CCAs >
5552inline void Columns<MT,false,false,true,CCAs...>::finalize(
size_t j )
5580template<
typename MT
5581 ,
typename... CCAs >
5582inline void Columns<MT,false,false,true,CCAs...>::erase(
size_t i,
size_t j )
5587 matrix_.erase( idx(j), i );
5603template<
typename MT
5604 ,
typename... CCAs >
5605inline typename Columns<MT,
false,
false,
true,CCAs...>::Iterator
5606 Columns<MT,false,false,true,CCAs...>::erase(
size_t j, Iterator pos )
5610 return matrix_.erase( idx(j), pos );
5627template<
typename MT
5628 ,
typename... CCAs >
5629inline typename Columns<MT,
false,
false,
true,CCAs...>::Iterator
5630 Columns<MT,false,false,true,CCAs...>::erase(
size_t j, Iterator first, Iterator last )
5634 return matrix_.erase( idx(j), first, last );
5663template<
typename MT
5664 ,
typename... CCAs >
5665template<
typename Pred >
5666inline void Columns<MT,false,false,true,CCAs...>::erase( Pred predicate )
5668 for(
size_t j=0UL; j<
columns(); ++j ) {
5669 matrix_.erase( idx(j),
begin(j),
end(j), predicate );
5703template<
typename MT
5704 ,
typename... CCAs >
5705template<
typename Pred >
5706inline void Columns<MT,false,false,true,CCAs...>::erase(
size_t j, Iterator first, Iterator last, Pred predicate )
5710 matrix_.erase( idx(j), first, last, predicate );
5739template<
typename MT
5740 ,
typename... CCAs >
5741inline typename Columns<MT,
false,
false,
true,CCAs...>::Iterator
5744 return matrix_.find( idx(j), i );
5765template<
typename MT
5766 ,
typename... CCAs >
5767inline typename Columns<MT,
false,
false,
true,CCAs...>::ConstIterator
5770 return matrix_.find( idx(j), i );
5790template<
typename MT
5791 ,
typename... CCAs >
5792inline typename Columns<MT,
false,
false,
true,CCAs...>::Iterator
5795 return matrix_.lowerBound( idx(j), i );
5815template<
typename MT
5816 ,
typename... CCAs >
5817inline typename Columns<MT,
false,
false,
true,CCAs...>::ConstIterator
5820 return matrix_.lowerBound( idx(j), i );
5840template<
typename MT
5841 ,
typename... CCAs >
5842inline typename Columns<MT,
false,
false,
true,CCAs...>::Iterator
5845 return matrix_.upperBound( idx(j), i );
5865template<
typename MT
5866 ,
typename... CCAs >
5867inline typename Columns<MT,
false,
false,
true,CCAs...>::ConstIterator
5870 return matrix_.upperBound( idx(j), i );
5895template<
typename MT
5896 ,
typename... CCAs >
5897template<
typename Other >
5898inline bool Columns<MT,false,false,true,CCAs...>::canAlias(
const Other* alias )
const noexcept
5900 return matrix_.isAliased( &unview( *alias ) );
5917template<
typename MT
5918 ,
typename... CCAs >
5919template<
typename Other >
5920inline bool Columns<MT,false,false,true,CCAs...>::isAliased(
const Other* alias )
const noexcept
5922 return matrix_.isAliased( &unview( *alias ) );
5939template<
typename MT
5940 ,
typename... CCAs >
5941inline bool Columns<MT,false,false,true,CCAs...>::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.
Header file for the implementation of the ColumnsData class template.
Header file for the columns 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
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 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_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
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COLUMNS_TYPE(T)
Constraint on the data type.
Definition: Columns.h:81
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 Columns base template.