natix.CompactDS.DiffSet.SeqAccessRank1 C# (CSharp) Method

SeqAccessRank1() private method

private SeqAccessRank1 ( int acc, long pos, int max, int &found_pos, BitStreamCtx ctx ) : int
acc int
pos long
max int
found_pos int
ctx BitStreamCtx
return int
        int SeqAccessRank1(int acc, long pos, int max, out int found_pos, BitStreamCtx ctx)
        {
            int i = 0;
            while (i < max && acc < pos) {
                int u = this.ReadNext (ctx);
                if (acc + u > pos) {
                    found_pos = acc;
                    return i;
                }
                acc += u;
                i++;
            }
            found_pos = acc;
            return i;
        }