Algorithm
Development Kit 1.0

algs.model
Interface IMultiPoint

All Known Implementing Classes:
Hyperpoint, TwoDPoint

public interface IMultiPoint

A multi-dimensional point has a set of coordinates in d-dimensional space.

This interface is the d-dimensional counterpart to IPoint. Indeed the classes which implement IPoint should also implement IMultiPoint to enable two-dimensional data to be processed in the same way that d-dimensional data can be.

Since:
1.0
Version:
1.0, 6/15/08
Author:
George Heineman

Method Summary
 int dimensionality()
          Return the dimensionality of this point.
 double distance(IMultiPoint imp)
          Return the Euclidean distance between the given IMultiPoint object.
 double getCoordinate(int dx)
          Return the coordinate value in the given dimension for the given point.
 double[] raw()
          For optimizing computations, return double[] coordinates.
 

Method Detail

dimensionality

int dimensionality()
Return the dimensionality of this point.


getCoordinate

double getCoordinate(int dx)
Return the coordinate value in the given dimension for the given point.

Parameters:
dx - the dimension 1 ≤ dx ≤ dimensionality() for the desired coordinate.

distance

double distance(IMultiPoint imp)
Return the Euclidean distance between the given IMultiPoint object.

Parameters:
imp - other IMultiPoint to which we want to compute the Euclidean distance.

raw

double[] raw()
For optimizing computations, return double[] coordinates.


Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.