| Package | flare.util.math |
| Class | public class DenseMatrix |
| Implements | IMatrix |
| Property | Defined by | ||
|---|---|---|---|
| cols : int [read-only] The number of columns.
| DenseMatrix | ||
| nnz : int [read-only] The number of non-zero values.
| DenseMatrix | ||
| rows : int [read-only] The number of rows.
| DenseMatrix | ||
| sum : Number [read-only] The sum of all the entries in this matrix.
| DenseMatrix | ||
| sumsq : Number [read-only] The sum of squares of all the entries in this matrix.
| DenseMatrix | ||
| values : Array [read-only] The underlying array of values
| DenseMatrix | ||
| Method | Defined by | ||
|---|---|---|---|
|
DenseMatrix(rows:int, cols:int)
Creates a new DenseMatrix with the given size.
| DenseMatrix | ||
|
Creates a copy of this matrix.
| DenseMatrix | ||
|
get(i:int, j:int):Number
| DenseMatrix | ||
|
init(rows:int, cols:int):void
Initializes the matrix to desired dimensions.
| DenseMatrix | ||
|
Creates a new matrix of the same type.
| DenseMatrix | ||
|
Multiplies this matrix by another.
| DenseMatrix | ||
|
scale(s:Number):void
Multiplies all values in this matrix by the input scalar.
| DenseMatrix | ||
|
set(i:int, j:int, v:Number):Number
| DenseMatrix | ||
|
visit(f:Function):void
Visit all values in the matrix.
| DenseMatrix | ||
|
visitNonZero(f:Function):void
Visit all non-zero values in the matrix.
| DenseMatrix | ||
| 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
| values | property |
values:Array [read-only]The underlying array of values
Implementation public function get values():Array
| DenseMatrix | () | constructor |
public function DenseMatrix(rows:int, cols:int)Creates a new DenseMatrix with the given size.
Parametersrows:int — the number of rows
|
|
cols:int — the number of columns
|
| clone | () | method |
| get | () | method |
public function get(i:int, j:int):NumberParameters
i:int |
|
j:int |
Number |
| 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):NumberParameters
i:int |
|
j:int |
|
v:Number |
Number |
| 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
|