|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ru.sscc.util.data.RealVectors | +--ru.sscc.util.data.FloatIRefVectors
An implementation of RealVectors
based on float[] vector
with indexing by int[] refence vector.
Fields inherited from class ru.sscc.util.data.RealVectors |
dimension,
size |
Constructor Summary | |
FloatIRefVectors(float[] vectors,
int[] ref,
int dimension)
Constructor. |
|
FloatIRefVectors(float[] vectors,
int[] ref,
int dimension,
int size)
Constructor. |
Method Summary | |
double |
add(int i,
int j,
double value)
Adds a value to j-th component of i-th vector and returns the result. |
void |
assign(RealPointer vector,
int i)
Assignment vector = "this i-th vector". |
BoundingBox |
boundingBox()
Calculates a minimal bounding box containing the vectors array. |
double |
get(int i,
int j)
Returns j-th componet of i-th vector. |
RealVector |
getComponent(int j)
Returns j-th component of all vectors as a RealVector . |
RealPointer |
getPointer(int i)
Returns a pointer to i-th vector (i is zero based index). |
RealVector |
getVector(int i)
Returns i-th data vector as a RealVector . |
boolean |
inBox(int i,
BoundingBox box)
Tests i-th vector to belong to a bounding box. |
double |
mul(int i,
int j,
double value)
Multiplies the j-th component of i-th vector by a value and returns the result. |
int |
offset(int i)
Returns offset of i-th vector in the vectors container. |
double |
set(int i,
int j,
double value)
Sets a value for j-th component of i-th vector and returns it. |
double |
squaredDistance(int index1,
RealPointer vec2)
Calculates the squared euqlidian distance between a vector stored in this object and another vector presented by a real pointer. |
Methods inherited from class ru.sscc.util.data.RealVectors |
by,
by,
calculateCenter,
ensureDimension,
ensureSize,
getPointers,
pos |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public FloatIRefVectors(float[] vectors, int[] ref, int dimension)
vectors
- a vectors' containerref
- a vectors' reference vectordimension
- a vector's dimensionpublic FloatIRefVectors(float[] vectors, int[] ref, int dimension, int size)
vectors
- a vectors' containerref
- a vectors' reference vectordimension
- a vector's dimensionsize
- a number of vectorsMethod Detail |
public double get(int i, int j)
public double set(int i, int j, double value)
public double add(int i, int j, double value)
public double mul(int i, int j, double value)
public RealVector getComponent(int j)
RealVector
.public RealPointer getPointer(int i)
next
operation.public RealVector getVector(int i)
RealVector
.public BoundingBox boundingBox()
public boolean inBox(int i, BoundingBox box)
i
- a vector's indexbox
- a bounding box for testpublic void assign(RealPointer vector, int i)
vector
- a pointer to the vectori
- an index of copied vector in this objectpublic int offset(int i)
public double squaredDistance(int index1, RealPointer vec2)
index1
- an index of the first vector in arrayvec2
- a pointer to the second vector
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |