35#ifndef _BLAZE_MATH_EXPRESSIONS_SPARSEMATRIX_H_
36#define _BLAZE_MATH_EXPRESSIONS_SPARSEMATRIX_H_
105template<
typename MT,
bool SO >
108template<
typename MT,
bool SO >
111template<
typename MT,
bool SO >
114template<
typename MT,
bool SO >
117template<
typename MT,
bool SO >
120template<
typename MT,
bool SO >
143template<
typename MT,
bool SO >
146 return (*sm).find( i, j );
168template<
typename MT,
bool SO >
171 return (*sm).find( i, j );
193template<
typename MT,
bool SO >
196 return (*sm).lowerBound( i, j );
218template<
typename MT,
bool SO >
221 return (*sm).lowerBound( i, j );
243template<
typename MT,
bool SO >
246 return (*sm).upperBound( i, j );
268template<
typename MT,
bool SO >
271 return (*sm).upperBound( i, j );
287template<
typename MT >
288inline auto resetLower_backend( SparseMatrix<MT,false>& dm ) -> DisableIf_t< IsUpper_v<MT> >
290 const size_t m( (*dm).rows() );
292 for(
size_t i=1UL; i<m; ++i ) {
293 (*dm).erase( i, (*dm).begin( i ), (*dm).lowerBound( i, i ) );
311template<
typename MT >
312inline auto resetLower_backend( SparseMatrix<MT,true>& dm ) -> DisableIf_t< IsUpper_v<MT> >
314 const size_t m ( (*dm).rows() );
315 const size_t n ( (*dm).columns() );
316 const size_t jend(
min( m, n ) );
318 for(
size_t j=0UL; j<jend; ++j ) {
319 (*dm).erase( j, (*dm).lowerBound( j+1UL, j ), (*dm).end( j ) );
338inline auto resetLower_backend( SparseMatrix<MT,SO>& dm ) -> EnableIf_t< IsUpper_v<MT> >
358inline void resetLower( SparseMatrix<MT,SO>& dm )
360 resetLower_backend( *dm );
377template<
typename MT >
378inline auto resetUpper_backend( SparseMatrix<MT,false>& dm ) -> DisableIf_t< IsLower_v<MT> >
380 const size_t m ( (*dm).rows() );
381 const size_t n ( (*dm).columns() );
382 const size_t iend(
min( m, n ) );
384 for(
size_t i=0UL; i<iend; ++i ) {
385 (*dm).erase( i, (*dm).lowerBound( i, i+1UL ), (*dm).end( i ) );
403template<
typename MT >
404inline auto resetUpper_backend( SparseMatrix<MT,true>& dm ) -> DisableIf_t< IsLower_v<MT> >
406 const size_t n( (*dm).columns() );
408 for(
size_t j=1UL; j<n; ++j ) {
409 (*dm).erase( j, (*dm).begin( j ), (*dm).lowerBound( j, j ) );
428inline auto resetUpper_backend( SparseMatrix<MT,SO>& dm ) -> EnableIf_t< IsLower_v<MT> >
448inline void resetUpper( SparseMatrix<MT,SO>& dm )
450 resetUpper_backend( *dm );
Header file for the EnableIf class template.
Header file for the IsLower type trait.
Header file for the IsUpper type trait.
Header file for the MAYBE_UNUSED function template.
Base class for matrices.
Definition: Matrix.h:85
Base class for sparse matrices.
Definition: SparseMatrix.h:77
Header file for the Matrix base class.
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
MT::ConstIterator find(const SparseMatrix< MT, SO > &sm, size_t i, size_t j)
Searches for a specific matrix element.
Definition: SparseMatrix.h:169
MT::ConstIterator upperBound(const 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:269
MT::ConstIterator lowerBound(const 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:219
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Header file for the generic min algorithm.