Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
 
3
namespace Matrix\Decomposition;
4
 
5
use Matrix\Exception;
6
use Matrix\Matrix;
7
 
8
class Decomposition
9
{
10
    const LU = 'LU';
11
    const QR = 'QR';
12
 
13
    /**
14
     * @throws Exception
15
     */
16
    public static function decomposition($type, Matrix $matrix)
17
    {
18
        switch (strtoupper($type)) {
19
            case self::LU:
20
                return new LU($matrix);
21
            case self::QR:
22
                return new QR($matrix);
23
            default:
24
                throw new Exception('Invalid Decomposition');
25
        }
26
    }
27
}