public class QuadTree
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
QuadTree(Cell boundary) |
QuadTree(org.nd4j.linalg.api.ndarray.INDArray data)
Pass in a matrix
|
QuadTree(QuadTree parent,
org.nd4j.linalg.api.ndarray.INDArray data,
Cell boundary) |
Modifier and Type | Method and Description |
---|---|
void |
computeEdgeForces(org.nd4j.linalg.api.ndarray.INDArray rowP,
org.nd4j.linalg.api.ndarray.INDArray colP,
org.nd4j.linalg.api.ndarray.INDArray valP,
int N,
org.nd4j.linalg.api.ndarray.INDArray posF) |
void |
computeNonEdgeForces(int pointIndex,
double theta,
org.nd4j.linalg.api.ndarray.INDArray negativeForce,
com.google.common.util.concurrent.AtomicDouble sumQ)
Compute non edge forces using barnes hut
|
int |
depth()
The depth of the node
|
protected QuadTree |
findIndex(org.nd4j.linalg.api.ndarray.INDArray coordinates)
Returns the cell of this element
|
Cell |
getBoundary() |
org.nd4j.linalg.api.ndarray.INDArray |
getCenterOfMass() |
int |
getCumSize() |
QuadTree |
getNorthEast() |
QuadTree |
getNorthWest() |
QuadTree |
getParent() |
int |
getSize() |
QuadTree |
getSouthEast() |
QuadTree |
getSouthWest() |
boolean |
insert(int newIndex)
Insert an index of the data in to the tree
|
boolean |
isCorrect()
Returns whether the tree is consistent or not
|
boolean |
isLeaf() |
void |
setBoundary(Cell boundary) |
void |
setCenterOfMass(org.nd4j.linalg.api.ndarray.INDArray centerOfMass) |
void |
setCumSize(int cumSize) |
void |
setLeaf(boolean isLeaf) |
void |
setNorthEast(QuadTree northEast) |
void |
setNorthWest(QuadTree northWest) |
void |
setParent(QuadTree parent) |
void |
setSize(int size) |
void |
setSouthEast(QuadTree southEast) |
void |
setSouthWest(QuadTree southWest) |
void |
subDivide()
Create four children
which fully divide this cell
into four quads of equal area
|
public QuadTree(org.nd4j.linalg.api.ndarray.INDArray data)
data
- public QuadTree(Cell boundary)
protected QuadTree findIndex(org.nd4j.linalg.api.ndarray.INDArray coordinates)
coordinates
- public boolean insert(int newIndex)
newIndex
- the index to insert in to the treepublic boolean isCorrect()
public void subDivide()
public void computeNonEdgeForces(int pointIndex, double theta, org.nd4j.linalg.api.ndarray.INDArray negativeForce, com.google.common.util.concurrent.AtomicDouble sumQ)
pointIndex
- theta
- negativeForce
- sumQ
- public void computeEdgeForces(org.nd4j.linalg.api.ndarray.INDArray rowP, org.nd4j.linalg.api.ndarray.INDArray colP, org.nd4j.linalg.api.ndarray.INDArray valP, int N, org.nd4j.linalg.api.ndarray.INDArray posF)
rowP
- a vectorcolP
- valP
- N
- posF
- public int depth()
public org.nd4j.linalg.api.ndarray.INDArray getCenterOfMass()
public void setCenterOfMass(org.nd4j.linalg.api.ndarray.INDArray centerOfMass)
public QuadTree getParent()
public void setParent(QuadTree parent)
public QuadTree getNorthWest()
public void setNorthWest(QuadTree northWest)
public QuadTree getNorthEast()
public void setNorthEast(QuadTree northEast)
public QuadTree getSouthWest()
public void setSouthWest(QuadTree southWest)
public QuadTree getSouthEast()
public void setSouthEast(QuadTree southEast)
public boolean isLeaf()
public void setLeaf(boolean isLeaf)
public int getSize()
public void setSize(int size)
public int getCumSize()
public void setCumSize(int cumSize)
public Cell getBoundary()
public void setBoundary(Cell boundary)