ocvolume.vq
Class point

java.lang.Object
  |
  +--ocvolume.vq.point
Direct Known Subclasses:
centroid

public class point
extends java.lang.Object

last updated on June 15, 2002
description: point class which stores coordinates in k-dimensional space
calls: none
called by: centroid, codebook
input: set of co-ordinates
output: none


Field Summary
protected  double[] coordinates
          k-dimensional coordinates array
protected  int dimension
          k-dimensions
 
Constructor Summary
point(double[] co)
          constructor to create a point with k-dimensional coordinates array
calls: none
called by: centroid, codebook
 
Method Summary
 void changeCo(double[] tCo)
          replace coordinates with new ones
calls: none
called by: centroid, codebook
static boolean equals(point p1, point p2)
          check whether two points are identical
calls: none
called by: centroid, codebook
 double[] getAllCo()
          get all the coordinates
calls: none
called by: codebook
 double getCo(int i)
          get coordinate at specific index
calls: none
called by: centroid, codebook
 int getDimension()
          get the k-dimensional space that the point is in
calls: none
called by: centroid, codebook
 void setCo(int i, double value)
          set coordinate at specific index
calls: none
called by: centroid, codebook
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

coordinates

protected double[] coordinates
k-dimensional coordinates array


dimension

protected int dimension
k-dimensions

Constructor Detail

point

public point(double[] co)
constructor to create a point with k-dimensional coordinates array
calls: none
called by: centroid, codebook

Parameters:
co - k-dimensional coordinates array
Method Detail

getAllCo

public double[] getAllCo()
get all the coordinates
calls: none
called by: codebook

Returns:
coordinates as a double array

getCo

public double getCo(int i)
get coordinate at specific index
calls: none
called by: centroid, codebook

Parameters:
i - index number
Returns:
coordinate at index i

setCo

public void setCo(int i,
                  double value)
set coordinate at specific index
calls: none
called by: centroid, codebook

Parameters:
i - index number
value - value of coordinate

changeCo

public void changeCo(double[] tCo)
replace coordinates with new ones
calls: none
called by: centroid, codebook

Parameters:
tCo - new coordinates array

getDimension

public int getDimension()
get the k-dimensional space that the point is in
calls: none
called by: centroid, codebook

Returns:
dimension

equals

public static boolean equals(point p1,
                             point p2)
check whether two points are identical
calls: none
called by: centroid, codebook

Parameters:
p1 - first point
p2 - second point
Returns:
true/false indicating whether two points are identical