public final class M5Matrix
extends java.lang.Object
Constructor and Description |
---|
M5Matrix(int nr,
int nc)
Constructs a matrix
|
Modifier and Type | Method and Description |
---|---|
void |
lubksb(int n,
int[] indx,
double[] b)
LU backward substitution
|
int[] |
ludcmp(int n,
int[] indx)
LU decomposition
|
M5Matrix |
multiply(M5Matrix b,
int l,
int m,
int n)
Reurns the multiplication of two matrices
|
double[] |
regression(M5Matrix y,
int n,
int m)
Linear regression
|
java.lang.String |
toString(int nrl,
int nrh,
int ncl,
int nch)
Converts a matrix to a string
|
M5Matrix |
transpose(int n,
int m)
Returns the transpose of a matrix [0:n-1][0:m-1]
|
public M5Matrix(int nr, int nc)
nr
- the number of the rowsnc
- the number of the columnspublic final java.lang.String toString(int nrl, int nrh, int ncl, int nch)
nrl
- the smallest index of the rowsnrh
- the largest index of the rowsncl
- the smallest index of the columnnch
- the largest index of the columnpublic final M5Matrix transpose(int n, int m)
n
- the number of rowsm
- the number of columnspublic final M5Matrix multiply(M5Matrix b, int l, int m, int n)
b
- the multiplication matrixl
- the number of the rows of the instance matrixm
- the number of the columns of the instance matrix, and the number of the rows of matrix bn
- the number of the columns of matrix bpublic final double[] regression(M5Matrix y, int n, int m)
y
- the dependent variable vectorn
- the number of the observationsm
- the number of the coefficientspublic final void lubksb(int n, int[] indx, double[] b)
n
- the number of the coefficientsindx
- the indexb
- the double vector, storing constant terms in the equation sets; it later stores the computed coefficients' valuespublic final int[] ludcmp(int n, int[] indx)
n
- the number of coefficientsindx
- the index