java.lang.Object
org.flag4j.linalg.VectorNorms
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
norm
(double... src) Computes the 2-norm of a vector.static double
norm
(double[] src, double p) Computes thep
-norm of a vector.static double
norm
(Complex128... src) Deprecated.static double
norm
(Complex128[] src, double p) Deprecated.static double
Computes the 2-norm of a vector.static double
Computes thep
-norm of a vector.static double
Deprecated.static double
Deprecated.static <T extends Field<T>>
doublenorm
(FieldVector<T> src) Computes the 2-norm of this vector.static <T extends Field<T>>
doublenorm
(FieldVector<T> src, double p) Computes the p-norm of this vector.static double
Computes the 2-norm of this vector.static double
Computes the p-norm of this vector.static double
norm
(CooCVector src) Computes the 2-norm of this vector.static double
norm
(CooCVector src, double p) Computes the p-norm of this vector.static double
Computes the 2-norm of this vector.static double
Computes the p-norm of this vector.
-
Constructor Details
-
VectorNorms
private VectorNorms()
-
-
Method Details
-
norm
Computes the 2-norm of this vector. This is equivalent tonorm(src, 2)
.- Parameters:
src
- Vector to compute norm of.- Returns:
- the 2-norm of this vector.
-
norm
Computes the p-norm of this vector.- Parameters:
src
- Vector to compute norm of.p
- The p value in the p-norm.
- If p is inf, then this method computes the maximum/infinite norm.- Returns:
- The p-norm of this vector.
- Throws:
IllegalArgumentException
- If p is less than 1.
-
norm
-
norm
Computes the p-norm of this vector.- Parameters:
src
- Vector to compute norm of.p
- The p value in the p-norm.
- If p is inf, then this method computes the maximum/infinite norm.- Returns:
- The p-norm of this vector.
- Throws:
IllegalArgumentException
- If p is less than 1.
-
norm
Deprecated.Computes the 2-norm of this vector. This is equivalent tonorm(2)
.- Returns:
- the 2-norm of this vector.
-
norm
Deprecated.Computes the p-norm of this vector. Warning, if p is large in absolute value, overflow issues may occur.- Parameters:
p
- The p value in the p-norm.
- If p isDouble.POSITIVE_INFINITY
, then this method computes the maximum/infinite norm.
- If p isDouble.NEGATIVE_INFINITY
, then this method computes the minimum norm.- Returns:
- The p-norm of this vector.
-
norm
Computes the 2-norm of this vector. This is equivalent tonorm(2)
.- Returns:
- the 2-norm of this vector.
-
norm
Computes the p-norm of this vector. Warning, if p is large in absolute value, overflow issues may occur.- Parameters:
p
- Thep
value in the p-norm:- If
p
isDouble.POSITIVE_INFINITY
, then this method computes the maximum/infinite norm. - If
p
isDouble.NEGATIVE_INFINITY
, then this method computes the minimum norm.
- If
- Returns:
- The p-norm of this vector.
-
norm
Computes the 2-norm of this vector. This is equivalent tonorm(src, 2)
.- Parameters:
src
- Vector to compute norm of.- Returns:
- the 2-norm of this vector.
-
norm
Computes the p-norm of this vector.- Parameters:
src
- Vector to compute norm of.p
- The p value in the p-norm.
- If p is inf, then this method computes the maximum/infinite norm.- Returns:
- The p-norm of this vector.
- Throws:
IllegalArgumentException
- If p is less than 1.
-
norm
public static double norm(double... src) Computes the 2-norm of a vector.- Parameters:
src
- Entries of the vector (or non-zero entries if vector is sparse).- Returns:
- The 2-norm of the vector.
-
norm
Deprecated.Computes the 2-norm of a vector.- Parameters:
src
- Entries of the vector (or non-zero entries if vector is sparse).- Returns:
- The 2-norm of the vector.
-
norm
Computes the 2-norm of a vector.- Parameters:
src
- Entries of the vector (or non-zero entries if vector is sparse).- Returns:
- The 2-norm of the vector.
-
norm
public static double norm(double[] src, double p) Computes thep
-norm of a vector.- Parameters:
src
- Entries of the vector (or non-zero entries if vector is sparse).p
- Thep
value in thep
-norm:- If
p
isDouble.POSITIVE_INFINITY
, then this method computes the maximum/infinite norm. - If
p
isDouble.NEGATIVE_INFINITY
, then this method computes the minimum norm.
Warning, if
p
is very large in absolute value, overflow errors may occur.- If
- Returns:
- The
p
-norm of the vector.
-
norm
Deprecated.Computes thep
-norm of a vector.- Parameters:
src
- Entries of the vector (or non-zero entries if vector is sparse).p
- Thep
value in thep
-norm.
- Ifp
isDouble.POSITIVE_INFINITY
, then this method computes the maximum/infinite norm.
- Ifp
isDouble.NEGATIVE_INFINITY
, then this method computes the minimum norm.
Warning, ifp
is large in absolute value, overflow errors may occur.- Returns:
- The
p
-norm of the vector.
-
norm
Computes thep
-norm of a vector.- Parameters:
src
- Entries of the vector (or non-zero entries if vector is sparse).p
- Thep
value in thep
-norm.
- Ifp
isDouble.POSITIVE_INFINITY
, then this method computes the maximum/infinite norm.
- Ifp
isDouble.NEGATIVE_INFINITY
, then this method computes the minimum norm.
Warning, ifp
is large in absolute value, overflow errors may occur.- Returns:
- The
p
-norm of the vector.
-