JAMA

# Class: PHPExcel_Shared_JAMA_Matrix

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

### Class Overview

### Variables

- $A

### Constants

- ArgumentBoundsException
- ArgumentTypeException
- ArrayLengthException
- MatrixDimensionException
- PolymorphicArgumentException

### Methods

- arrayLeftDivide
- arrayLeftDivideEquals
- __construct
- arrayRightDivide
- arrayRightDivideEquals
- arrayTimes
- arrayTimesEquals
- checkMatrixDimensions
- concat
- det
- diagonal
- get
- getArray
- getColumnDimension
- getMatrix
- getMatrixByCol
- getMatrixByRow
- getRowDimension
- identity
- inverse
- minus
- minusEquals
- plus
- plusEquals
- power
- set
- solve
- times
- trace
- transpose
- uminus

### Class Details

[line 27]
[ Top ]

### Class Variables

#### $A = array()

[line 42]

Matrix storage

#### Tags:

access: | public

Type: | array

[ Top ]

### Class Methods

### method arrayLeftDivide [line 778]

`Matrix arrayLeftDivide( Matrix $B)`

arrayLeftDivide

Element-by-element Left division A / B

#### Tags:

return: | Division result
access: | public

#### Parameters:

Matrix | $B | Matrix B

[ Top ]

### method arrayLeftDivideEquals [line 815]

`Matrix arrayLeftDivideEquals( mixed $B)`

arrayLeftDivideEquals

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

#### Tags:

return: | Matrix Aij
access: | public

#### Parameters:

mixed | $B | Matrix/Array

[ Top ]

### constructor __construct [line 66]

`PHPExcel_Shared_JAMA_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. In essence, we're just implementing a simple RTTI filter and calling the appropriate constructor.

#### Tags:

access: | public

[ Top ]

### method arrayRightDivide [line 685]

`Matrix arrayRightDivide( Matrix $B)`

arrayRightDivide

Element-by-element right division A / B

#### Tags:

return: | Division result
access: | public

#### Parameters:

Matrix | $B | Matrix B

[ Top ]

### method arrayRightDivideEquals [line 741]

`Matrix arrayRightDivideEquals( mixed $B)`

arrayRightDivideEquals

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

#### Tags:

return: | Matrix Aij
access: | public

#### Parameters:

mixed | $B | Matrix/Array

[ Top ]

### method arrayTimes [line 597]

`Matrix arrayTimes( mixed $B)`

arrayTimes

Element-by-element multiplication Cij = Aij * Bij

#### Tags:

return: | Matrix Cij
access: | public

#### Parameters:

mixed | $B | Matrix/Array

[ Top ]

### method arrayTimesEquals [line 634]

`Matrix arrayTimesEquals( mixed $B)`

arrayTimesEquals

Element-by-element multiplication Aij = Aij * Bij

#### Tags:

return: | Matrix Aij
access: | public

#### Parameters:

mixed | $B | Matrix/Array

[ Top ]

### method checkMatrixDimensions [line 272]

`boolean checkMatrixDimensions( [Matrix $B = null])`

checkMatrixDimensions

Is matrix B the same size?

#### Tags:

access: | public

#### Parameters:

Matrix | $B | Matrix B

[ Top ]

### method concat [line 992]

`Matrix concat( mixed $B)`

concat

A = A & B

#### Tags:

return: | Sum
access: | public

#### Parameters:

mixed | $B | Matrix/Array

[ Top ]

### method det [line 1053]

`float det( )`

det

Calculate determinant

#### Tags:

return: | Determinant
access: | public

[ Top ]

### method diagonal [line 323]

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

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 get [line 156]

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

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

`array getArray( )`

getArray

#### Tags:

return: | Matrix array
access: | public

[ Top ]

### method getColumnDimension [line 143]

`int getColumnDimension( )`

getColumnDimension

#### Tags:

return: | Column dimension
access: | public

[ Top ]

### method getMatrix [line 171]

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

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

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

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

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

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

`int getRowDimension( )`

getRowDimension

#### Tags:

return: | Row dimension
access: | public

[ Top ]

### method identity [line 309]

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

identity

Generate an identity matrix.

#### Tags:

return: | Identity matrix
access: | public

#### Parameters:

int | $m | Row dimension
int | $n | Column dimension

[ Top ]

### method inverse [line 1042]

`Matrix inverse( )`

Matrix inverse or pseudoinverse.

#### Tags:

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

[ Top ]

### method minus [line 510]

`Matrix minus( mixed $B)`

minus

A - B

#### Tags:

return: | Sum
access: | public

#### Parameters:

mixed | $B | Matrix/Array

[ Top ]

### method minusEquals [line 546]

`Matrix minusEquals( mixed $B)`

minusEquals

A = A - B

#### Tags:

return: | Sum
access: | public

#### Parameters:

mixed | $B | Matrix/Array

[ Top ]

### method plus [line 424]

`Matrix plus( mixed $B)`

plus

A + B

#### Tags:

return: | Sum
access: | public

#### Parameters:

mixed | $B | Matrix/Array

[ Top ]

### method plusEquals [line 460]

`Matrix plusEquals( mixed $B)`

plusEquals

A = A + B

#### Tags:

return: | Sum
access: | public

#### Parameters:

mixed | $B | Matrix/Array

[ Top ]

### method power [line 942]

`Matrix power( mixed $B)`

power

A = A ^ B

#### Tags:

return: | Sum
access: | public

#### Parameters:

mixed | $B | Matrix/Array

[ Top ]

### method set [line 295]

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

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 solve [line 1026]

`Matrix solve( Matrix $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 times [line 851]

`Matrix times( mixed $n)`

times

Matrix multiplication

#### Tags:

return: | Product
access: | public

#### Parameters:

mixed | $n | Matrix/Array/Scalar

[ Top ]

### method trace [line 397]

`float trace( )`

trace

Sum of diagonal elements

#### Tags:

return: | Sum of diagonal elements
access: | public

[ Top ]

### method transpose [line 380]

`Matrix transpose( )`

transpose

Tranpose matrix

#### Tags:

return: | Transposed matrix
access: | public

[ Top ]

### method uminus [line 413]

`Matrix uminus( )`

uminus

Unary minus matrix -A

#### Tags:

return: | Unary minus matrix
access: | public

[ Top ]

### Class Constants

#### ArgumentBoundsException = "Invalid argument range."

[line 32]

[ Top ]

#### ArgumentTypeException = "Invalid argument type."

[line 31]

[ Top ]

#### ArrayLengthException = "Array length must be a multiple of m."

[line 34]

[ Top ]

#### MatrixDimensionException = "Matrix dimensions are not equal."

[line 33]

[ Top ]

#### PolymorphicArgumentException = "Invalid argument pattern for polymorphic function."

[line 30]

[ Top ]

Documentation generated on Fri, 12 Oct 2012 00:16:41 +0200 by phpDocumentor 1.4.4