Class Index | File Index

Classes


Methods

Class Matrix


Defined in: Matrix.js.

Class Summary
Constructor Attributes Constructor Name and Description





Matrix(rows, columns, values)
Provides a mathematical matrix object
Method Summary
Method Attributes Method Name and Description
add(that)
Adds one matrix to another.
<static>
Matrix.columnVector(the)
Given an array of numbers creates a column vector Matrix object.
copy()
Provide a copy contructor
{boolean}
An operation on graph adjacency matrix.
simple implementation of Floyd-Warshall All-Pairs Shortest Path algorithm for weighted graphs
{Matrix[]}
Produces two matrices, L and U, which are lower triangular matrice and upper triangular matrices respectively.
multiply(that)
Multiply one matrix by another
{Matrix (Nx1 sized)}
naiveGaussian(sumvector)
Runs a naive Gaussian elimination on a Matrix or a Matrix and a sum vector.
<static>
Matrix.rowVector(the)
Given an array of numbers creates a row Matrix object.
{Matrix (Nx1 sized)}
Runs a Gaussian elimination with scaled partial pivoting on a a Matrix and a sum vector.
subtract(that)
Subtract one matrix from another
Provides the Transpose matrix operation, i.e.
tridiagonalSolve(columnvector)
Solves a symmetric matric of the tri-diagonal form
Class Detail
Matrix(rows, columns, values)
Provides a mathematical matrix object
Parameters:
rows
{Integer} number of rows in the matrix
columns
{Integer} number of columns in the matrix
values
{Double[][]} a multidimensional array with rows and column as specified by the other parameters
Method Detail
{Matrix} add(that)
Adds one matrix to another.
Parameters:
that
{Matrix} Matrix to be added with.
Returns:
{Matrix} The resulting sum

<static> {Matrix} Matrix.columnVector(the)
Given an array of numbers creates a column vector Matrix object. Essentially shortand for creating matrices of form [[a] [b] [...] [c]]
Parameters:
{Double[]} the
matrix entries
Returns:
{Matrix} a X-by-1 matrix

{Matrix} copy()
Provide a copy contructor
Returns:
{Matrix} A copy of the existing matrix

{boolean} findSink()
An operation on graph adjacency matrix. It checks if a graph contains a sink node. A node which has V-1 inbound edges and 0 outbound edges. Running time is only O(n)
Returns:
{boolean}

{Matrix} FloydWarshall()
simple implementation of Floyd-Warshall All-Pairs Shortest Path algorithm for weighted graphs
Returns:
{Matrix} The APSP matrix for a given matrix

{Matrix[]} LUdecomposition()
Produces two matrices, L and U, which are lower triangular matrice and upper triangular matrices respectively.
Returns:
{Matrix[]} An array of Matrix objects, L =

{Matrix} multiply(that)
Multiply one matrix by another
Parameters:
{Matrix} that
The matrix being multiplied
Returns:
{Matrix} The product matrix

{Matrix (Nx1 sized)} naiveGaussian(sumvector)
Runs a naive Gaussian elimination on a Matrix or a Matrix and a sum vector. Given the form Ax = b; A is the matrix and b is the sum vector; x is the result
Parameters:
sumvector
{Matrix (Nx1 sized)} An N row, 1 column vector containing the sums.
Returns:
{Matrix (Nx1 sized)} The answer

<static> {Matrix} Matrix.rowVector(the)
Given an array of numbers creates a row Matrix object. Essentially shortand for creating matrices of form [a,b,c,...]
Parameters:
{Double[]} the
matrix entries
Returns:
{Matrix} a 1-by-X matrix

{Matrix (Nx1 sized)} scaledPartialPivotGaussian(sumvector)
Runs a Gaussian elimination with scaled partial pivoting on a a Matrix and a sum vector. Given the form Ax = b; A is the matrix and b is the sum vector; x is the result
Parameters:
sumvector
{Matrix (Nx1 sized)} An N row, 1 column vector containing the sums.
Returns:
{Matrix (Nx1 sized)} The answer P. 267

{Matrix} subtract(that)
Subtract one matrix from another
Parameters:
{Matrix} that
The term being subtracted
Returns:
{Matrix} The difference matrix

toHTML()

toString()

{Matrix} transpose()
Provides the Transpose matrix operation, i.e. flips the matrix
Returns:
{Matrix} The transpose of the original matrix

{Matrix} tridiagonalSolve(columnvector)
Solves a symmetric matric of the tri-diagonal form
Author: Sahil Diwan.
Parameters:
{Matrix} columnvector
An N-by-1 matrix
Returns:
{Matrix} Solutions in an N-by-1 matrix

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Jul 19 2013 13:20:00 GMT-0400 (EDT)