File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/LinearAlgebra/Decomposition Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ private static function diagonalize(NumericMatrix $S): array
217217 // Each column should contain 1 non-zero element
218218 $ j = self ::isStandardBasisVector ($ vector );
219219
220- if ($ j === false ) {
220+ if ($ j === - 1 ) {
221221 throw new MatrixException ("S Matrix in SVD is not orthogonal: \n" . (string ) $ S );
222222 }
223223
@@ -263,11 +263,11 @@ private static function diagonalize(NumericMatrix $S): array
263263 *
264264 * @param Vector $v
265265 *
266- * @return int|false The index of the non-zero entry or false if either:
266+ * @return int The index of the non-zero entry or -1 if either:
267267 * 1. There are multiple non-zero entries
268268 * 2. The vector is a zero vector
269269 */
270- private static function isStandardBasisVector (Vector $ v ): int | false
270+ private static function isStandardBasisVector (Vector $ v ): int
271271 {
272272 if ($ v ->l2Norm () === 0 ) {
273273 return false ;
@@ -282,7 +282,7 @@ private static function isStandardBasisVector(Vector $v): int|false
282282 if ($ index === -1 ) {
283283 $ index = $ i ;
284284 } else { // If we already found a non-zero component, then return false
285- return false ;
285+ return - 1 ;
286286 }
287287 }
288288 }
You can’t perform that action at this time.
0 commit comments