From 70c588964c940c9185aba60cb80a83ee7ecc75fc Mon Sep 17 00:00:00 2001 From: Uppinder Chugh Date: Wed, 20 Jun 2018 07:13:57 +0530 Subject: [PATCH] Use Xapian::docid for 'k' and 'r' --- xapian-core/diversify/diversify.cc | 4 ++-- xapian-core/diversify/diversifyinternal.h | 8 ++++---- xapian-core/include/xapian/diversify.h | 4 ++-- xapian-core/tests/perftest/perftest.cc | 3 ++- xapian-core/tests/perftest/perftest.h | 3 ++- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/xapian-core/diversify/diversify.cc b/xapian-core/diversify/diversify.cc index 1c5a9e064..c1d3edd8f 100644 --- a/xapian-core/diversify/diversify.cc +++ b/xapian-core/diversify/diversify.cc @@ -45,8 +45,8 @@ Diversify::Diversify(Diversify&&) = default; Diversify& Diversify::operator=(Diversify&&) = default; -Diversify::Diversify(unsigned int k_, - double r_, +Diversify::Diversify(Xapian::doccount k_, + Xapian::doccount r_, double lambda_, double b_, double sigma_sqr_) diff --git a/xapian-core/diversify/diversifyinternal.h b/xapian-core/diversify/diversifyinternal.h index aac075d22..19b1d1495 100644 --- a/xapian-core/diversify/diversifyinternal.h +++ b/xapian-core/diversify/diversifyinternal.h @@ -36,10 +36,10 @@ class Xapian::Diversify::Internal : public Xapian::Internal::intrusive_base { void operator=(const Internal&) = delete; /// Top-k documents of given mset are diversified - unsigned int k; + Xapian::doccount k; /// Number of relevant documents from each cluster used for building topC - double r; + Xapian::doccount r; /// MPT parameters double lambda, b, sigma_sqr; @@ -58,8 +58,8 @@ class Xapian::Diversify::Internal : public Xapian::Internal::intrusive_base { public: /// Constructor for initialising diversification parameters - explicit Internal(unsigned int k_, - double r_, + explicit Internal(Xapian::doccount k_, + Xapian::doccount r_, double lambda_, double b_, double sigma_sqr_) diff --git a/xapian-core/include/xapian/diversify.h b/xapian-core/include/xapian/diversify.h index 679d86155..89ad23841 100644 --- a/xapian-core/include/xapian/diversify.h +++ b/xapian-core/include/xapian/diversify.h @@ -91,8 +91,8 @@ class XAPIAN_VISIBILITY_DEFAULT Diversify { * @param sigma_sqr_ Parameter for MPT, normally in the range * [1e-6,1] */ - explicit Diversify(unsigned int k_, - double r_, + explicit Diversify(Xapian::doccount k_, + Xapian::doccount r_, double lambda_ = 0.5, double b_ = 5.0, double sigma_sqr_ = 1e-3); diff --git a/xapian-core/tests/perftest/perftest.cc b/xapian-core/tests/perftest/perftest.cc index 08e37a858..3ebad9482 100644 --- a/xapian-core/tests/perftest/perftest.cc +++ b/xapian-core/tests/perftest/perftest.cc @@ -402,7 +402,8 @@ PerfTestLogger::diversify_start() } void -PerfTestLogger::diversify_end(unsigned int k, unsigned int r, +PerfTestLogger::diversify_end(Xapian::doccount k, + Xapian::doccount r, const Xapian::DocumentSet & dset) { Assert(diversifying_started); diff --git a/xapian-core/tests/perftest/perftest.h b/xapian-core/tests/perftest/perftest.h index 76dfe5ed6..d8abe080d 100644 --- a/xapian-core/tests/perftest/perftest.h +++ b/xapian-core/tests/perftest/perftest.h @@ -108,7 +108,8 @@ class PerfTestLogger { /** Log the completion of diversification. */ - void diversify_end(unsigned int k, unsigned int r, + void diversify_end(Xapian::doccount k, + Xapian::doccount r, const Xapian::DocumentSet & dset); /** Log the end of a diversification run. -- 2.11.4.GIT