numal.highprecision
Class Linear_algebra
java.lang.Object
numal.highprecision.Linear_algebra
public class Linear_algebra
- extends Object
Method Summary |
static void |
hshreabid(double[][] a,
int m,
int n,
double[] d,
double[] b,
double[] em)
Reduces an m x n matrix a to a bidiagonal form B. |
static void |
pretfmmat(double[][] a,
int m,
int n,
double[] d)
|
static void |
psttfmmat(double[][] a,
int n,
double[][] v,
double[] b)
|
static int |
qrisngvaldec(double[][] a,
int m,
int n,
double[] val,
double[][] v,
double[] em)
Calculates the singular value decomposition UDV^T of a given matrix A. |
static int |
qrisngvaldecbid(double[] d,
double[] b,
int m,
int n,
double[][] u,
double[][] v,
double[] em)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Linear_algebra
public Linear_algebra()
qrisngvaldec
public static int qrisngvaldec(double[][] a,
int m,
int n,
double[] val,
double[][] v,
double[] em)
- Calculates the singular value decomposition UDV^T of a given matrix A.
The matrix is first transformed to bidiagonal form by calling
hshreabid(double[][], int, int, double[], double[], double[])
, the two
transforming matrices are calculated by calling psttfmmat(double[][], int, double[][], double[])
and pretfmmat(double[][], int, int, double[])
,
and finally the singular value decomposition is calculated by qrisngvaldecbid(double[], double[], int, int, double[][], double[][], double[])
.
Dependencies:
hshreabid(double[][], int, int, double[], double[], double[])
,
psttfmmat(double[][], int, double[][], double[])
,
pretfmmat(double[][], int, int, double[])
,
qrisngvaldecbid(double[], double[], int, int, double[][], double[][], double[])
.
- input:
- em[0] : the machine precision
- em[2] : the relative precision in the singular values
- em[4] : the maximal number of iterations to be performed
- em[6] : the minimal nonneglectable singular value
- output:
- em[1] : the infinity norm of the matrix
- em[3] : the maximal neglected superdiagonal element
- em[5] : the number of iterations performed
- em[7] : the numerical rank of the matrix; i.e. the number of singular values greater than or equal to em[6]
- Parameters:
a
- input: the given mxn matrix output: the matrix U in the singular value decomposition UDV^Tm
- the number of rows of the matrix an
- the number of columns of a, precondition: n ≤ mval
- output: the singular values 1 to nv
- output: the transpose of matrix V in the singular value decompositionem
- input and output arameters mentioned in the list above
- Returns:
- number of singular values not found, i.e., a number not equal to zero if the number of iterations exceeds em[4]
hshreabid
public static void hshreabid(double[][] a,
int m,
int n,
double[] d,
double[] b,
double[] em)
- Reduces an m x n matrix a to a bidiagonal form B.
Method originally from class numal.LinearAlgebra - Lau (2004)
section 3.12.1.A Other transformations : To bidiagonal form - real matrices p.212.
Dependencies: tammat, mattam, elmcol, elmrow
- Parameters:
a
- input: m by n matrix output: data concerning the premultiplying and postmultiplying matricesm
- number of rowsn
- number of columnsd
- output: vector of the diagonal of the bidiagonal matrix Bb
- output: vector of the super diagonal of the bidiagonal matrix Bem
- output:
psttfmmat
public static void psttfmmat(double[][] a,
int n,
double[][] v,
double[] b)
pretfmmat
public static void pretfmmat(double[][] a,
int m,
int n,
double[] d)
qrisngvaldecbid
public static int qrisngvaldecbid(double[] d,
double[] b,
int m,
int n,
double[][] u,
double[][] v,
double[] em)