# tablepress/3.2.1/libraries/vendor/markbaker/matrix/classes/Decomposition/Decomposition.php

TablePress – Tables in WordPress made easy, version 3.2.1. 28 lines.

- Page: https://pluginprobe.com/plugins/tablepress/3.2.1/code/libraries/vendor/markbaker/matrix/classes/Decomposition/Decomposition.php
- Raw: https://pluginprobe.com/plugins/tablepress/3.2.1/raw/libraries/vendor/markbaker/matrix/classes/Decomposition/Decomposition.php
- Modified: 2025-01-08T09:25:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tablepress/3.2.1/code/libraries/vendor/markbaker/matrix/classes/Decomposition/Decomposition.php#L10-L20`.

```php
<?php

namespace TablePress\Matrix\Decomposition;

use TablePress\Matrix\Exception;
use TablePress\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');
		}
	}
}

```
