|
Algorithm Development Kit 1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectalgs.model.nd.Hyperpoint
public class Hyperpoint
Standard d-dimensional implementation of IMultiPoint.
IMultiPoint
Constructor Summary | |
---|---|
Hyperpoint(double[] vals)
Construct when given a raw array of double values |
|
Hyperpoint(IMultiPoint pt)
Construct when given an IMultiPoint. |
|
Hyperpoint(java.lang.String s)
Construct Hyperpoint when given a comma-separated string of doubles. |
Method Summary | |
---|---|
int |
dimensionality()
Return the dimensionality of this point. |
double |
distance(IMultiPoint imp)
Return the Euclidean distance between the given IMultiPoint. |
boolean |
equals(java.lang.Object o)
Supports the equals checking of IMultiPoint objects. |
double |
getCoordinate(int d)
All coordinates are 1-based. |
int |
hashCode()
Reasonable hash code. |
double[] |
raw()
Return copy of points for safe implementation. |
java.lang.String |
toString()
Reasonable toString() implementation. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Hyperpoint(IMultiPoint pt)
pt
- multi-dimensional point from which values are taken.public Hyperpoint(double[] vals)
vals
- array of size d containing double coordinates.public Hyperpoint(java.lang.String s)
The number of dimensions in the resulting Hyperpoint is based on the number of values in the string.
s
- String formed from a comma-separated set of doubles.Method Detail |
---|
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- object to be compared against.public java.lang.String toString()
toString
in class java.lang.Object
public int dimensionality()
IMultiPoint
dimensionality
in interface IMultiPoint
IMultiPoint.dimensionality()
public double getCoordinate(int d)
getCoordinate
in interface IMultiPoint
d
- the dimension 1 ≤ dx ≤ dimensionality() for the desired coordinate.IMultiPoint.getCoordinate(int)
public double distance(IMultiPoint imp)
Optimized for two Hyperpoint objects, but works with any IMultiPoint
distance
in interface IMultiPoint
imp
- compute n-dimensional distance to this point.public int hashCode()
hashCode
in class java.lang.Object
public double[] raw()
raw
in interface IMultiPoint
|
Algorithm Development Kit 1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |