LinkedListCube< T > Class Template Reference

#include <LinkedListCube.h>

Public Member Functions

 LinkedListCube ()
 
 ~LinkedListCube ()
 
int alloc (int N_x, int N_y, int N_z, int max_num_nodes_in_pool)
 
int alloc_dual (int N_x, int N_y, int N_z, int max_num_nodes_in_pool)
 
int add_to_pool (T *t)
 
int add_to_pool_dual (T *t)
 
LinkedListNode< T > * get_from_pool (int i)
 
void clear ()
 
void clear_layer (int l)
 
void clear_shadow_layer ()
 
int add_node_to_stack (int i, int x, int y, int z)
 
int add_node_to_stack_shadow (int i, int x, int y, int z)
 
LinkedListNode< T > * get_top_of_stack (int x, int y, int z)
 
int get_pool_size ()
 
void get_dim (int *Nx, int *Ny, int *Nz)
 
int safely_swap_layers ()
 
void allow_swapping ()
 
void forbid_swapping ()
 

Protected Member Functions

void swap_layers ()
 

Protected Attributes

int N_x
 
int N_y
 
int N_z
 
int max_num_nodes_in_pool
 
int num_nodes_in_pool
 
LinkedListNode< T > ** root1
 
LinkedListNode< T > ** root2
 
LinkedListNode< T > ** root
 
LinkedListNode< T > ** root_shadow
 
LinkedListNode< T > * pool1
 
LinkedListNode< T > * pool2
 
LinkedListNode< T > * pool
 
LinkedListNode< T > * pool_shadow
 
int active_layer
 
int shadow_layer
 
bool can_swap
 

Private Member Functions

void pbc (int *x, int *y, int *z)
 

Private Attributes

int add_index
 

Constructor & Destructor Documentation

◆ LinkedListCube()

template<class T>
LinkedListCube< T >::LinkedListCube ( )

Constructor

◆ ~LinkedListCube()

template<class T>
LinkedListCube< T >::~LinkedListCube ( )

Destructor

Member Function Documentation

◆ add_node_to_stack()

template<class T>
int LinkedListCube< T >::add_node_to_stack ( int  i,
int  x,
int  y,
int  z 
)

Adds the specified pool node to the stack at index (x, y, z) on the grid. Does this by setting the current top of stack node to be the 'next' in the list after node i, with node i becoming the new top of stack node on that cell;

Referenced by PreComp_solver::build_pc_nearest_neighbour_lookup().

◆ add_node_to_stack_shadow()

template<class T>
int LinkedListCube< T >::add_node_to_stack_shadow ( int  i,
int  x,
int  y,
int  z 
)

◆ add_to_pool()

template<class T>
int LinkedListCube< T >::add_to_pool ( T *  t)

Adds the specified T object to the pool (at the index given by add_index)

Referenced by PreComp_solver::init(), and World::init().

◆ add_to_pool_dual()

template<class T>
int LinkedListCube< T >::add_to_pool_dual ( T *  t)

Adds the specified T object to the pool (at the index given by add_index)

Referenced by PreComp_solver::init(), and World::init().

◆ alloc()

template<class T>
int LinkedListCube< T >::alloc ( int  N_x,
int  N_y,
int  N_z,
int  max_num_nodes_in_pool 
)

Builds a LinkedListCube of dimensions N_x x N_y x N_z, and an array of LinkedListNodes of size max_num_nodes_in_pool

Referenced by PreComp_solver::init(), and World::init().

◆ alloc_dual()

template<class T>
int LinkedListCube< T >::alloc_dual ( int  N_x,
int  N_y,
int  N_z,
int  max_num_nodes_in_pool 
)

Builds 2 layers of LinkedListCubes of dimensions N_x x N_y x N_z, a and an dual array of LinkedListNodes of size max_num_nodes_in_pool

Referenced by PreComp_solver::init(), and World::init().

◆ allow_swapping()

template<class T>
void LinkedListCube< T >::allow_swapping ( )

◆ clear()

template<class T>
void LinkedListCube< T >::clear ( )

Completely clears entire grid of all linked lists by setting all pointers to NULL in root, and all 'next' pointers to NULL in the pool of LinkedListNodes.

Referenced by PreComp_solver::build_pc_nearest_neighbour_lookup().

◆ clear_layer()

template<class T>
void LinkedListCube< T >::clear_layer ( int  l)

◆ clear_shadow_layer()

◆ forbid_swapping()

template<class T>
void LinkedListCube< T >::forbid_swapping ( )

◆ get_dim()

template<class T>
void LinkedListCube< T >::get_dim ( int *  Nx,
int *  Ny,
int *  Nz 
)

◆ get_from_pool()

template<class T>
LinkedListNode<T>* LinkedListCube< T >::get_from_pool ( int  i)

◆ get_pool_size()

template<class T>
int LinkedListCube< T >::get_pool_size ( )

Returns how many objects are in the 'pool'

Referenced by BEM_Poisson_Boltzmann::init(), PreComp_solver::init(), and VdW_solver::solve().

◆ get_top_of_stack()

◆ pbc()

template<class T>
void LinkedListCube< T >::pbc ( int *  x,
int *  y,
int *  z 
)
private

◆ safely_swap_layers()

◆ swap_layers()

template<class T>
void LinkedListCube< T >::swap_layers ( )
protected

Field Documentation

◆ active_layer

template<class T>
int LinkedListCube< T >::active_layer
protected

◆ add_index

template<class T>
int LinkedListCube< T >::add_index
private

The current index in the pool array at which nodes are to be added

◆ can_swap

template<class T>
bool LinkedListCube< T >::can_swap
protected

◆ max_num_nodes_in_pool

template<class T>
int LinkedListCube< T >::max_num_nodes_in_pool
protected

The number of linked list nodes available for stacking

◆ N_x

template<class T>
int LinkedListCube< T >::N_x
protected

The cube has dimensions N_x x N_y x N_z

◆ N_y

template<class T>
int LinkedListCube< T >::N_y
protected

◆ N_z

template<class T>
int LinkedListCube< T >::N_z
protected

◆ num_nodes_in_pool

template<class T>
int LinkedListCube< T >::num_nodes_in_pool
protected

The number of nodes in use

◆ pool

template<class T>
LinkedListNode<T>* LinkedListCube< T >::pool
protected

◆ pool1

template<class T>
LinkedListNode<T>* LinkedListCube< T >::pool1
protected

A "pool" of LinkedListNodes available for stacking on the various stacks in the cube

◆ pool2

template<class T>
LinkedListNode<T>* LinkedListCube< T >::pool2
protected

◆ pool_shadow

template<class T>
LinkedListNode<T>* LinkedListCube< T >::pool_shadow
protected

◆ root

template<class T>
LinkedListNode<T>** LinkedListCube< T >::root
protected

◆ root1

template<class T>
LinkedListNode<T>** LinkedListCube< T >::root1
protected

A cubic grid of pointers

◆ root2

template<class T>
LinkedListNode<T>** LinkedListCube< T >::root2
protected

◆ root_shadow

template<class T>
LinkedListNode<T>** LinkedListCube< T >::root_shadow
protected

◆ shadow_layer

template<class T>
int LinkedListCube< T >::shadow_layer
protected

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