|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.lgc.wsh.opt.VectUtil
public class VectUtil
Implements convenience methods for Vect.
| Field Summary | |
|---|---|
(package private) static Almost |
ALMOST_DOT
|
| Constructor Summary | |
|---|---|
VectUtil()
|
|
| Method Summary | |
|---|---|
static boolean |
areSame(VectConst v1,
VectConst v2)
See if two vectors are the same. |
static Vect |
cloneZero(VectConst v)
Clone a vector and initialized to zero, so that out.dot(out) == 0. |
static void |
copy(Vect to,
VectConst from)
Copy the state of one vector onto another. |
static int |
getTransposePrecision(VectConst data,
VectConst model,
LinearTransform transform)
Return the number of significant digits in the dot product when calculated with and without the transpose. |
static int |
getTransposePrecision(VectConst data,
VectConst model,
Transform transform)
Return the number of significant digits in the dot product when calculated with and without the transpose. |
static void |
scale(Vect v,
double scalar)
Scale a vector by a scalar constant. |
static void |
test(VectConst vect)
Exercise all methods of Vect. |
static void |
zero(Vect v)
Set the magnitude of this vector to zero, so that this.dot(this) == 0. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final Almost ALMOST_DOT
| Constructor Detail |
|---|
public VectUtil()
| Method Detail |
|---|
public static void scale(Vect v,
double scalar)
v - Vector to scale.scalar - Factor to scale the vector.public static void zero(Vect v)
v - Vector to zero
public static void copy(Vect to,
VectConst from)
to - Vector whose state should be initialized
with the state of from.from - Vector whose state should be copied.public static Vect cloneZero(VectConst v)
v - Vect to clone
public static boolean areSame(VectConst v1,
VectConst v2)
v1 - First vectorv2 - Second vector
public static void test(VectConst vect)
vect - An instance of a Vect to test.
Should be initialized to random non-zero values.
A vector of zero magnitude will fail.
public static int getTransposePrecision(VectConst data,
VectConst model,
LinearTransform transform)
data - Nonzero sample datamodel - A nonzero sample model.transform - The transform to test.
public static int getTransposePrecision(VectConst data,
VectConst model,
Transform transform)
data - Nonzero sample datamodel - A nonzero sample model.transform - The transform to test.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||