Uses the Tridiagonal Matrix Algorithm, also known as the Thomas Algorithm, to solve
一个线性方程系统,其中系数矩阵是一个三边矩阵.
Methods
static Cesium.TridiagonalSystemSolver.solve(diagonal, lower, upper, right) → Array.<Cartesian3>
解决线性方程的三面体系统.
Performance:
Linear time.
| Name | Type | Description |
|---|---|---|
diagonal |
Array.<number> | 长度为 NT 0 n NT 1 的阵列,包含系数矩阵的对角. |
lower |
Array.<number> | 长度为 NT 0 n-1 NT 1 的数组,包含系数矩阵的下对角. |
upper |
Array.<number> |
长度为 n - 1 −的数组,包含系数矩阵的上对角. |
right |
Array.<Cartesian3> | 长度为 NT 0 n NT 1 的笛卡尔阵列,是方程式系统的右侧. |
Returns:
An array of Cartesians with length
n that is the solution to the tridiagonal system of equations.
Throws:
-
DeveloperError : diagonal and right must have the same lengths.
-
DeveloperError : lower and upper must have the same lengths.
-
DeveloperError : lower and upper must be one less than the length of diagonal.
Example:
const lowerDiagonal = [1.0, 1.0, 1.0, 1.0];
const diagonal = [2.0, 4.0, 4.0, 4.0, 2.0];
const upperDiagonal = [1.0, 1.0, 1.0, 1.0];
const rightHandSide = [
new Cesium.Cartesian3(410757.0, -1595711.0, 1375302.0),
new Cesium.Cartesian3(-5986705.0, -2190640.0, 1099600.0),
new Cesium.Cartesian3(-12593180.0, 288588.0, -1755549.0),
new Cesium.Cartesian3(-5349898.0, 2457005.0, -2685438.0),
new Cesium.Cartesian3(845820.0, 1573488.0, -1205591.0)
];
const solution = Cesium.TridiagonalSystemSolver.solve(lowerDiagonal, diagonal, upperDiagonal, rightHandSide);