Move evaluator<SparseCompressedBase>::find(i,j) to a more general and reusable SparseCompressedBase::lower_bound(i,j) functiion

This commit is contained in:
Gael Guennebaud
2019-01-28 17:24:44 +01:00
parent 53560f9186
commit 803fa79767
2 changed files with 32 additions and 11 deletions

View File

@@ -140,6 +140,14 @@ struct SparseSelfAdjointShape { static std::string debugName() { return "SparseS
template<> struct glue_shapes<SparseShape,SelfAdjointShape> { typedef SparseSelfAdjointShape type; };
template<> struct glue_shapes<SparseShape,TriangularShape > { typedef SparseTriangularShape type; };
// return type of SparseCompressedBase::lower_bound;
struct LowerBoundIndex {
LowerBoundIndex() : value(-1), found(false) {}
LowerBoundIndex(Index val, bool ok) : value(val), found(ok) {}
Index value;
bool found;
};
} // end namespace internal
/** \ingroup SparseCore_Module