public class IsVector
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
IsVector.SizeMismatch
This is the exception thrown when an operation is performed on
two vectors with different sizes.
|
static class |
IsVector.VectorAccessException
This is the exception thrown when any invalid access to a
Vector instance is detected. |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
equal(Vector v1,
Vector v2,
double epsilon)
Check the equality of two vectors up to a precision.
|
static void |
throwIfInvalidIndex(Vector v,
int index)
Check if an index is a valid index.
|
static void |
throwIfNotEqualSize(Vector v1,
Vector v2)
Check if the input vectors have the same size.
|
public static void throwIfNotEqualSize(Vector v1, Vector v2)
v1 - a vectorv2 - a vectorIsVector.SizeMismatch - if sizes do not matchpublic static void throwIfInvalidIndex(Vector v, int index)
v - a vectorindex - a vector indexIsVector.VectorAccessException - if the index is invalidpublic static boolean equal(Vector v1, Vector v2, double epsilon)
v1 - a vectorv2 - another vectorepsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0true if all entries are equal, entry by entry