|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.hogent.tarsos.lsh.Vector
public class Vector
An Vector contains a vector of 'dimension' values. It serves as the main data structure that is stored and retrieved. It also has an identifier (key).
Constructor Summary | |
---|---|
Vector(int dimensions)
Creates a new vector with the requested number of dimensions. |
|
Vector(Vector other)
Copy constructor. |
Method Summary | |
---|---|
double |
dot(Vector other)
Calculates the dot product, or scalar product, of this vector with the other vector. |
double |
get(int dimension)
Returns the value at the requested dimension. |
int |
getDimensions()
|
java.lang.String |
getKey()
|
void |
moveSlightly(double radius)
Moves the vector slightly, adds a value selected from -radius to +radius to each element. |
void |
set(int dimension,
double value)
Set a value at a certain dimension d. |
void |
setKey(java.lang.String key)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Vector(int dimensions)
dimensions
- The number of dimensions.public Vector(Vector other)
other
- The other vector.Method Detail |
---|
public void moveSlightly(double radius)
radius
- The radius determines the amount to change the vector.public void set(int dimension, double value)
dimension
- The dimension, index for the value.value
- The value to set.public double get(int dimension)
dimension
- The dimension, index for the value.
public int getDimensions()
public double dot(Vector other)
other
- The other vector, should have the same number of dimensions.
public void setKey(java.lang.String key)
public java.lang.String getKey()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |