protected virtual IResult GetCandidatesPlain(int[] qseq, int maxcand)
{
// var n = this.DB.Count;
// if (n < 500000) {
// //return this.GetCandidatesSmallDB (qseq, maxcand);
// }
var len_qseq = qseq.Length;
var ialg = new BaezaYatesIntersection<int> (new DoublingSearch<int> ());
IList<int> current = new SortedListRSCache (this.SEQ.Unravel (qseq [0]));
int i = 1;
while (i < len_qseq && current.Count > maxcand) {
var rs = this.SEQ.Unravel (qseq [i]);
var I = new SortedListRSCache (rs, -i);
var L = new List<IList<int>> () {current, I};
var intersection = ialg.Intersection (L);
++i;
if (intersection.Count < maxcand) {
break;
}
current = intersection;
}
var res = new ResultTies (int.MaxValue);
foreach (var c in current) {
if (c % this.K == 0) {
res.Push (c / this.K, 0);
}
}
return res;
}