Class AxisChecker<T>
java.lang.Object
org.hipparchus.analysis.interpolation.AxisChecker<T>
- Type Parameters:
T- grid data type
Checker for sampled data along a regular grid.
This class is intended to check one axis of n-dimensional grid data.
A typical use case is loading data from a file with entries of the form:
x₁ y₁ valueA₁₁ valueB₁₁ x₁ y₂ valueA₁₂ valueB₁₂ ⋮ x₁ yₙ valueA₁ₙ valueB₁ₙ x₂ y₁ valueA₂₁ valueB₂₁ x₂ y₂ valueA₂₂ valueB₂₂ ⋮ x₂ yₙ valueA₂ₙ valueB₂ₙ x₃ yₙ valueA₃ₙ valueB₃ₙ ⋮ xₘ yₙ valueAₘₙ valueBₘₙ
In this case, the grid is two-dimensional, with the x-axis having m steps ranging from x₁ to xₘ and the y-axis having n steps ranging from y₁ to yₙ.
In this case, users could store the entries in some custom container
class Entry with getters getX(), getY(), getValueA(), and
getValueB(). Then the checks for both x and y axes could be built as follows:
List<Entry> data = readData();
RegularIndexer xIndexer = new AxisChecker<>(Entry::getX(), toleranceX).checkGridData(data);
RegularIndexer yIndexer = new AxisChecker<>(Entry::getY(), toleranceY).checkGridData(data);
- Since:
- 4.1
-
Constructor Summary
ConstructorsConstructorDescriptionAxisChecker(ToDoubleFunction<T> extractor, double tolerance) Simple constructor. -
Method Summary
Modifier and TypeMethodDescriptioncheckGridData(Iterable<T> gridData) Check grid data for regularity (i.e., regular sampling, no missing points, same number of points at all coordinates…).
-
Constructor Details
-
AxisChecker
Simple constructor.- Parameters:
extractor- coordinate extractortolerance- tolerance below which extracted coordinates are considered equal
-
-
Method Details
-
checkGridData
Check grid data for regularity (i.e., regular sampling, no missing points, same number of points at all coordinates…).The check for one axis performs two passes over the full grid data.
- Parameters:
gridData- grid data to check- Returns:
- regular sampling for the axis configured at construction
-