|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector
org.strbio.math.DVectorSet
public class DVectorSet
A class to encapsulate a set of points, where each point is represented as a DVector. The minimum dimension of each DVector can be specified to ensure the set contains 2D, 3D data (although this can be circumvented by unscrupulous programs)
Version 1.1, 7/6/99 - added findNClosest Version 1.0, 4/16/99 - original version.
DVector,
Serialized Form| Field Summary |
|---|
| Fields inherited from class java.util.Vector |
|---|
capacityIncrement, elementCount, elementData |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
DVectorSet()
Create an empty set of points, with no minimum dimension |
|
DVectorSet(DMatrix y)
Create a set from a DMatrix, creating a new point for each row in the matrix. |
|
DVectorSet(DVectorSet y)
Create a set by copying another set, but not the DVectors in it. |
|
DVectorSet(int minimumDimension)
Create an empty set of points, with a particular minimum dimension. |
|
| Method Summary | |
|---|---|
void |
add(DVector q)
add in a single point to this set, without duplicating it. |
void |
add(DVectorSet q)
add in another set of DVectors, without duplicating them. |
void |
addFast(DVector q)
add in a single point, without checking dimensionality. |
void |
clear()
Delete all info on this set, but not the points themselves. |
IVector |
findNClosest(int n,
DVector v)
What are the indices of the N closest values to a DVector? |
DVector |
getDimension(int d)
get a DVector of returning the d'th coordinate for each point. |
double |
max(int d)
Get maximum value in dimension d (i.e. 0 = x, 1 = y) |
double |
min(int d)
Get minimum value in dimension d (i.e. 0 = x, 1 = y) |
int |
n()
How many DVectors are in the set? |
DVector |
p(int i)
short for point(i) |
DVector |
point(int i)
Return the i'th point in the set. |
void |
remove(DVector q)
Remove a DVector from the set. |
java.lang.Object |
remove(int i)
Remove DVector number i from the set, and return it. |
void |
setPointAt(int i,
DVector p)
set the i'th point in the set. |
void |
setPointAtFast(int i,
DVector p)
set the i'th point in the set. |
DMatrix |
toDMatrix()
Return the DVector set expressed as a matrix, with one row per point, and one column per dimension. |
| Methods inherited from class java.util.Vector |
|---|
add, add, addAll, addAll, addElement, capacity, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
iterator, listIterator, listIterator |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
iterator, listIterator, listIterator |
| Constructor Detail |
|---|
public DVectorSet()
public DVectorSet(int minimumDimension)
public DVectorSet(DVectorSet y)
public DVectorSet(DMatrix y)
| Method Detail |
|---|
public int n()
public DVector point(int i)
public void setPointAt(int i,
DVector p)
public void setPointAtFast(int i,
DVector p)
public DVector p(int i)
public DVector getDimension(int d)
public void clear()
clear in interface java.util.Collectionclear in interface java.util.Listclear in class java.util.Vectorpublic DMatrix toDMatrix()
public final void add(DVector q)
public final void addFast(DVector q)
public final void remove(DVector q)
public final java.lang.Object remove(int i)
remove in interface java.util.Listremove in class java.util.Vectorpublic final void add(DVectorSet q)
public final double min(int d)
public final double max(int d)
public final IVector findNClosest(int n,
DVector v)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||