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

Class: Matrix

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

Class Overview




Variables

Methods



Class Details

[line 27]


[ Top ]


Class Variables

$A = array()

[line 33]

Matrix storage

Matrix storage




Tags:

access:  private

Type:   array


[ Top ]

$m =

[line 40]

Matrix row dimension

Matrix row dimension




Tags:

access:  private

Type:   int


[ Top ]

$n =

[line 47]

Matrix column dimension

Matrix column dimension




Tags:

access:  private

Type:   int


[ Top ]



Class Methods


constructor Matrix [line 54]

Matrix Matrix( )

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.




[ Top ]

method arrayLeftDivide [line 1052]

Matrix arrayLeftDivide( Matrix $B)

arrayLeftDivide

arrayLeftDivide Element-by-element Left division A / B




Tags:

return:  Division result


Parameters:

Matrix   $B   Matrix B

[ Top ]

method arrayLeftDivideEquals [line 1100]

Matrix &arrayLeftDivideEquals( mixed $B)

arrayLeftDivideEquals

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




Tags:

return:  Matrix Aij


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method arrayRightDivide [line 956]

Matrix arrayRightDivide( Matrix $B)

arrayRightDivide

arrayRightDivide Element-by-element right division A / B




Tags:

return:  Division result


Parameters:

Matrix   $B   Matrix B

[ Top ]

method arrayRightDivideEquals [line 1004]

Matrix &arrayRightDivideEquals( mixed $B)

arrayRightDivideEquals

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




Tags:

return:  Matrix Aij


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method arrayTimes [line 859]

Matrix arrayTimes( mixed $B)

arrayTimes

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




Tags:

return:  Matrix Cij


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method arrayTimesEquals [line 908]

Matrix &arrayTimesEquals( mixed $B)

arrayTimesEquals

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




Tags:

return:  Matrix Aij


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method checkMatrixDimensions [line 382]

boolean checkMatrixDimensions( [Matrix $B = null])

checkMatrixDimensions

checkMatrixDimensions Is matrix B the same size?




Parameters:

Matrix   $B   Matrix B

[ Top ]

method chol [line 1223]

Matrix chol( )

chol

chol Cholesky decomposition




Tags:

return:  Cholesky decomposition


[ Top ]

method cond [line 634]

ratio cond( )

Matrix condition (2 norm)

Matrix condition (2 norm)




Tags:

return:  of largest to smallest singular value.


[ Top ]

method constructWithCopy [line 149]

void constructWithCopy( double $A)

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

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




Tags:

exception:  IllegalArgumentException All rows must have the same length


Parameters:

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

[ Top ]

method det [line 1293]

float det( )

det

det Calculate determinant




Tags:

return:  Determinant


[ Top ]

method diagonal [line 439]

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

diagonal

diagonal Generate a diagonal matrix




Tags:

return:  Diagonal matrix


Parameters:

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

[ Top ]

method eig [line 1251]

Matrix eig( )

eig

eig Eigenvalue decomposition




Tags:

return:  Eigenvalue decomposition


[ Top ]

method filled [line 454]

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

filled

filled Generate a filled matrix




Tags:

return:  Filled matrix


Parameters:

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

[ Top ]

method get [line 215]

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)


Parameters:

int   $i   Row position
int   $j   Column position

[ Top ]

method getArray [line 133]

array &getArray( )

getArray

getArray




Tags:

return:  Matrix array


[ Top ]

method getArrayCopy [line 141]

array getArrayCopy( )

getArrayCopy

getArrayCopy




Tags:

return:  Matrix array copy


[ Top ]

method getColumnDimension [line 204]

int getColumnDimension( )

getColumnDimension

getColumnDimension




Tags:

return:  Column dimension


[ Top ]

method getColumnPackedCopy [line 167]

array getColumnPackedCopy( )

getColumnPacked

getColumnPacked Get a column-packed array




Tags:

return:  Column-packed matrix array


[ Top ]

method getMatrix [line 228]

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

getMatrix

getMatrix Get a submatrix




Tags:

return:  Submatrix


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 518]

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

getMatrixByCol

getMatrixByCol Get a submatrix by column index/range




Tags:

return:  Submatrix


Parameters:

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

[ Top ]

method getMatrixByRow [line 501]

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

getMatrixByRow

getMatrixByRow Get a submatrix by row index/range




Tags:

return:  Submatrix


Parameters:

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

[ Top ]

method getRowDimension [line 196]

int getRowDimension( )

getRowDimension

getRowDimension




Tags:

return:  Row dimension


[ Top ]

method getRowPackedCopy [line 182]

array getRowPackedCopy( )

getRowPacked

getRowPacked Get a row-packed array




Tags:

return:  Row-packed matrix array


[ Top ]

method identity [line 427]

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

identity Generate an identity matrix.

identity Generate an identity matrix.




Tags:

return:  Identity matrix


Parameters:

int   $m   Row dimension
int   $n   Column dimension

[ Top ]

method inverse [line 1283]

Matrix inverse( )

Matrix inverse or pseudoinverse.

Matrix inverse or pseudoinverse.




Tags:

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


[ Top ]

method lu [line 1232]

Matrix lu( )

lu

lu LU decomposition




Tags:

return:  LU decomposition


[ Top ]

method minus [line 764]

Matrix minus( mixed $B)

minus

minus A - B




Tags:

return:  Sum


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method minusEquals [line 811]

Matrix &minusEquals( mixed $B)

minusEquals

minusEquals A = A - B




Tags:

return:  Sum


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method mprint [line 1302]

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


Parameters:

   $A  
   $format  
   $width  

[ Top ]

method norm1 [line 561]

float norm1( )

norm1

norm1 One norm




Tags:

return:  Maximum column sum


[ Top ]

method norm2 [line 583]

float norm2( )

norm2

norm2 Maximum singular value




Tags:

return:  Maximum singular value


[ Top ]

method normF [line 613]

float normF( )

normF

normF Frobenius norm




Tags:

return:  Square root of the sum of all elements squared


[ Top ]

method normInf [line 592]

float normInf( )

normInf

normInf Infinite norm




Tags:

return:  Maximum row sum


[ Top ]

method packed [line 489]

array &packed( )

packed

packed Alias for getRowPacked




Tags:

return:  Packed array


[ Top ]

method plus [line 670]

Matrix plus( mixed $B)

plus

plus A + B




Tags:

return:  Sum


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method plusEquals [line 717]

Matrix &plusEquals( mixed $B)

plusEquals

plusEquals A = A + B




Tags:

return:  Sum


Parameters:

mixed   $B   Matrix/Array

[ Top ]

method qr [line 1241]

Matrix qr( )

qr

qr QR decomposition




Tags:

return:  QR decomposition


[ Top ]

method random [line 470]

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

random

random Generate a random matrix




Tags:

return:  Random matrix


Parameters:

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

[ Top ]

method rank [line 625]

effective rank( )

Matrix rank

Matrix rank




Tags:

return:  numerical rank, obtained from SVD.


[ Top ]

method set [line 403]

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)


Parameters:

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

[ Top ]

method setMatrix [line 335]

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

setMatrix

setMatrix Set a submatrix




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 1269]

Matrix solve( Matrix $B)

Solve A*X = B.

Solve A*X = B.




Tags:

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


Parameters:

Matrix   $B   Right hand side

[ Top ]

method svd [line 1260]

Singular svd( )

svd

svd Singular value decomposition




Tags:

return:  value decomposition


[ Top ]

method times [line 1147]

Matrix times( mixed $n)

times

times Matrix multiplication




Tags:

return:  Product


Parameters:

mixed   $n   Matrix/Array/Scalar

[ Top ]

method toHTML [line 1321]

Output toHTML( [ $width = 2])

Debugging utility.

Debugging utility.




Tags:

return:  HTML representation of matrix


Parameters:

   $width  

[ Top ]

method trace [line 644]

float trace( )

trace

trace Sum of diagonal elements




Tags:

return:  Sum of diagonal elements


[ Top ]

method transpose [line 533]

Matrix transpose( )

transpose

transpose Tranpose matrix




Tags:

return:  Transposed matrix


[ Top ]

method uminus [line 660]

Matrix uminus( )

uminus

uminus Unary minus matrix -A




Tags:

return:  Unary minus matrix


[ Top ]


Documentation generated on Mon, 05 Jan 2009 20:38:05 +0100 by phpDocumentor 1.4.1