Tapkee
QuadTree Class Reference

#include <quadtree.hpp>

Public Member Functions

 QuadTree (ScalarType *inp_data, int N)
 
 QuadTree (ScalarType *inp_data, ScalarType inp_x, ScalarType inp_y, ScalarType inp_hw, ScalarType inp_hh)
 
 QuadTree (ScalarType *inp_data, int N, ScalarType inp_x, ScalarType inp_y, ScalarType inp_hw, ScalarType inp_hh)
 
 QuadTree (QuadTree *inp_parent, ScalarType *inp_data, int N, ScalarType inp_x, ScalarType inp_y, ScalarType inp_hw, ScalarType inp_hh)
 
 QuadTree (QuadTree *inp_parent, ScalarType *inp_data, ScalarType inp_x, ScalarType inp_y, ScalarType inp_hw, ScalarType inp_hh)
 
 ~QuadTree ()
 
void setData (ScalarType *inp_data)
 
QuadTreegetParent ()
 
bool insert (int new_index)
 
void subdivide ()
 
bool isCorrect ()
 
void rebuildTree ()
 
void getAllIndices (int *indices)
 
int getDepth ()
 
void computeNonEdgeForces (int point_index, ScalarType theta, ScalarType neg_f[], ScalarType *sum_Q)
 
void computeEdgeForces (int *row_P, int *col_P, ScalarType *val_P, int N, ScalarType *pos_f)
 
void print ()
 

Private Member Functions

 QuadTree (const QuadTree &)
 
QuadTreeoperator= (const QuadTree &)
 
void init (QuadTree *inp_parent, ScalarType *inp_data, ScalarType inp_x, ScalarType inp_y, ScalarType inp_hw, ScalarType inp_hh)
 
void fill (int N)
 
int getAllIndices (int *indices, int loc)
 

Private Attributes

ScalarType buff [QT_NO_DIMS]
 
QuadTreeparent
 
bool is_leaf
 
int size
 
int cum_size
 
Cell boundary
 
ScalarType * data
 
ScalarType center_of_mass [QT_NO_DIMS]
 
int index [QT_NODE_CAPACITY]
 
QuadTreenorthWest
 
QuadTreenorthEast
 
QuadTreesouthWest
 
QuadTreesouthEast
 

Static Private Attributes

static const int QT_NO_DIMS = 2
 
static const int QT_NODE_CAPACITY = 1
 

Detailed Description

Definition at line 67 of file quadtree.hpp.

Constructor & Destructor Documentation

◆ QuadTree() [1/6]

QuadTree ( ScalarType *  inp_data,
int  N 
)

Definition at line 100 of file quadtree.hpp.

◆ QuadTree() [2/6]

QuadTree ( ScalarType *  inp_data,
ScalarType  inp_x,
ScalarType  inp_y,
ScalarType  inp_hw,
ScalarType  inp_hh 
)

Definition at line 125 of file quadtree.hpp.

◆ QuadTree() [3/6]

QuadTree ( ScalarType *  inp_data,
int  N,
ScalarType  inp_x,
ScalarType  inp_y,
ScalarType  inp_hw,
ScalarType  inp_hh 
)

Definition at line 133 of file quadtree.hpp.

◆ QuadTree() [4/6]

QuadTree ( QuadTree inp_parent,
ScalarType *  inp_data,
int  N,
ScalarType  inp_x,
ScalarType  inp_y,
ScalarType  inp_hw,
ScalarType  inp_hh 
)

Definition at line 142 of file quadtree.hpp.

◆ QuadTree() [5/6]

QuadTree ( QuadTree inp_parent,
ScalarType *  inp_data,
ScalarType  inp_x,
ScalarType  inp_y,
ScalarType  inp_hw,
ScalarType  inp_hh 
)

Definition at line 151 of file quadtree.hpp.

◆ ~QuadTree()

~QuadTree ( )

Definition at line 159 of file quadtree.hpp.

◆ QuadTree() [6/6]

QuadTree ( const QuadTree )
private

Member Function Documentation

◆ computeEdgeForces()

void computeEdgeForces ( int *  row_P,
int *  col_P,
ScalarType *  val_P,
int  N,
ScalarType *  pos_f 
)

Definition at line 350 of file quadtree.hpp.

◆ computeNonEdgeForces()

void computeNonEdgeForces ( int  point_index,
ScalarType  theta,
ScalarType  neg_f[],
ScalarType *  sum_Q 
)

Definition at line 317 of file quadtree.hpp.

◆ fill()

void fill ( int  N)
private

Definition at line 426 of file quadtree.hpp.

◆ getAllIndices() [1/2]

void getAllIndices ( int *  indices)

Definition at line 302 of file quadtree.hpp.

◆ getAllIndices() [2/2]

int getAllIndices ( int *  indices,
int  loc 
)
private

Definition at line 432 of file quadtree.hpp.

◆ getDepth()

int getDepth ( )

Definition at line 307 of file quadtree.hpp.

◆ getParent()

QuadTree* getParent ( )

Definition at line 172 of file quadtree.hpp.

◆ init()

void init ( QuadTree inp_parent,
ScalarType *  inp_data,
ScalarType  inp_x,
ScalarType  inp_y,
ScalarType  inp_hw,
ScalarType  inp_hh 
)
private

Definition at line 407 of file quadtree.hpp.

◆ insert()

bool insert ( int  new_index)

Definition at line 180 of file quadtree.hpp.

◆ isCorrect()

bool isCorrect ( )

Definition at line 250 of file quadtree.hpp.

◆ operator=()

QuadTree& operator= ( const QuadTree )
private

◆ print()

void print ( )

Definition at line 374 of file quadtree.hpp.

◆ rebuildTree()

void rebuildTree ( )

Definition at line 264 of file quadtree.hpp.

◆ setData()

void setData ( ScalarType *  inp_data)

Definition at line 167 of file quadtree.hpp.

◆ subdivide()

void subdivide ( )

Definition at line 226 of file quadtree.hpp.

Member Data Documentation

◆ boundary

Cell boundary
private

Definition at line 84 of file quadtree.hpp.

◆ buff

ScalarType buff[QT_NO_DIMS]
private

Definition at line 75 of file quadtree.hpp.

◆ center_of_mass

ScalarType center_of_mass[QT_NO_DIMS]
private

Definition at line 88 of file quadtree.hpp.

◆ cum_size

int cum_size
private

Definition at line 81 of file quadtree.hpp.

◆ data

ScalarType* data
private

Definition at line 87 of file quadtree.hpp.

◆ index

int index[QT_NODE_CAPACITY]
private

Definition at line 89 of file quadtree.hpp.

◆ is_leaf

bool is_leaf
private

Definition at line 79 of file quadtree.hpp.

◆ northEast

QuadTree* northEast
private

Definition at line 93 of file quadtree.hpp.

◆ northWest

QuadTree* northWest
private

Definition at line 92 of file quadtree.hpp.

◆ parent

QuadTree* parent
private

Definition at line 78 of file quadtree.hpp.

◆ QT_NO_DIMS

const int QT_NO_DIMS = 2
staticprivate

Definition at line 71 of file quadtree.hpp.

◆ QT_NODE_CAPACITY

const int QT_NODE_CAPACITY = 1
staticprivate

Definition at line 72 of file quadtree.hpp.

◆ size

int size
private

Definition at line 80 of file quadtree.hpp.

◆ southEast

QuadTree* southEast
private

Definition at line 95 of file quadtree.hpp.

◆ southWest

QuadTree* southWest
private

Definition at line 94 of file quadtree.hpp.


The documentation for this class was generated from the following file: