public void VerifyRec(int i0, int Len, BoundingBoxCode cd, int idx) { TreeNode[] tree = InitTree(); TreeNode nt = tree[idx]; for (int n = 0; n < Codes.Length; n++) { bool innen = cd.IsInside(this.Codes[n]); bool innen2 = n >= i0 && n < (i0 + Len); if (innen != innen2) { throw new ApplicationException(); } } if (nt.Left >= 0) { int i0L = i0; int LenL = nt.iMid - i0L; VerifyRec(i0L, LenL, cd.GetSubBox(false), nt.Left); } if (nt.Right >= 0) { int i0R = nt.iMid; int LenR = i0 + Len - i0R; VerifyRec(i0R, LenR, cd.GetSubBox(true), nt.Right); } }
public void Test(int i0, int iMid, PointLocalization owner, BoundingBoxCode b) { for (int i = 0; i < owner.Codes.Length; i++) { bool innen = b.IsInside(owner.Codes[i]); bool innen2 = i >= i0 && i < iMid; if (innen != innen2) { throw new ApplicationException(); } } }