PL2,PL2+: Greatly improve upper bound on weight
commit8ffe3ca72cbf9825ed66dc7ea08cebc6b52bba7e
authorOlly Betts <olly@survex.com>
Thu, 18 Aug 2016 21:37:42 +0000 (19 09:37 +1200)
committerOlly Betts <olly@survex.com>
Fri, 16 Sep 2016 05:45:17 +0000 (16 17:45 +1200)
treeee63a8341119e019f850c383817d035c9e78cbd9
parent24abf891460bcc535fe02d8afaa0b414206f55bc
PL2,PL2+: Greatly improve upper bound on weight

Split the weight equation into two parts and maximise each separately
as that gives an easily solvable problem, and in common cases the
maximum is at the same value of wdfn for both parts.  This approach was
suggested by Aarsh Shah in: https://github.com/xapian/xapian/pull/48

In a simple test, the upper bounds are now just over double the
highest weight actually achieved - previously they were several hundred
times.

(cherry picked from commit 0964391357ec249cf133c288685e7fab63425eee)
xapian-core/weight/pl2plusweight.cc
xapian-core/weight/pl2weight.cc