### Methods

## Polymorphic constructor

    __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

    arrayLeftDivide() : \Matrix

Element-by-element Left division A / B

### Returns

`\Matrix`Division result

## arrayLeftDivideEquals

    arrayLeftDivideEquals() : \Matrix

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

### Returns

`\Matrix`Matrix Aij

## arrayRightDivide

    arrayRightDivide() : \Matrix

Element-by-element right division A / B

### Returns

`\Matrix`Division result

## arrayRightDivideEquals

    arrayRightDivideEquals() : \Matrix

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

### Returns

`\Matrix`Matrix Aij

## arrayTimes

    arrayTimes() : \Matrix

Element-by-element multiplication Cij = Aij * Bij

### Returns

`\Matrix`Matrix Cij

## arrayTimesEquals

    arrayTimesEquals() : \Matrix

Element-by-element multiplication Aij = Aij * Bij

### Returns

`\Matrix`Matrix Aij

## checkMatrixDimensions

    checkMatrixDimensions(\Matrix $B) : boolean

Is matrix B the same size?

### Parameters

#### $B

`\Matrix`

Matrix B

### Returns

`boolean`

## concat

    concat() : \Matrix

A = A & B

### Returns

`\Matrix`Sum

## det

    det() : float

Calculate determinant

### Returns

`float`Determinant

## diagonal

    diagonal(int $m, int $n, mixed $c) : \Matrix

Generate a diagonal matrix

### Parameters

#### $m

`int`

Row dimension

#### $n

`int`

Column dimension

#### $c

`mixed`

Diagonal value

### Returns

`\Matrix`Diagonal matrix

## get

    get(int $i, int $j) : mixed

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

### Parameters

#### $i

`int`

Row position

#### $j

`int`

Column position

### Returns

`mixed`Element (int/float/double)

## getArray

    getArray() : array

### Returns

`array`Matrix array

## getColumnDimension

    getColumnDimension() : int

### Returns

`int`Column dimension

## getMatrix

    getMatrix() : \Matrix

Get a submatrix

### Returns

`\Matrix`Submatrix

## getMatrixByCol

    getMatrixByCol($j0, $jF) : \Matrix

Get a submatrix by column index/range

### Parameters

#### $j0

#### $jF

### Returns

`\Matrix`Submatrix

## getMatrixByRow

    getMatrixByRow(int $i0, int $iF) : \Matrix

Get a submatrix by row index/range

### Parameters

#### $i0

`int`

Initial row index

#### $iF

`int`

Final row index

### Returns

`\Matrix`Submatrix

## getRowDimension

    getRowDimension() : int

### Returns

`int`Row dimension

## identity

    identity(int $m, int $n) : \Matrix

Generate an identity matrix.

### Parameters

#### $m

`int`

Row dimension

#### $n

`int`

Column dimension

### Returns

`\Matrix`Identity matrix

## Matrix inverse or pseudoinverse.

    inverse() : \Matrix

### Returns

`\Matrix`... Inverse(A) if A is square, pseudoinverse otherwise.

## minus

    minus() : \Matrix

A - B

### Returns

`\Matrix`Sum

## minusEquals

    minusEquals() : \Matrix

A = A - B

### Returns

`\Matrix`Sum

## plus

    plus() : \Matrix

A + B

### Returns

`\Matrix`Sum

## plusEquals

    plusEquals() : \Matrix

A = A + B

### Returns

`\Matrix`Sum

## power

    power() : \Matrix

A = A ^ B

### Returns

`\Matrix`Sum

## set

    set(int $i, int $j, mixed $c) : mixed

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

### Parameters

#### $i

`int`

Row position

#### $j

`int`

Column position

#### $c

`mixed`

Int/float/double value

### Returns

`mixed`Element (int/float/double)

## Solve A*X = B.

    solve(\Matrix $B) : \Matrix

### Parameters

#### $B

`\Matrix`

Right hand side

### Returns

`\Matrix`... Solution if A is square, least squares solution otherwise

## times

    times() : \Matrix

Matrix multiplication

### Returns

`\Matrix`Product

## trace

    trace() : float

Sum of diagonal elements

### Returns

`float`Sum of diagonal elements

## transpose

    transpose() : \Matrix

Tranpose matrix

### Returns

`\Matrix`Transposed matrix

## uminus

    uminus() : \Matrix

Unary minus matrix -A

### Returns

`\Matrix`Unary minus matrix

### Properties

##

    $A : array

access | public

##

    $m : int

access | private

##

    $n : int

access | private

### Constants

## ArgumentBoundsException

    ArgumentBoundsException

## ArgumentTypeException

    ArgumentTypeException

## ArrayLengthException

    ArrayLengthException

## MatrixDimensionException

    MatrixDimensionException

## PolymorphicArgumentException

    PolymorphicArgumentException