__construct()
As PHP has no support for polymorphic constructors, we hack our own sort of polymorphism using func_num_args, func_get_arg, and gettype. In essence, we're just implementing a simple RTTI filter and calling the appropriate constructor.
arrayLeftDivide() : \Matrix
Element-by-element Left division A / B
\MatrixDivision resultarrayLeftDivideEquals() : \Matrix
Element-by-element Left division Aij = Aij / Bij
\MatrixMatrix AijarrayRightDivide() : \Matrix
Element-by-element right division A / B
\MatrixDivision resultarrayRightDivideEquals() : \Matrix
Element-by-element right division Aij = Aij / Bij
\MatrixMatrix AijarrayTimes() : \Matrix
Element-by-element multiplication Cij = Aij * Bij
\MatrixMatrix CijarrayTimesEquals() : \Matrix
Element-by-element multiplication Aij = Aij * Bij
\MatrixMatrix AijcheckMatrixDimensions(\Matrix $B) : boolean
Is matrix B the same size?
\MatrixMatrix B
booleanconcat() : \Matrix
A = A & B
\MatrixSumdet() : float
Calculate determinant
floatDeterminantdiagonal(int $m, int $n, mixed $c) : \Matrix
Generate a diagonal matrix
intRow dimension
intColumn dimension
mixedDiagonal value
\MatrixDiagonal matrixget(int $i, int $j) : mixed
Get the i,j-th element of the matrix.
intRow position
intColumn position
mixedElement (int/float/double)getArray() : array
arrayMatrix arraygetColumnDimension() : int
intColumn dimensiongetMatrix() : \Matrix
Get a submatrix
\MatrixSubmatrixgetMatrixByCol($j0, $jF) : \Matrix
Get a submatrix by column index/range
\MatrixSubmatrixgetMatrixByRow(int $i0, int $iF) : \Matrix
Get a submatrix by row index/range
intInitial row index
intFinal row index
\MatrixSubmatrixgetRowDimension() : int
intRow dimensionidentity(int $m, int $n) : \Matrix
Generate an identity matrix.
intRow dimension
intColumn dimension
\MatrixIdentity matrixinverse() : \Matrix
\Matrix... Inverse(A) if A is square, pseudoinverse otherwise.minus() : \Matrix
A - B
\MatrixSumminusEquals() : \Matrix
A = A - B
\MatrixSumplus() : \Matrix
A + B
\MatrixSumplusEquals() : \Matrix
A = A + B
\MatrixSumpower() : \Matrix
A = A ^ B
\MatrixSumset(int $i, int $j, mixed $c) : mixed
Set the i,j-th element of the matrix.
intRow position
intColumn position
mixedInt/float/double value
mixedElement (int/float/double)solve(\Matrix $B) : \Matrix
\MatrixRight hand side
\Matrix... Solution if A is square, least squares solution otherwisetimes() : \Matrix
Matrix multiplication
\MatrixProducttrace() : float
Sum of diagonal elements
floatSum of diagonal elementstranspose() : \Matrix
Tranpose matrix
\MatrixTransposed matrixuminus() : \Matrix
Unary minus matrix -A
\MatrixUnary minus matrix$A : array
| access | public |
|---|
$m : int
| access | private |
|---|
$n : int
| access | private |
|---|
ArgumentBoundsException
ArgumentTypeException
ArrayLengthException
MatrixDimensionException
PolymorphicArgumentException