public class ScalarVect extends java.lang.Object implements Vect
Modifier and Type | Field and Description |
---|---|
protected double |
_value
wrapped data
|
protected double |
_variance
variance for value
|
Modifier | Constructor and Description |
---|---|
protected |
ScalarVect()
To be used with init()
|
|
ScalarVect(double value,
double variance)
Specify the initial value
|
Modifier and Type | Method and Description |
---|---|
void |
add(double scaleThis,
double scaleOther,
VectConst other)
Add a scaled version of another vector to a scaled version of this
vector.
|
ScalarVect |
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).
|
double |
get()
Get the value of the scalar.
|
void |
init(double value,
double variance)
Initialize the 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.
|
void |
set(double value)
Set the value of the scalar.
|
java.lang.String |
toString() |
protected transient double _value
protected transient double _variance
public ScalarVect(double value, double variance)
value
- The initial value of the wrapped scalarvariance
- The method multiplyInverseCovariance()
will divide the scalar by this number.
Pass a value of 1 if you do not care.protected ScalarVect()
public final void init(double value, double variance)
value
- The initial value of the wrapped scalar .variance
- The method multiplyInverseCovariance()
will divide the scalar by this number.
Pass a value of 1 if you do not care.public double get()
public void set(double value)
value
- The new value of the wrapped scalar.public ScalarVect clone()
public double dot(VectConst other)
VectConst
public java.lang.String toString()
toString
in class java.lang.Object
public void dispose()
Vect
public void multiplyInverseCovariance()
Vect
multiplyInverseCovariance
in interface Vect
public void constrain()
Vect
public void postCondition()
Vect
postCondition
in interface Vect
public void add(double scaleThis, double scaleOther, VectConst other)
Vect
public void project(double scaleThis, double scaleOther, VectConst other)
Vect
public double magnitude()
VectConst
Vect vect = (Vect) this.clone(); vect.multiplyInverseCovariance(); return this.dot(vect);But you can usually avoid the clone.