Class MultivariateArrayGrid
- java.lang.Object
-
- dev.nm.analysis.curvefit.interpolation.multivariate.MultivariateArrayGrid
-
- All Implemented Interfaces:
MultivariateGrid
public class MultivariateArrayGrid extends Object implements MultivariateGrid
Implementation ofMultivariateGrid, backed by the givenMultiDimensionalCollectioninstance.
-
-
Constructor Summary
Constructors Constructor Description MultivariateArrayGrid(MultiDimensionalCollection<Double> y, double[]... x)Create a new instance where the dependent variable is specified by aMultiDimensionalCollectionand the independent variables form the specified grid.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdimension()Get the total number of dimensions of the grid.intsize(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.doublex(int i, int j)Get the value of the independent variable xi at the given index.doubley(int... indices)Get the value of the dependent variable y at the given indices in the grid.
-
-
-
Constructor Detail
-
MultivariateArrayGrid
public MultivariateArrayGrid(MultiDimensionalCollection<Double> y, double[]... x)
Create a new instance where the dependent variable is specified by aMultiDimensionalCollectionand the independent variables form the specified grid.- Parameters:
y- the values of the dependent variablex- each element specifies the grid of independent variables along one dimension
-
-
Method Detail
-
y
public double y(int... indices)
Description copied from interface:MultivariateGridGet the value of the dependent variable y at the given indices in the grid.- Specified by:
yin interfaceMultivariateGrid- 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:MultivariateGridGet the value of the independent variable xi at the given index.- Specified by:
xin interfaceMultivariateGrid- Parameters:
i- the dimension index of the independent variable xij- the index of the value in the specified dimension xi- Returns:
- \(x_i_j\)
-
x
public double[] x(int i)
Description copied from interface:MultivariateGridGet all the values of the independent variable xi as an array.- Specified by:
xin interfaceMultivariateGrid- Parameters:
i- the dimension index of the independent variable xi- Returns:
- \(x_i\)'s
-
size
public int size(int i)
Description copied from interface:MultivariateGridGet the size of the grid in the given dimension xi.- Specified by:
sizein interfaceMultivariateGrid- Parameters:
i- the dimension index of the independent variable xi- Returns:
- the size of the dimension
-
dimension
public int dimension()
Description copied from interface:MultivariateGridGet the total number of dimensions of the grid.- Specified by:
dimensionin interfaceMultivariateGrid- Returns:
- the number of dimensions
-
-