@Test public void testQuadTree() { INDArray n = Nd4j.ones(3, 2); n.slice(1).addi(1); n.slice(2).addi(2); QuadTree quadTree = new QuadTree(n); assertEquals(n.rows(), quadTree.getCumSize()); assertTrue(quadTree.isCorrect()); }
public QuadTree(INDArray data) { INDArray meanY = data.mean(0); INDArray minY = data.min(0); INDArray maxY = data.max(0); init(data, meanY.getDouble(0), meanY.getDouble(1), max(maxY.getDouble(0) - meanY.getDouble(0), meanY.getDouble(0) - minY.getDouble(0)) + Nd4j.EPS_THRESHOLD, max(maxY.getDouble(1) - meanY.getDouble(1), meanY.getDouble(1) - minY.getDouble(1)) + Nd4j.EPS_THRESHOLD); fill(); }
QuadTree implements Serializable { public QuadTree(INDArray data) { INDArray meanY = data.mean(0); INDArray minY = data.min(0); INDArray maxY = data.max(0); init(data, meanY.getDouble(0), meanY.getDouble(1), max(maxY.getDouble(0) - meanY.getDouble(0), meanY.getDouble(0) - minY.getDouble(0)) + Nd4j.EPS_THRESHOLD, max(maxY.getDouble(1) - meanY.getDouble(1), meanY.getDouble(1) - minY.getDouble(1)) + Nd4j.EPS_THRESHOLD); fill(); } }
QuadTree implements Serializable { public QuadTree(INDArray data) { INDArray meanY = data.mean(0); INDArray minY = data.min(0); INDArray maxY = data.max(0); init(data, meanY.getDouble(0), meanY.getDouble(1), max(maxY.getDouble(0) - meanY.getDouble(0), meanY.getDouble(0) - minY.getDouble(0)) + Nd4j.EPS_THRESHOLD, max(maxY.getDouble(1) - meanY.getDouble(1), meanY.getDouble(1) - minY.getDouble(1)) + Nd4j.EPS_THRESHOLD); fill(); } QuadTree(INDArray data);  QuadTree(QuadTree parent, INDArray data, Cell boundary);  QuadTree(Cell boundary); }
QuadTree implements Serializable { public QuadTree(INDArray data) { INDArray meanY = data.mean(0); INDArray minY = data.min(0); INDArray maxY = data.max(0); init(data, meanY.getDouble(0), meanY.getDouble(1), max(maxY.getDouble(0) - meanY.getDouble(0), meanY.getDouble(0) - minY.getDouble(0)) + Nd4j.EPS_THRESHOLD, max(maxY.getDouble(1) - meanY.getDouble(1), meanY.getDouble(1) - minY.getDouble(1)) + Nd4j.EPS_THRESHOLD); fill(); } QuadTree(INDArray data);  QuadTree(QuadTree parent, INDArray data, Cell boundary);  QuadTree(Cell boundary); boolean insert(int newIndex); boolean isCorrect(); void subDivide(); void computeNonEdgeForces(int pointIndex, double theta, INDArray negativeForce, AtomicDouble sumQ); void computeEdgeForces(INDArray rowP, INDArray colP, INDArray valP, int N, INDArray posF); int depth(); INDArray getCenterOfMass(); void setCenterOfMass(INDArray centerOfMass); QuadTree getParent(); void setParent(QuadTree parent); QuadTree getNorthWest(); void setNorthWest(QuadTree northWest); QuadTree getNorthEast(); void setNorthEast(QuadTree northEast); QuadTree getSouthWest(); void setSouthWest(QuadTree southWest); QuadTree getSouthEast(); void setSouthEast(QuadTree southEast); boolean isLeaf(); void setLeaf(boolean isLeaf); int getSize(); void setSize(int size); int getCumSize(); void setCumSize(int cumSize); Cell getBoundary(); void setBoundary(Cell boundary); }
QuadTree implements Serializable { public QuadTree(INDArray data) { INDArray meanY = data.mean(0); INDArray minY = data.min(0); INDArray maxY = data.max(0); init(data, meanY.getDouble(0), meanY.getDouble(1), max(maxY.getDouble(0) - meanY.getDouble(0), meanY.getDouble(0) - minY.getDouble(0)) + Nd4j.EPS_THRESHOLD, max(maxY.getDouble(1) - meanY.getDouble(1), meanY.getDouble(1) - minY.getDouble(1)) + Nd4j.EPS_THRESHOLD); fill(); } QuadTree(INDArray data);  QuadTree(QuadTree parent, INDArray data, Cell boundary);  QuadTree(Cell boundary); boolean insert(int newIndex); boolean isCorrect(); void subDivide(); void computeNonEdgeForces(int pointIndex, double theta, INDArray negativeForce, AtomicDouble sumQ); void computeEdgeForces(INDArray rowP, INDArray colP, INDArray valP, int N, INDArray posF); int depth(); INDArray getCenterOfMass(); void setCenterOfMass(INDArray centerOfMass); QuadTree getParent(); void setParent(QuadTree parent); QuadTree getNorthWest(); void setNorthWest(QuadTree northWest); QuadTree getNorthEast(); void setNorthEast(QuadTree northEast); QuadTree getSouthWest(); void setSouthWest(QuadTree southWest); QuadTree getSouthEast(); void setSouthEast(QuadTree southEast); boolean isLeaf(); void setLeaf(boolean isLeaf); int getSize(); void setSize(int size); int getCumSize(); void setCumSize(int cumSize); Cell getBoundary(); void setBoundary(Cell boundary);  }