|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mines.jtk.opt.ArrayVect3f
public class ArrayVect3f
Implement a Vect as a three-dimensional array of floats. The embedded data are exposed by a getData method. For all practical purposes this member is public, except that this class must always point to the same array. The implementation as an array is the point of this class, to avoid duplicate implementations elsewhere. Multiple inheritance is prohibited and prevents the mixin pattern, but you can share the wrapped array as a private member of your own class, and easily delegate all implemented methods.
| Field Summary | |
|---|---|
protected float[][][] |
_data
wrapped data |
protected double |
_variance
variance for all samples |
| Constructor Summary | |
|---|---|
protected |
ArrayVect3f()
To be used with init() |
|
ArrayVect3f(float[][][] data,
double variance)
Wrap an array as a Vect. |
| Method Summary | |
|---|---|
void |
add(double scaleThis,
double scaleOther,
VectConst other)
Add a scaled version of another vector to a scaled version of this vector. |
ArrayVect3f |
clone()
|
void |
constrain()
Optionally apply a hard constraint (such as an inequality) to the current vector. |
void |
dispose()
Optionally free any resources held by this object. |
double |
dot(VectConst other)
Return the Cartesian dot product of this vector with another vector (not including any inverse covariance). |
float[][][] |
getData()
Get the embedded data. |
int |
getSize()
Return the size of the embedded array |
double |
getVariance()
Get the value of the variance passed to the constructor. |
protected void |
init(float[][][] data,
double variance)
Wrap an array as a Vect. |
double |
magnitude()
This is the dot product of the vector with itself premultiplied by the inverse covariance. |
void |
multiplyInverseCovariance()
Optionally multiply a vector by the inverse covariance matrix. |
void |
postCondition()
Apply a linear filter that enhances components that should be optimized first, and suppresses components of lesser importance. |
void |
project(double scaleThis,
double scaleOther,
VectConst other)
Project another vector onto the space of this vector, then scale, and add to a scaled version of this vector. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected float[][][] _data
protected double _variance
| Constructor Detail |
|---|
public ArrayVect3f(float[][][] data,
double variance)
data - This will be assigned to the public data.variance - This variance will be used to divide data in
multiplyInverseCovariance.protected ArrayVect3f()
| Method Detail |
|---|
public double getVariance()
protected void init(float[][][] data,
double variance)
data - This will be assigned to the public data.variance - This variance will be used to divide data in
multiplyInverseCovariance.public float[][][] getData()
public int getSize()
public void add(double scaleThis,
double scaleOther,
VectConst other)
Vect
add in interface VectscaleThis - Multiply this vector by this scalar before adding.scaleOther - Multiply the other vector by this scalar before adding.other - The other vector to be multiplied.
public void project(double scaleThis,
double scaleOther,
VectConst other)
Vect
project in interface VectscaleThis - Multiply this vector by this scalar before adding.scaleOther - Multiply the other vector by this scalar before adding.other - The other vector to be projected, scaled, and added.public void dispose()
Vect
dispose in interface Vectpublic void multiplyInverseCovariance()
Vect
multiplyInverseCovariance in interface Vectpublic double magnitude()
VectConst
Vect vect = (Vect) this.clone();
vect.multiplyInverseCovariance();
return this.dot(vect);
But you can usually avoid the clone.
magnitude in interface VectConstpublic void constrain()
Vect
constrain in interface Vectpublic void postCondition()
Vect
postCondition in interface Vectpublic ArrayVect3f clone()
clone in interface Vectclone in interface VectConstclone in class java.lang.Objectpublic double dot(VectConst other)
VectConst
dot in interface VectConstother - The vector to be dotted.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||