66
77Stand-alone Linear Algebra Library for PHP
88
9+ ## New Major Version
10+
11+ LinearAlgebra has just reached version 2.0. This release includes several breaking changes. Check the changelog for
12+ specifics about what has changed, but the biggest changes are that the root namespace has been capitalized and that the
13+ library now depends on PHP 7.0 or higher. A number of lesser-used functions have been removed, new functions added, and
14+ the internals of the package are now much cleaner.
15+
16+ If you're still using PHP 5.x, the 1.0 series still exists and supports PHP 5, though it will receive no further updates.
17+
918## Installation
1019
1120 composer require mcordingley/LinearAlgebra
@@ -21,7 +30,7 @@ archive that you can include into your project. PHP will autoload classes from i
2130
2231Start with a ` use ` statement for the class:
2332
24- use mcordingley \LinearAlgebra\Matrix;
33+ use MCordingley \LinearAlgebra\Matrix;
2534
2635Then, instantiate a new instance of the matrix class like so:
2736
@@ -83,6 +92,11 @@ It's also possible to run a map over the matrix:
8392Submatrices may be extracted with ` sliceColumns($offset, $length) ` and ` sliceRows($offset, $length) ` . The semantics of
8493the arguments are the same as PHP's ` array_slice ` .
8594
95+ Similarly, ` spliceColumns($offset, $length, $replacement) ` and ` spliceRows($offset, $length, $replacement) ` can be used
96+ to create new matrices with specific rows or columns removed or replaced. Unlike the native PHP ` array_splice ` , these
97+ operations do not modify the matrix in place and return the removed elements, but instead return a new matrix with the
98+ splice applied.
99+
86100If you need to combine together matrices, you can do so by calling the concatenation methods:
87101
88102 $m1 = new Matrix([
@@ -127,6 +141,7 @@ pivots performed.
127141 - Add ` entrywise() ` to compute the Hadamard product.
128142 - Add ` upper() ` and ` lower() `
129143 - Add ` sliceColumns() ` and ` sliceRows() `
144+ - Add ` spliceColumns() ` and ` spliceRows() `
130145 - Add ` LU ` and ` LUP ` decompositions as classes.
131146
132147- 1.3.2
0 commit comments