|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mines.jtk.opt.ArrayVect2f
public class ArrayVect2f
Implement a Vect as a two dimensional array of floats. The second dimension can be of variable lengths. 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 in java 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 each sample |
| Constructor Summary | |
|---|---|
protected |
ArrayVect2f()
To be used with init() |
|
ArrayVect2f(float[][] data,
double variance)
Wrap an array as a Vect. |
|
ArrayVect2f(float[][] data,
int[] firstSample,
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. |
ArrayVect2f |
clone()
|
void |
constrain()
Optionally apply a hard constraint (such as an inequality) to the current vector. |
void |
dataChanged()
Call this method when there has been any external change to data returned by getData(). |
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 |
protected void |
init(float[][] data,
int[] firstSample,
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 ArrayVect2f(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 ArrayVect2f(float[][] data,
int[] firstSample,
double variance)
data - This will be assigned to the public data.firstSample - First non-zero sample of each trace.variance - This variance will be used to divide data in
multiplyInverseCovariance.protected ArrayVect2f()
| Method Detail |
|---|
protected void init(float[][] data,
int[] firstSample,
double variance)
data - This will be assigned to the public data.firstSample - First non-zero sample of each trace.variance - This variance will be used to divide data in
multiplyInverseCovariance.public float[][] getData()
public void dataChanged()
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 ArrayVect2f 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 | |||||||||