35 #ifndef _BLAZE_MATH_EXPRESSIONS_SPARSEMATRIX_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_SPARSEMATRIX_H_ 77 :
public Matrix<MT,SO>
101 template<
typename MT >
102 inline auto resetLower_backend( SparseMatrix<MT,false>& dm ) -> DisableIf_t< IsUpper_v<MT> >
104 const size_t m( (~dm).
rows() );
106 for(
size_t i=1UL; i<m; ++i ) {
107 (~dm).erase( i, (~dm).begin( i ), (~dm).lowerBound( i, i ) );
125 template<
typename MT >
126 inline auto resetLower_backend( SparseMatrix<MT,true>& dm ) -> DisableIf_t< IsUpper_v<MT> >
128 const size_t m ( (~dm).
rows() );
129 const size_t n ( (~dm).
columns() );
130 const size_t jend(
min( m, n ) );
132 for(
size_t j=0UL; j<jend; ++j ) {
133 (~dm).erase( j, (~dm).lowerBound( j+1UL, j ), (~dm).
end( j ) );
150 template<
typename MT
152 inline auto resetLower_backend( SparseMatrix<MT,SO>& dm ) -> EnableIf_t< IsUpper_v<MT> >
170 template<
typename MT
172 inline void resetLower( SparseMatrix<MT,SO>& dm )
174 resetLower_backend( ~dm );
191 template<
typename MT >
192 inline auto resetUpper_backend( SparseMatrix<MT,false>& dm ) -> DisableIf_t< IsLower_v<MT> >
194 const size_t m ( (~dm).
rows() );
195 const size_t n ( (~dm).
columns() );
196 const size_t iend(
min( m, n ) );
198 for(
size_t i=0UL; i<iend; ++i ) {
199 (~dm).erase( i, (~dm).lowerBound( i, i+1UL ), (~dm).
end( i ) );
217 template<
typename MT >
218 inline auto resetUpper_backend( SparseMatrix<MT,true>& dm ) -> DisableIf_t< IsLower_v<MT> >
220 const size_t n( (~dm).
columns() );
222 for(
size_t j=1UL; j<n; ++j ) {
223 (~dm).erase( j, (~dm).begin( j ), (~dm).lowerBound( j, j ) );
240 template<
typename MT
242 inline auto resetUpper_backend( SparseMatrix<MT,SO>& dm ) -> EnableIf_t< IsLower_v<MT> >
260 template<
typename MT
262 inline void resetUpper( SparseMatrix<MT,SO>& dm )
264 resetUpper_backend( ~dm );
Headerfile for the generic min algorithm.
Header file for the MAYBE_UNUSED function template.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
Header file for the DisableIf class template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
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:1162
Header file for the IsLower type trait.
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:438
Header file for the EnableIf class template.
Header file for the Matrix base class.
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
Header file for the IsUpper type trait.