\Matrix

Namespaces

Decomposition
Operators

Classes

Builder Matrix Builder class.
Exception
Functions
Matrix Matrix object.

Functions

add()

add(array<int,mixed>  ...$matrixValues) : \Matrix\Matrix

Adds two or more matrices

Parameters

array $matrixValues variadic

The matrices to add

Throws

\Matrix\Exception

Returns

\Matrix\Matrix —

adjoint()

adjoint(\Matrix\Matrix|array  $matrix) : \Matrix\Matrix

Returns the adjoint of a matrix or an array.

Parameters

\Matrix\Matrix|array $matrix

Matrix or an array to treat as a matrix.

Throws

\Matrix\Exception

If argument isn't a valid matrix or array.

Returns

\Matrix\Matrix —

The new matrix

antidiagonal()

antidiagonal(\Matrix\Matrix|array  $matrix) : \Matrix\Matrix

Returns the antidiagonal of a matrix or an array.

Parameters

\Matrix\Matrix|array $matrix

Matrix or an array to treat as a matrix.

Throws

\Matrix\Exception

If argument isn't a valid matrix or array.

Returns

\Matrix\Matrix —

The new matrix

cofactors()

cofactors(\Matrix\Matrix|array  $matrix) : \Matrix\Matrix

Returns the cofactors of a matrix or an array.

Parameters

\Matrix\Matrix|array $matrix

Matrix or an array to treat as a matrix.

Throws

\Matrix\Exception

If argument isn't a valid matrix or array.

Returns

\Matrix\Matrix —

The new matrix

determinant()

determinant(\Matrix\Matrix|array  $matrix) : float

Returns the determinant of a matrix or an array.

Parameters

\Matrix\Matrix|array $matrix

Matrix or an array to treat as a matrix.

Throws

\Matrix\Exception

If argument isn't a valid matrix or array.

Returns

float —

Matrix determinant

diagonal()

diagonal(\Matrix\Matrix|array  $matrix) : \Matrix\Matrix

Returns the diagonal of a matrix or an array.

Parameters

\Matrix\Matrix|array $matrix

Matrix or an array to treat as a matrix.

Throws

\Matrix\Exception

If argument isn't a valid matrix or array.

Returns

\Matrix\Matrix —

The new matrix

directsum()

directsum(array<int,mixed>  ...$matrixValues) : \Matrix\Matrix

Adds two or more matrices

Parameters

array $matrixValues variadic

The matrices to add

Throws

\Matrix\Exception

Returns

\Matrix\Matrix —

divideby()

divideby(array<int,mixed>  ...$matrixValues) : \Matrix\Matrix

Divides two or more matrix numbers

Parameters

array $matrixValues variadic

The matrices to divide

Throws

\Matrix\Exception

Returns

\Matrix\Matrix —

divideinto()

divideinto(array<int,mixed>  ...$matrixValues) : \Matrix\Matrix

Divides two or more matrix numbers

Parameters

array $matrixValues variadic

The numbers to divide

Throws

\Matrix\Exception

Returns

\Matrix\Matrix —

identity()

identity(\Matrix\Matrix|array  $matrix) : \Matrix\Matrix

Returns the identity of a matrix or an array.

Parameters

\Matrix\Matrix|array $matrix

Matrix or an array to treat as a matrix.

Throws

\Matrix\Exception

If argument isn't a valid matrix or array.

Returns

\Matrix\Matrix —

The identity matrix

inverse()

inverse(\Matrix\Matrix|array  $matrix) : \Matrix\Matrix

Returns the inverse of a matrix or an array.

Parameters

\Matrix\Matrix|array $matrix

Matrix or an array to treat as a matrix.

Throws

\Matrix\Exception

If argument isn't a valid matrix or array.

Returns

\Matrix\Matrix —

The new matrix

minors()

minors(\Matrix\Matrix|array  $matrix) : \Matrix\Matrix

Returns the minors of a matrix or an array.

Parameters

\Matrix\Matrix|array $matrix

Matrix or an array to treat as a matrix.

Throws

\Matrix\Exception

If argument isn't a valid matrix or array.

Returns

\Matrix\Matrix —

The new matrix

multiply()

multiply(array<int,mixed>  ...$matrixValues) : \Matrix\Matrix

Multiplies two or more matrices

Parameters

array $matrixValues variadic

The matrices to multiply

Throws

\Matrix\Exception

Returns

\Matrix\Matrix —

subtract()

subtract(array<int,mixed>  ...$matrixValues) : \Matrix\Matrix

Subtracts two or more matrices

Parameters

array $matrixValues variadic

The matrices to subtract

Throws

\Matrix\Exception

Returns

\Matrix\Matrix —

trace()

trace(\Matrix\Matrix|array  $matrix) : float

Returns the trace of a matrix or an array.

Parameters

\Matrix\Matrix|array $matrix

Matrix or an array to treat as a matrix.

Throws

\Matrix\Exception

If argument isn't a valid matrix or array.

Returns

float —

The trace of the matrix

transpose()

transpose(\Matrix\Matrix|array  $matrix) : \Matrix\Matrix

Returns the transpose of a matrix or an array.

Parameters

\Matrix\Matrix|array $matrix

Matrix or an array to treat as a matrix.

Throws

\Matrix\Exception

If argument isn't a valid matrix or array.

Returns

\Matrix\Matrix —

The transposed matrix