JAMA
[ class tree: JAMA ] [ index: JAMA ] [ all elements ]

Class: Matrix

Source Location: /PHPExcel/Shared/JAMA/Matrix.php

Class Overview




Variables

Methods



Class Details

[line 36]


[ Top ]


Class Variables

$A = array()

[line 44]

Matrix storage

Matrix storage




Tags:

access:  public

Type:   array


[ Top ]

$m =

[line 52]

Matrix row dimension

Matrix row dimension




Tags:

access:  private

Type:   int


[ Top ]

$n =

[line 60]

Matrix column dimension

Matrix column dimension




Tags:

access:  private

Type:   int


[ Top ]



Class Methods


constructor __construct [line 68]

Matrix __construct( )

Polymorphic constructor As PHP has no support for polymorphic constructors, we hack our own sort of polymorphism using func_num_args, func_get_arg, and gettype.

Polymorphic constructor 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.




Tags:

access:  public


[ Top ]

method arrayLeftDivide [line 1001]

Matrix arrayLeftDivide( Matrix $B)

arrayLeftDivide

arrayLeftDivide Element-by-element Left division A / B




Tags:

return:  Division result
access:  public


Parameters:

Matrix   $B   Matrix B

[ Top ]

method arrayLeftDivideEquals [line 1038]

Matrix arrayLeftDivideEquals( mixed $B)

arrayLeftDivideEquals

arrayLeftDivideEquals Element-by-element Left division Aij = Aij / Bij




Tags:

return:  Matrix Aij
access:  public


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method arrayRightDivide [line 927]

Matrix arrayRightDivide( Matrix $B)

arrayRightDivide

arrayRightDivide Element-by-element right division A / B




Tags:

return:  Division result
access:  public


Parameters:

Matrix   $B   Matrix B

[ Top ]

method arrayRightDivideEquals [line 964]

Matrix arrayRightDivideEquals( mixed $B)

arrayRightDivideEquals

arrayRightDivideEquals Element-by-element right division Aij = Aij / Bij




Tags:

return:  Matrix Aij
access:  public


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method arrayTimes [line 853]

Matrix arrayTimes( mixed $B)

arrayTimes

arrayTimes Element-by-element multiplication Cij = Aij * Bij




Tags:

return:  Matrix Cij
access:  public


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method arrayTimesEquals [line 890]

Matrix arrayTimesEquals( mixed $B)

arrayTimesEquals

arrayTimesEquals Element-by-element multiplication Aij = Aij * Bij




Tags:

return:  Matrix Aij
access:  public


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method checkMatrixDimensions [line 405]

boolean checkMatrixDimensions( [Matrix $B = null])

checkMatrixDimensions

checkMatrixDimensions Is matrix B the same size?




Tags:

access:  public


Parameters:

Matrix   $B   Matrix B

[ Top ]

method chol [line 1236]

Matrix chol( )

chol

chol Cholesky decomposition




Tags:

return:  Cholesky decomposition
access:  public


[ Top ]

method concat [line 1201]

Matrix concat( mixed $B)

concat

concat A = A & B




Tags:

return:  Sum
access:  public


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method cond [line 669]

ratio cond( )

Matrix condition (2 norm)

Matrix condition (2 norm)




Tags:

return:  of largest to smallest singular value.
access:  public


[ Top ]

method constructWithCopy [line 165]

void constructWithCopy( double $A)

constructWithCopy Construct a matrix from a copy of a 2-D array.

constructWithCopy Construct a matrix from a copy of a 2-D array.




Tags:

exception:  IllegalArgumentException All rows must have the same length
access:  public


Parameters:

double   $A   A[][] Two-dimensional array of doubles.

[ Top ]

method det [line 1318]

float det( )

det

det Calculate determinant




Tags:

return:  Determinant
access:  public


[ Top ]

method diagonal [line 468]

Matrix diagonal( [int $m = null], [int $n = null], [mixed $c = 1])

diagonal

diagonal Generate a diagonal matrix




Tags:

return:  Diagonal matrix
access:  public


Parameters:

int   $m   Row dimension
int   $n   Column dimension
mixed   $c   Diagonal value

[ Top ]

method eig [line 1269]

Matrix eig( )

eig

eig Eigenvalue decomposition




Tags:

return:  Eigenvalue decomposition
access:  public


[ Top ]

method filled [line 486]

Matrix filled( [int $m = null], [int $n = null], [int $c = 0])

filled

filled Generate a filled matrix




Tags:

return:  Filled matrix
access:  public


Parameters:

int   $m   Row dimension
int   $n   Column dimension
int   $c   Fill constant

[ Top ]

method get [line 243]

mixed get( [int $i = null], [int $j = null])

get Get the i,j-th element of the matrix.

get Get the i,j-th element of the matrix.




Tags:

return:  Element (int/float/double)
access:  public


Parameters:

int   $i   Row position
int   $j   Column position

[ Top ]

method getArray [line 143]

array getArray( )

getArray

getArray




Tags:

return:  Matrix array
access:  public


[ Top ]

method getArrayCopy [line 153]

array getArrayCopy( )

getArrayCopy

getArrayCopy




Tags:

return:  Matrix array copy
access:  public


[ Top ]

method getColumnDimension [line 230]

int getColumnDimension( )

getColumnDimension

getColumnDimension




Tags:

return:  Column dimension
access:  public


[ Top ]

method getColumnPackedCopy [line 187]

array getColumnPackedCopy( )

getColumnPackedCopy

getColumnPackedCopy Get a column-packed array




Tags:

return:  Column-packed matrix array
access:  public


[ Top ]

method getMatrix [line 258]

Matrix getMatrix( int $i0, int $iF, int $j0, int $jF)

getMatrix

getMatrix Get a submatrix




Tags:

return:  Submatrix
access:  public


Parameters:

int   $i0   Initial row index
int   $iF   Final row index
int   $j0   Initial column index
int   $jF   Final column index

[ Top ]

method getMatrixByCol [line 558]

Matrix getMatrixByCol( [ $j0 = null], [ $jF = null], int $i0, int $iF)

getMatrixByCol

getMatrixByCol Get a submatrix by column index/range




Tags:

return:  Submatrix
access:  public


Parameters:

int   $i0   Initial column index
int   $iF   Final column index
   $j0  
   $jF  

[ Top ]

method getMatrixByRow [line 537]

Matrix getMatrixByRow( [int $i0 = null], [int $iF = null])

getMatrixByRow

getMatrixByRow Get a submatrix by row index/range




Tags:

return:  Submatrix
access:  public


Parameters:

int   $i0   Initial row index
int   $iF   Final row index

[ Top ]

method getRowDimension [line 220]

int getRowDimension( )

getRowDimension

getRowDimension




Tags:

return:  Row dimension
access:  public


[ Top ]

method getRowPackedCopy [line 204]

array getRowPackedCopy( )

getRowPackedCopy

getRowPackedCopy Get a row-packed array




Tags:

return:  Row-packed matrix array
access:  public


[ Top ]

method identity [line 454]

Matrix identity( [int $m = null], [int $n = null])

identity Generate an identity matrix.

identity Generate an identity matrix.




Tags:

return:  Identity matrix
access:  public


Parameters:

int   $m   Row dimension
int   $n   Column dimension

[ Top ]

method inverse [line 1307]

Matrix inverse( )

Matrix inverse or pseudoinverse.

Matrix inverse or pseudoinverse.




Tags:

return:  ... Inverse(A) if A is square, pseudoinverse otherwise.
access:  public


[ Top ]

method lu [line 1247]

Matrix lu( )

lu

lu LU decomposition




Tags:

return:  LU decomposition
access:  public


[ Top ]

method minus [line 780]

Matrix minus( mixed $B)

minus

minus A - B




Tags:

return:  Sum
access:  public


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method minusEquals [line 816]

Matrix minusEquals( mixed $B)

minusEquals

minusEquals A = A - B




Tags:

return:  Sum
access:  public


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method mprint [line 1329]

html mprint( $A, [ $format = "%01.2f"], [ $width = 2])

Older debugging utility for backwards compatability.

Older debugging utility for backwards compatability.




Tags:

return:  version of matrix
access:  public


Parameters:

   $A  
   $format  
   $width  

[ Top ]

method norm1 [line 594]

float norm1( )

norm1

norm1 One norm




Tags:

return:  Maximum column sum
access:  public


[ Top ]

method norm2 [line 613]

float norm2( )

norm2

norm2 Maximum singular value




Tags:

return:  Maximum singular value
access:  public


[ Top ]

method normF [line 642]

float normF( )

normF

normF Frobenius norm




Tags:

return:  Square root of the sum of all elements squared
access:  public


[ Top ]

method normInf [line 623]

float normInf( )

normInf

normInf Infinite norm




Tags:

return:  Maximum row sum
access:  public


[ Top ]

method packed [line 524]

array packed( )

packed

packed Alias for getRowPacked




Tags:

return:  Packed array
access:  public


[ Top ]

method plus [line 708]

Matrix plus( mixed $B)

plus

plus A + B




Tags:

return:  Sum
access:  public


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method plusEquals [line 744]

Matrix plusEquals( mixed $B)

plusEquals

plusEquals A = A + B




Tags:

return:  Sum
access:  public


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method power [line 1165]

Matrix power( mixed $B)

power

power A = A ^ B




Tags:

return:  Sum
access:  public


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method qr [line 1258]

Matrix qr( )

qr

qr QR decomposition




Tags:

return:  QR decomposition
access:  public


[ Top ]

method random [line 503]

Matrix random( [int $m = null], [int $n = null], [ $a = RAND_MIN], [ $b = RAND_MAX])

random

random Generate a random matrix




Tags:

return:  Random matrix
access:  public


Parameters:

int   $m   Row dimension
int   $n   Column dimension
   $a  
   $b  

[ Top ]

method rank [line 658]

effective rank( )

Matrix rank

Matrix rank




Tags:

return:  numerical rank, obtained from SVD.
access:  public


[ Top ]

method set [line 428]

mixed set( [int $i = null], [int $j = null], [mixed $c = null])

set Set the i,j-th element of the matrix.

set Set the i,j-th element of the matrix.




Tags:

return:  Element (int/float/double)
access:  public


Parameters:

int   $i   Row position
int   $j   Column position
mixed   $c   Int/float/double value

[ Top ]

method setMatrix [line 362]

void setMatrix( int $i0, int $j0, mixed $S)

setMatrix

setMatrix Set a submatrix




Tags:

access:  public


Parameters:

int   $i0   Initial row index
int   $j0   Initial column index
mixed   $S   Matrix/Array submatrix ($i0, $j0, $S) $S = Matrix ($i0, $j0, $S) $S = Array

[ Top ]

method solve [line 1291]

Matrix solve( Matrix $B)

Solve A*X = B.

Solve A*X = B.




Tags:

return:  ... Solution if A is square, least squares solution otherwise
access:  public


Parameters:

Matrix   $B   Right hand side

[ Top ]

method svd [line 1280]

Singular svd( )

svd

svd Singular value decomposition




Tags:

return:  value decomposition
access:  public


[ Top ]

method times [line 1074]

Matrix times( mixed $n)

times

times Matrix multiplication




Tags:

return:  Product
access:  public


Parameters:

mixed   $n   Matrix/Array/Scalar

[ Top ]

method toHTML [line 1349]

Output toHTML( [ $width = 2])

Debugging utility.

Debugging utility.




Tags:

return:  HTML representation of matrix
access:  public


Parameters:

   $width  

[ Top ]

method trace [line 681]

float trace( )

trace

trace Sum of diagonal elements




Tags:

return:  Sum of diagonal elements
access:  public


[ Top ]

method transpose [line 577]

Matrix transpose( )

transpose

transpose Tranpose matrix




Tags:

return:  Transposed matrix
access:  public


[ Top ]

method uminus [line 697]

Matrix uminus( )

uminus

uminus Unary minus matrix -A




Tags:

return:  Unary minus matrix
access:  public


[ Top ]


Documentation generated on Mon, 10 Aug 2009 08:06:34 +0200 by phpDocumentor 1.4.1