STARS-H
Software for Testing Accuracy, Reliability and Scalability of Hierarchical computations
Spatial statistics problem

Template for spatial statistics problems. More...

Collaboration diagram for Spatial statistics problem:

Modules

 Kernels
 Set of kernels for spatial statistics problems.
 

Data Structures

struct  starsh_ssdata
 Structure for Spatial Statistics problems. More...
 

Typedefs

typedef struct starsh_ssdata STARSH_ssdata
 Structure for Spatial Statistics problems.
 

Enumerations

enum  STARSH_SPATIAL_KERNEL {
  STARSH_SPATIAL_EXP = 1, STARSH_SPATIAL_SQREXP = 2, STARSH_SPATIAL_MATERN = 3, STARSH_SPATIAL_MATERN2 = 4,
  STARSH_SPATIAL_EXP_SIMD = 11, STARSH_SPATIAL_SQREXP_SIMD = 12, STARSH_SPATIAL_MATERN_SIMD = 13, STARSH_SPATIAL_MATERN2_SIMD = 14,
  STARSH_SPATIAL_EXP_GCD = 15, STARSH_SPATIAL_SQREXP_GCD = 16, STARSH_SPATIAL_MATERN_GCD = 17, STARSH_SPATIAL_MATERN2_GCD = 18,
  STARSH_SPATIAL_PARSIMONIOUS_GCD = 19, STARSH_SPATIAL_PARSIMONIOUS2_GCD = 20, STARSH_SPATIAL_PARSIMONIOUS_SIMD = 21, STARSH_SPATIAL_PARSIMONIOUS2_SIMD = 22
}
 List of built-in kernels for starsh_ssdata_get_kernel(). More...
 
enum  STARSH_SPATIAL_PARAM {
  STARSH_SPATIAL_NDIM = 1, STARSH_SPATIAL_BETA = 2, STARSH_SPATIAL_NU = 3, STARSH_SPATIAL_NOISE = 4,
  STARSH_SPATIAL_PLACE = 5, STARSH_SPATIAL_SIGMA = 6, STARSH_SPATIAL_SIGMA2 = 7, STARSH_SPATIAL_NU2 = 8,
  STARSH_SPATIAL_CORR = 9
}
 List of parameters for starsh_application(). More...
 
enum  STARSH_CAUCHY_PARAM { STARSH_CAUCHY_POINT = 1, STARSH_CAUCHY_DIAG = 2 }
 List of parameters for starsh_application(). More...
 

Functions

int starsh_ssdata_new (STARSH_ssdata **data, STARSH_int count, int ndim)
 Allocate memory for STARSH_ssdata object. More...
 
int starsh_ssdata_init (STARSH_ssdata **data, STARSH_int count, int ndim, double *point, double beta, double nu, double noise, double sigma)
 Initialize STARSH_ssdata object by given data. More...
 
int starsh_ssdata_init_parsimonious (STARSH_ssdata **data, STARSH_int count, int ndim, double *point, double sigma1, double sigma2, double beta, double nu1, double nu2, double corr, double noise)
 Initialize STARSH_ssdata object by given data. More...
 
int starsh_ssdata_generate (STARSH_ssdata **data, STARSH_int count, int ndim, double beta, double nu, double noise, enum STARSH_PARTICLES_PLACEMENT place, double sigma)
 Generate STARSH_ssdata object by given distribution. More...
 
int starsh_ssdata_generate_parsimonious (STARSH_ssdata **data, STARSH_int count, int ndim, double beta, double nu, double noise, enum STARSH_PARTICLES_PLACEMENT place, double sigma, double sigma2, double nu2, double corr)
 Generate STARSH_ssdata object by given distribution. More...
 
int starsh_ssdata_generate_va (STARSH_ssdata **data, STARSH_int count, va_list args)
 Generate STARSH_ssdata object with incomplete set of parameters. More...
 
int starsh_ssdata_generate_el (STARSH_ssdata **data, STARSH_int count,...)
 Generate STARSH_ssdata object with incomplete set of parameters. More...
 
void starsh_ssdata_free (STARSH_ssdata *data)
 Free memory of STARSH_ssdata object. More...
 
int starsh_ssdata_get_kernel (STARSH_kernel **kernel, STARSH_ssdata *data, enum STARSH_SPATIAL_KERNEL type)
 Get kernel for spatial statistics problem. More...
 
int starsh_esdata_get_kernel (STARSH_kernel **kernel, STARSH_esdata *data, enum STARSH_ELECTROSTATICS_KERNEL type)
 Get kernel for electrostatics problem. More...
 
void starsh_mddata_free (STARSH_mddata *data)
 Free memory of STARSH_mddata object. More...
 

Detailed Description

Template for spatial statistics problems.

STARSH_ssdata holds all the necessary data.

Enumeration Type Documentation

◆ STARSH_CAUCHY_PARAM

List of parameters for starsh_application().

In the table below each constant corresponds to a given argument and type for starsh_cauchy_new(). These constants are used to generate problem with incomplete set of parameters via starsh_application() or starsh_cauchy_new_va().

See also
starsh_application(), starsh_cauchy_new(), starsh_cauchy_init(), starsh_cauchy_new_va().
Enumerator
STARSH_CAUCHY_POINT 

Values of X_i for Cauchy matrix.

STARSH_CAUCHY_DIAG 

Diagonal values of Cauchy matrix.

◆ STARSH_SPATIAL_KERNEL

List of built-in kernels for starsh_ssdata_get_kernel().

For more info on exact formulas inside kernels, take a look at functions starsh_ssdata_block_exp_kernel_nd(), starsh_ssdata_block_sqrexp_kernel_nd(), starsh_ssdata_block_matern_kernel_nd(), starsh_ssdata_block_matern2_kernel_nd(), starsh_ssdata_block_exp_kernel_nd_simd(), starsh_ssdata_block_sqrexp_kernel_nd_simd(), starsh_ssdata_block_matern_kernel_nd_simd(), starsh_ssdata_block_matern2_kernel_nd_simd().

Enumerator
STARSH_SPATIAL_EXP 

Exponential kernel.

See also
starsh_ssdata_block_exp_kernel_nd().
STARSH_SPATIAL_SQREXP 

Square exponential kernel.

See also
starsh_ssdata_block_sqrexp_kernel_nd().
STARSH_SPATIAL_MATERN 

Matérn kernel.

See also
starsh_ssdata_block_matern_kernel_nd().
STARSH_SPATIAL_MATERN2 

Modified Matérn kernel.

See also
starsh_ssdata_block_matern2_kernel_nd().
STARSH_SPATIAL_EXP_SIMD 

Exponential kernel with SIMD.

See also
starsh_ssdata_block_exp_kernel_nd_simd().
STARSH_SPATIAL_SQREXP_SIMD 

Exponential kernel with SIMD.

See also
starsh_ssdata_block_sqrexp_kernel_nd_simd().
STARSH_SPATIAL_MATERN_SIMD 

Matérn kernel with SIMD.

See also
starsh_ssdata_block_matern_kernel_nd().
STARSH_SPATIAL_MATERN2_SIMD 

Modified Matérn kernel with SIMD.

See also
starsh_ssdata_block_matern2_kernel_nd_simd().
STARSH_SPATIAL_EXP_GCD 

Exponential kernel.

See also
starsh_ssdata_block_exp_kernel_nd_simd_gcd().
STARSH_SPATIAL_SQREXP_GCD 

Square exponential kernel.

See also
starsh_ssdata_block_sqrexp_kernel_nd_simd_gcd().
STARSH_SPATIAL_MATERN_GCD 

Matérn kernel with SIMD.

See also
starsh_ssdata_block_matern_kernel_nd_simd_gcd().
STARSH_SPATIAL_MATERN2_GCD 

Modified Matérn kernel with SIMD.

See also
starsh_ssdata_block_matern2_kernel_nd_simd_gcd().
STARSH_SPATIAL_PARSIMONIOUS_GCD 

Bivariate Modified parsimonious Matérn kernel with GCD.

See also
starsh_ssdata_block_parsimonious_kernel_nd_simd_gcd().
STARSH_SPATIAL_PARSIMONIOUS2_GCD 

Bivariate Modified parsimonious2 Matérn kernel with GCD.

See also
starsh_ssdata_block_parsimonious_kernel_nd_simd_gcd().
STARSH_SPATIAL_PARSIMONIOUS_SIMD 

Bivariate Modified parsimonious Matérn kernel with SIMD.

See also
starsh_ssdata_block_parsimonious_kernel_nd_simd().
STARSH_SPATIAL_PARSIMONIOUS2_SIMD 

Bivariate Modified parsimonious2 Matérnkernel with SIMD.

See also
starsh_ssdata_block_parsimonious_kernel_nd_simd().

◆ STARSH_SPATIAL_PARAM

List of parameters for starsh_application().

In the table below each constant corresponds to a given argument and type for starsh_ssdata_generate(). These constants are used to generate problem with incomplete set of parameters via starsh_application(), starsh_ssdata_generate_va() or starsh_ssdata_generate_el().

See also
starsh_application(), starsh_ssdata_generate(), starsh_ssdata_generate_va(), starsh_ssdata_generate_el().
Enumerator
STARSH_SPATIAL_NDIM 

Dimensionality of space (ndim, integer).

STARSH_SPATIAL_BETA 

Correlation length (beta, double).

STARSH_SPATIAL_NU 

Smoothing parameter for Matérn kernel (nu, double).

STARSH_SPATIAL_NOISE 

Noise or what to add to diagonal elements (noise, double).

STARSH_SPATIAL_PLACE 

Distribution of particles (place, STARSH_PARTICLES_PLACEMENT).

STARSH_SPATIAL_SIGMA 

Variance parameter (sigma, double).

STARSH_SPATIAL_SIGMA2 

Variance for the second variable (in the parsimonious bivariate case).

STARSH_SPATIAL_NU2 

Order of Matérn kernel for the second variable (in the parsimonious bivariate case).

STARSH_SPATIAL_CORR 

spatial range parameter (define the correlation between the two variables in the parsimonious bivariate case).

Function Documentation

◆ starsh_esdata_get_kernel()

int starsh_esdata_get_kernel ( STARSH_kernel **  kernel,
STARSH_esdata data,
enum STARSH_ELECTROSTATICS_KERNEL  type 
)

Get kernel for electrostatics problem.

Kernel can be selected with this call or manually. To select kernel manually look into Kernels.

Parameters
[out]kernelAddress of pointer to STARSH_kernel function.
[in]dataPointer to STARSH_esdata object.
[in]typeType of kernel. For more info look at STARSH_ELECTROSTATICS_KERNEL.
Returns
Error code STARSH_ERRNO.
See also
starsh_esdata_block_coulomb_potential_kernel_nd(), starsh_esdata_block_coulomb_potential_kernel_nd_simd().

◆ starsh_mddata_free()

void starsh_mddata_free ( STARSH_mddata data)

Free memory of STARSH_mddata object.

See also
starsh_mddata_new(), starsh_mddata_init(), starsh_mddata_generate().

◆ starsh_ssdata_free()

void starsh_ssdata_free ( STARSH_ssdata data)

◆ starsh_ssdata_generate()

int starsh_ssdata_generate ( STARSH_ssdata **  data,
STARSH_int  count,
int  ndim,
double  beta,
double  nu,
double  noise,
enum STARSH_PARTICLES_PLACEMENT  place,
double  sigma 
)

Generate STARSH_ssdata object by given distribution.

Parameters
[out]dataAddress of pointer to STARSH_ssdata object.
[in]countNumber of particles.
[in]ndimDimensionality of space.
[in]betaCorrelation length.
[in]nuSmoothing parameter for Matérn kernel.
[in]noiseValue to add to diagonal elements.
[in]placePlacement strategy for spatial points.
[in]sigmaSquare of variance.
Returns
Error code STARSH_ERRNO.
See also
starsh_ssdata_generate_va(), starsh_ssdata_generate_el().

◆ starsh_ssdata_generate_el()

int starsh_ssdata_generate_el ( STARSH_ssdata **  data,
STARSH_int  count,
  ... 
)

Generate STARSH_ssdata object with incomplete set of parameters.

Parse possibly incomplete set of parameters for starsh_ssdata_generate(). If argument is not in the ..., then its default value is used:

Argument Default value Type –
ndim 2 int
beta 0.1 double
nu 0.5 double
noise 0.0 double
place STARSH_PARTICLES_UNIFORM STARSH_PARTICLES_PLACEMENT
sigma 1.0 double

List of arguments in ... should look as pairs (Arg.constant, Value) with 0 as a last argument. For correspondance of arguments and arg.constants take a look at STARSH_SPATIAL_PARAM.

Parameters
[out]dataAddress of pointer to STARSH_ssdata object.
[in]countNumber of particles.
[in]...Variable amount of arguments.
Returns
Error code STARSH_ERRNO.
Examples
See also
starsh_ssdata_generate(), starsh_ssdata_generate_va().

◆ starsh_ssdata_generate_parsimonious()

int starsh_ssdata_generate_parsimonious ( STARSH_ssdata **  data,
STARSH_int  count,
int  ndim,
double  beta,
double  nu,
double  noise,
enum STARSH_PARTICLES_PLACEMENT  place,
double  sigma,
double  sigma2,
double  nu2,
double  corr 
)

Generate STARSH_ssdata object by given distribution.

Parameters
[out]dataAddress of pointer to STARSH_ssdata object.
[in]countNumber of particles.
[in]ndimDimensionality of space.
[in]betaCorrelation length.
[in]nuSmoothing parameter for Matérn kernel.
[in]noiseValue to add to diagonal elements.
[in]placePlacement strategy for spatial points.
[in]sigmaSquare of variance.
[in]sigma2Square of variance2.
[in]nu2Smoothing parameter for Matérn kernel.
[in]corrCorr parameter for Matérn kernel.
Returns
Error code STARSH_ERRNO.
See also
starsh_ssdata_generate_va(), starsh_ssdata_generate_el().

◆ starsh_ssdata_generate_va()

int starsh_ssdata_generate_va ( STARSH_ssdata **  data,
STARSH_int  count,
va_list  args 
)

Generate STARSH_ssdata object with incomplete set of parameters.

Parse possibly incomplete set of parameters for starsh_ssdata_generate(). If argument is not in the args, then its default value is used:

Argument Default value Type –
ndim 2 int
beta 0.1 double
nu 0.5 double
noise 0.0 double
place STARSH_PARTICLES_UNIFORM STARSH_PARTICLES_PLACEMENT
sigma 1.0 double
nu2 0.5 double
`sigma2 1.0 double
corr 0.5 double

List of arguments args should look as pairs (Arg.constant, Value) with 0 as a last argument. For correspondance of arguments and arg.constants take a look at STARSH_SPATIAL_PARAM.

Parameters
[out]dataAddress of pointer to STARSH_ssdata object.
[in]countNumber of particles.
[in]argsArguments, packed into va_args.
Returns
Error code STARSH_ERRNO.
Examples
See also
starsh_ssdata_generate(), starsh_ssdata_generate_el().

◆ starsh_ssdata_get_kernel()

int starsh_ssdata_get_kernel ( STARSH_kernel **  kernel,
STARSH_ssdata data,
enum STARSH_SPATIAL_KERNEL  type 
)

Get kernel for spatial statistics problem.

Kernel can be selected with this call or manually. To select kernel manually look into Kernels.

Parameters
[out]kernelAddress of pointer to STARSH_kernel function.
[in]dataPointer to STARSH_ssdata object.
[in]typeType of kernel. For more info look at STARSH_SPATIAL_KERNEL.
Returns
Error code STARSH_ERRNO.
See also
starsh_ssdata_block_exp_kernel_nd(), starsh_ssdata_block_exp_kernel_nd_simd(), starsh_ssdata_block_sqrexp_kernel_nd(), starsh_ssdata_block_sqrexp_kernel_nd_simd(), starsh_ssdata_block_matern_kernel_nd(), starsh_ssdata_block_matern_kernel_nd_simd(), starsh_ssdata_block_matern2_kernel_nd(), starsh_ssdata_block_matern2_kernel_nd_simd().

◆ starsh_ssdata_init()

int starsh_ssdata_init ( STARSH_ssdata **  data,
STARSH_int  count,
int  ndim,
double *  point,
double  beta,
double  nu,
double  noise,
double  sigma 
)

Initialize STARSH_ssdata object by given data.

Array point should be stored in a special way: x_1 x_2 ... x_count y_1 y_2 ... y_count z_1 z_2 .... This function does not allocate memory for coordinates and uses provided pointer point. Do not free memory of point until you finish using returned STARSH_ssdata object. Do not forget to sort data->particles by starsh_particles_zsort_inplace() to take advantage of low-rank submatrices.

Parameters
[out]dataAddress of pointer to STARSH_ssdata object.
[in]countNumber of particles.
[in]ndimDimensionality of space.
[in]pointPointer to array of coordinates of particles.
[in]betaCorrelation length.
[in]nuSmoothing parameter for Matérn kernel.
[in]noiseValue to add to diagonal elements.
[in]sigmaSquare of variance.
Returns
Error code STARSH_ERRNO.
See also
starsh_ssdata_new(), starsh_ssdata_free(), starsh_ssdata_generate(), starsh_ssdata_read_from_file(), starsh_particles_zsort_inplace().

◆ starsh_ssdata_init_parsimonious()

int starsh_ssdata_init_parsimonious ( STARSH_ssdata **  data,
STARSH_int  count,
int  ndim,
double *  point,
double  sigma1,
double  sigma2,
double  beta,
double  nu1,
double  nu2,
double  corr,
double  noise 
)

Initialize STARSH_ssdata object by given data.

Array point should be stored in a special way: x_1 x_2 ... x_count y_1 y_2 ... y_count z_1 z_2 .... This function does not allocate memory for coordinates and uses provided pointer point. Do not free memory of point until you finish using returned STARSH_ssdata object. Do not forget to sort data->particles by starsh_particles_zsort_inplace() to take advantage of low-rank submatrices.

Parameters
[out]dataAddress of pointer to STARSH_ssdata object.
[in]countNumber of particles.
[in]ndimDimensionality of space.
[in]pointPointer to array of coordinates of particles.
[in]betaCorrelation length.
[in]nuSmoothing parameter for Matérn kernel.
[in]noiseValue to add to diagonal elements.
[in]sigmaSquare of variance.
Returns
Error code STARSH_ERRNO.
See also
starsh_ssdata_new(), starsh_ssdata_free(), starsh_ssdata_generate(), starsh_ssdata_read_from_file(), starsh_particles_zsort_inplace().

◆ starsh_ssdata_new()

int starsh_ssdata_new ( STARSH_ssdata **  data,
STARSH_int  count,
int  ndim 
)

Allocate memory for STARSH_ssdata object.

This functions only allocates memory for particles without setting coordinates to any value. Do not forget to sort data->particles by starsh_particles_zsort_inplace() to take advantage of low-rank submatrices.

Parameters
[out]dataAddress of pointer to STARSH_ssdata object.
[in]countNumber of particles.
[in]ndimDimensionality of space.
Returns
Error code STARSH_ERRNO.
See also
starsh_ssdata_init(), starsh_ssdata_free(), starsh_ssdata_generate(), starsh_ssdata_read_from_file(), starsh_particles_zsort_inplace(), STARSH_particles.