TridiagonalSystemSolver

TridiagonalSystemSolver()

使用三对角矩阵算法(又称托马斯算法)求解系数矩阵为三对角矩阵的线性方程组。

Methods

staticSuperMap3D.TridiagonalSystemSolver.solve(diagonal, lower, upper, 右侧具有长度n的Cartesian坐标数组,是方程组的右侧。)Array.<Cartesian3>

Solves a tridiagonal system of linear equations.
Performance:

Linear time.

Name Type Description
diagonal Array.<Number> 长度为 n 的数组,包含系数矩阵的对角线。
lower Array.<Number> 长度为 n - 1 的数组,包含系数矩阵的下对角线。
upper Array.<Number> 长度为 n - 1 的数组,包含系数矩阵的上对角线。
右侧具有长度n的Cartesian坐标数组,是方程组的右侧。 Array.<Cartesian3>
Returns:
An array of Cartesians with length n that is the solution to the tridiagonal system of equations.
Throws:
Example:
var lowerDiagonal = [1.0, 1.0, 1.0, 1.0];
var diagonal = [2.0, 4.0, 4.0, 4.0, 2.0];
var upperDiagonal = [1.0, 1.0, 1.0, 1.0];
var rightHandSide = [
    new SuperMap3D.Cartesian3(410757.0, -1595711.0, 1375302.0),
    new SuperMap3D.Cartesian3(-5986705.0, -2190640.0, 1099600.0),
    new SuperMap3D.Cartesian3(-12593180.0, 288588.0, -1755549.0),
    new SuperMap3D.Cartesian3(-5349898.0, 2457005.0, -2685438.0),
    new SuperMap3D.Cartesian3(845820.0, 1573488.0, -1205591.0)
];

var solution = SuperMap3D.TridiagonalSystemSolver.solve(lowerDiagonal, diagonal, upperDiagonal, rightHandSide);