public final class Utils extends Object
| Modifier and Type | Method and Description |
|---|---|
static double |
calculateScaledResidual(RealMatrix a,
RealMatrix x,
RealMatrix b)
Calculate the scaled residual
||Ax-b||_oo/( ||A||_oo . |
static double |
calculateScaledResidual(RealMatrix a,
RealVector x,
RealVector b)
Calculate the scaled residual
||Ax-b||_oo/( ||A||_oo . |
static double |
getDoubleMachineEpsilon()
The smallest positive (epsilon) such that 1.0 + epsilon !
|
static double |
max(double a,
double b)
Returns max(a, b) or NaN if one value is a NaN.
|
static double |
min(double a,
double b)
Returns min(a, b) or NaN if one value is a NaN.
|
static RealMatrix |
randomValuesMatrix(int rows,
int cols,
double min,
double max,
Long seed)
Returns matrix filled with random values.
|
static RealMatrix |
randomValuesPositiveMatrix(int rows,
int cols,
double min,
double max,
Long seed)
Returns matrix filled with random positive values.
|
static double[] |
replaceValues(double[] v,
double oldValue,
double newValue)
Return a new array with all the occurrences of oldValue replaced by
newValue.
|
public static final double getDoubleMachineEpsilon()
public static double calculateScaledResidual(RealMatrix a, RealMatrix x, RealMatrix b)
a - A matrixx - X matrixb - B matrixpublic static double calculateScaledResidual(RealMatrix a, RealVector x, RealVector b)
a - A matrixx - X matrixb - B matrixpublic static RealMatrix randomValuesMatrix(int rows, int cols, double min, double max, Long seed)
rows - number of rowscols - number of columnsmin - minmax - maxseed - seedpublic static RealMatrix randomValuesPositiveMatrix(int rows, int cols, double min, double max, Long seed)
rows - number of rowscols - number of columnsmin - minmax - maxseed - seedpublic static final double[] replaceValues(double[] v,
double oldValue,
double newValue)
v - arrayoldValue - old valuenewValue - new valuepublic static double max(double a,
double b)
a - ab - bpublic static double min(double a,
double b)
a - ab - bCopyright © 2025 CNES. All rights reserved.