ru.sscc.spline.mesh
Class StrictNonuniformMesh

java.lang.Object
  |
  +--ru.sscc.spline.mesh.SimpleMesh
        |
        +--ru.sscc.spline.mesh.StrictNonuniformMesh

public class StrictNonuniformMesh
extends SimpleMesh

The implementation of 1D ordered nonuniform mesh with strict representation of nodes in the double[] type internal array.

See Also:
Serialized Form

Field Summary
protected  double[] points
          Points container.
 
Fields inherited from class ru.sscc.spline.mesh.SimpleMesh
origin, scale, size
 
Constructor Summary
StrictNonuniformMesh(RealVector data)
          Constructs a mesh having the double[] type internal representation via a real data vector.
 
Method Summary
 double averageStep()
          Returns an average mesh step.
 double distance(int i, int j)
          Returns a distance between i-th and j-th nodes of transformed mesh, e.g.
 void findCell(SimpleMeshWorkspace workspace, double x)
          Finds a mesh cell to which a point belongs.
 double get(int i)
          Returns a value of i-th mesh node in the original coordinate system.
 boolean isUniform()
          Returns a mesh uniformness tag.
 
Methods inherited from class ru.sscc.spline.mesh.SimpleMesh
extendedMeshDistance, findCell, findCell, origin, scale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

points

protected double[] points
Points container.
Constructor Detail

StrictNonuniformMesh

public StrictNonuniformMesh(RealVector data)
Constructs a mesh having the double[] type internal representation via a real data vector. The affine transform of the original mesh is applied in such a way to convert the first and the last mesh nodes to 0 and n-1 correspondingly (here n is a nodes number). Throws IllegalArgumentException if the original mesh isn't ordered.
Method Detail

averageStep

public double averageStep()
Returns an average mesh step.
Overrides:
averageStep in class SimpleMesh

findCell

public void findCell(SimpleMeshWorkspace workspace,
                     double x)
Finds a mesh cell to which a point belongs. Writes the cell index and a position within the cell (a distance in new coordinates from the left cell bound) into workspace's attributes cellIndex and cellPoint. The algorithm is adaptive (at first it tests cells neighbouring to the cell found before).
Overrides:
findCell in class SimpleMesh
Parameters:
workspace - a mesh workspace
x - a point (in original coordinates) to search

get

public final double get(int i)
Returns a value of i-th mesh node in the original coordinate system.
Overrides:
get in class SimpleMesh

isUniform

public final boolean isUniform()
Returns a mesh uniformness tag.
Overrides:
isUniform in class SimpleMesh

distance

public final double distance(int i,
                             int j)
Returns a distance between i-th and j-th nodes of transformed mesh, e.g. the value ti-tj.
Overrides:
distance in class SimpleMesh