MathWorx

Class Matrix

Object
   |
   +--Matrix

class Matrix

Defined in Matrix.js

Requires:


Field Summary
 Array components
          an Array whose elements are Vectors, the vectors being rows of the matrix
 
Constructor Summary
Matrix(<Object> elements)
            Constructor function.
 
Method Summary
 Matrix add(<Matrix> matrix)
           Adds a matrix to another one of the same size.
 Matrix augment(<Matrix> matrix)
           Augments a matrix to the right of a matrix.
 Boolean canMultiplyFromLeft(<Object> matrix)
           Tests to see whether the supplied matrix can be multiplied by this matrix in Matrix.prototype.form = this;times matrix.
 Vector col(<Integer> j)
           Returns the j'th column as a vector.
 Object det()
           Shorthand for determinant()
 Number determinant()
           Calculates the determinant of a square matrix (returns null if matrix not a square).
 Object dimensions()
           Returns the dimensions of the matrix as an Object.
 Boolean equalTo(<Matrix> matrix)
           Checks two matrices for equality.
 Number get(<Integer> i,<Integer> j)
           Returns the i,j'th element of the matrix.
 Vector getDiagonal()
           Gets and returns the diagonal entries of a square matrix.
 Object indexOf(<Number> val)
           Returns the indices of the FIRST occurence of a given value.
 Matrix invert()
           Inverts an invertible matrix and returns the inverse.
 Boolean invertible()
           Tests to see if a matrix is or is not invertible.
 Boolean isSingular()
           Tests a matrix for singularity.
 Boolean isSquare()
           Tests to see if a matrix is square or not.
 Matrix map(<Function> func)
           Maps a matrix onto a new one according to a supplied function.
 Number max()
           Returns the absolute maximum component of the matrix.
 Matrix minor(<Integer> row, <Integer> col, <Integer> numrows, <Integer> numcols)
           Creates a sub-matrix from the original matrix.
 Object multiply(<Object> matrix)
           If possible, multiplies the supplied matrix by this matrix.
 Matrix multiplyBy(<Number> k)
           Multiplies a matrix by a scalar value.
 Matrix negative()
           Returns the negative version of the current matrix.
 Integer numCols()
           Get the number of columns in the matrix.
 Integer numRows()
           Get the number of rows in the matrix.
 Number rank()
           Calculates the rank of a matrix.
 Matrix round()
           Rounds all the elements of a matrix into a new one.
 Vector row(<Integer> i)
           Returns a specific row of the matrix as a Vector (which it is already)
 Boolean sameSizeAs(<Matrix> matrix)
           Tests to see if two matrices are the same size.
 void setElement(<Integer> i, <Integer> j, <Number> val)
           Sets the i,j'th element to val.
 Object snapTo(<Number> val)
           Sets all values within range of Zero (set in easyload.js) to val.
 Matrix subtract(<Matrix> matrix)
           Subtracts another matrix of the same size from this one.
 String toString()
           Creates and returns a string representation of the matrix.
 Matrix toUpperTriangular()
           Uses a modified version of Gaussian elimination to create and return a new, upper triangular version of the original matrix while preserving determinant and rank.
 Vector toVector()
           Makes a Vector out of a 1-D (row or column) Matrix.
 Object tr()
           Shorthand for trace() function.
 Number trace()
           Computes the trace of a square matrix (returns null if matrix is not a square).
 Matrix transpose()
           Creates a new matrix that is the transpose of the original matrix.
<static> Object diagonal(<Object> elements)
           Creates a diagonal matrix (off-diagonal elements are 0) from a given array of elements
<static> Matrix I(<Integer> n)
           Creates the Identity matrix of dimension N.
<static> Object random(<Integer> rows, <Integer> cols, <Integer> max)
           Creates a rows x cols matrix with random elements between 0 and max
<static> Matrix zero(<Integer> rows, <Integer> cols)
           Creates a rows x cols matrix with all 0 elements.

Field Detail

components

Array components

Constructor Detail

Matrix

Matrix(<Object> elements)

Method Detail

add

Matrix add(<Matrix> matrix)

augment

Matrix augment(<Matrix> matrix)

canMultiplyFromLeft

Boolean canMultiplyFromLeft(<Object> matrix)

col

Vector col(<Integer> j)

det

Object det()

determinant

Number determinant()

dimensions

Object dimensions()

equalTo

Boolean equalTo(<Matrix> matrix)

get

Number get(<Integer> i,<Integer> j)

getDiagonal

Vector getDiagonal()

indexOf

Object indexOf(<Number> val)

invert

Matrix invert()

invertible

Boolean invertible()

isSingular

Boolean isSingular()

isSquare

Boolean isSquare()

map

Matrix map(<Function> func)

max

Number max()

minor

Matrix minor(<Integer> row, <Integer> col, <Integer> numrows, <Integer> numcols)

multiply

Object multiply(<Object> matrix)

multiplyBy

Matrix multiplyBy(<Number> k)

negative

Matrix negative()

numCols

Integer numCols()

numRows

Integer numRows()

rank

Number rank()

round

Matrix round()

row

Vector row(<Integer> i)

sameSizeAs

Boolean sameSizeAs(<Matrix> matrix)

setElement

void setElement(<Integer> i, <Integer> j, <Number> val)

snapTo

Object snapTo(<Number> val)

subtract

Matrix subtract(<Matrix> matrix)

toString

String toString()

toUpperTriangular

Matrix toUpperTriangular()

toVector

Vector toVector()

tr

Object tr()

trace

Number trace()

transpose

Matrix transpose()

diagonal

<static> Object diagonal(<Object> elements)

I

<static> Matrix I(<Integer> n)

random

<static> Object random(<Integer> rows, <Integer> cols, <Integer> max)

zero

<static> Matrix zero(<Integer> rows, <Integer> cols)

MathWorx

Documentation generated by JSDoc on Tue Aug 5 10:22:22 2008