Version Description
- 2019-11-12
Download this release
Release Info
Developer | codeinwp |
Plugin | WordPress Charts and Graphs Lite |
Version | 3.3.3 |
Comparing to | |
See all releases |
Code changes from version 3.3.2 to 3.3.3
- CHANGELOG.md +4 -0
- classes/Visualizer/Plugin.php +1 -1
- classes/Visualizer/Render/Page/Data.php +6 -1
- css/media.css +1 -1
- index.php +1 -1
- readme.md +6 -1
- readme.txt +6 -1
- themeisle-hash.json +1 -1
- vendor/autoload.php +1 -1
- vendor/autoload_52.php +1 -1
- vendor/codeinwp/themeisle-sdk/CHANGELOG.md +8 -0
- vendor/codeinwp/themeisle-sdk/load.php +1 -1
- vendor/codeinwp/themeisle-sdk/src/Modules/Licenser.php +3 -1
- vendor/composer/autoload_real.php +5 -5
- vendor/composer/autoload_real_52.php +3 -3
- vendor/composer/installed.json +17 -18
- vendor/markbaker/matrix/classes/src/Builder.php +4 -3
- vendor/markbaker/matrix/classes/src/Functions.php +42 -23
- vendor/markbaker/matrix/classes/src/Matrix.php +35 -38
- vendor/markbaker/matrix/classes/src/Operators/DirectSum.php +10 -11
- vendor/markbaker/matrix/classes/src/functions/adjoint.php +8 -4
- vendor/markbaker/matrix/classes/src/functions/antidiagonal.php +4 -1
- vendor/markbaker/matrix/classes/src/functions/cofactors.php +8 -4
- vendor/markbaker/matrix/classes/src/functions/determinant.php +8 -4
- vendor/markbaker/matrix/classes/src/functions/diagonal.php +8 -4
- vendor/markbaker/matrix/classes/src/functions/identity.php +8 -4
- vendor/markbaker/matrix/classes/src/functions/inverse.php +8 -4
- vendor/markbaker/matrix/classes/src/functions/minors.php +8 -4
- vendor/markbaker/matrix/classes/src/functions/trace.php +8 -4
- vendor/markbaker/matrix/classes/src/functions/transpose.php +8 -4
- vendor/markbaker/matrix/classes/src/operations/add.php +10 -5
- vendor/markbaker/matrix/classes/src/operations/directsum.php +10 -5
- vendor/markbaker/matrix/classes/src/operations/divideby.php +10 -4
- vendor/markbaker/matrix/classes/src/operations/divideinto.php +10 -5
- vendor/markbaker/matrix/classes/src/operations/multiply.php +10 -5
- vendor/markbaker/matrix/classes/src/operations/subtract.php +10 -5
- vendor/markbaker/matrix/composer.7.2.json +86 -0
- vendor/markbaker/matrix/infection.json.dist +17 -0
- vendor/markbaker/matrix/phpstan.neon +4 -0
CHANGELOG.md
CHANGED
@@ -1,4 +1,8 @@
|
|
1 |
|
|
|
|
|
|
|
|
|
2 |
### v3.3.2 - 2019-10-03
|
3 |
**Changes:**
|
4 |
* Add support for Dataset schema
|
1 |
|
2 |
+
### v3.3.3 - 2019-11-12
|
3 |
+
**Changes:**
|
4 |
+
* Tested upto WordPress 5.3
|
5 |
+
|
6 |
### v3.3.2 - 2019-10-03
|
7 |
**Changes:**
|
8 |
* Add support for Dataset schema
|
classes/Visualizer/Plugin.php
CHANGED
@@ -28,7 +28,7 @@
|
|
28 |
class Visualizer_Plugin {
|
29 |
|
30 |
const NAME = 'visualizer';
|
31 |
-
const VERSION = '3.3.
|
32 |
|
33 |
// custom post types
|
34 |
const CPT_VISUALIZER = 'visualizer';
|
28 |
class Visualizer_Plugin {
|
29 |
|
30 |
const NAME = 'visualizer';
|
31 |
+
const VERSION = '3.3.3';
|
32 |
|
33 |
// custom post types
|
34 |
const CPT_VISUALIZER = 'visualizer';
|
classes/Visualizer/Render/Page/Data.php
CHANGED
@@ -446,7 +446,12 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
|
|
446 |
|
447 |
<?php $this->getPermissionsLink( $this->chart->ID ); ?>
|
448 |
|
449 |
-
<li class="viz-group bottom-fixed" id="vz-chart-copyright">Visualizer ©
|
|
|
|
|
|
|
|
|
|
|
450 |
</ul>
|
451 |
<?php
|
452 |
// changed by Ash/Upwork
|
446 |
|
447 |
<?php $this->getPermissionsLink( $this->chart->ID ); ?>
|
448 |
|
449 |
+
<li class="viz-group bottom-fixed" id="vz-chart-copyright">Visualizer ©
|
450 |
+
<?php
|
451 |
+
// phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date, WordPress.DateTime.CurrentTimeTimestamp.Requested
|
452 |
+
echo date( 'Y', current_time( 'timestamp' ) );
|
453 |
+
?>
|
454 |
+
</li>
|
455 |
</ul>
|
456 |
<?php
|
457 |
// changed by Ash/Upwork
|
css/media.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/*
|
2 |
-
Version: 3.3.
|
3 |
*/
|
4 |
#visualizer-library-view {
|
5 |
padding: 30px 10px 10px 30px;
|
1 |
/*
|
2 |
+
Version: 3.3.3
|
3 |
*/
|
4 |
#visualizer-library-view {
|
5 |
padding: 30px 10px 10px 30px;
|
index.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Visualizer: Tables and Charts Manager for WordPress
|
5 |
Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
|
6 |
Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
|
7 |
-
Version: 3.3.
|
8 |
Author: Themeisle
|
9 |
Author URI: http://themeisle.com
|
10 |
License: GPL v2.0 or later
|
4 |
Plugin Name: Visualizer: Tables and Charts Manager for WordPress
|
5 |
Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
|
6 |
Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
|
7 |
+
Version: 3.3.3
|
8 |
Author: Themeisle
|
9 |
Author URI: http://themeisle.com
|
10 |
License: GPL v2.0 or later
|
readme.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
**Contributors:** [codeinwp](https://profiles.wordpress.org/codeinwp), [marius2012](https://profiles.wordpress.org/marius2012), [marius_codeinwp](https://profiles.wordpress.org/marius_codeinwp), [hardeepasrani](https://profiles.wordpress.org/hardeepasrani), [themeisle](https://profiles.wordpress.org/themeisle), [Madalin_ThemeIsle](https://profiles.wordpress.org/Madalin_ThemeIsle), [contactashish13](https://profiles.wordpress.org/contactashish13)
|
3 |
**Tags:** chart, charts, charting, table, tables, tabling, graph, graphs, graphing, visualisation, visualise data, visualization, visualize data, HTML5, pie chart, line chart, bar chart, column chart, gauge chart, area chart, scatter chart, candlestick chart, geo chart, google visualization api, data tables, chartjs
|
4 |
**Requires at least:** 3.5
|
5 |
-
**Tested up to:** 5.
|
6 |
**Requires PHP:** 5.6
|
7 |
**Stable tag:** trunk
|
8 |
**License:** GPL v2.0 or later
|
@@ -157,6 +157,11 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
|
|
157 |
13. Bar chart
|
158 |
|
159 |
## Changelog ##
|
|
|
|
|
|
|
|
|
|
|
160 |
### 3.3.2 - 2019-10-03 ###
|
161 |
|
162 |
* Add support for Dataset schema
|
2 |
**Contributors:** [codeinwp](https://profiles.wordpress.org/codeinwp), [marius2012](https://profiles.wordpress.org/marius2012), [marius_codeinwp](https://profiles.wordpress.org/marius_codeinwp), [hardeepasrani](https://profiles.wordpress.org/hardeepasrani), [themeisle](https://profiles.wordpress.org/themeisle), [Madalin_ThemeIsle](https://profiles.wordpress.org/Madalin_ThemeIsle), [contactashish13](https://profiles.wordpress.org/contactashish13)
|
3 |
**Tags:** chart, charts, charting, table, tables, tabling, graph, graphs, graphing, visualisation, visualise data, visualization, visualize data, HTML5, pie chart, line chart, bar chart, column chart, gauge chart, area chart, scatter chart, candlestick chart, geo chart, google visualization api, data tables, chartjs
|
4 |
**Requires at least:** 3.5
|
5 |
+
**Tested up to:** 5.3
|
6 |
**Requires PHP:** 5.6
|
7 |
**Stable tag:** trunk
|
8 |
**License:** GPL v2.0 or later
|
157 |
13. Bar chart
|
158 |
|
159 |
## Changelog ##
|
160 |
+
### 3.3.3 - 2019-11-12 ###
|
161 |
+
|
162 |
+
* Tested upto WordPress 5.3
|
163 |
+
|
164 |
+
|
165 |
### 3.3.2 - 2019-10-03 ###
|
166 |
|
167 |
* Add support for Dataset schema
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Contributors: codeinwp,marius2012,marius_codeinwp,hardeepasrani,themeisle,Madalin_ThemeIsle,contactashish13
|
3 |
Tags: chart, charts, charting, table, tables, tabling, graph, graphs, graphing, visualisation, visualise data, visualization, visualize data, HTML5, pie chart, line chart, bar chart, column chart, gauge chart, area chart, scatter chart, candlestick chart, geo chart, google visualization api, data tables, chartjs
|
4 |
Requires at least: 3.5
|
5 |
-
Tested up to: 5.
|
6 |
Requires PHP: 5.6
|
7 |
Stable tag: trunk
|
8 |
License: GPL v2.0 or later
|
@@ -157,6 +157,11 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
|
|
157 |
13. Bar chart
|
158 |
|
159 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
160 |
= 3.3.2 - 2019-10-03 =
|
161 |
|
162 |
* Add support for Dataset schema
|
2 |
Contributors: codeinwp,marius2012,marius_codeinwp,hardeepasrani,themeisle,Madalin_ThemeIsle,contactashish13
|
3 |
Tags: chart, charts, charting, table, tables, tabling, graph, graphs, graphing, visualisation, visualise data, visualization, visualize data, HTML5, pie chart, line chart, bar chart, column chart, gauge chart, area chart, scatter chart, candlestick chart, geo chart, google visualization api, data tables, chartjs
|
4 |
Requires at least: 3.5
|
5 |
+
Tested up to: 5.3
|
6 |
Requires PHP: 5.6
|
7 |
Stable tag: trunk
|
8 |
License: GPL v2.0 or later
|
157 |
13. Bar chart
|
158 |
|
159 |
== Changelog ==
|
160 |
+
= 3.3.3 - 2019-11-12 =
|
161 |
+
|
162 |
+
* Tested upto WordPress 5.3
|
163 |
+
|
164 |
+
|
165 |
= 3.3.2 - 2019-10-03 =
|
166 |
|
167 |
* Add support for Dataset schema
|
themeisle-hash.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"index.php":"
|
1 |
+
{"index.php":"569496aebdbfd41a2278e22f8ff5c57d"}
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit20d0201b02d7aa3ffcbbd565487f3a9b::getLoader();
|
vendor/autoload_52.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit4ecb0bcaaaf96c41f2985097c9c09d21::getLoader();
|
vendor/codeinwp/themeisle-sdk/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
## [3.1.6](https://github.com/Codeinwp/themeisle-sdk/compare/v3.1.5...v3.1.6) (2019-09-24)
|
2 |
|
3 |
|
1 |
+
## [3.1.7](https://github.com/Codeinwp/themeisle-sdk/compare/v3.1.6...v3.1.7) (2019-11-07)
|
2 |
+
|
3 |
+
|
4 |
+
### Bug Fixes
|
5 |
+
|
6 |
+
* license field style on wp5.3 ([0239997](https://github.com/Codeinwp/themeisle-sdk/commit/0239997))
|
7 |
+
* license field style on wp5.3 ([86d3a1b](https://github.com/Codeinwp/themeisle-sdk/commit/86d3a1b))
|
8 |
+
|
9 |
## [3.1.6](https://github.com/Codeinwp/themeisle-sdk/compare/v3.1.5...v3.1.6) (2019-09-24)
|
10 |
|
11 |
|
vendor/codeinwp/themeisle-sdk/load.php
CHANGED
@@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
14 |
return;
|
15 |
}
|
16 |
// Current SDK version and path.
|
17 |
-
$themeisle_sdk_version = '3.1.
|
18 |
$themeisle_sdk_path = dirname( __FILE__ );
|
19 |
|
20 |
global $themeisle_sdk_max_version;
|
14 |
return;
|
15 |
}
|
16 |
// Current SDK version and path.
|
17 |
+
$themeisle_sdk_version = '3.1.7';
|
18 |
$themeisle_sdk_path = dirname( __FILE__ );
|
19 |
|
20 |
global $themeisle_sdk_max_version;
|
vendor/codeinwp/themeisle-sdk/src/Modules/Licenser.php
CHANGED
@@ -121,7 +121,9 @@ class Licenser extends Abstract_Module {
|
|
121 |
|
122 |
input.themeisle-sdk-license-input {
|
123 |
width: 300px;
|
124 |
-
padding:
|
|
|
|
|
125 |
}
|
126 |
|
127 |
.themeisle-sdk-license-deactivate-cta {
|
121 |
|
122 |
input.themeisle-sdk-license-input {
|
123 |
width: 300px;
|
124 |
+
padding: 0 8px;
|
125 |
+
line-height: 2;
|
126 |
+
min-height: 30px;
|
127 |
}
|
128 |
|
129 |
.themeisle-sdk-license-deactivate-cta {
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit9f54278002a2a3d5d2dae9716acfaa3f
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
27 |
foreach ($map as $namespace => $path) {
|
@@ -42,14 +42,14 @@ class ComposerAutoloaderInit9f54278002a2a3d5d2dae9716acfaa3f
|
|
42 |
|
43 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
44 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
45 |
-
|
46 |
}
|
47 |
|
48 |
return $loader;
|
49 |
}
|
50 |
}
|
51 |
|
52 |
-
function
|
53 |
{
|
54 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
55 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit20d0201b02d7aa3ffcbbd565487f3a9b
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit20d0201b02d7aa3ffcbbd565487f3a9b', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit20d0201b02d7aa3ffcbbd565487f3a9b', 'loadClassLoader'));
|
25 |
|
26 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
27 |
foreach ($map as $namespace => $path) {
|
42 |
|
43 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
44 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
45 |
+
composerRequire20d0201b02d7aa3ffcbbd565487f3a9b($fileIdentifier, $file);
|
46 |
}
|
47 |
|
48 |
return $loader;
|
49 |
}
|
50 |
}
|
51 |
|
52 |
+
function composerRequire20d0201b02d7aa3ffcbbd565487f3a9b($fileIdentifier, $file)
|
53 |
{
|
54 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
55 |
require $file;
|
vendor/composer/autoload_real_52.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real_52.php generated by xrstf/composer-php52
|
4 |
|
5 |
-
class
|
6 |
private static $loader;
|
7 |
|
8 |
public static function loadClassLoader($class) {
|
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitde0bba044daaad07246a648664761814 {
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new xrstf_Composer52_ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$vendorDir = dirname(dirname(__FILE__));
|
27 |
$baseDir = dirname($vendorDir);
|
2 |
|
3 |
// autoload_real_52.php generated by xrstf/composer-php52
|
4 |
|
5 |
+
class ComposerAutoloaderInit4ecb0bcaaaf96c41f2985097c9c09d21 {
|
6 |
private static $loader;
|
7 |
|
8 |
public static function loadClassLoader($class) {
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit4ecb0bcaaaf96c41f2985097c9c09d21', 'loadClassLoader'), true /*, true */);
|
23 |
self::$loader = $loader = new xrstf_Composer52_ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit4ecb0bcaaaf96c41f2985097c9c09d21', 'loadClassLoader'));
|
25 |
|
26 |
$vendorDir = dirname(dirname(__FILE__));
|
27 |
$baseDir = dirname($vendorDir);
|
vendor/composer/installed.json
CHANGED
@@ -6,12 +6,12 @@
|
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/Codeinwp/themeisle-sdk.git",
|
9 |
-
"reference": "
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
-
"url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/
|
14 |
-
"reference": "
|
15 |
"shasum": ""
|
16 |
},
|
17 |
"require-dev": {
|
@@ -19,7 +19,7 @@
|
|
19 |
"squizlabs/php_codesniffer": "^3.1",
|
20 |
"wp-coding-standards/wpcs": "^1.0.0"
|
21 |
},
|
22 |
-
"time": "2019-
|
23 |
"type": "library",
|
24 |
"installation-source": "source",
|
25 |
"notification-url": "https://packagist.org/downloads/",
|
@@ -74,33 +74,32 @@
|
|
74 |
},
|
75 |
{
|
76 |
"name": "markbaker/matrix",
|
77 |
-
"version": "1.
|
78 |
-
"version_normalized": "1.
|
79 |
"source": {
|
80 |
"type": "git",
|
81 |
"url": "https://github.com/MarkBaker/PHPMatrix.git",
|
82 |
-
"reference": "
|
83 |
},
|
84 |
"dist": {
|
85 |
"type": "zip",
|
86 |
-
"url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/
|
87 |
-
"reference": "
|
88 |
"shasum": ""
|
89 |
},
|
90 |
"require": {
|
91 |
"php": "^5.6.0|^7.0.0"
|
92 |
},
|
93 |
"require-dev": {
|
94 |
-
"dealerdirect/phpcodesniffer-composer-installer": "
|
95 |
-
"phpcompatibility/php-compatibility": "
|
96 |
-
"
|
97 |
-
"
|
98 |
-
"
|
99 |
-
"
|
100 |
-
"
|
101 |
-
"squizlabs/php_codesniffer": "^3.3.0"
|
102 |
},
|
103 |
-
"time": "
|
104 |
"type": "library",
|
105 |
"installation-source": "dist",
|
106 |
"autoload": {
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/Codeinwp/themeisle-sdk.git",
|
9 |
+
"reference": "5162163ec2d609e0b61e382f8fcf6ad47cca3293"
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
+
"url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/5162163ec2d609e0b61e382f8fcf6ad47cca3293",
|
14 |
+
"reference": "5162163ec2d609e0b61e382f8fcf6ad47cca3293",
|
15 |
"shasum": ""
|
16 |
},
|
17 |
"require-dev": {
|
19 |
"squizlabs/php_codesniffer": "^3.1",
|
20 |
"wp-coding-standards/wpcs": "^1.0.0"
|
21 |
},
|
22 |
+
"time": "2019-11-07 12:16:41",
|
23 |
"type": "library",
|
24 |
"installation-source": "source",
|
25 |
"notification-url": "https://packagist.org/downloads/",
|
74 |
},
|
75 |
{
|
76 |
"name": "markbaker/matrix",
|
77 |
+
"version": "1.2.0",
|
78 |
+
"version_normalized": "1.2.0.0",
|
79 |
"source": {
|
80 |
"type": "git",
|
81 |
"url": "https://github.com/MarkBaker/PHPMatrix.git",
|
82 |
+
"reference": "5348c5a67e3b75cd209d70103f916a93b1f1ed21"
|
83 |
},
|
84 |
"dist": {
|
85 |
"type": "zip",
|
86 |
+
"url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/5348c5a67e3b75cd209d70103f916a93b1f1ed21",
|
87 |
+
"reference": "5348c5a67e3b75cd209d70103f916a93b1f1ed21",
|
88 |
"shasum": ""
|
89 |
},
|
90 |
"require": {
|
91 |
"php": "^5.6.0|^7.0.0"
|
92 |
},
|
93 |
"require-dev": {
|
94 |
+
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
|
95 |
+
"phpcompatibility/php-compatibility": "dev-master",
|
96 |
+
"phploc/phploc": "^4",
|
97 |
+
"phpmd/phpmd": "dev-master",
|
98 |
+
"phpunit/phpunit": "^5.7",
|
99 |
+
"sebastian/phpcpd": "^3.0",
|
100 |
+
"squizlabs/php_codesniffer": "^3.0@dev"
|
|
|
101 |
},
|
102 |
+
"time": "2019-10-06 11:29:25",
|
103 |
"type": "library",
|
104 |
"installation-source": "dist",
|
105 |
"autoload": {
|
vendor/markbaker/matrix/classes/src/Builder.php
CHANGED
@@ -7,6 +7,7 @@
|
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
/**
|
@@ -20,9 +21,9 @@ class Builder
|
|
20 |
* Create a new matrix of specified dimensions, and filled with a specified value
|
21 |
* If the column argument isn't provided, then a square matrix will be created
|
22 |
*
|
23 |
-
* @param $value
|
24 |
-
* @param $rows
|
25 |
-
* @param null $columns
|
26 |
* @return Matrix
|
27 |
* @throws Exception
|
28 |
*/
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
/**
|
21 |
* Create a new matrix of specified dimensions, and filled with a specified value
|
22 |
* If the column argument isn't provided, then a square matrix will be created
|
23 |
*
|
24 |
+
* @param mixed $value
|
25 |
+
* @param int $rows
|
26 |
+
* @param int|null $columns
|
27 |
* @return Matrix
|
28 |
* @throws Exception
|
29 |
*/
|
vendor/markbaker/matrix/classes/src/Functions.php
CHANGED
@@ -9,7 +9,9 @@ class Functions
|
|
9 |
*
|
10 |
* @param Matrix $matrix The matrix whose adjoint we wish to calculate
|
11 |
* @return Matrix
|
12 |
-
|
|
|
|
|
13 |
private static function getAdjoint(Matrix $matrix)
|
14 |
{
|
15 |
return self::transpose(
|
@@ -41,7 +43,9 @@ class Functions
|
|
41 |
*
|
42 |
* @param Matrix $matrix The matrix whose cofactors we wish to calculate
|
43 |
* @return Matrix
|
44 |
-
|
|
|
|
|
45 |
private static function getCofactors(Matrix $matrix)
|
46 |
{
|
47 |
$cofactors = self::getMinors($matrix);
|
@@ -65,8 +69,9 @@ class Functions
|
|
65 |
*
|
66 |
* @param Matrix $matrix The matrix whose cofactors we wish to calculate
|
67 |
* @return Matrix
|
|
|
68 |
* @throws Exception
|
69 |
-
|
70 |
public static function cofactors(Matrix $matrix)
|
71 |
{
|
72 |
if (!$matrix->isSquare()) {
|
@@ -76,6 +81,13 @@ class Functions
|
|
76 |
return self::getCofactors($matrix);
|
77 |
}
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
private static function getDeterminantSegment(Matrix $matrix, $row, $column)
|
80 |
{
|
81 |
$tmpMatrix = $matrix->toArray();
|
@@ -95,24 +107,32 @@ class Functions
|
|
95 |
*
|
96 |
* @param Matrix $matrix The matrix whose determinant we wish to calculate
|
97 |
* @return float
|
98 |
-
|
|
|
|
|
99 |
private static function getDeterminant(Matrix $matrix)
|
100 |
{
|
101 |
$dimensions = $matrix->rows;
|
102 |
-
if ($dimensions == 1) {
|
103 |
-
return $matrix->getValue(1, 1);
|
104 |
-
} elseif ($dimensions == 2) {
|
105 |
-
return $matrix->getValue(1, 1) * $matrix->getValue(2, 2) - $matrix->getValue(1, 2) * $matrix->getValue(2, 1);
|
106 |
-
}
|
107 |
-
|
108 |
$determinant = 0;
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
$determinant
|
113 |
-
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
}
|
117 |
|
118 |
return $determinant;
|
@@ -233,7 +253,9 @@ class Functions
|
|
233 |
*
|
234 |
* @param Matrix $matrix The matrix whose minors we wish to calculate
|
235 |
* @return array[]
|
236 |
-
|
|
|
|
|
237 |
protected static function getMinors(Matrix $matrix)
|
238 |
{
|
239 |
$minors = $matrix->toArray();
|
@@ -301,16 +323,13 @@ class Functions
|
|
301 |
*
|
302 |
* @param Matrix $matrix The matrix whose transpose we wish to calculate
|
303 |
* @return Matrix
|
304 |
-
* @throws Exception
|
305 |
**/
|
306 |
public static function transpose(Matrix $matrix)
|
307 |
{
|
|
|
308 |
$grid = call_user_func_array(
|
309 |
'array_map',
|
310 |
-
|
311 |
-
[null],
|
312 |
-
$matrix->toArray()
|
313 |
-
)
|
314 |
);
|
315 |
|
316 |
return new Matrix($grid);
|
9 |
*
|
10 |
* @param Matrix $matrix The matrix whose adjoint we wish to calculate
|
11 |
* @return Matrix
|
12 |
+
*
|
13 |
+
* @throws Exception
|
14 |
+
*/
|
15 |
private static function getAdjoint(Matrix $matrix)
|
16 |
{
|
17 |
return self::transpose(
|
43 |
*
|
44 |
* @param Matrix $matrix The matrix whose cofactors we wish to calculate
|
45 |
* @return Matrix
|
46 |
+
*
|
47 |
+
* @throws Exception
|
48 |
+
*/
|
49 |
private static function getCofactors(Matrix $matrix)
|
50 |
{
|
51 |
$cofactors = self::getMinors($matrix);
|
69 |
*
|
70 |
* @param Matrix $matrix The matrix whose cofactors we wish to calculate
|
71 |
* @return Matrix
|
72 |
+
*
|
73 |
* @throws Exception
|
74 |
+
*/
|
75 |
public static function cofactors(Matrix $matrix)
|
76 |
{
|
77 |
if (!$matrix->isSquare()) {
|
81 |
return self::getCofactors($matrix);
|
82 |
}
|
83 |
|
84 |
+
/**
|
85 |
+
* @param Matrix $matrix
|
86 |
+
* @param int $row
|
87 |
+
* @param int $column
|
88 |
+
* @return float
|
89 |
+
* @throws Exception
|
90 |
+
*/
|
91 |
private static function getDeterminantSegment(Matrix $matrix, $row, $column)
|
92 |
{
|
93 |
$tmpMatrix = $matrix->toArray();
|
107 |
*
|
108 |
* @param Matrix $matrix The matrix whose determinant we wish to calculate
|
109 |
* @return float
|
110 |
+
*
|
111 |
+
* @throws Exception
|
112 |
+
*/
|
113 |
private static function getDeterminant(Matrix $matrix)
|
114 |
{
|
115 |
$dimensions = $matrix->rows;
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
$determinant = 0;
|
117 |
+
|
118 |
+
switch ($dimensions) {
|
119 |
+
case 1:
|
120 |
+
$determinant = $matrix->getValue(1, 1);
|
121 |
+
break;
|
122 |
+
case 2:
|
123 |
+
$determinant = $matrix->getValue(1, 1) * $matrix->getValue(2, 2) -
|
124 |
+
$matrix->getValue(1, 2) * $matrix->getValue(2, 1);
|
125 |
+
break;
|
126 |
+
default:
|
127 |
+
for ($i = 1; $i <= $dimensions; ++$i) {
|
128 |
+
$det = $matrix->getValue(1, $i) * self::getDeterminantSegment($matrix, 0, $i - 1);
|
129 |
+
if (($i % 2) == 0) {
|
130 |
+
$determinant -= $det;
|
131 |
+
} else {
|
132 |
+
$determinant += $det;
|
133 |
+
}
|
134 |
+
}
|
135 |
+
break;
|
136 |
}
|
137 |
|
138 |
return $determinant;
|
253 |
*
|
254 |
* @param Matrix $matrix The matrix whose minors we wish to calculate
|
255 |
* @return array[]
|
256 |
+
*
|
257 |
+
* @throws Exception
|
258 |
+
*/
|
259 |
protected static function getMinors(Matrix $matrix)
|
260 |
{
|
261 |
$minors = $matrix->toArray();
|
323 |
*
|
324 |
* @param Matrix $matrix The matrix whose transpose we wish to calculate
|
325 |
* @return Matrix
|
|
|
326 |
**/
|
327 |
public static function transpose(Matrix $matrix)
|
328 |
{
|
329 |
+
$array = array_values(array_merge([null], $matrix->toArray()));
|
330 |
$grid = call_user_func_array(
|
331 |
'array_map',
|
332 |
+
$array
|
|
|
|
|
|
|
333 |
);
|
334 |
|
335 |
return new Matrix($grid);
|
vendor/markbaker/matrix/classes/src/Matrix.php
CHANGED
@@ -7,6 +7,7 @@
|
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
/**
|
@@ -44,7 +45,7 @@ class Matrix
|
|
44 |
*
|
45 |
* @param array $grid
|
46 |
*/
|
47 |
-
public function __construct(array $grid)
|
48 |
{
|
49 |
$this->buildFromArray(array_values($grid));
|
50 |
}
|
@@ -61,8 +62,7 @@ class Matrix
|
|
61 |
$grid,
|
62 |
function ($carry, $value) {
|
63 |
return max($carry, is_array($value) ? count($value) : 1);
|
64 |
-
}
|
65 |
-
0
|
66 |
);
|
67 |
$this->columns = $columns;
|
68 |
|
@@ -82,7 +82,7 @@ class Matrix
|
|
82 |
/**
|
83 |
* Validate that a row number is a positive integer
|
84 |
*
|
85 |
-
* @param $row
|
86 |
* @return int
|
87 |
* @throws Exception
|
88 |
*/
|
@@ -92,13 +92,13 @@ class Matrix
|
|
92 |
throw new Exception('Invalid Row');
|
93 |
}
|
94 |
|
95 |
-
return (int)
|
96 |
}
|
97 |
|
98 |
/**
|
99 |
* Validate that a column number is a positive integer
|
100 |
*
|
101 |
-
* @param $column
|
102 |
* @return int
|
103 |
* @throws Exception
|
104 |
*/
|
@@ -108,13 +108,13 @@ class Matrix
|
|
108 |
throw new Exception('Invalid Column');
|
109 |
}
|
110 |
|
111 |
-
return (int)
|
112 |
}
|
113 |
|
114 |
/**
|
115 |
* Validate that a row number falls within the set of rows for this matrix
|
116 |
*
|
117 |
-
* @param $row
|
118 |
* @return int
|
119 |
* @throws Exception
|
120 |
*/
|
@@ -131,7 +131,7 @@ class Matrix
|
|
131 |
/**
|
132 |
* Validate that a column number falls within the set of columns for this matrix
|
133 |
*
|
134 |
-
* @param $column
|
135 |
* @return int
|
136 |
* @throws Exception
|
137 |
*/
|
@@ -152,7 +152,7 @@ class Matrix
|
|
152 |
*
|
153 |
* Note that row numbers start from 1, not from 0
|
154 |
*
|
155 |
-
* @param $row
|
156 |
* @param int $rowCount
|
157 |
* @return static
|
158 |
* @throws Exception
|
@@ -160,11 +160,11 @@ class Matrix
|
|
160 |
public function getRows($row, $rowCount = 1)
|
161 |
{
|
162 |
$row = $this->validateRowInRange($row);
|
163 |
-
if ($rowCount
|
164 |
$rowCount = $this->rows - $row + 1;
|
165 |
}
|
166 |
|
167 |
-
return new static(array_slice($this->grid, $row - 1, $rowCount));
|
168 |
}
|
169 |
|
170 |
/**
|
@@ -174,9 +174,9 @@ class Matrix
|
|
174 |
*
|
175 |
* Note that column numbers start from 1, not from 0
|
176 |
*
|
177 |
-
* @param $column
|
178 |
* @param int $columnCount
|
179 |
-
* @return
|
180 |
* @throws Exception
|
181 |
*/
|
182 |
public function getColumns($column, $columnCount = 1)
|
@@ -202,7 +202,7 @@ class Matrix
|
|
202 |
*
|
203 |
* Note that row numbers start from 1, not from 0
|
204 |
*
|
205 |
-
* @param $row
|
206 |
* @param int $rowCount
|
207 |
* @return static
|
208 |
* @throws Exception
|
@@ -210,12 +210,12 @@ class Matrix
|
|
210 |
public function dropRows($row, $rowCount = 1)
|
211 |
{
|
212 |
$this->validateRowInRange($row);
|
213 |
-
if ($rowCount
|
214 |
$rowCount = $this->rows - $row + 1;
|
215 |
}
|
216 |
|
217 |
$grid = $this->grid;
|
218 |
-
array_splice($grid, $row - 1, $rowCount);
|
219 |
|
220 |
return new static($grid);
|
221 |
}
|
@@ -228,7 +228,7 @@ class Matrix
|
|
228 |
*
|
229 |
* Note that column numbers start from 1, not from 0
|
230 |
*
|
231 |
-
* @param $column
|
232 |
* @param int $columnCount
|
233 |
* @return static
|
234 |
* @throws Exception
|
@@ -239,12 +239,12 @@ class Matrix
|
|
239 |
if ($columnCount < 1) {
|
240 |
$columnCount = $this->columns + $columnCount - $column + 1;
|
241 |
}
|
242 |
-
|
243 |
$grid = $this->grid;
|
244 |
array_walk(
|
245 |
$grid,
|
246 |
function (&$row) use ($column, $columnCount) {
|
247 |
-
array_splice($row, $column - 1, $columnCount);
|
248 |
}
|
249 |
);
|
250 |
|
@@ -255,9 +255,9 @@ class Matrix
|
|
255 |
* Return a value from this matrix, from the "cell" identified by the row and column numbers
|
256 |
* Note that row and column numbers start from 1, not from 0
|
257 |
*
|
258 |
-
* @param $row
|
259 |
-
* @param $column
|
260 |
-
* @return
|
261 |
* @throws Exception
|
262 |
*/
|
263 |
public function getValue($row, $column)
|
@@ -338,9 +338,9 @@ class Matrix
|
|
338 |
/**
|
339 |
* Access specific properties as read-only (no setters)
|
340 |
*
|
341 |
-
* @param
|
342 |
-
* @return
|
343 |
-
* @throws
|
344 |
*/
|
345 |
public function __get($propertyName)
|
346 |
{
|
@@ -379,24 +379,21 @@ class Matrix
|
|
379 |
/**
|
380 |
* Returns the result of the function call or operation
|
381 |
*
|
382 |
-
* @param
|
383 |
-
* @param
|
384 |
-
* @return
|
385 |
-
* @throws
|
386 |
*/
|
387 |
public function __call($functionName, $arguments)
|
388 |
{
|
389 |
$functionName = strtolower(str_replace('_', '', $functionName));
|
390 |
|
391 |
-
|
392 |
-
if (in_array($functionName, self::$functions)) {
|
393 |
$functionName = "\\" . __NAMESPACE__ . "\\{$functionName}";
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
$functionName = "\\" . __NAMESPACE__ . "\\{$functionName}";
|
399 |
-
return $functionName($this, ...$arguments);
|
400 |
}
|
401 |
throw new Exception('Function or Operation does not exist');
|
402 |
}
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
/**
|
45 |
*
|
46 |
* @param array $grid
|
47 |
*/
|
48 |
+
final public function __construct(array $grid)
|
49 |
{
|
50 |
$this->buildFromArray(array_values($grid));
|
51 |
}
|
62 |
$grid,
|
63 |
function ($carry, $value) {
|
64 |
return max($carry, is_array($value) ? count($value) : 1);
|
65 |
+
}
|
|
|
66 |
);
|
67 |
$this->columns = $columns;
|
68 |
|
82 |
/**
|
83 |
* Validate that a row number is a positive integer
|
84 |
*
|
85 |
+
* @param int $row
|
86 |
* @return int
|
87 |
* @throws Exception
|
88 |
*/
|
92 |
throw new Exception('Invalid Row');
|
93 |
}
|
94 |
|
95 |
+
return (int)$row;
|
96 |
}
|
97 |
|
98 |
/**
|
99 |
* Validate that a column number is a positive integer
|
100 |
*
|
101 |
+
* @param int $column
|
102 |
* @return int
|
103 |
* @throws Exception
|
104 |
*/
|
108 |
throw new Exception('Invalid Column');
|
109 |
}
|
110 |
|
111 |
+
return (int)$column;
|
112 |
}
|
113 |
|
114 |
/**
|
115 |
* Validate that a row number falls within the set of rows for this matrix
|
116 |
*
|
117 |
+
* @param int $row
|
118 |
* @return int
|
119 |
* @throws Exception
|
120 |
*/
|
131 |
/**
|
132 |
* Validate that a column number falls within the set of columns for this matrix
|
133 |
*
|
134 |
+
* @param int $column
|
135 |
* @return int
|
136 |
* @throws Exception
|
137 |
*/
|
152 |
*
|
153 |
* Note that row numbers start from 1, not from 0
|
154 |
*
|
155 |
+
* @param int $row
|
156 |
* @param int $rowCount
|
157 |
* @return static
|
158 |
* @throws Exception
|
160 |
public function getRows($row, $rowCount = 1)
|
161 |
{
|
162 |
$row = $this->validateRowInRange($row);
|
163 |
+
if ($rowCount === 0) {
|
164 |
$rowCount = $this->rows - $row + 1;
|
165 |
}
|
166 |
|
167 |
+
return new static(array_slice($this->grid, $row - 1, (int)$rowCount));
|
168 |
}
|
169 |
|
170 |
/**
|
174 |
*
|
175 |
* Note that column numbers start from 1, not from 0
|
176 |
*
|
177 |
+
* @param int $column
|
178 |
* @param int $columnCount
|
179 |
+
* @return Matrix
|
180 |
* @throws Exception
|
181 |
*/
|
182 |
public function getColumns($column, $columnCount = 1)
|
202 |
*
|
203 |
* Note that row numbers start from 1, not from 0
|
204 |
*
|
205 |
+
* @param int $row
|
206 |
* @param int $rowCount
|
207 |
* @return static
|
208 |
* @throws Exception
|
210 |
public function dropRows($row, $rowCount = 1)
|
211 |
{
|
212 |
$this->validateRowInRange($row);
|
213 |
+
if ($rowCount === 0) {
|
214 |
$rowCount = $this->rows - $row + 1;
|
215 |
}
|
216 |
|
217 |
$grid = $this->grid;
|
218 |
+
array_splice($grid, $row - 1, (int)$rowCount);
|
219 |
|
220 |
return new static($grid);
|
221 |
}
|
228 |
*
|
229 |
* Note that column numbers start from 1, not from 0
|
230 |
*
|
231 |
+
* @param int $column
|
232 |
* @param int $columnCount
|
233 |
* @return static
|
234 |
* @throws Exception
|
239 |
if ($columnCount < 1) {
|
240 |
$columnCount = $this->columns + $columnCount - $column + 1;
|
241 |
}
|
242 |
+
|
243 |
$grid = $this->grid;
|
244 |
array_walk(
|
245 |
$grid,
|
246 |
function (&$row) use ($column, $columnCount) {
|
247 |
+
array_splice($row, $column - 1, (int)$columnCount);
|
248 |
}
|
249 |
);
|
250 |
|
255 |
* Return a value from this matrix, from the "cell" identified by the row and column numbers
|
256 |
* Note that row and column numbers start from 1, not from 0
|
257 |
*
|
258 |
+
* @param int $row
|
259 |
+
* @param int $column
|
260 |
+
* @return mixed
|
261 |
* @throws Exception
|
262 |
*/
|
263 |
public function getValue($row, $column)
|
338 |
/**
|
339 |
* Access specific properties as read-only (no setters)
|
340 |
*
|
341 |
+
* @param string $propertyName
|
342 |
+
* @return mixed
|
343 |
+
* @throws Exception
|
344 |
*/
|
345 |
public function __get($propertyName)
|
346 |
{
|
379 |
/**
|
380 |
* Returns the result of the function call or operation
|
381 |
*
|
382 |
+
* @param string $functionName
|
383 |
+
* @param mixed[] $arguments
|
384 |
+
* @return Matrix|float
|
385 |
+
* @throws Exception
|
386 |
*/
|
387 |
public function __call($functionName, $arguments)
|
388 |
{
|
389 |
$functionName = strtolower(str_replace('_', '', $functionName));
|
390 |
|
391 |
+
if (in_array($functionName, self::$functions) || in_array($functionName, self::$operations)) {
|
|
|
392 |
$functionName = "\\" . __NAMESPACE__ . "\\{$functionName}";
|
393 |
+
if (is_callable($functionName)) {
|
394 |
+
$arguments = array_values(array_merge([$this], $arguments));
|
395 |
+
return call_user_func_array($functionName, $arguments);
|
396 |
+
}
|
|
|
|
|
397 |
}
|
398 |
throw new Exception('Function or Operation does not exist');
|
399 |
}
|
vendor/markbaker/matrix/classes/src/Operators/DirectSum.php
CHANGED
@@ -11,16 +11,16 @@ class DirectSum extends Operator
|
|
11 |
* Execute the addition
|
12 |
*
|
13 |
* @param mixed $value The matrix or numeric value to add to the current base value
|
14 |
-
* @throws Exception If the provided argument is not appropriate for the operation
|
15 |
* @return $this The operation object, allowing multiple additions to be chained
|
16 |
-
|
|
|
17 |
public function execute($value)
|
18 |
{
|
19 |
if (is_array($value)) {
|
20 |
$value = new Matrix($value);
|
21 |
}
|
22 |
|
23 |
-
if (
|
24 |
return $this->directSumMatrix($value);
|
25 |
}
|
26 |
|
@@ -32,30 +32,29 @@ class DirectSum extends Operator
|
|
32 |
*
|
33 |
* @param Matrix $value The numeric value to concatenate/direct sum with the current base value
|
34 |
* @return $this The operation object, allowing multiple additions to be chained
|
35 |
-
* @throws Exception If the provided argument is not appropriate for the operation
|
36 |
**/
|
37 |
-
|
38 |
{
|
39 |
$originalColumnCount = count($this->matrix[0]);
|
40 |
$originalRowCount = count($this->matrix);
|
41 |
-
$
|
42 |
-
$
|
43 |
$value = $value->toArray();
|
44 |
|
45 |
for ($row = 0; $row < $this->rows; ++$row) {
|
46 |
-
$this->matrix[$row] = array_merge($this->matrix[$row], array_fill(0, $
|
47 |
}
|
48 |
|
49 |
$this->matrix = array_merge(
|
50 |
$this->matrix,
|
51 |
-
array_fill(0, $
|
52 |
);
|
53 |
|
54 |
-
for ($row = $originalRowCount; $row < $originalRowCount + $
|
55 |
array_splice(
|
56 |
$this->matrix[$row],
|
57 |
$originalColumnCount,
|
58 |
-
$
|
59 |
$value[$row - $originalRowCount]
|
60 |
);
|
61 |
}
|
11 |
* Execute the addition
|
12 |
*
|
13 |
* @param mixed $value The matrix or numeric value to add to the current base value
|
|
|
14 |
* @return $this The operation object, allowing multiple additions to be chained
|
15 |
+
* @throws Exception If the provided argument is not appropriate for the operation
|
16 |
+
*/
|
17 |
public function execute($value)
|
18 |
{
|
19 |
if (is_array($value)) {
|
20 |
$value = new Matrix($value);
|
21 |
}
|
22 |
|
23 |
+
if ($value instanceof Matrix) {
|
24 |
return $this->directSumMatrix($value);
|
25 |
}
|
26 |
|
32 |
*
|
33 |
* @param Matrix $value The numeric value to concatenate/direct sum with the current base value
|
34 |
* @return $this The operation object, allowing multiple additions to be chained
|
|
|
35 |
**/
|
36 |
+
private function directSumMatrix($value)
|
37 |
{
|
38 |
$originalColumnCount = count($this->matrix[0]);
|
39 |
$originalRowCount = count($this->matrix);
|
40 |
+
$valColumnCount = $value->columns;
|
41 |
+
$valRowCount = $value->rows;
|
42 |
$value = $value->toArray();
|
43 |
|
44 |
for ($row = 0; $row < $this->rows; ++$row) {
|
45 |
+
$this->matrix[$row] = array_merge($this->matrix[$row], array_fill(0, $valColumnCount, 0));
|
46 |
}
|
47 |
|
48 |
$this->matrix = array_merge(
|
49 |
$this->matrix,
|
50 |
+
array_fill(0, $valRowCount, array_fill(0, $originalColumnCount, 0))
|
51 |
);
|
52 |
|
53 |
+
for ($row = $originalRowCount; $row < $originalRowCount + $valRowCount; ++$row) {
|
54 |
array_splice(
|
55 |
$this->matrix[$row],
|
56 |
$originalColumnCount,
|
57 |
+
$valColumnCount,
|
58 |
$value[$row - $originalRowCount]
|
59 |
);
|
60 |
}
|
vendor/markbaker/matrix/classes/src/functions/adjoint.php
CHANGED
@@ -7,20 +7,24 @@
|
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
/**
|
13 |
* Returns the adjoint of a matrix or an array.
|
14 |
*
|
15 |
-
* @param
|
16 |
-
* @return
|
17 |
-
* @throws
|
18 |
*/
|
19 |
function adjoint($matrix)
|
20 |
{
|
21 |
-
if (
|
22 |
$matrix = new Matrix($matrix);
|
23 |
}
|
|
|
|
|
|
|
24 |
|
25 |
return Functions::adjoint($matrix);
|
26 |
}
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
/**
|
14 |
* Returns the adjoint of a matrix or an array.
|
15 |
*
|
16 |
+
* @param Matrix|array $matrix Matrix or an array to treat as a matrix.
|
17 |
+
* @return Matrix The new matrix
|
18 |
+
* @throws Exception If argument isn't a valid matrix or array.
|
19 |
*/
|
20 |
function adjoint($matrix)
|
21 |
{
|
22 |
+
if (is_array($matrix)) {
|
23 |
$matrix = new Matrix($matrix);
|
24 |
}
|
25 |
+
if (!$matrix instanceof Matrix) {
|
26 |
+
throw new Exception('Must be Matrix or array');
|
27 |
+
}
|
28 |
|
29 |
return Functions::adjoint($matrix);
|
30 |
}
|
vendor/markbaker/matrix/classes/src/functions/antidiagonal.php
CHANGED
@@ -18,9 +18,12 @@ namespace Matrix;
|
|
18 |
*/
|
19 |
function antidiagonal($matrix)
|
20 |
{
|
21 |
-
if (
|
22 |
$matrix = new Matrix($matrix);
|
23 |
}
|
|
|
|
|
|
|
24 |
|
25 |
return Functions::antidiagonal($matrix);
|
26 |
}
|
18 |
*/
|
19 |
function antidiagonal($matrix)
|
20 |
{
|
21 |
+
if (is_array($matrix)) {
|
22 |
$matrix = new Matrix($matrix);
|
23 |
}
|
24 |
+
if (!$matrix instanceof Matrix) {
|
25 |
+
throw new Exception('Must be Matrix or array');
|
26 |
+
}
|
27 |
|
28 |
return Functions::antidiagonal($matrix);
|
29 |
}
|
vendor/markbaker/matrix/classes/src/functions/cofactors.php
CHANGED
@@ -7,20 +7,24 @@
|
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
/**
|
13 |
* Returns the cofactors of a matrix or an array.
|
14 |
*
|
15 |
-
* @param
|
16 |
-
* @return
|
17 |
-
* @throws
|
18 |
*/
|
19 |
function cofactors($matrix)
|
20 |
{
|
21 |
-
if (
|
22 |
$matrix = new Matrix($matrix);
|
23 |
}
|
|
|
|
|
|
|
24 |
|
25 |
return Functions::cofactors($matrix);
|
26 |
}
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
/**
|
14 |
* Returns the cofactors of a matrix or an array.
|
15 |
*
|
16 |
+
* @param Matrix|array $matrix Matrix or an array to treat as a matrix.
|
17 |
+
* @return Matrix The new matrix
|
18 |
+
* @throws Exception If argument isn't a valid matrix or array.
|
19 |
*/
|
20 |
function cofactors($matrix)
|
21 |
{
|
22 |
+
if (is_array($matrix)) {
|
23 |
$matrix = new Matrix($matrix);
|
24 |
}
|
25 |
+
if (!$matrix instanceof Matrix) {
|
26 |
+
throw new Exception('Must be Matrix or array');
|
27 |
+
}
|
28 |
|
29 |
return Functions::cofactors($matrix);
|
30 |
}
|
vendor/markbaker/matrix/classes/src/functions/determinant.php
CHANGED
@@ -7,20 +7,24 @@
|
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
/**
|
13 |
* Returns the determinant of a matrix or an array.
|
14 |
*
|
15 |
-
* @param
|
16 |
-
* @return
|
17 |
-
* @throws
|
18 |
*/
|
19 |
function determinant($matrix)
|
20 |
{
|
21 |
-
if (
|
22 |
$matrix = new Matrix($matrix);
|
23 |
}
|
|
|
|
|
|
|
24 |
|
25 |
return Functions::determinant($matrix);
|
26 |
}
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
/**
|
14 |
* Returns the determinant of a matrix or an array.
|
15 |
*
|
16 |
+
* @param Matrix|array $matrix Matrix or an array to treat as a matrix.
|
17 |
+
* @return float Matrix determinant
|
18 |
+
* @throws Exception If argument isn't a valid matrix or array.
|
19 |
*/
|
20 |
function determinant($matrix)
|
21 |
{
|
22 |
+
if (is_array($matrix)) {
|
23 |
$matrix = new Matrix($matrix);
|
24 |
}
|
25 |
+
if (!$matrix instanceof Matrix) {
|
26 |
+
throw new Exception('Must be Matrix or array');
|
27 |
+
}
|
28 |
|
29 |
return Functions::determinant($matrix);
|
30 |
}
|
vendor/markbaker/matrix/classes/src/functions/diagonal.php
CHANGED
@@ -7,20 +7,24 @@
|
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
/**
|
13 |
* Returns the diagonal of a matrix or an array.
|
14 |
*
|
15 |
-
* @param
|
16 |
-
* @return
|
17 |
-
* @throws
|
18 |
*/
|
19 |
function diagonal($matrix)
|
20 |
{
|
21 |
-
if (
|
22 |
$matrix = new Matrix($matrix);
|
23 |
}
|
|
|
|
|
|
|
24 |
|
25 |
return Functions::diagonal($matrix);
|
26 |
}
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
/**
|
14 |
* Returns the diagonal of a matrix or an array.
|
15 |
*
|
16 |
+
* @param Matrix|array $matrix Matrix or an array to treat as a matrix.
|
17 |
+
* @return Matrix The new matrix
|
18 |
+
* @throws Exception If argument isn't a valid matrix or array.
|
19 |
*/
|
20 |
function diagonal($matrix)
|
21 |
{
|
22 |
+
if (is_array($matrix)) {
|
23 |
$matrix = new Matrix($matrix);
|
24 |
}
|
25 |
+
if (!$matrix instanceof Matrix) {
|
26 |
+
throw new Exception('Must be Matrix or array');
|
27 |
+
}
|
28 |
|
29 |
return Functions::diagonal($matrix);
|
30 |
}
|
vendor/markbaker/matrix/classes/src/functions/identity.php
CHANGED
@@ -7,20 +7,24 @@
|
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
/**
|
13 |
* Returns the identity of a matrix or an array.
|
14 |
*
|
15 |
-
* @param
|
16 |
-
* @return
|
17 |
-
* @throws
|
18 |
*/
|
19 |
function identity($matrix)
|
20 |
{
|
21 |
-
if (
|
22 |
$matrix = new Matrix($matrix);
|
23 |
}
|
|
|
|
|
|
|
24 |
|
25 |
return Functions::identity($matrix);
|
26 |
}
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
/**
|
14 |
* Returns the identity of a matrix or an array.
|
15 |
*
|
16 |
+
* @param Matrix|array $matrix Matrix or an array to treat as a matrix.
|
17 |
+
* @return Matrix The identity matrix
|
18 |
+
* @throws Exception If argument isn't a valid matrix or array.
|
19 |
*/
|
20 |
function identity($matrix)
|
21 |
{
|
22 |
+
if (is_array($matrix)) {
|
23 |
$matrix = new Matrix($matrix);
|
24 |
}
|
25 |
+
if (!$matrix instanceof Matrix) {
|
26 |
+
throw new Exception('Must be Matrix or array');
|
27 |
+
}
|
28 |
|
29 |
return Functions::identity($matrix);
|
30 |
}
|
vendor/markbaker/matrix/classes/src/functions/inverse.php
CHANGED
@@ -7,20 +7,24 @@
|
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
/**
|
13 |
* Returns the inverse of a matrix or an array.
|
14 |
*
|
15 |
-
* @param
|
16 |
-
* @return
|
17 |
-
* @throws
|
18 |
*/
|
19 |
function inverse($matrix)
|
20 |
{
|
21 |
-
if (
|
22 |
$matrix = new Matrix($matrix);
|
23 |
}
|
|
|
|
|
|
|
24 |
|
25 |
return Functions::inverse($matrix);
|
26 |
}
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
/**
|
14 |
* Returns the inverse of a matrix or an array.
|
15 |
*
|
16 |
+
* @param Matrix|array $matrix Matrix or an array to treat as a matrix.
|
17 |
+
* @return Matrix The new matrix
|
18 |
+
* @throws Exception If argument isn't a valid matrix or array.
|
19 |
*/
|
20 |
function inverse($matrix)
|
21 |
{
|
22 |
+
if (is_array($matrix)) {
|
23 |
$matrix = new Matrix($matrix);
|
24 |
}
|
25 |
+
if (!$matrix instanceof Matrix) {
|
26 |
+
throw new Exception('Must be Matrix or array');
|
27 |
+
}
|
28 |
|
29 |
return Functions::inverse($matrix);
|
30 |
}
|
vendor/markbaker/matrix/classes/src/functions/minors.php
CHANGED
@@ -7,20 +7,24 @@
|
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
/**
|
13 |
* Returns the minors of a matrix or an array.
|
14 |
*
|
15 |
-
* @param
|
16 |
-
* @return
|
17 |
-
* @throws
|
18 |
*/
|
19 |
function minors($matrix)
|
20 |
{
|
21 |
-
if (
|
22 |
$matrix = new Matrix($matrix);
|
23 |
}
|
|
|
|
|
|
|
24 |
|
25 |
return Functions::minors($matrix);
|
26 |
}
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
/**
|
14 |
* Returns the minors of a matrix or an array.
|
15 |
*
|
16 |
+
* @param Matrix|array $matrix Matrix or an array to treat as a matrix.
|
17 |
+
* @return Matrix The new matrix
|
18 |
+
* @throws Exception If argument isn't a valid matrix or array.
|
19 |
*/
|
20 |
function minors($matrix)
|
21 |
{
|
22 |
+
if (is_array($matrix)) {
|
23 |
$matrix = new Matrix($matrix);
|
24 |
}
|
25 |
+
if (!$matrix instanceof Matrix) {
|
26 |
+
throw new Exception('Must be Matrix or array');
|
27 |
+
}
|
28 |
|
29 |
return Functions::minors($matrix);
|
30 |
}
|
vendor/markbaker/matrix/classes/src/functions/trace.php
CHANGED
@@ -7,20 +7,24 @@
|
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
/**
|
13 |
* Returns the trace of a matrix or an array.
|
14 |
*
|
15 |
-
* @param
|
16 |
-
* @return
|
17 |
-
* @throws
|
18 |
*/
|
19 |
function trace($matrix)
|
20 |
{
|
21 |
-
if (
|
22 |
$matrix = new Matrix($matrix);
|
23 |
}
|
|
|
|
|
|
|
24 |
|
25 |
return Functions::trace($matrix);
|
26 |
}
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
/**
|
14 |
* Returns the trace of a matrix or an array.
|
15 |
*
|
16 |
+
* @param Matrix|array $matrix Matrix or an array to treat as a matrix.
|
17 |
+
* @return float The trace of the matrix
|
18 |
+
* @throws Exception If argument isn't a valid matrix or array.
|
19 |
*/
|
20 |
function trace($matrix)
|
21 |
{
|
22 |
+
if (is_array($matrix)) {
|
23 |
$matrix = new Matrix($matrix);
|
24 |
}
|
25 |
+
if (!$matrix instanceof Matrix) {
|
26 |
+
throw new Exception('Must be Matrix or array');
|
27 |
+
}
|
28 |
|
29 |
return Functions::trace($matrix);
|
30 |
}
|
vendor/markbaker/matrix/classes/src/functions/transpose.php
CHANGED
@@ -7,20 +7,24 @@
|
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
/**
|
13 |
* Returns the transpose of a matrix or an array.
|
14 |
*
|
15 |
-
* @param
|
16 |
-
* @return
|
17 |
-
* @throws
|
18 |
*/
|
19 |
function transpose($matrix)
|
20 |
{
|
21 |
-
if (
|
22 |
$matrix = new Matrix($matrix);
|
23 |
}
|
|
|
|
|
|
|
24 |
|
25 |
return Functions::transpose($matrix);
|
26 |
}
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
/**
|
14 |
* Returns the transpose of a matrix or an array.
|
15 |
*
|
16 |
+
* @param Matrix|array $matrix Matrix or an array to treat as a matrix.
|
17 |
+
* @return Matrix The transposed matrix
|
18 |
+
* @throws Exception If argument isn't a valid matrix or array.
|
19 |
*/
|
20 |
function transpose($matrix)
|
21 |
{
|
22 |
+
if (is_array($matrix)) {
|
23 |
$matrix = new Matrix($matrix);
|
24 |
}
|
25 |
+
if (!$matrix instanceof Matrix) {
|
26 |
+
throw new Exception('Must be Matrix or array');
|
27 |
+
}
|
28 |
|
29 |
return Functions::transpose($matrix);
|
30 |
}
|
vendor/markbaker/matrix/classes/src/operations/add.php
CHANGED
@@ -7,6 +7,7 @@
|
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
use Matrix\Operators\Addition;
|
@@ -14,20 +15,24 @@ use Matrix\Operators\Addition;
|
|
14 |
/**
|
15 |
* Adds two or more matrices
|
16 |
*
|
17 |
-
* @param
|
18 |
-
* @return
|
19 |
-
* @throws
|
20 |
*/
|
21 |
function add(...$matrixValues)
|
22 |
{
|
23 |
if (count($matrixValues) < 2) {
|
24 |
-
throw new Exception('
|
25 |
}
|
26 |
|
27 |
$matrix = array_shift($matrixValues);
|
28 |
-
|
|
|
29 |
$matrix = new Matrix($matrix);
|
30 |
}
|
|
|
|
|
|
|
31 |
|
32 |
$result = new Addition($matrix);
|
33 |
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
use Matrix\Operators\Addition;
|
15 |
/**
|
16 |
* Adds two or more matrices
|
17 |
*
|
18 |
+
* @param array<int, mixed> $matrixValues The matrices to add
|
19 |
+
* @return Matrix
|
20 |
+
* @throws Exception
|
21 |
*/
|
22 |
function add(...$matrixValues)
|
23 |
{
|
24 |
if (count($matrixValues) < 2) {
|
25 |
+
throw new Exception('Addition operation requires at least 2 arguments');
|
26 |
}
|
27 |
|
28 |
$matrix = array_shift($matrixValues);
|
29 |
+
|
30 |
+
if (is_array($matrix)) {
|
31 |
$matrix = new Matrix($matrix);
|
32 |
}
|
33 |
+
if (!$matrix instanceof Matrix) {
|
34 |
+
throw new Exception('Addition arguments must be Matrix or array');
|
35 |
+
}
|
36 |
|
37 |
$result = new Addition($matrix);
|
38 |
|
vendor/markbaker/matrix/classes/src/operations/directsum.php
CHANGED
@@ -7,6 +7,7 @@
|
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
use Matrix\Operators\DirectSum;
|
@@ -14,20 +15,24 @@ use Matrix\Operators\DirectSum;
|
|
14 |
/**
|
15 |
* Adds two or more matrices
|
16 |
*
|
17 |
-
* @param
|
18 |
-
* @return
|
19 |
-
* @throws
|
20 |
*/
|
21 |
function directsum(...$matrixValues)
|
22 |
{
|
23 |
if (count($matrixValues) < 2) {
|
24 |
-
throw new Exception('
|
25 |
}
|
26 |
|
27 |
$matrix = array_shift($matrixValues);
|
28 |
-
|
|
|
29 |
$matrix = new Matrix($matrix);
|
30 |
}
|
|
|
|
|
|
|
31 |
|
32 |
$result = new DirectSum($matrix);
|
33 |
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
use Matrix\Operators\DirectSum;
|
15 |
/**
|
16 |
* Adds two or more matrices
|
17 |
*
|
18 |
+
* @param array<int, mixed> $matrixValues The matrices to add
|
19 |
+
* @return Matrix
|
20 |
+
* @throws Exception
|
21 |
*/
|
22 |
function directsum(...$matrixValues)
|
23 |
{
|
24 |
if (count($matrixValues) < 2) {
|
25 |
+
throw new Exception('DirectSum operation requires at least 2 arguments');
|
26 |
}
|
27 |
|
28 |
$matrix = array_shift($matrixValues);
|
29 |
+
|
30 |
+
if (is_array($matrix)) {
|
31 |
$matrix = new Matrix($matrix);
|
32 |
}
|
33 |
+
if (!$matrix instanceof Matrix) {
|
34 |
+
throw new Exception('DirectSum arguments must be Matrix or array');
|
35 |
+
}
|
36 |
|
37 |
$result = new DirectSum($matrix);
|
38 |
|
vendor/markbaker/matrix/classes/src/operations/divideby.php
CHANGED
@@ -7,6 +7,7 @@
|
|
7 |
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
use Matrix\Operators\Division;
|
@@ -14,19 +15,24 @@ use Matrix\Operators\Division;
|
|
14 |
/**
|
15 |
* Divides two or more matrix numbers
|
16 |
*
|
17 |
-
* @param
|
18 |
-
* @return
|
|
|
19 |
*/
|
20 |
function divideby(...$matrixValues)
|
21 |
{
|
22 |
if (count($matrixValues) < 2) {
|
23 |
-
throw new
|
24 |
}
|
25 |
|
26 |
$matrix = array_shift($matrixValues);
|
27 |
-
|
|
|
28 |
$matrix = new Matrix($matrix);
|
29 |
}
|
|
|
|
|
|
|
30 |
|
31 |
$result = new Division($matrix);
|
32 |
|
7 |
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
use Matrix\Operators\Division;
|
15 |
/**
|
16 |
* Divides two or more matrix numbers
|
17 |
*
|
18 |
+
* @param array<int, mixed> $matrixValues The matrices to divide
|
19 |
+
* @return Matrix
|
20 |
+
* @throws Exception
|
21 |
*/
|
22 |
function divideby(...$matrixValues)
|
23 |
{
|
24 |
if (count($matrixValues) < 2) {
|
25 |
+
throw new Exception('Division operation requires at least 2 arguments');
|
26 |
}
|
27 |
|
28 |
$matrix = array_shift($matrixValues);
|
29 |
+
|
30 |
+
if (is_array($matrix)) {
|
31 |
$matrix = new Matrix($matrix);
|
32 |
}
|
33 |
+
if (!$matrix instanceof Matrix) {
|
34 |
+
throw new Exception('Division arguments must be Matrix or array');
|
35 |
+
}
|
36 |
|
37 |
$result = new Division($matrix);
|
38 |
|
vendor/markbaker/matrix/classes/src/operations/divideinto.php
CHANGED
@@ -7,6 +7,7 @@
|
|
7 |
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
use Matrix\Operators\Division;
|
@@ -14,20 +15,24 @@ use Matrix\Operators\Division;
|
|
14 |
/**
|
15 |
* Divides two or more matrix numbers
|
16 |
*
|
17 |
-
* @param
|
18 |
-
* @return
|
|
|
19 |
*/
|
20 |
function divideinto(...$matrixValues)
|
21 |
{
|
22 |
if (count($matrixValues) < 2) {
|
23 |
-
throw new
|
24 |
}
|
25 |
-
$matrixValues = array_reverse($matrixValues);
|
26 |
|
27 |
$matrix = array_shift($matrixValues);
|
28 |
-
|
|
|
29 |
$matrix = new Matrix($matrix);
|
30 |
}
|
|
|
|
|
|
|
31 |
|
32 |
$result = new Division($matrix);
|
33 |
|
7 |
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
use Matrix\Operators\Division;
|
15 |
/**
|
16 |
* Divides two or more matrix numbers
|
17 |
*
|
18 |
+
* @param array<int, mixed> $matrixValues The numbers to divide
|
19 |
+
* @return Matrix
|
20 |
+
* @throws Exception
|
21 |
*/
|
22 |
function divideinto(...$matrixValues)
|
23 |
{
|
24 |
if (count($matrixValues) < 2) {
|
25 |
+
throw new Exception('Division operation requires at least 2 arguments');
|
26 |
}
|
|
|
27 |
|
28 |
$matrix = array_shift($matrixValues);
|
29 |
+
|
30 |
+
if (is_array($matrix)) {
|
31 |
$matrix = new Matrix($matrix);
|
32 |
}
|
33 |
+
if (!$matrix instanceof Matrix) {
|
34 |
+
throw new Exception('Division arguments must be Matrix or array');
|
35 |
+
}
|
36 |
|
37 |
$result = new Division($matrix);
|
38 |
|
vendor/markbaker/matrix/classes/src/operations/multiply.php
CHANGED
@@ -7,6 +7,7 @@
|
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
use Matrix\Operators\Multiplication;
|
@@ -14,20 +15,24 @@ use Matrix\Operators\Multiplication;
|
|
14 |
/**
|
15 |
* Multiplies two or more matrices
|
16 |
*
|
17 |
-
* @param
|
18 |
-
* @return
|
19 |
-
* @throws
|
20 |
*/
|
21 |
function multiply(...$matrixValues)
|
22 |
{
|
23 |
if (count($matrixValues) < 2) {
|
24 |
-
throw new Exception('
|
25 |
}
|
26 |
|
27 |
$matrix = array_shift($matrixValues);
|
28 |
-
|
|
|
29 |
$matrix = new Matrix($matrix);
|
30 |
}
|
|
|
|
|
|
|
31 |
|
32 |
$result = new Multiplication($matrix);
|
33 |
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
use Matrix\Operators\Multiplication;
|
15 |
/**
|
16 |
* Multiplies two or more matrices
|
17 |
*
|
18 |
+
* @param array<int, mixed> $matrixValues The matrices to multiply
|
19 |
+
* @return Matrix
|
20 |
+
* @throws Exception
|
21 |
*/
|
22 |
function multiply(...$matrixValues)
|
23 |
{
|
24 |
if (count($matrixValues) < 2) {
|
25 |
+
throw new Exception('Multiplication operation requires at least 2 arguments');
|
26 |
}
|
27 |
|
28 |
$matrix = array_shift($matrixValues);
|
29 |
+
|
30 |
+
if (is_array($matrix)) {
|
31 |
$matrix = new Matrix($matrix);
|
32 |
}
|
33 |
+
if (!$matrix instanceof Matrix) {
|
34 |
+
throw new Exception('Multiplication arguments must be Matrix or array');
|
35 |
+
}
|
36 |
|
37 |
$result = new Multiplication($matrix);
|
38 |
|
vendor/markbaker/matrix/classes/src/operations/subtract.php
CHANGED
@@ -7,6 +7,7 @@
|
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
|
|
10 |
namespace Matrix;
|
11 |
|
12 |
use Matrix\Operators\Subtraction;
|
@@ -14,20 +15,24 @@ use Matrix\Operators\Subtraction;
|
|
14 |
/**
|
15 |
* Subtracts two or more matrices
|
16 |
*
|
17 |
-
* @param
|
18 |
-
* @return
|
19 |
-
* @throws
|
20 |
*/
|
21 |
function subtract(...$matrixValues)
|
22 |
{
|
23 |
if (count($matrixValues) < 2) {
|
24 |
-
throw new Exception('
|
25 |
}
|
26 |
|
27 |
$matrix = array_shift($matrixValues);
|
28 |
-
|
|
|
29 |
$matrix = new Matrix($matrix);
|
30 |
}
|
|
|
|
|
|
|
31 |
|
32 |
$result = new Subtraction($matrix);
|
33 |
|
7 |
* @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
|
8 |
* @license https://opensource.org/licenses/MIT MIT
|
9 |
*/
|
10 |
+
|
11 |
namespace Matrix;
|
12 |
|
13 |
use Matrix\Operators\Subtraction;
|
15 |
/**
|
16 |
* Subtracts two or more matrices
|
17 |
*
|
18 |
+
* @param array<int, mixed> $matrixValues The matrices to subtract
|
19 |
+
* @return Matrix
|
20 |
+
* @throws Exception
|
21 |
*/
|
22 |
function subtract(...$matrixValues)
|
23 |
{
|
24 |
if (count($matrixValues) < 2) {
|
25 |
+
throw new Exception('Subtraction operation requires at least 2 arguments');
|
26 |
}
|
27 |
|
28 |
$matrix = array_shift($matrixValues);
|
29 |
+
|
30 |
+
if (is_array($matrix)) {
|
31 |
$matrix = new Matrix($matrix);
|
32 |
}
|
33 |
+
if (!$matrix instanceof Matrix) {
|
34 |
+
throw new Exception('Subtraction arguments must be Matrix or array');
|
35 |
+
}
|
36 |
|
37 |
$result = new Subtraction($matrix);
|
38 |
|
vendor/markbaker/matrix/composer.7.2.json
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "markbaker/matrix",
|
3 |
+
"type": "library",
|
4 |
+
"description": "PHP Class for working with matrices",
|
5 |
+
"keywords": ["matrix", "vector", "mathematics"],
|
6 |
+
"homepage": "https://github.com/MarkBaker/PHPMatrix",
|
7 |
+
"license": "MIT",
|
8 |
+
"authors": [
|
9 |
+
{
|
10 |
+
"name": "Mark Baker",
|
11 |
+
"email": "mark@lange.demon.co.uk"
|
12 |
+
}
|
13 |
+
],
|
14 |
+
"require": {
|
15 |
+
"php": "^7.2"
|
16 |
+
},
|
17 |
+
"require-dev": {
|
18 |
+
"phpunit/phpunit": "^8.4@dev",
|
19 |
+
"squizlabs/php_codesniffer": "^3.0@dev",
|
20 |
+
"phpmd/phpmd": "dev-master",
|
21 |
+
"infection/infection": "0.13.x-dev",
|
22 |
+
"phpstan/phpstan": "^0.12.0@dev",
|
23 |
+
"sebastian/phpcpd": "^4.1",
|
24 |
+
"phploc/phploc": "^5.0@dev",
|
25 |
+
"phpcompatibility/php-compatibility": "dev-master",
|
26 |
+
"dealerdirect/phpcodesniffer-composer-installer": "dev-master"
|
27 |
+
},
|
28 |
+
"autoload": {
|
29 |
+
"psr-4": {
|
30 |
+
"Matrix\\": "classes/src/"
|
31 |
+
},
|
32 |
+
"files": [
|
33 |
+
"classes/src/functions/adjoint.php",
|
34 |
+
"classes/src/functions/antidiagonal.php",
|
35 |
+
"classes/src/functions/cofactors.php",
|
36 |
+
"classes/src/functions/determinant.php",
|
37 |
+
"classes/src/functions/diagonal.php",
|
38 |
+
"classes/src/functions/identity.php",
|
39 |
+
"classes/src/functions/inverse.php",
|
40 |
+
"classes/src/functions/minors.php",
|
41 |
+
"classes/src/functions/trace.php",
|
42 |
+
"classes/src/functions/transpose.php",
|
43 |
+
"classes/src/operations/add.php",
|
44 |
+
"classes/src/operations/directsum.php",
|
45 |
+
"classes/src/operations/subtract.php",
|
46 |
+
"classes/src/operations/multiply.php",
|
47 |
+
"classes/src/operations/divideby.php",
|
48 |
+
"classes/src/operations/divideinto.php"
|
49 |
+
]
|
50 |
+
},
|
51 |
+
"autoload-dev": {
|
52 |
+
"psr-4": {
|
53 |
+
"Matrix\\Test\\": "unitTests/classes/src/"
|
54 |
+
},
|
55 |
+
"files": [
|
56 |
+
"unitTests/classes/src/functions/adjointTest.php",
|
57 |
+
"unitTests/classes/src/functions/antidiagonalTest.php",
|
58 |
+
"unitTests/classes/src/functions/cofactorsTest.php",
|
59 |
+
"unitTests/classes/src/functions/determinantTest.php",
|
60 |
+
"unitTests/classes/src/functions/diagonalTest.php",
|
61 |
+
"unitTests/classes/src/functions/identityTest.php",
|
62 |
+
"unitTests/classes/src/functions/inverseTest.php",
|
63 |
+
"unitTests/classes/src/functions/minorsTest.php",
|
64 |
+
"unitTests/classes/src/functions/traceTest.php",
|
65 |
+
"unitTests/classes/src/functions/transposeTest.php",
|
66 |
+
"unitTests/classes/src/operations/addTest.php",
|
67 |
+
"unitTests/classes/src/operations/directsumTest.php",
|
68 |
+
"unitTests/classes/src/operations/subtractTest.php",
|
69 |
+
"unitTests/classes/src/operations/multiplyTest.php",
|
70 |
+
"unitTests/classes/src/operations/dividebyTest.php",
|
71 |
+
"unitTests/classes/src/operations/divideintoTest.php"
|
72 |
+
]
|
73 |
+
},
|
74 |
+
"scripts": {
|
75 |
+
"style": "phpcs --report-width=200 --report=summary,full -n",
|
76 |
+
"test": "phpunit -c phpunit.xml.dist",
|
77 |
+
"mess": "phpmd classes/src/ xml codesize,unusedcode,design,naming -n",
|
78 |
+
"lines": "phploc classes/src/ -n",
|
79 |
+
"cpd": "phpcpd classes/src/ -n",
|
80 |
+
"versions": "phpcs --report-width=200 --report=summary,full classes/src/ --standard=PHPCompatibility --runtime-set testVersion 5.6- -n",
|
81 |
+
"infection": "infection --min-msi=70 --min-covered-msi=70 --log-verbosity=all",
|
82 |
+
"phpstan": "phpstan analyse classes/src/ -c phpstan.neon --level=7 --no-progress -vvv --memory-limit=1024M",
|
83 |
+
"coverage": "phpunit -c phpunit.xml.dist --coverage-text --coverage-html ./build/coverage"
|
84 |
+
},
|
85 |
+
"minimum-stability": "dev"
|
86 |
+
}
|
vendor/markbaker/matrix/infection.json.dist
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"timeout": 1,
|
3 |
+
"source": {
|
4 |
+
"directories": [
|
5 |
+
"classes\/src"
|
6 |
+
]
|
7 |
+
},
|
8 |
+
"logs": {
|
9 |
+
"text": "build/infection/text.log",
|
10 |
+
"summary": "build/infection/summary.log",
|
11 |
+
"debug": "build/infection/debug.log",
|
12 |
+
"perMutator": "build/infection/perMutator.md"
|
13 |
+
},
|
14 |
+
"mutators": {
|
15 |
+
"@default": true
|
16 |
+
}
|
17 |
+
}
|
vendor/markbaker/matrix/phpstan.neon
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
parameters:
|
2 |
+
ignoreErrors:
|
3 |
+
- '#Property [A-Za-z\\]+::\$[A-Za-z]+ has no typehint specified#'
|
4 |
+
- '#Method [A-Za-z\\]+::[A-Za-z]+\(\) has no return typehint specified#'
|