public IEnumerable<Bitmap> IteratePartsKNN(IResult res, double dqp, float stddev, float mean, Sequence seq) { var sym = this.Discretize(dqp, stddev, mean); yield return seq.Unravel(sym); var left = sym - 1; var right = sym + 1; bool do_next = true; while (do_next) { do_next = false; var __left = this.Discretize(dqp - res.CoveringRadius, stddev, mean); if (0 <= left && __left <= left) { yield return seq.Unravel(left); --left; do_next = true; } var __right = this.Discretize(dqp + res.CoveringRadius, stddev, mean); if (right <= __right && right < seq.Sigma) { yield return seq.Unravel(right); ++right; do_next = true; } /*Console.WriteLine ("left: {0}, right: {1}, __left: {2}, __right: {3}", left, right, __left, __right);*/ } }