public class TridiagonalFMatrix
extends java.lang.Object
|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 and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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.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.