SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.curvefit.interpolation.multivariate

Class MultivariateRegularGrid

• java.lang.Object
• com.numericalmethod.suanshu.analysis.curvefit.interpolation.multivariate.MultivariateRegularGrid
• All Implemented Interfaces:
MultivariateGrid

public class MultivariateRegularGrid
extends Object
implements MultivariateGrid
A regular grid is a tessellation of n-dimensional Euclidean space by congruent parallelotopes (e.g. bricks), meaning that grid points are equally-spaced. This is a special case of rectilinear grid. This implementation is backed by a MultivariateArrayGrid.
Wikipedia: Regular grid
• Nested Class Summary

Nested Classes
Modifier and Type Class and Description
static class  MultivariateRegularGrid.EquallySpacedVariable
Specify the positioning and spacing along one dimension.
• Constructor Summary

Constructors
Constructor and Description
MultivariateRegularGrid(MultiDimensionalCollection<Double> y, MultivariateRegularGrid.EquallySpacedVariable... x)
Create a new instance where the dependent variable is specified by a MultiDimensionalCollection and the independent variables form the specified grid.
• Method Summary

All Methods
Modifier and Type Method and Description
double deltaX(int i)
Get the distance between two adjacent points along the axis with the given index.
int dimension()
Get the total number of dimensions of the grid.
int size(int i)
Get the size of the grid in the given dimension xi.
double[] x(int i)
Get all the values of the independent variable xi as an array.
double x(int i, int j)
Get the value of the independent variable xi at the given index.
double x0(int i)
Get the value of $$\mathbf{x_i}_0$$, the first value of the independent variable $$x_i$$.
double y(int... indices)
Get the value of the dependent variable y at the given indices in the grid.
• Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• Constructor Detail

• MultivariateRegularGrid

public MultivariateRegularGrid(MultiDimensionalCollection<Double> y,
MultivariateRegularGrid.EquallySpacedVariable... x)
Create a new instance where the dependent variable is specified by a MultiDimensionalCollection and the independent variables form the specified grid.
Parameters:
y - the values of the dependent variable
x - each element specifies the independent variables along one dimension
• Method Detail

• y

public double y(int... indices)
Description copied from interface: MultivariateGrid
Get the value of the dependent variable y at the given indices in the grid.
Specified by:
y in interface MultivariateGrid
Parameters:
indices - the indices of the independent variables in the grid
Returns:
$$y(\mathbf{x})$$, the value of the dependent variable at $$\mathbf{x}$$
• x

public double x(int i,
int j)
Description copied from interface: MultivariateGrid
Get the value of the independent variable xi at the given index.
Specified by:
x in interface MultivariateGrid
Parameters:
i - the dimension index of the independent variable xi
j - the index of the value in the specified dimension xi
Returns:
$$x_i_j$$
• x

public double[] x(int i)
Description copied from interface: MultivariateGrid
Get all the values of the independent variable xi as an array.
Specified by:
x in interface MultivariateGrid
Parameters:
i - the dimension index of the independent variable xi
Returns:
$$x_i$$'s
• size

public int size(int i)
Description copied from interface: MultivariateGrid
Get the size of the grid in the given dimension xi.
Specified by:
size in interface MultivariateGrid
Parameters:
i - the dimension index of the independent variable xi
Returns:
the size of the dimension
• dimension

public int dimension()
Description copied from interface: MultivariateGrid
Get the total number of dimensions of the grid.
Specified by:
dimension in interface MultivariateGrid
Returns:
the number of dimensions
• x0

public double x0(int i)
Get the value of $$\mathbf{x_i}_0$$, the first value of the independent variable $$x_i$$. The value of $$x_i_j$$ can be computed as $$x_i_0 + (j\times\delta_{x_i})$$.
Parameters:
i - the dimension index of the independent variable xi
Returns:
$$x_i_0$$
• deltaX

public double deltaX(int i)
Get the distance between two adjacent points along the axis with the given index.
Parameters:
i - the dimension index of the independent variable xi
Returns:
$$\delta_{x_i}$$