class Handbook
extends java.lang.Object
@Book{LinearAlgebraHandbook, author = {J.H. Wilkinson and C. Reinsch}, title = {Handbook for Automatic Computation}, publisher = {Springer-Verlag}, address = {New York}, year = {1971}, volume = {II: Linear Algebra} }
Constructor and Description |
---|
Handbook() |
Modifier and Type | Method and Description |
---|---|
private static double |
abs(double x)
A synonym for
Math.abs(double) |
protected static void |
balance(double[][] a,
int[] lohi,
double[] d,
int n,
int b)
Reduce the norm of a[0:n-1][0:n-1] by exact diagonal similarity
transformations stored in d[0:n-1].
|
private static <RE extends IRingElement<RE>> |
check_complex(RE value) |
private static <RE extends IRingElement<RE>> |
check_complex(Vector<RE> v) |
private static <RE extends IRingElement<RE>> |
check_double(Matrix<RE> matrix) |
private static <RE extends IRingElement<RE>> |
check_double(RE value) |
private static <RE extends IRingElement<RE>> |
check_double(Vector<RE> v) |
private static <RE extends IRingElement<RE>> |
check_type(RE value,
IRingElement<?> check,
java.lang.String name)
test whether two instances have the same type.
|
static <RE extends IRingElement<RE>> |
complexValues(Vector<RE> theVector)
Returns a 2xN array containing the real and imaginary components of a
complex vector of length N.
|
static <RE extends IRingElement<RE>> |
doubleValue(Matrix<RE> a,
int i,
int j)
Returns the I,Jth double-precision floating-point value in a Matrix.
|
static <RE extends IRingElement<RE>> |
doubleValue(RE d)
Returns the double-precision floating-point value in a RingElement.
|
static <RE extends IRingElement<RE>> |
doubleValue(Vector<RE> x,
int i)
Returns the Ith double-precision floating-point value in a Vector.
|
static <RE extends IRingElement<RE>> |
doubleValues(Matrix<RE> matrix) |
static <RE extends IRingElement<RE>> |
eig(Matrix<RE> matrix)
Returns a complex vector containing the eigenvalues of a given matrix.
|
protected static void |
elmhes(double[][] a,
int[] iint,
int n,
int k,
int l)
Given the unsymmetric matrix A, stored in the array
a[0:n-1,0:n-1] , this procedure reduces the sub-matrix of
order l-k+1, which starts at the element a[k-1][k-1], and finishes at the
element a[l-1][l-1], to Hessenberg form H, by non-orthogonal elementary
transformations. |
private static void |
exc(int m,
double[][] a,
double[] d,
int n,
int j,
int k,
int l)
exchange routine used by
balance(double[][], int[], double[], int, int) |
private static double |
get(double[][] a,
int i,
int j)
Get an element from matrix a.
|
private static double |
get(double[] a,
int i)
Get an element from vector a.
|
protected static void |
hqr(double[][] h,
double[] wr,
double[] wi,
int[] cnt,
int n,
double macheps)
used in
eig(Matrix) |
private static void |
set(double[][] a,
int i,
int j,
double v)
Get an element from matrix a.
|
private static void |
set(double[] a,
int i,
double v)
Set an element in vector a.
|
private static void |
set(int[] a,
int i,
int v)
Set a value in vector a
|
private static double |
sqrt(double x)
A synonym for
Math.sqrt(double) |
private static void |
swap(double[][] a,
int r,
int c,
int rr,
int cc)
exchange two elements in the matrix a
|
private static <RE extends IRingElement<RE>> |
unwrap(RE f) |
public static <RE extends IRingElement<RE>> Vector<Complex> eig(Matrix<RE> matrix) throws InvalidOperationException
@Book{LinearAlgebraHandbook, author = {J.H. Wilkinson and C. Reinsch}, title = {Handbook for Automatic Computation}, publisher = {Springer-Verlag}, address = {New York}, year = {1971}, volume = {II: Linear Algebra} }
matrix
- the matrix for which the eigenvectors are calculatedInvalidOperationException
- if theMatrix does not contain doublesInvalidOperationException
- if theMatrix is not squareprotected static void hqr(double[][] h, double[] wr, double[] wi, int[] cnt, int n, double macheps)
eig(Matrix)
h
- wr
- wi
- cnt
- n
- macheps
- protected static void elmhes(double[][] a, int[] iint, int n, int k, int l)
a[0:n-1,0:n-1]
, this procedure reduces the sub-matrix of
order l-k+1, which starts at the element a[k-1][k-1], and finishes at the
element a[l-1][l-1], to Hessenberg form H, by non-orthogonal elementary
transformations. The matrix H is overwritten on A with details of the
transformations stored in the remaining triangle under H and in the array
iint[k-1:l-1].a
- the matrix to be reducediint
- row and column interchanges involved in reductionn
- k
- l
- protected static void balance(double[][] a, int[] lohi, double[] d, int n, int b)
a
- lohi
- two integers such that a[i][j] is equal to zero if
d
- n
- b
- private static void exc(int m, double[][] a, double[] d, int n, int j, int k, int l)
balance(double[][], int[], double[], int, int)
m
- a
- d
- n
- j
- k
- l
- private static double get(double[][] a, int i, int j)
a
- a double matrixi
- ,j
- the indices to be usedprivate static void set(double[] a, int i, double v)
a
- a double vectori
- the indexv
- the value to be set.private static double get(double[] a, int i)
a
- a double vectori
- an index.private static void set(double[][] a, int i, int j, double v)
a
- a double matrixi
- ,j
- the indices to be usedv
- the value to be set.private static void set(int[] a, int i, int v)
a
- a integer vectori
- the indexv
- the value to be setprivate static double abs(double x)
Math.abs(double)
x
- a double value.private static double sqrt(double x)
Math.sqrt(double)
x
- a double valueMath.sqrt(double)
private static void swap(double[][] a, int r, int c, int rr, int cc)
a
- a matrixr
- the row of the first elementc
- the column of the first elementrr
- the row of the second elementcc
- the column of the second elementpublic static <RE extends IRingElement<RE>> double[][] doubleValues(Matrix<RE> matrix) throws InvalidOperationException
matrix
- an array with double values.InvalidOperationException
- if theMatrix does not contain doublespublic static <RE extends IRingElement<RE>> double[][] complexValues(Vector<RE> theVector) throws InvalidOperationException
theVector
- containing the Complex valuesInvalidOperationException
- if theVector does not contain Complexpublic static <RE extends IRingElement<RE>> double doubleValue(RE d) throws InvalidOperationException
d
- the elementInvalidOperationException
- if d does not contain a doublepublic static <RE extends IRingElement<RE>> double doubleValue(Vector<RE> x, int i) throws InvalidOperationException
x
- the Vectori
- the indexInvalidOperationException
- if v does not contain doubleInvalidOperationException
- if the index is out of boundspublic static <RE extends IRingElement<RE>> double doubleValue(Matrix<RE> a, int i, int j) throws InvalidOperationException
a
- the Matrixi
- row indexj
- column indexInvalidOperationException
- if v does not contain doubleInvalidOperationException
- if either index is out of boundsprivate static <RE extends IRingElement<RE>> double unwrap(RE f)
f
- private static <RE extends IRingElement<RE>> void check_double(Matrix<RE> matrix) throws InvalidOperationException
matrix
- a matrixInvalidOperationException
- if a does not contain instances of DoubleWrapper.private static <RE extends IRingElement<RE>> void check_double(RE value) throws InvalidOperationException
value
- an instance of IRingElement
InvalidOperationException
- if value does not contain instances of DoubleWrapper.private static <RE extends IRingElement<RE>> void check_double(Vector<RE> v) throws InvalidOperationException
v
- a vectorInvalidOperationException
- if v does not contain instances of DoubleWrapper.private static <RE extends IRingElement<RE>> void check_complex(Vector<RE> v) throws InvalidOperationException
v
- a vectorInvalidOperationException
- if v does not contain instances of Complex.private static <RE extends IRingElement<RE>> void check_complex(RE value) throws InvalidOperationException
value
- InvalidOperationException
- if value does not contain an instance of Complex.private static <RE extends IRingElement<RE>> void check_type(RE value, IRingElement<?> check, java.lang.String name) throws InvalidOperationException
value
- the instance to be testedcheck
- the comparison instancename
- the informal name of the typeInvalidOperationException
- if the types differ.