Please can you elaborate ? get_maxpart()  will be called only once for each
weight object.So, all this calculation for the upper bound will be done
only once , right ?


On Sat, Jun 22, 2013 at 10:15 PM, Dan Colish <notifications@github.com>wrote:

> In xapian-core/weight/dphweight.cc:
>
> > +
> > +    double weight = normalization * (wdf * (log((wdf * get_average_length() / len) *
> > +    (get_collection_size() / get_collection_freq())) / base_change) +
> > +    (0.5 * (log(2 * 3.14 * wdf * (1 - wdf_to_len)) / base_change)));
> > +
> > +    return (get_wqf() * weight);
> > +}
> > +
> > +double
> > +DPHWeight::get_maxpart() const
> > +{
> > +    if (get_wdf_upper_bound() == 0) return 0.0;
> > +
> > +    double wdf_lower(1.0);
> > +    double base_change(log(2));
> > +    double wdf_upper(get_wdf_upper_bound());
>
> Only call this once an assign it locally.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/xapian/xapian/pull/12/files#r4831284>
> .
>