| Package | flare.util.math |
| Interface | public interface IMatrix |
| Implementors | DenseMatrix, SparseMatrix |
| Property | Defined by | ||
|---|---|---|---|
| cols : int [read-only] The number of columns.
| IMatrix | ||
| nnz : int [read-only] The number of non-zero values.
| IMatrix | ||
| rows : int [read-only] The number of rows.
| IMatrix | ||
| sum : Number [read-only] The sum of all the entries in this matrix.
| IMatrix | ||
| sumsq : Number [read-only] The sum of squares of all the entries in this matrix.
| IMatrix | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates a copy of this matrix.
| IMatrix | ||
|
get(i:int, j:int):Number
Returns the value at the given indices.
| IMatrix | ||
|
init(rows:int, cols:int):void
Initializes the matrix to desired dimensions.
| IMatrix | ||
|
Creates a new matrix of the same type.
| IMatrix | ||
|
Multiplies this matrix by another.
| IMatrix | ||
|
scale(s:Number):void
Multiplies all values in this matrix by the input scalar.
| IMatrix | ||
|
set(i:int, j:int, v:Number):Number
Sets the value at the given indices.
| IMatrix | ||
|
visit(f:Function):void
Visit all values in the matrix.
| IMatrix | ||
|
visitNonZero(f:Function):void
Visit all non-zero values in the matrix.
| IMatrix | ||
| cols | property |
cols:int [read-only]The number of columns.
Implementation public function get cols():int
| nnz | property |
nnz:int [read-only]The number of non-zero values.
Implementation public function get nnz():int
| rows | property |
rows:int [read-only]The number of rows.
Implementation public function get rows():int
| sum | property |
sum:Number [read-only]The sum of all the entries in this matrix.
Implementation public function get sum():Number
| sumsq | property |
sumsq:Number [read-only]The sum of squares of all the entries in this matrix.
Implementation public function get sumsq():Number
| clone | () | method |
| get | () | method |
public function get(i:int, j:int):NumberReturns the value at the given indices.
Parametersi:int — the row index
|
|
j:int — the column index
|
Number — the value at position i,j
|
| init | () | method |
public function init(rows:int, cols:int):voidInitializes the matrix to desired dimensions. This method also resets all values in the matrix to zero.
Parametersrows:int — the number of rows in this matrix
|
|
cols:int — the number of columns in this matrix
|
| like | () | method |
public function like(rows:int, cols:int):IMatrixCreates a new matrix of the same type.
Parametersrows:int — the number of rows in the new matrix
|
|
cols:int — the number of columns in the new matrix
|
IMatrix —
a new matrix
|
| multiply | () | method |
public function multiply(b:IMatrix):IMatrixMultiplies this matrix by another. The number of rows in this matrix must match the number of columns in the input matrix.
Parametersb:IMatrix — the matrix to multiply by.
|
IMatrix —
a new matrix that is the product of this matrix with the
input matrix. The new matrix will be of the same type as this one.
|
| scale | () | method |
public function scale(s:Number):voidMultiplies all values in this matrix by the input scalar.
Parameterss:Number — the scalar to multiply by.
|
| set | () | method |
public function set(i:int, j:int, v:Number):NumberSets the value at the given indices.
Parametersi:int — the row index
|
|
j:int — the column index
|
|
v:Number — the value to set
|
Number — the input value v
|
| visit | () | method |
public function visit(f:Function):voidVisit all values in the matrix. The input function is expected to take three arguments--the row index, the column index, and the cell value--and return a number which then becomes the new value for the cell.
Parametersf:Function — the function to invoke for each value
|
| visitNonZero | () | method |
public function visitNonZero(f:Function):voidVisit all non-zero values in the matrix. The input function is expected to take three arguments--the row index, the column index, and the cell value--and return a number which then becomes the new value for the cell.
Parametersf:Function — the function to invoke for each non-zero value
|