matrix.js
No description.

File Location

/goog/math/matrix.js

Classes

goog.math.Matrix
Class for representing and manipulating matrices. The entry that lies in the i-th row and the j-th column of a matrix is typically referred to as the i,j entry of the matrix. The m-by-n matrix A would have its entries referred to as: [ a0,0 a0,1 a0,2 ... a0,j ... a0,n ] [ a1,0 a1,1 a1,2 ... a1,j ... a1,n ] [ a2,0 a2,1 a2,2 ... a2,j ... a2,n ] [ . . . . . ] [ . . . . . ] [ . . . . . ] [ ai,0 ai,1 ai,2 ... ai,j ... ai,n ] [ . . . . . ] [ . . . . . ] [ . . . . . ] [ am,0 am,1 am,2 ... am,j ... am,n ]

Public Protected Private

Global Functions

goog.math.Matrix.createIdentityMatrix(n) !goog.math.Matrix
Creates a square identity matrix. i.e. for n = 3:
[ 1 0 0 ]
[ 0 1 0 ]
[ 0 0 1 ]
Arguments:
n : number
The size of the square identity matrix.
Returns: !goog.math.Matrix  Identity matrix of width and height n.
code »
goog.math.Matrix.createZeroPaddedArray_(mn) !Array.<!Array.<number>>
Creates a new zero padded matix.
Arguments:
m : number
Height of matrix.
n : number
Width of matrix.
Returns: !Array.<!Array.<number>>  The new zero padded matrix.
code »
goog.math.Matrix.forEach(matrixfnopt_obj)
Calls a function for each cell in a matrix.
Arguments:
matrix : goog.math.Matrix
The matrix to iterate over.
fn : Function
The function to call for every element. This function takes 4 arguments (value, i, j, and the matrix) and the return value is irrelevant.
opt_obj : Object=
The object to be used as the value of 'this' within fn.
code »
goog.math.Matrix.isValidArray(arr) boolean
Tests whether an array is a valid matrix. A valid array is an array of arrays where all arrays are of the same length and all elements are numbers.
Arguments:
arr : Array
An array to test.
Returns: boolean  Whether the array is a valid matrix.
code »
goog.math.Matrix.map(matrixfnopt_obj) !goog.math.Matrix
Calls a function for every cell in a matrix and inserts the result into a new matrix of equal dimensions.
Arguments:
matrix : goog.math.Matrix
The matrix to iterate over.
fn : Function
The function to call for every element. This function takes 4 arguments (value, i, j and the matrix) and should return something. The result will be inserted into a new matrix.
opt_obj : Object=
The object to be used as the value of 'this' within fn.
Returns: !goog.math.Matrix  A new matrix with the results from fn.
code »

Directory math

File Reference