Todo List
[line 53]
Matrix __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.
Matrix arrayLeftDivide( Matrix $B)
Element-by-element Left division A / B
Matrix arrayLeftDivideEquals( mixed $B)
Element-by-element Left division Aij = Aij / Bij
Matrix arrayRightDivide( Matrix $B)
Element-by-element right division A / B
Matrix arrayRightDivideEquals( mixed $B)
Element-by-element right division Aij = Aij / Bij
Matrix arrayTimes( mixed $B)
Element-by-element multiplication Cij = Aij * Bij
Matrix arrayTimesEquals( mixed $B)
Element-by-element multiplication Aij = Aij * Bij
boolean checkMatrixDimensions( [Matrix $B = null])
Is matrix B the same size?
Matrix chol( )
Cholesky decomposition
Matrix concat( mixed $B)
A = A & B
ratio cond( )
void constructWithCopy( double $A)
float det( )
Calculate determinant
Matrix diagonal( [int $m = null], [int $n = null], [mixed $c = 1])
Generate a diagonal matrix
Matrix eig( )
Eigenvalue decomposition
Matrix filled( [int $m = null], [int $n = null], [int $c = 0])
Generate a filled matrix
mixed get( [int $i = null], [int $j = null])
Get the i,j-th element of the matrix.
array getArray( )
array getArrayCopy( )
int getColumnDimension( )
array getColumnPackedCopy( )
Get a column-packed array
Matrix getMatrix( int $i0, int $iF, int $j0, int $jF)
Get a submatrix
Matrix getMatrixByCol( [ $j0 = null], [ $jF = null], int $i0, int $iF)
Get a submatrix by column index/range
Matrix getMatrixByRow( [int $i0 = null], [int $iF = null])
Get a submatrix by row index/range
int getRowDimension( )
array getRowPackedCopy( )
Get a row-packed array
Matrix identity( [int $m = null], [int $n = null])
Generate an identity matrix.
Matrix inverse( )
Matrix lu( )
LU decomposition
Matrix minus( mixed $B)
A - B
Matrix minusEquals( mixed $B)
A = A - B
html mprint( $A, [ $format = "%01.2f"], [ $width = 2])
float norm1( )
One norm
float norm2( )
Maximum singular value
float normF( )
Frobenius norm
float normInf( )
Infinite norm
array packed( )
Alias for getRowPacked
Matrix plus( mixed $B)
A + B
Matrix plusEquals( mixed $B)
A = A + B
Matrix power( mixed $B)
A = A ^ B
Matrix qr( )
QR decomposition
Matrix random( [int $m = null], [int $n = null], [ $a = RAND_MIN], [ $b = RAND_MAX])
Generate a random matrix
effective rank( )
mixed set( [int $i = null], [int $j = null], [mixed $c = null])
Set the i,j-th element of the matrix.
void setMatrix( int $i0, int $j0, mixed $S)
Set a submatrix
Matrix solve( Matrix $B)
Singular svd( )
Singular value decomposition
Matrix times( mixed $n)
Matrix multiplication
Output toHTML( [ $width = 2])
float trace( )
Sum of diagonal elements
Matrix transpose( )
Tranpose matrix
Matrix uminus( )
Unary minus matrix -A