mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-08 13:28:39 +00:00
Fix #128
This commit is contained in:
parent
f1e6e7a63b
commit
75f86a29ba
|
|
@ -81,6 +81,8 @@ class QRDecomposition
|
||||||
|
|
||||||
public function getH()
|
public function getH()
|
||||||
{
|
{
|
||||||
|
$H = [[]];
|
||||||
|
|
||||||
for ($i = 0; $i < $this->m; ++$i) {
|
for ($i = 0; $i < $this->m; ++$i) {
|
||||||
for ($j = 0; $j < $this->n; ++$j) {
|
for ($j = 0; $j < $this->n; ++$j) {
|
||||||
if ($i >= $j) {
|
if ($i >= $j) {
|
||||||
|
|
@ -99,6 +101,8 @@ class QRDecomposition
|
||||||
|
|
||||||
public function getR()
|
public function getR()
|
||||||
{
|
{
|
||||||
|
$R = [[]];
|
||||||
|
|
||||||
for ($i = 0; $i < $this->n; ++$i) {
|
for ($i = 0; $i < $this->n; ++$i) {
|
||||||
for ($j = 0; $j < $this->n; ++$j) {
|
for ($j = 0; $j < $this->n; ++$j) {
|
||||||
if ($i < $j) {
|
if ($i < $j) {
|
||||||
|
|
@ -119,10 +123,13 @@ class QRDecomposition
|
||||||
|
|
||||||
public function getQ()
|
public function getQ()
|
||||||
{
|
{
|
||||||
|
$Q = [[]];
|
||||||
|
|
||||||
for ($k = $this->n-1; $k >= 0; --$k) {
|
for ($k = $this->n-1; $k >= 0; --$k) {
|
||||||
for ($i = 0; $i < $this->m; ++$i) {
|
for ($i = 0; $i < $this->m; ++$i) {
|
||||||
$Q[$i][$k] = 0.0;
|
$Q[$i][$k] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$Q[$k][$k] = 1.0;
|
$Q[$k][$k] = 1.0;
|
||||||
for ($j = $k; $j < $this->n; ++$j) {
|
for ($j = $k; $j < $this->n; ++$j) {
|
||||||
if ($this->QR[$k][$k] != 0) {
|
if ($this->QR[$k][$k] != 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user