numal.highprecision
Class Linear_algebra

java.lang.Object
  extended by numal.highprecision.Linear_algebra

public class Linear_algebra
extends Object


Constructor Summary
Linear_algebra()
           
 
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
 

Constructor Detail

Linear_algebra

public Linear_algebra()
Method Detail

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[]).

Parameters:
a - input: the given mxn matrix output: the matrix U in the singular value decomposition UDV^T
m - the number of rows of the matrix a
n - the number of columns of a, precondition: n ≤ m
val - output: the singular values 1 to n
v - output: the transpose of matrix V in the singular value decomposition
em - 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 matrices
m - number of rows
n - number of columns
d - output: vector of the diagonal of the bidiagonal matrix B
b - output: vector of the super diagonal of the bidiagonal matrix B
em - 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)