public class VectMap extends java.lang.Object implements VectContainer
Constructor and Description |
---|
VectMap(boolean cloneContents)
Specify whether contents are copied or not.
|
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.
|
VectMap |
clone() |
void |
constrain()
Optionally apply a hard constraint (such as an inequality)
to the current vector.
|
boolean |
containsKey(int index)
Returns true if this container has a vect for the specified index.
|
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).
|
Vect |
get(int index)
Get a vect for the specified index.
|
int[] |
getKeys()
Return a set of all indices that have been assigned to a value.
|
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 |
put(int index,
Vect vect)
Save a vect for the specified index.
|
int |
size()
Returns the number of unique indices in this container.
|
public VectMap(boolean cloneContents)
cloneContents
- If true, all put and get
methods will clone the passed Vect.public void put(int index, Vect vect)
VectContainer
put
in interface VectContainer
index
- A unique integer for the requested vect.
Integers need not be consecutive. Use any valid integer.vect
- Vect for specified index.public Vect get(int index)
VectContainer
get
in interface VectContainer
index
- A unique integer for the requested vect.
Integers need not be consecutive.public int size()
VectContainer
size
in interface VectContainer
public boolean containsKey(int index)
VectContainer
containsKey
in interface VectContainer
index
- Check for a Vect with this index.public final int[] getKeys()
VectContainer
getKeys
in interface VectContainer
public double dot(VectConst other)
VectConst
public VectMap clone()
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.