|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mines.jtk.la.TridiagonalFMatrix
public class TridiagonalFMatrix
A tridiagonal matrix is a square matrix specified by three diagonals. All elements except for those on the diagonal, lower sub-diagonal, and upper super-diagonal of the matrix are equal to zero. The diagonals are represented by three arrays a, b, and c of matrix elements. Here is an example of a tridiagonal system of n = 4 equations:
|b[0] c[0] 0 0 | |u[0]| |r[0]|
|a[1] b[1] c[1] 0 | |u[1]| = |r[1]|
| 0 a[2] b[2] c[2]| |u[2]| |r[2]|
| 0 0 a[3] b[3]| |u[3]| |r[3]|
The values a[0] and c[n-1] are ignored.
| Constructor Summary | |
|---|---|
TridiagonalFMatrix(int n)
Constructs a tridiagonal matrix with the specified number of rows. |
|
TridiagonalFMatrix(int n,
float[] a,
float[] b,
float[] c)
Constructs a new tridiagonal matrix with specified elements. |
|
| Method Summary | |
|---|---|
float[] |
a()
Returns the array a of lower sub-diagonal elements. |
float[] |
b()
Returns the array b of diagonal elements. |
float[] |
c()
Returns the array c of upper sub-diagonal elements. |
int |
n()
Returns the number of rows and columns in this matrix. |
void |
solve(float[] r,
float[] u)
Solves this tridiagonal system for specified right-hand-side. |
float[] |
times(float[] x)
Multiplies this matrix by the specified column vector. |
void |
times(float[] x,
float[] y)
Multiplies this matrix by the specified column vector. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TridiagonalFMatrix(int n)
n - the number of rows (and columns) in the matrix.
public TridiagonalFMatrix(int n,
float[] a,
float[] b,
float[] c)
n - the number of rows (and columns) in the matrix.a - array of lower sub-diagonal elements; a[0] is ignored.b - array of diagonal elements.c - array of upper super-diagonal elements; c[n-1] is ignored.| Method Detail |
|---|
public int n()
public float[] a()
public float[] b()
public float[] c()
public void solve(float[] r,
float[] u)
r - input array containing the right-hand-side column vector.u - output array containing the left-hand-side vector of unknowns.public float[] times(float[] x)
x - input array containing the column vector.
public void times(float[] x,
float[] y)
x - input array containing the column vector.y - output array containing the matrix-vector product.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||