CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
cbl::chainmesh::ChainMesh1D Class Reference

The class ChainMesh1D. More...

#include "Headers/ChainMesh.h"

Inheritance diagram for cbl::chainmesh::ChainMesh1D:
Collaboration diagram for cbl::chainmesh::ChainMesh1D:

Public Member Functions

 ChainMesh1D ()=default
 default constructor
 
 ~ChainMesh1D ()=default
 default destructor
 
void set_par (const double cell_size, const std::vector< double > xx, const double rMAX, const double rMIN=-1., const long nMAX=300, const long nMIN=0)
 function that set parameters for the chain-mesh More...
 
 ChainMesh1D (const double cell_size, const std::vector< double > xx, const double rMAX, const double rMIN=-1., const long nMAX=300, const long nMIN=0)
 constructor More...
 
- Public Member Functions inherited from cbl::chainmesh::ChainMesh
 ChainMesh ()=default
 default constructor
 
 ChainMesh (const double cell_size, const long nDim)
 constructor More...
 
 ~ChainMesh ()=default
 default destructor
 
void set_par (const double cell_size, const long nDim)
 function that set parameters for the chain-mesh More...
 
long nCell () const
 get the private member ChainMesh::m_nCell_tot More...
 
long nCell_NonEmpty () const
 get the private member ChainMesh::m_nCell_NonEmpty More...
 
std::vector< long > NonEmpty_Cells () const
 get the private member ChainMesh::m_NonEmpty_Cells More...
 
long pos_to_index (const std::vector< double > center) const
 get the index of the cell given the object coordinates More...
 
long inds_to_index (const std::vector< long > indx) const
 get the unique index of the cell given the n indices More...
 
void index_to_inds (const long index, const std::vector< long > nn, std::vector< long > &indx) const
 get the n indices given the unique index More...
 
void create_chain_mesh (const std::vector< std::vector< double > > data, const double rMax, const double rMin=-1., const long nMAX=300, const long nMIN=10)
 create the chain mesh More...
 
void create_chain_mesh_m2 (const std::vector< std::vector< double > > data)
 create the chain mesh More...
 
void get_searching_region (const double r_max, const double r_min=-1.)
 set the internal variable m_search_region, the list of cell around a generic center More...
 
std::vector< long > close_objects_cell (const int cell_index, long ii=-1) const
 get the indeces of the objects close to a cell More...
 
std::vector< long > close_objects (std::vector< double > center, long ii=-1) const
 get the indeces of the objects close to an object More...
 
void normalize (std::vector< std::vector< double >> points, std::vector< double > values, const double rMAX)
 function to set a normalized (square/cubic) grid from a sample of points, used for the N-dim interpolation More...
 
double interpolate (std::vector< double > xi, const int distNum)
 N-dim interpolation of a set of N coordinates on a normalised grid (see normalize) More...
 
std::vector< double > interpolate (std::vector< std::vector< double >> points, std::vector< double > values, std::vector< std::vector< double >> xi, const int distNum, const double rMAX)
 N-dim interpolation. More...
 
std::vector< long > get_list (const long cell_index) const
 get the index of the object inside a cell More...
 

Additional Inherited Members

- Protected Attributes inherited from cbl::chainmesh::ChainMesh
int m_nDim
 the number of dimension
 
std::vector< long > m_cell_to_index
 indexes in the i-th cell
 
double m_cell_size
 the size of the cell in unit of the interested quantity
 
std::vector< long > m_List
 list of internal use
 
std::vector< long > m_Label
 array containing the last particle of the chain-mesh in each cell
 
std::vector< std::vector< long > > m_List_index
 index list of internal use
 
std::vector< std::vector< double > > m_Lim
 Min,Max limits of variable(s) used for the chain-mesh.
 
std::vector< double > m_Delta
 Max-Min of variable(s) used for the chain-mesh.
 
std::vector< long > m_nCell
 number of cell(s) for variable(s)
 
std::vector< long > m_search_region
 the list of cell around a generic center
 
long m_nCell_tot
 the total number of cells
 
long m_nCell_NonEmpty
 the number of non-empty cells
 
std::vector< long > m_NonEmpty_Cells
 the total number of non-empty cells
 
std::vector< long > m_multCell
 multiplicative factor to compute the projected number of cells
 
std::vector< std::vector< double > > m_points
 the vector containing the sample points for the n-dim interpolation
 
std::vector< double > m_values
 the vector containing the values of the n-dim function on the sample points
 
std::vector< std::vector< double > > m_extremals
 the vector containing the extremals of the sample points coordinates
 
std::vector< double > m_delta
 vetors of differences between the extremals of the sample points coordinates
 
double m_rMAX
 the maximum radius for the search of close points in the chain mesh
 
double m_rMIN
 the minimum radius for the search of close points in the chain mesh
 

Detailed Description

The class ChainMesh1D.

This class is used to handle objects of type ChainMesh1D

Definition at line 299 of file ChainMesh.h.

Constructor & Destructor Documentation

◆ ChainMesh1D()

cbl::chainmesh::ChainMesh1D::ChainMesh1D ( const double  cell_size,
const std::vector< double >  xx,
const double  rMAX,
const double  rMIN = -1.,
const long  nMAX = 300,
const long  nMIN = 0 
)

constructor

Parameters
cell_sizedouble storing the cell size
xxthe vector with the variable used for the chain-mesh
rMAXthe maximum separation
rMINthe minimum separation
nMAXthe allowed maximum number of chain-mesh cells in each dimension
nMINthe allowed minimum number of chain-mesh cells in each dimension

Definition at line 556 of file ChainMesh.cpp.

Member Function Documentation

◆ set_par()

void cbl::chainmesh::ChainMesh1D::set_par ( const double  cell_size,
const std::vector< double >  xx,
const double  rMAX,
const double  rMIN = -1.,
const long  nMAX = 300,
const long  nMIN = 0 
)

function that set parameters for the chain-mesh

Parameters
cell_sizedouble storing the cell size
xxthe vector with the variable used for the chain-mesh
rMAXthe maximum separation
rMINthe minimum separation
nMAXthe allowed maximum number of chain-mesh cells in each dimension
nMINthe allowed minimum number of chain-mesh cells in each dimension

Definition at line 543 of file ChainMesh.cpp.


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