|Charles Greathouse on Fri, 21 Jun 2013 15:05:30 +0200|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
|Re: setsearch flags|
On Thu, Jun 20, 2013 at 01:28:29PM -0400, Charles Greathouse wrote:Fundamentally you are using the wrong data structure.
> My immediate purpose was an implementation of Hooley's Δ function, which I
> tried to define as:
> For each divisor d < n of n, this finds the number of divisors in the
> interval [d, de]. So my vector does consist only of integers. Unfortunately
> neither flag gives the desired behavior, since one or both of floor(de) and
> floor(de+1) may be in the set.
> Thus my feature request for another flag on setsearch.
As an abstract data structure, Set are not ordered.
You should use vecsort and vecsearch, which allow for arbitrary comparaison
function to be used.