summaryrefslogtreecommitdiffstats
path: root/vendor/markbaker/matrix/classes/src/Functions
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/markbaker/matrix/classes/src/Functions')
-rw-r--r--vendor/markbaker/matrix/classes/src/Functions/adjoint.php32
-rw-r--r--vendor/markbaker/matrix/classes/src/Functions/antidiagonal.php31
-rw-r--r--vendor/markbaker/matrix/classes/src/Functions/cofactors.php32
-rw-r--r--vendor/markbaker/matrix/classes/src/Functions/determinant.php32
-rw-r--r--vendor/markbaker/matrix/classes/src/Functions/diagonal.php32
-rw-r--r--vendor/markbaker/matrix/classes/src/Functions/identity.php32
-rw-r--r--vendor/markbaker/matrix/classes/src/Functions/inverse.php32
-rw-r--r--vendor/markbaker/matrix/classes/src/Functions/minors.php32
-rw-r--r--vendor/markbaker/matrix/classes/src/Functions/trace.php32
-rw-r--r--vendor/markbaker/matrix/classes/src/Functions/transpose.php32
10 files changed, 319 insertions, 0 deletions
diff --git a/vendor/markbaker/matrix/classes/src/Functions/adjoint.php b/vendor/markbaker/matrix/classes/src/Functions/adjoint.php
new file mode 100644
index 0000000..aafbb0f
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Functions/adjoint.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ *
+ * Function code for the matrix adjoint() function
+ *
+ * @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
+ * @license https://opensource.org/licenses/MIT MIT
+ */
+
+namespace Matrix;
+
+/**
+ * Returns the adjoint of a matrix or an array.
+ *
+ * @param Matrix|array $matrix Matrix or an array to treat as a matrix.
+ * @return Matrix The new matrix
+ * @throws Exception If argument isn't a valid matrix or array.
+ */
+if (!function_exists(__NAMESPACE__ . '\\adjoint')) {
+ function adjoint($matrix): Matrix
+ {
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Must be Matrix or array');
+ }
+
+ return Functions::adjoint($matrix);
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Functions/antidiagonal.php b/vendor/markbaker/matrix/classes/src/Functions/antidiagonal.php
new file mode 100644
index 0000000..8904912
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Functions/antidiagonal.php
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ *
+ * Function code for the matrix antidiagonal() function
+ *
+ * @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
+ * @license https://opensource.org/licenses/MIT MIT
+ */
+namespace Matrix;
+
+/**
+ * Returns the antidiagonal of a matrix or an array.
+ *
+ * @param Matrix|array $matrix Matrix or an array to treat as a matrix.
+ * @return Matrix The new matrix
+ * @throws Exception If argument isn't a valid matrix or array.
+ */
+if (!function_exists(__NAMESPACE__ . '\\antidiagonal')) {
+ function antidiagonal($matrix): Matrix
+ {
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Must be Matrix or array');
+ }
+
+ return Functions::antidiagonal($matrix);
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Functions/cofactors.php b/vendor/markbaker/matrix/classes/src/Functions/cofactors.php
new file mode 100644
index 0000000..c071e45
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Functions/cofactors.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ *
+ * Function code for the matrix cofactors() function
+ *
+ * @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
+ * @license https://opensource.org/licenses/MIT MIT
+ */
+
+namespace Matrix;
+
+/**
+ * Returns the cofactors of a matrix or an array.
+ *
+ * @param Matrix|array $matrix Matrix or an array to treat as a matrix.
+ * @return Matrix The new matrix
+ * @throws Exception If argument isn't a valid matrix or array.
+ */
+if (!function_exists(__NAMESPACE__ . '\\cofactors')) {
+ function cofactors($matrix): Matrix
+ {
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Must be Matrix or array');
+ }
+
+ return Functions::cofactors($matrix);
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Functions/determinant.php b/vendor/markbaker/matrix/classes/src/Functions/determinant.php
new file mode 100644
index 0000000..d3573ab
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Functions/determinant.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ *
+ * Function code for the matrix determinant() function
+ *
+ * @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
+ * @license https://opensource.org/licenses/MIT MIT
+ */
+
+namespace Matrix;
+
+/**
+ * Returns the determinant of a matrix or an array.
+ *
+ * @param Matrix|array $matrix Matrix or an array to treat as a matrix.
+ * @return float Matrix determinant
+ * @throws Exception If argument isn't a valid matrix or array.
+ */
+if (!function_exists(__NAMESPACE__ . '\\determinant')) {
+ function determinant($matrix): float
+ {
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Must be Matrix or array');
+ }
+
+ return Functions::determinant($matrix);
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Functions/diagonal.php b/vendor/markbaker/matrix/classes/src/Functions/diagonal.php
new file mode 100644
index 0000000..8993db3
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Functions/diagonal.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ *
+ * Function code for the matrix diagonal() function
+ *
+ * @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
+ * @license https://opensource.org/licenses/MIT MIT
+ */
+
+namespace Matrix;
+
+/**
+ * Returns the diagonal of a matrix or an array.
+ *
+ * @param Matrix|array $matrix Matrix or an array to treat as a matrix.
+ * @return Matrix The new matrix
+ * @throws Exception If argument isn't a valid matrix or array.
+ */
+if (!function_exists(__NAMESPACE__ . '\\diagonal')) {
+ function diagonal($matrix): Matrix
+ {
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Must be Matrix or array');
+ }
+
+ return Functions::diagonal($matrix);
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Functions/identity.php b/vendor/markbaker/matrix/classes/src/Functions/identity.php
new file mode 100644
index 0000000..7f870db
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Functions/identity.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ *
+ * Function code for the matrix identity() function
+ *
+ * @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
+ * @license https://opensource.org/licenses/MIT MIT
+ */
+
+namespace Matrix;
+
+/**
+ * Returns the identity of a matrix or an array.
+ *
+ * @param Matrix|array $matrix Matrix or an array to treat as a matrix.
+ * @return Matrix The identity matrix
+ * @throws Exception If argument isn't a valid matrix or array.
+ */
+if (!function_exists(__NAMESPACE__ . '\\identity')) {
+ function identity($matrix): Matrix
+ {
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Must be Matrix or array');
+ }
+
+ return Functions::identity($matrix);
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Functions/inverse.php b/vendor/markbaker/matrix/classes/src/Functions/inverse.php
new file mode 100644
index 0000000..4bf08d0
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Functions/inverse.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ *
+ * Function code for the matrix inverse() function
+ *
+ * @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
+ * @license https://opensource.org/licenses/MIT MIT
+ */
+
+namespace Matrix;
+
+/**
+ * Returns the inverse of a matrix or an array.
+ *
+ * @param Matrix|array $matrix Matrix or an array to treat as a matrix.
+ * @return Matrix The new matrix
+ * @throws Exception If argument isn't a valid matrix or array.
+ */
+if (!function_exists(__NAMESPACE__ . '\\inverse')) {
+ function inverse($matrix): Matrix
+ {
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Must be Matrix or array');
+ }
+
+ return Functions::inverse($matrix);
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Functions/minors.php b/vendor/markbaker/matrix/classes/src/Functions/minors.php
new file mode 100644
index 0000000..f34833b
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Functions/minors.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ *
+ * Function code for the matrix minors() function
+ *
+ * @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
+ * @license https://opensource.org/licenses/MIT MIT
+ */
+
+namespace Matrix;
+
+/**
+ * Returns the minors of a matrix or an array.
+ *
+ * @param Matrix|array $matrix Matrix or an array to treat as a matrix.
+ * @return Matrix The new matrix
+ * @throws Exception If argument isn't a valid matrix or array.
+ */
+if (!function_exists(__NAMESPACE__ . '\\minors')) {
+ function minors($matrix): Matrix
+ {
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Must be Matrix or array');
+ }
+
+ return Functions::minors($matrix);
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Functions/trace.php b/vendor/markbaker/matrix/classes/src/Functions/trace.php
new file mode 100644
index 0000000..0c395f6
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Functions/trace.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ *
+ * Function code for the matrix trace() function
+ *
+ * @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
+ * @license https://opensource.org/licenses/MIT MIT
+ */
+
+namespace Matrix;
+
+/**
+ * Returns the trace of a matrix or an array.
+ *
+ * @param Matrix|array $matrix Matrix or an array to treat as a matrix.
+ * @return float The trace of the matrix
+ * @throws Exception If argument isn't a valid matrix or array.
+ */
+if (!function_exists(__NAMESPACE__ . '\\trace')) {
+ function trace($matrix): float
+ {
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Must be Matrix or array');
+ }
+
+ return Functions::trace($matrix);
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Functions/transpose.php b/vendor/markbaker/matrix/classes/src/Functions/transpose.php
new file mode 100644
index 0000000..8413634
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Functions/transpose.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ *
+ * Function code for the matrix transpose() function
+ *
+ * @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
+ * @license https://opensource.org/licenses/MIT MIT
+ */
+
+namespace Matrix;
+
+/**
+ * Returns the transpose of a matrix or an array.
+ *
+ * @param Matrix|array $matrix Matrix or an array to treat as a matrix.
+ * @return Matrix The transposed matrix
+ * @throws Exception If argument isn't a valid matrix or array.
+ */
+if (!function_exists(__NAMESPACE__ . '\\transpose')) {
+ function transpose($matrix): Matrix
+ {
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Must be Matrix or array');
+ }
+
+ return Functions::transpose($matrix);
+ }
+}