Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 28, 2024 via composer

markbaker/matrix 2.1.4

PHP Class for working with matrices
Package summary
Share
0
issues
1
license
1
MIT
Package created
12 Aug 2018
Version published
2 Dec 2022
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
markbaker/matrix@2.1.4
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of markbaker/matrix 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does markbaker/matrix do?

The PHPMatrix (markbaker/matrix) package is a PHP library designed for working with matrices. The library provides numerous operations such as addition, subtraction, multiplication, division and functions like finding the adjoint, diagonal, determinant, inverse, trace, transposing and more to facilitate the efficient handling and manipulation of matrices.

How do you use markbaker/matrix?

The installation and usage of the PHPMatrix package is relatively straightforward. It begins with creating a new Matrix object by providing an array as the constructor argument:

$grid = [
    [16,  3,  2, 13],
    [ 5, 10, 11,  8],
    [ 9,  6,  7, 12],
    [ 4, 15, 14,  1],
];

$matrix = new Matrix\Matrix($grid);

You can also use the Builder class to create specific matrices:

$matrix = Matrix\Builder::createFilledMatrix(1, 5, 3); // creates a 5x3 matrix filled with 1s

$matrix = Matrix\Builder::createIdentityMatrix(3); // creates a 3x3 identity matrix

Mathematical operations can be conducted by calling appropriate methods:

$matrix1 = new Matrix\Matrix([
    [2, 7, 6],
    [9, 5, 1],
    [4, 3, 8],
]);
$matrix2 = new Matrix\Matrix([
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9],
]);

$result = $matrix1->multiply($matrix2)->toArray(); // multiplies two matrices

Where are the markbaker/matrix docs?

Unfortunately, specific documentation for PHPMatrix does not seem to be directly mentioned in the readme, nor can it be found in the GitHub repository. It seems most likely that the readme file itself and the comments in the source code act as the primary documentation source for users of PHPMatrix.