@@ -26,7 +26,7 @@ public function __construct(Matrix $matrix)
26
26
*
27
27
* @return Matrix Lower triangular factor
28
28
*/
29
- public function getL ()
29
+ public function getL (): Matrix
30
30
{
31
31
$ lower = [];
32
32
@@ -51,7 +51,7 @@ public function getL()
51
51
*
52
52
* @return Matrix Upper triangular factor
53
53
*/
54
- public function getU ()
54
+ public function getU (): Matrix
55
55
{
56
56
$ upper = [];
57
57
@@ -74,7 +74,7 @@ public function getU()
74
74
*
75
75
* @return Matrix Pivot matrix
76
76
*/
77
- public function getP ()
77
+ public function getP (): Matrix
78
78
{
79
79
$ pMatrix = [];
80
80
@@ -93,7 +93,7 @@ public function getP()
93
93
*
94
94
* @return array Pivot vector
95
95
*/
96
- public function getPivot ()
96
+ public function getPivot (): array
97
97
{
98
98
return $ this ->pivot ;
99
99
}
@@ -103,7 +103,7 @@ public function getPivot()
103
103
*
104
104
* @return bool true if U, and hence A, is nonsingular
105
105
*/
106
- public function isNonsingular ()
106
+ public function isNonsingular (): bool
107
107
{
108
108
for ($ diagonal = 0 ; $ diagonal < $ this ->columns ; ++$ diagonal ) {
109
109
if ($ this ->luMatrix [$ diagonal ][$ diagonal ] === 0.0 ) {
@@ -114,7 +114,7 @@ public function isNonsingular()
114
114
return true ;
115
115
}
116
116
117
- private function buildPivot ()
117
+ private function buildPivot (): void
118
118
{
119
119
for ($ row = 0 ; $ row < $ this ->rows ; ++$ row ) {
120
120
$ this ->pivot [$ row ] = $ row ;
@@ -136,7 +136,7 @@ private function buildPivot()
136
136
}
137
137
}
138
138
139
- private function localisedReferenceColumn ($ column )
139
+ private function localisedReferenceColumn ($ column ): array
140
140
{
141
141
$ luColumn = [];
142
142
@@ -147,7 +147,7 @@ private function localisedReferenceColumn($column)
147
147
return $ luColumn ;
148
148
}
149
149
150
- private function applyTransformations ($ column , array $ luColumn )
150
+ private function applyTransformations ($ column , array $ luColumn ): void
151
151
{
152
152
for ($ row = 0 ; $ row < $ this ->rows ; ++$ row ) {
153
153
$ luRow = $ this ->luMatrix [$ row ];
@@ -161,7 +161,7 @@ private function applyTransformations($column, array $luColumn)
161
161
}
162
162
}
163
163
164
- private function findPivot ($ column , array $ luColumn )
164
+ private function findPivot ($ column , array $ luColumn ): int
165
165
{
166
166
$ pivot = $ column ;
167
167
for ($ row = $ column + 1 ; $ row < $ this ->rows ; ++$ row ) {
@@ -173,7 +173,7 @@ private function findPivot($column, array $luColumn)
173
173
return $ pivot ;
174
174
}
175
175
176
- private function pivotExchange ($ pivot , $ column )
176
+ private function pivotExchange ($ pivot , $ column ): void
177
177
{
178
178
for ($ kValue = 0 ; $ kValue < $ this ->columns ; ++$ kValue ) {
179
179
$ tValue = $ this ->luMatrix [$ pivot ][$ kValue ];
@@ -186,7 +186,7 @@ private function pivotExchange($pivot, $column)
186
186
$ this ->pivot [$ column ] = $ lValue ;
187
187
}
188
188
189
- private function computeMultipliers ($ diagonal )
189
+ private function computeMultipliers ($ diagonal ): void
190
190
{
191
191
if (($ diagonal < $ this ->rows ) && ($ this ->luMatrix [$ diagonal ][$ diagonal ] != 0.0 )) {
192
192
for ($ row = $ diagonal + 1 ; $ row < $ this ->rows ; ++$ row ) {
0 commit comments