• File: Decomposition.php
  • Full Path: /var/www/crm_set/modules/surveys/vendor/markbaker/matrix/classes/src/Decomposition/Decomposition.php
  • Date Modified: 09/21/2026 4:20 AM
  • File size: 530 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?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');
        }
    }
}