Modifier and Type | Method and Description |
---|---|
static double |
checkedNorm(double norm)
Throws an
IllegalArgumentException if the given norm value
is not real (ie, not NaN or infinite) or zero. |
static double |
checkedNorm(Vector<?> vec)
Returns the vector's norm value, throwing an
IllegalArgumentException if the value
is not real (ie, not NaN or infinite) or zero. |
static IllegalArgumentException |
illegalNorm(double norm)
Return an exception indicating an illegal norm value.
|
static boolean |
isRealNonZero(double value)
Returns true if the given value is real (ie, not NaN or infinite)
and not equal to zero.
|
static double |
linearCombination(double a1,
double b1,
double a2,
double b2)
Compute the linear combination \(a_1 b_1 + a_2 b_2 \) with high accuracy.
|
static double |
linearCombination(double a1,
double b1,
double a2,
double b2,
double a3,
double b3)
Compute the linear combination \(a_1 b_1 + a_2 b_2 + a_3 b_3 \) with high accuracy.
|
static double |
norm(double x)
Get the L2 norm (commonly known as the Euclidean norm) for the vector
with the given components.
|
static double |
norm(double x1,
double x2)
Get the L2 norm (commonly known as the Euclidean norm) for the vector
with the given components.
|
static double |
norm(double x1,
double x2,
double x3)
Get the L2 norm (commonly known as the Euclidean norm) for the vector
with the given components.
|
static double |
normSq(double x)
Get the square of the L2 norm (also known as the Euclidean norm)
for the vector with the given components.
|
static double |
normSq(double x1,
double x2)
Get the square of the L2 norm (also known as the Euclidean norm)
for the vector with the given components.
|
static double |
normSq(double x1,
double x2,
double x3)
Get the square of the L2 norm (also known as the Euclidean norm)
for the vector with the given components.
|
public static boolean isRealNonZero(double value)
value
- the value to testvalue
is not NaN, infinite, or zero; otherwise
falsepublic static double checkedNorm(double norm)
IllegalArgumentException
if the given norm value
is not real (ie, not NaN or infinite) or zero. The argument is returned
to allow this method to be called inline.norm
- vector norm valueIllegalArgumentException
- if the given norm value is NaN, infinite,
or zeropublic static double checkedNorm(Vector<?> vec)
IllegalArgumentException
if the value
is not real (ie, not NaN or infinite) or zero.vec
- vector to obtain the real, non-zero norm ofIllegalArgumentException
- if the vector norm value is NaN, infinite,
or zeropublic static IllegalArgumentException illegalNorm(double norm)
norm
- illegal norm valuepublic static double norm(double x)
x
- vector componentpublic static double norm(double x1, double x2)
x1
- first vector componentx2
- second vector componentpublic static double norm(double x1, double x2, double x3)
x1
- first vector componentx2
- second vector componentx3
- third vector componentpublic static double normSq(double x)
x
- vector componentnorm(double)
public static double normSq(double x1, double x2)
x1
- first vector componentx2
- second vector componentnorm(double, double)
public static double normSq(double x1, double x2, double x3)
x1
- first vector componentx2
- second vector componentx3
- third vector componentnorm(double, double, double)
public static double linearCombination(double a1, double b1, double a2, double b2)
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the seconf termSum
public static double linearCombination(double a1, double b1, double a2, double b2, double a3, double b3)
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the seconf terma3
- first factor of the third termb3
- second factor of the third termSum
Copyright © 2016–2021 The Apache Software Foundation. All rights reserved.