@@ -10,12 +10,10 @@ Stand-alone Linear Algebra Library for PHP
1010
1111Alternately, include this in your composer.json and then update:
1212
13- "mcordingley/linearalgebra": "^1.0 .0"
13+ "mcordingley/linearalgebra": "^1.4 .0"
1414
15- If Composer isn't an option for you,
16- [ download] ( https://github.com/mcordingley/LinearAlgebra/blob/master/linear-algebra.phar )
17- ` linear-algebra.phar ` and include it in your project. PHP will autoload classes
18- from inside the archive as needed.
15+ If Composer isn't an option for you, clone this repository and run ` build-phar.php ` to generate a phar
16+ archive that you can include into your project. PHP will autoload classes from inside the archive as needed.
1917
2018## Usage
2119
@@ -40,21 +38,20 @@ the zero-based indices of the row and column that you want:
4038
4139 $element = $matrix->get($row, $column);
4240
43- It's also possible to find out how large the matrix is with the ` rows ` and
44- ` columns ` properties:
41+ It's also possible to find out how large the matrix is with ` getRowCount() ` and ` getColumnCount() ` :
4542
46- $rows = $matrix->rows ;
47- $columns = $matrix->columns ;
43+ $rows = $matrix->getRowCount() ;
44+ $columns = $matrix->getColumnCount() ;
4845
4946You can also add, subtract, and multiply the matrix with scalar values and other
5047matrices. All operations return a new Matrix and do not modify the underlying matrix:
5148
52- $addedScalar = $matrix->add (3);
53- $addedMatrix = $matrix->add ($anotherMatrix);
54- $subtractedScalar = $matrix->subtract (2);
55- $subtractedMatrix = $matrix->subtract ($anotherMatrix);
56- $multipliedByScalar = $matrix->multiply (4);
57- $multipliedByMatrix = $matrix->multiply ($anotherMatrix);
49+ $addedScalar = $matrix->addScalar (3);
50+ $addedMatrix = $matrix->addMatrix ($anotherMatrix);
51+ $subtractedScalar = $matrix->subtractScalar (2);
52+ $subtractedMatrix = $matrix->subtractMatrix ($anotherMatrix);
53+ $multipliedByScalar = $matrix->multiplyScalar (4);
54+ $multipliedByMatrix = $matrix->multiplyMatrix ($anotherMatrix);
5855
5956Matrices can be compared with ` equals ` to see if they're equal:
6057
@@ -107,6 +104,20 @@ If you need to combine together matrices, you can do so by calling the concatena
107104
108105## Change-log
109106
107+ - 2.0.0 (future)
108+ - Drop support for PHP 5.x
109+ - Introduce strict scalar type hints
110+ - Drop deprecated functions and properties.
111+
112+ - 1.3.0
113+ - Remove generated Phar file. Users who need it should use the ` build-phar.php ` script to generate one.
114+ - Refactor LUDecomposition to have a less awkward constructor.
115+ - Split ` add() ` into ` addMatrix() ` and ` addScalar() ` . Deprecate ` add() ` .
116+ - Split ` subtract() ` into ` subtractMatrix() ` and ` subtractScalar() ` . Deprecate ` subtract() ` .
117+ - Split ` multiply() ` into ` multiplyMatrix() ` and ` multiplyScalar() ` . Deprecate ` multiply() ` .
118+ - Add ` getRowCount() ` and ` getColumnCount() ` accessors.
119+ - Deprecate ` rows ` and ` columns ` properties.
120+
110121- 1.2.0
111122 - Added ` concatenateBottom($other) `
112123 - Added ` concatencateRight($other) `
0 commit comments