public class LinEqSysSolver extends Object
Constructor and Description |
---|
LinEqSysSolver() |
Modifier and Type | Method and Description |
---|---|
static boolean |
gauss_debug(double[][] a,
double[] c,
double[] x,
int n,
double eps)
Same as the
gausss method, but prints extra debug information. |
static boolean |
gauss(double[][] a,
double[] c,
double[] x,
int n,
double eps)
Solves a linear equation system using the gaussian algorithm.
|
static boolean |
pivotize(double[][] a,
double[] c,
int k,
int n,
double eps)
Rearranges the matrix
a by swapping line k with a suitable pivot line k' . |
public static boolean gauss(double[][] a, double[] c, double[] x, int n, double eps) throws SingularMatrixException
a
- coefficient matrix [0..n-1][0..n-1] (left side of equation)c
- the constant vector [0..n-1] (right side of equation)x
- the result vector [0..n-1] (right side of equation)n
- number of coefficientseps
- the epsilon value, e.g. 1.0e-09SingularMatrixException
- if the matrix a
is singularpublic static boolean gauss_debug(double[][] a, double[] c, double[] x, int n, double eps)
gausss
method, but prints extra debug information.a
- coefficient matrix [0..n-1][0..n-1] (left side of equation)c
- the constant vector [0..n-1] (right side of equation)x
- the result vector [0..n-1] (right side of equation)n
- number of coefficientseps
- the epsilon value, e.g. 1.0e-09SingularMatrixException
- if the matrix a
is singulargauss(double[][], double[], double[], int, double)
public static boolean pivotize(double[][] a, double[] c, int k, int n, double eps)
a
by swapping line k
with a suitable pivot line k'
.a
- coefficient matrix [0..n-1][0..n-1] (left side of equation)c
- the constant vector [0..n-1] (right side of equation)k
- the current index of a diagonal element = current line and columnn
- matrix sizeeps
- the epsilon value, e.g. 1.0e-09SingularMatrixException
- if the matrix a
is singularCopyright © 2014–2017 European Space Agency (ESA). All rights reserved.