Matrix
in package
implements
ArrayAccess
Tags
Interfaces, Classes, Traits and Enums
- ArrayAccess
Table of Contents
- $columns : int
- $matrix : array<string|int, mixed>
- $rows : int
- __construct() : mixed
- __toString() : string
- add() : Matrix
- determinant() : float
- Computation of the determinant of 1x1, 2x2 and 3x3 matrices
- divideScalar() : Matrix
- getColumns() : int
- getElement() : float
- getRows() : int
- isSquare() : bool
- multiplyScalar() : Matrix
- offsetExists() : bool
- offsetGet() : mixed
- offsetSet() : void
- offsetUnset() : void
- product() : Matrix
- Naive Matrix product, O(n^3)
- set() : void
- setElement() : void
- subtract() : Matrix
- transpose() : Matrix
Properties
$columns
private
int
$columns
$matrix
private
array<string|int, mixed>
$matrix
= []
$rows
private
int
$rows
Methods
__construct()
public
__construct(int $rows, int $columns[, array<string|int, array<string|int, float>> $set = [] ]) : mixed
Parameters
- $rows : int
- $columns : int
- $set : array<string|int, array<string|int, float>> = []
Return values
mixed —__toString()
public
__toString() : string
Return values
string —add()
public
add(Matrix $matrix) : Matrix
Parameters
- $matrix : Matrix
Return values
Matrix —determinant()
Computation of the determinant of 1x1, 2x2 and 3x3 matrices
public
determinant() : float
Return values
float —divideScalar()
public
divideScalar(float $number) : Matrix
Parameters
- $number : float
Return values
Matrix —getColumns()
public
getColumns() : int
Return values
int —getElement()
public
getElement(int $row, int $column) : float
Parameters
- $row : int
- $column : int
Return values
float —getRows()
public
getRows() : int
Return values
int —isSquare()
public
isSquare() : bool
Return values
bool —multiplyScalar()
public
multiplyScalar(float $number) : Matrix
Parameters
- $number : float
Return values
Matrix —offsetExists()
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
bool —offsetGet()
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
Return values
mixed —offsetSet()
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
Return values
void —offsetUnset()
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
Return values
void —product()
Naive Matrix product, O(n^3)
public
product(Matrix $matrix) : Matrix
Parameters
- $matrix : Matrix
Return values
Matrix —set()
public
set(array<string|int, array<string|int, float>> $m) : void
Parameters
- $m : array<string|int, array<string|int, float>>
Return values
void —setElement()
public
setElement(int $row, int $column, float $value) : void
Parameters
- $row : int
- $column : int
- $value : float
Return values
void —subtract()
public
subtract(Matrix $matrix) : Matrix
Parameters
- $matrix : Matrix
Return values
Matrix —transpose()
public
transpose() : Matrix