void split_points(final short [][] pnts, IntArrayView inds) { IntFloatPair spl = choose_split(pnts, inds); ((InternalNodeData)node_data).disc_dim = spl.first; ((InternalNodeData)node_data).disc = spl.second; int N = inds.size(); int l = 0; int r = N; while (l!=r) { if (pnts[inds.getFast(l)][((InternalNodeData)node_data).disc_dim] < ((InternalNodeData)node_data).disc) l++; else { r--; int t = inds.getFast(l); inds.setFast(l, inds.getFast(r)); inds.setFast(r, t); } } // If either partition is empty -> vectors identical! if (l==0 || l==N) { l = N/2; } // The vectors are identical, so keep nlogn performance. left = new ShortKDTreeNode(pnts, inds.subView(0, l), rng); ((InternalNodeData)node_data).right = new ShortKDTreeNode(pnts, inds.subView(l, N), rng); }
void split_points(final float [][] pnts, IntArrayView inds) { IntFloatPair spl = choose_split(pnts, inds); ((InternalNodeData)node_data).disc_dim = spl.first; ((InternalNodeData)node_data).disc = spl.second; int N = inds.size(); int l = 0; int r = N; while (l!=r) { if (pnts[inds.getFast(l)][((InternalNodeData)node_data).disc_dim] < ((InternalNodeData)node_data).disc) l++; else { r--; int t = inds.getFast(l); inds.setFast(l, inds.getFast(r)); inds.setFast(r, t); } } // If either partition is empty -> vectors identical! if (l==0 || l==N) { l = N/2; } // The vectors are identical, so keep nlogn performance. left = new FloatKDTreeNode(pnts, inds.subView(0, l), rng); ((InternalNodeData)node_data).right = new FloatKDTreeNode(pnts, inds.subView(l, N), rng); }
void split_points(final int [][] pnts, IntArrayView inds) { IntFloatPair spl = choose_split(pnts, inds); ((InternalNodeData)node_data).disc_dim = spl.first; ((InternalNodeData)node_data).disc = spl.second; int N = inds.size(); int l = 0; int r = N; while (l!=r) { if (pnts[inds.getFast(l)][((InternalNodeData)node_data).disc_dim] < ((InternalNodeData)node_data).disc) l++; else { r--; int t = inds.getFast(l); inds.setFast(l, inds.getFast(r)); inds.setFast(r, t); } } // If either partition is empty -> vectors identical! if (l==0 || l==N) { l = N/2; } // The vectors are identical, so keep nlogn performance. left = new IntKDTreeNode(pnts, inds.subView(0, l), rng); ((InternalNodeData)node_data).right = new IntKDTreeNode(pnts, inds.subView(l, N), rng); }
void split_points(final double [][] pnts, IntArrayView inds) { IntDoublePair spl = choose_split(pnts, inds); ((InternalNodeData)node_data).disc_dim = spl.first; ((InternalNodeData)node_data).disc = spl.second; int N = inds.size(); int l = 0; int r = N; while (l!=r) { if (pnts[inds.getFast(l)][((InternalNodeData)node_data).disc_dim] < ((InternalNodeData)node_data).disc) l++; else { r--; int t = inds.getFast(l); inds.setFast(l, inds.getFast(r)); inds.setFast(r, t); } } // If either partition is empty -> vectors identical! if (l==0 || l==N) { l = N/2; } // The vectors are identical, so keep nlogn performance. left = new DoubleKDTreeNode(pnts, inds.subView(0, l), rng); ((InternalNodeData)node_data).right = new DoubleKDTreeNode(pnts, inds.subView(l, N), rng); }
void split_points(final long [][] pnts, IntArrayView inds) { IntFloatPair spl = choose_split(pnts, inds); ((InternalNodeData)node_data).disc_dim = spl.first; ((InternalNodeData)node_data).disc = spl.second; int N = inds.size(); int l = 0; int r = N; while (l!=r) { if (pnts[inds.getFast(l)][((InternalNodeData)node_data).disc_dim] < ((InternalNodeData)node_data).disc) l++; else { r--; int t = inds.getFast(l); inds.setFast(l, inds.getFast(r)); inds.setFast(r, t); } } // If either partition is empty -> vectors identical! if (l==0 || l==N) { l = N/2; } // The vectors are identical, so keep nlogn performance. left = new LongKDTreeNode(pnts, inds.subView(0, l), rng); ((InternalNodeData)node_data).right = new LongKDTreeNode(pnts, inds.subView(l, N), rng); }
void split_points(final double [][] pnts, IntArrayView inds) { IntDoublePair spl = choose_split(pnts, inds); ((InternalNodeData)node_data).disc_dim = spl.first; ((InternalNodeData)node_data).disc = spl.second; int N = inds.size(); int l = 0; int r = N; while (l!=r) { if (pnts[inds.getFast(l)][((InternalNodeData)node_data).disc_dim] < ((InternalNodeData)node_data).disc) l++; else { r--; int t = inds.getFast(l); inds.setFast(l, inds.getFast(r)); inds.setFast(r, t); } } // If either partition is empty -> vectors identical! if (l==0 || l==N) { l = N/2; } // The vectors are identical, so keep nlogn performance. left = new DoubleKDTreeNode(pnts, inds.subView(0, l), rng); ((InternalNodeData)node_data).right = new DoubleKDTreeNode(pnts, inds.subView(l, N), rng); }
void split_points(final byte [][] pnts, IntArrayView inds) { IntFloatPair spl = choose_split(pnts, inds); ((InternalNodeData)node_data).disc_dim = spl.first; ((InternalNodeData)node_data).disc = spl.second; int N = inds.size(); int l = 0; int r = N; while (l!=r) { if (pnts[inds.getFast(l)][((InternalNodeData)node_data).disc_dim] < ((InternalNodeData)node_data).disc) l++; else { r--; int t = inds.getFast(l); inds.setFast(l, inds.getFast(r)); inds.setFast(r, t); } } // If either partition is empty -> vectors identical! if (l==0 || l==N) { l = N/2; } // The vectors are identical, so keep nlogn performance. left = new ByteKDTreeNode(pnts, inds.subView(0, l), rng); ((InternalNodeData)node_data).right = new ByteKDTreeNode(pnts, inds.subView(l, N), rng); }
void split_points(final int [][] pnts, IntArrayView inds) { IntFloatPair spl = choose_split(pnts, inds); ((InternalNodeData)node_data).disc_dim = spl.first; ((InternalNodeData)node_data).disc = spl.second; int N = inds.size(); int l = 0; int r = N; while (l!=r) { if (pnts[inds.getFast(l)][((InternalNodeData)node_data).disc_dim] < ((InternalNodeData)node_data).disc) l++; else { r--; int t = inds.getFast(l); inds.setFast(l, inds.getFast(r)); inds.setFast(r, t); } } // If either partition is empty -> vectors identical! if (l==0 || l==N) { l = N/2; } // The vectors are identical, so keep nlogn performance. left = new IntKDTreeNode(pnts, inds.subView(0, l), rng); ((InternalNodeData)node_data).right = new IntKDTreeNode(pnts, inds.subView(l, N), rng); }
void split_points(final short [][] pnts, IntArrayView inds) { IntFloatPair spl = choose_split(pnts, inds); ((InternalNodeData)node_data).disc_dim = spl.first; ((InternalNodeData)node_data).disc = spl.second; int N = inds.size(); int l = 0; int r = N; while (l!=r) { if (pnts[inds.getFast(l)][((InternalNodeData)node_data).disc_dim] < ((InternalNodeData)node_data).disc) l++; else { r--; int t = inds.getFast(l); inds.setFast(l, inds.getFast(r)); inds.setFast(r, t); } } // If either partition is empty -> vectors identical! if (l==0 || l==N) { l = N/2; } // The vectors are identical, so keep nlogn performance. left = new ShortKDTreeNode(pnts, inds.subView(0, l), rng); ((InternalNodeData)node_data).right = new ShortKDTreeNode(pnts, inds.subView(l, N), rng); }
void split_points(final long [][] pnts, IntArrayView inds) { IntFloatPair spl = choose_split(pnts, inds); ((InternalNodeData)node_data).disc_dim = spl.first; ((InternalNodeData)node_data).disc = spl.second; int N = inds.size(); int l = 0; int r = N; while (l!=r) { if (pnts[inds.getFast(l)][((InternalNodeData)node_data).disc_dim] < ((InternalNodeData)node_data).disc) l++; else { r--; int t = inds.getFast(l); inds.setFast(l, inds.getFast(r)); inds.setFast(r, t); } } // If either partition is empty -> vectors identical! if (l==0 || l==N) { l = N/2; } // The vectors are identical, so keep nlogn performance. left = new LongKDTreeNode(pnts, inds.subView(0, l), rng); ((InternalNodeData)node_data).right = new LongKDTreeNode(pnts, inds.subView(l, N), rng); }
void split_points(final float [][] pnts, IntArrayView inds) { IntFloatPair spl = choose_split(pnts, inds); ((InternalNodeData)node_data).disc_dim = spl.first; ((InternalNodeData)node_data).disc = spl.second; int N = inds.size(); int l = 0; int r = N; while (l!=r) { if (pnts[inds.getFast(l)][((InternalNodeData)node_data).disc_dim] < ((InternalNodeData)node_data).disc) l++; else { r--; int t = inds.getFast(l); inds.setFast(l, inds.getFast(r)); inds.setFast(r, t); } } // If either partition is empty -> vectors identical! if (l==0 || l==N) { l = N/2; } // The vectors are identical, so keep nlogn performance. left = new FloatKDTreeNode(pnts, inds.subView(0, l), rng); ((InternalNodeData)node_data).right = new FloatKDTreeNode(pnts, inds.subView(l, N), rng); }
void split_points(final byte [][] pnts, IntArrayView inds) { IntFloatPair spl = choose_split(pnts, inds); ((InternalNodeData)node_data).disc_dim = spl.first; ((InternalNodeData)node_data).disc = spl.second; int N = inds.size(); int l = 0; int r = N; while (l!=r) { if (pnts[inds.getFast(l)][((InternalNodeData)node_data).disc_dim] < ((InternalNodeData)node_data).disc) l++; else { r--; int t = inds.getFast(l); inds.setFast(l, inds.getFast(r)); inds.setFast(r, t); } } // If either partition is empty -> vectors identical! if (l==0 || l==N) { l = N/2; } // The vectors are identical, so keep nlogn performance. left = new ByteKDTreeNode(pnts, inds.subView(0, l), rng); ((InternalNodeData)node_data).right = new ByteKDTreeNode(pnts, inds.subView(l, N), rng); }