ru.sscc.spline.reduction
Class ReducedMesh

java.lang.Object
  |
  +--ru.sscc.spline.reduction.ReducedMesh
Direct Known Subclasses:
ScatteredMesh, StrictScatteredMesh

public abstract class ReducedMesh
extends java.lang.Object
implements Reduction

The abstract support for a multidimensional mesh. An initial user's mesh is transformed in some way (usually with affine transform) and is stored in reduced mesh. The dimensions of initial and reduced meshes may differ (the reduced dimension may be less than the initial one). The class describes abstract methods for point reduction and calculation of squared distance between the reduced point and a mesh node.

See Also:
Serialized Form

Field Summary
 Reduction reduction
          The reduction used in the mesh.
 int size
          The number of points in the reduced mesh.
 
Constructor Summary
ReducedMesh(Reduction reduction, int size)
          Constructor.
 
Method Summary
static Reduction coverByOrthogonalReduction(Reduction reduction, RealVectors data, double reductionAccuracy)
          Applies the findOrthogonalBase method to calculated the orthogonal base and covers the reduction by the orthogonal reduction if the base found (otherwise returns the initial reduction).
static DenseMatrix findOrthogonalBase(Reduction reduction, RealVectors data, double reductionAccuracy)
          Finds an orthonormal base of vectors that are orthogonal to mesh vectors after the transformion by specified reduction.
 int initialDimension()
          Returns the dimension of initial space of independent varibles.
abstract  void putNode(int i, RealPointer point)
          Copies i-th node of the reduced mesh to the point specified.
 int reducedDimension()
          Returns the dimension of reduced space of independent varibles.
 void reducePoint(RealPointer x, RealPointer y)
          Transforms point coordinates from initial to reduced.
abstract  double squaredDistance(int i, RealPointer y)
          Calculates the squared distance between i-th mesh node of reduced mesh and a point prepared in reduced coordinates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reduction

public final Reduction reduction
The reduction used in the mesh.

size

public final int size
The number of points in the reduced mesh.
Constructor Detail

ReducedMesh

public ReducedMesh(Reduction reduction,
                   int size)
Constructor.
Parameters:
reduction - a reduction used
size - a number of mesh nodes
Method Detail

initialDimension

public final int initialDimension()
Returns the dimension of initial space of independent varibles.
Specified by:
initialDimension in interface Reduction

reducedDimension

public final int reducedDimension()
Returns the dimension of reduced space of independent varibles.
Specified by:
reducedDimension in interface Reduction

reducePoint

public final void reducePoint(RealPointer x,
                              RealPointer y)
Transforms point coordinates from initial to reduced.
Specified by:
reducePoint in interface Reduction
Parameters:
x - the point in initial coordinates
y - the point in reduced coordinates

squaredDistance

public abstract double squaredDistance(int i,
                                       RealPointer y)
Calculates the squared distance between i-th mesh node of reduced mesh and a point prepared in reduced coordinates.
Parameters:
i - a mesh node number
y - a point in reduced coordinates
Returns:
a squared distance

putNode

public abstract void putNode(int i,
                             RealPointer point)
Copies i-th node of the reduced mesh to the point specified.
Parameters:
point - a point to copy to
i - a node index

findOrthogonalBase

public static DenseMatrix findOrthogonalBase(Reduction reduction,
                                             RealVectors data,
                                             double reductionAccuracy)
Finds an orthonormal base of vectors that are orthogonal to mesh vectors after the transformion by specified reduction. The algorithm temporary applies the specified reduction to mesh notes, analyzes the reduced mesh to belong to a proper subspace of the reduced space, and calculates the orthogonal comliment base vectors.
Parameters:
reduction - a space reduction
data - a user's mesh
reductionAccuracy - a reduction accuracy used in the algorithm (a small non-negative value. Use the relative accuracy of mesh data here)
Returns:
a matrix of linear independent column-vectors that a orthogonal to the reduced mesh vectors or null if no orthogonal vectors found (the matrix entries are ordered by columns).

coverByOrthogonalReduction

public static Reduction coverByOrthogonalReduction(Reduction reduction,
                                                   RealVectors data,
                                                   double reductionAccuracy)
Applies the findOrthogonalBase method to calculated the orthogonal base and covers the reduction by the orthogonal reduction if the base found (otherwise returns the initial reduction).
Parameters:
reduction - a space reduction
data - a user's mesh
reductionAccuracy - a reduction accuracy used in the algorithm (a small non-negative value. Use the relative accuracy of mesh data here)
Returns:
an orthogonal cover of the initial reduction if the orthogonal base found, or the initial reduction if no orthogonal vectors found.