Lapack::solveLinearEquation
(PECL lapack >= 0.1.0)
Lapack::solveLinearEquation — Solve a system of linear equations
说明
public
static
Lapack::solveLinearEquation (
array
$a
,
array $b
) :
array
This function computes the solution to the system of linear equations with a square matrix A and multiple right-hand sides B. Solves A * X = B for multiple B.
参数
-
a
-
Square matrix of linear equations
-
b
-
Right hand side to be solved for
返回值
Matrix X
范例
Example #1 Using Lapack::singularValues():
<?php
$a = array(
array( 6.80, -6.05, -0.45, 8.32, -9.67 ),
array(-2.11, -3.30, 2.58, 2.71, -5.14 ),
array( 5.66, 5.36, -2.70, 4.35, -7.26 ),
array( 5.97, -4.44, 0.27, -7.17, 6.08 ),
array( 8.23, 1.08, 9.04, 2.14, -6.87 ),
);
$b = array(
array( 4.02, -1.56, 9.81 ),
array( 6.19, 4.00, -4.09 ),
array( -8.22, -8.67, -4.57 ),
array( -7.57, 1.75, -8.61 ),
array( -3.03, 2.86, 8.99 ),
);
$result = Lapack::solveLinearEquation($a, $b);
?>