-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mark Baker
authored
Jan 21, 2021
1 parent
4647614
commit a25c3e3
Showing
6 changed files
with
1,202 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace Matrix\Decomposition; | ||
|
||
use Matrix\Exception; | ||
use Matrix\Matrix; | ||
|
||
class Decomposition | ||
{ | ||
const LU = 'LU'; | ||
const QR = 'QR'; | ||
|
||
/** | ||
* @throws Exception | ||
*/ | ||
public static function decomposition($type, Matrix $matrix) | ||
{ | ||
switch (strtoupper($type)) { | ||
case self::LU: | ||
return new LU($matrix); | ||
case self::QR: | ||
return new QR($matrix); | ||
default: | ||
throw new Exception('Invalid Decomposition'); | ||
} | ||
} | ||
} |
Oops, something went wrong.