All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class EDU.gatech.cc.is.learning.Bilinear2D

java.lang.Object
   |
   +----EDU.gatech.cc.is.learning.FunctionApproximator
           |
           +----EDU.gatech.cc.is.learning.Bilinear2D

public class Bilinear2D
extends FunctionApproximator
implements Cloneable, Serializable
Transform points from a two-dimensional space to another two dimensional space.

Introduction
The Bilinear2D is a vectorial function that transforms points from a two-dimensional space to another two-dimensional space. The transformation is specified using a grid at the domain space and associating the points at the target space that correspond to each node of the grid.

Computation
The evaluation of query points is performed using a bilinear interpolation of the target points associated with the four neighboring points to the query point.

The domain space is specified by a rectangle and a grid of points. The rectangle is defined using four numbers: min_x_limit, max_x_limit, min_y_limit, and max_y_limit. The grid of points is defined using the number of points along the x and y axes: npoints_x and npoints_y, and a bidimensional array of 2D doubles (i.e., the points in the range space).

File format
A text file can be used to define a Bilinear2D function. The format is as follows:

 min_x_limit:   [value]
 max_x_limit:   [value]
 min_y_limit:   [value]
 max_y_limit:   [value]
 npoints_x:     [r]
 npoints_y:     [s]
 [x_00],[y_00]  [x_01],[y_01] ... [x_0r],[y_0r]
 [x_10],[y_10]  [x_11],[y_11] ... [x_1r],[y_1r]
       .              .                 .
       .              .                 .
       .              .                 .
 [x_s0],[y_s0]  [x_s1],[y_s1] ... [x_sr],[y_sr]
 
Example:
 min_x_limit:   0
 max_x_limit:   50
 min_y_limit:   0
 max_y_limit:   50
 npoints_x:     5
 npoints_y:     5
 10,20  7.5,20    5,20  2.5,20   0,20
 10,15  7.5,15    5,15  2.5,15   0,15
 10,10  7.5,10    5,10  2.5,10   0,10
 10, 5  7.5, 5    5, 5  2.5, 5   0, 5
 10, 0  7.5, 0    5, 0  2.5, 0   0, 0
 

Copyright (c)1997 Georgia Tech Research Corporation

Version:
$Revision: 1.2 $
Author:
Juan Carlos Santamaria (carlos@cc.gatech.edu)
See Also:
FunctionApproximator

Variable Index

 o max_x_limit
Maximum value for the x variable in the domain space.
 o max_y_limit
Maximum value for the y variable in the domain space.
 o min_x_limit
Minimum value for the x variable in the domain space.
 o min_y_limit
Minimum value for the y variable in the domain space.
 o npoints_x
Number of grid points in the x axis.
 o npoints_y
Number of grid points in the y axis.
 o range_x
Range of the x variable in the domain space: (max_limit - min_limit).
 o range_y
Range of the y variable in the domain space: (max_limit - min_limit).
 o resolution_x
Resolution of the x axis: (max_limit - min_limit) / (npoints - 1)
 o resolution_y
Resolution of the y axis: (max_limit - min_limit) / (npoints - 1)
 o table
Grid of points.

Constructor Index

 o Bilinear2D(double, double, int, double, double, int, double[][][])
Create an instance of a Bilinear function approximator that maps points from a two-dimensional space (x,y) to another two-dimensional space (u,v).
 o Bilinear2D(String)
Loads the definition of a Bilinear2D function approximator from a file.

Method Index

 o query(double[])
Computes and returns the bilinear interpolation associated with the point.
 o query(int, int)
Computes and returns the bilinear interpolation associated with the point.
 o saveDefinition(String)
Save a definition of this instance in a file.
 o update(double[], double[])
Not implemented.

Variables

 o max_x_limit
 public final double max_x_limit
Maximum value for the x variable in the domain space.

 o min_x_limit
 public final double min_x_limit
Minimum value for the x variable in the domain space.

 o range_x
 public final double range_x
Range of the x variable in the domain space: (max_limit - min_limit).

 o npoints_x
 public final int npoints_x
Number of grid points in the x axis.

 o resolution_x
 public final double resolution_x
Resolution of the x axis: (max_limit - min_limit) / (npoints - 1)

 o max_y_limit
 public final double max_y_limit
Maximum value for the y variable in the domain space.

 o min_y_limit
 public final double min_y_limit
Minimum value for the y variable in the domain space.

 o range_y
 public final double range_y
Range of the y variable in the domain space: (max_limit - min_limit).

 o npoints_y
 public final int npoints_y
Number of grid points in the y axis.

 o resolution_y
 public final double resolution_y
Resolution of the y axis: (max_limit - min_limit) / (npoints - 1)

 o table
 protected double table[][][]
Grid of points.

Constructors

 o Bilinear2D
 public Bilinear2D(double min_x_limit,
                   double max_x_limit,
                   int npoints_x,
                   double min_y_limit,
                   double max_y_limit,
                   int npoints_y,
                   double table[][][])
Create an instance of a Bilinear function approximator that maps points from a two-dimensional space (x,y) to another two-dimensional space (u,v).

 o Bilinear2D
 public Bilinear2D(String filename) throws FunctionApproximatorException, IOException
Loads the definition of a Bilinear2D function approximator from a file.

Parameters:
filename - the file name.
Returns:
an instance of the Bilinear2D defined by the file.
Throws: IOException
if an I/O error occurs.
Throws: FunctionApproximatorException
if a parse error occurs.
See Also:
FunctionApproximator

Methods

 o saveDefinition
 public void saveDefinition(String filename) throws FunctionApproximatorException, IOException
Save a definition of this instance in a file.

Parameters:
filename - the file name.
Throws: IOException
if an I/O error occurs.
Throws: FunctionApproximatorException
if something wrong occurs.
Overrides:
saveDefinition in class FunctionApproximator
 o query
 public double[] query(double point[])
Computes and returns the bilinear interpolation associated with the point. The point is clipped to the domain rectangle.

Parameters:
point - the input point (two-dimensional array of doubles).
Returns:
the output point (two-dimensional array of doubles).
Overrides:
query in class FunctionApproximator
 o query
 public double[] query(int x,
                       int y)
Computes and returns the bilinear interpolation associated with the point. The point is clipped to the domain rectangle.

Parameters:
x - the x ordinate of the input point.
y - the y ordinate of the input point.
Returns:
the output point (two-dimensional array of doubles).
 o update
 public void update(double q[],
                    double p[]) throws FunctionApproximatorException
Not implemented.

Throws: FunctionApproximatorException
always.
Overrides:
update in class FunctionApproximator

All Packages  Class Hierarchy  This Package  Previous  Next  Index