|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.stanford.nlp.linalg.AbstractMatrix
Abstract Matrix class
| Field Summary | |
protected int |
nc
|
protected int |
nnz
|
protected int |
nr
|
| Constructor Summary | |
AbstractMatrix()
default constructor. |
|
AbstractMatrix(int num_rows,
int num_columns)
constructs Matrix of given size |
|
AbstractMatrix(int num_rows,
int num_columns,
int cardinality)
constructs matrix of given size and cardinality |
|
AbstractMatrix(String filename)
constructs Matrix and sets values according to ASCII file of form: num_rows num_columns cardinality followed by triplets row, column, value |
|
| Method Summary | |
abstract void |
allocate(int num_rows,
int num_columns)
allocates memory for matrix of given size |
abstract void |
allocate(int num_rows,
int num_columns,
int cardinality)
allocates memory for matrix of given size and cardinality |
int |
cardinality()
Returns the number of cells having non-zero values; ignores tolerance. |
abstract Object |
clone()
|
Iterator |
columnIterator()
iterates through all Array columns in the Matrix |
int |
columns()
returns number of columns in matrix |
Iterator |
entryIterator()
returns iterator over all Entries in matrix. |
Set |
entrySet()
returns Set of all entries in matrix for sparse matrices, returns set of all nonzero entries in matrix |
Matrix |
normalizeColumns(Metric metric)
returns Matrix whose columns are normalized to 1 does not change receiver |
int |
rows()
returns number of rows in matrix |
void |
setColumn(int index,
Array column)
sets column with index index = column |
Matrix |
tfidf()
|
String |
toDenseString()
Returns a dense string representation of matrix. |
String |
toMatlabSparseString()
returns sparse string representation of matrix, in Matlab-readable format, ensuring that the first matrix entry is [1,1,value] rather than [0,0,value] i.e. |
String |
toSparseString()
returns sparse string representation of matrix num_rows num_columns cardinality row column value row column value ... |
String |
toString()
returns bracket-delimited entrySet String representation of Matrix [[[row,column,value], [row,column,value]], [[row,column,value]...] |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.stanford.nlp.linalg.Matrix |
get, getColumn, set |
| Field Detail |
protected int nr
protected int nc
protected int nnz
| Constructor Detail |
public AbstractMatrix()
public AbstractMatrix(int num_rows,
int num_columns)
public AbstractMatrix(int num_rows,
int num_columns,
int cardinality)
public AbstractMatrix(String filename)
throws FileNotFoundException,
IOException
| Method Detail |
public Set entrySet()
entrySet in interface Matrixpublic String toString()
toString in interface MatrixtoString in class Objectpublic String toSparseString()
toSparseString in interface Matrixpublic String toMatlabSparseString()
toMatlabSparseString in interface Matrixpublic String toDenseString()
value value value value value value value value value value value value value value value value
toDenseString in interface Matrixpublic Matrix normalizeColumns(Metric metric)
Matrix
normalizeColumns in interface Matrixpublic Matrix tfidf()
public Iterator columnIterator()
Matrix
columnIterator in interface Matrix
public abstract void allocate(int num_rows,
int num_columns)
public abstract void allocate(int num_rows,
int num_columns,
int cardinality)
public int columns()
Matrix
columns in interface Matrixpublic int rows()
Matrix
rows in interface Matrixpublic int cardinality()
Matrix
cardinality in interface Matrixpublic Iterator entryIterator()
entryIterator in interface Matrixpublic abstract Object clone()
clone in interface Matrixclone in class Object
public void setColumn(int index,
Array column)
Matrixindex = column
setColumn in interface Matrix
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||