public class VectUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
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.
|
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 zeropublic 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 clonepublic static boolean areSame(VectConst v1, VectConst v2)
v1
- First vectorv2
- Second vectorpublic 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.