|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.unitn.disi.smatch.data.matrices.SparseMatrixChar
public class SparseMatrixChar
A sparse implementation using compressed row storage (CRS) scheme. Needs row-wise traversal and signaling the row end.
Constructor Summary | |
---|---|
SparseMatrixChar()
|
|
SparseMatrixChar(int x,
int y,
char[][] in)
|
|
SparseMatrixChar(int rows,
int columns,
int num_nz)
|
Method Summary | |
---|---|
void |
endOfRow()
Signals end of row for a CRS scheme. |
char |
getElement(int x,
int y)
Returns an element. |
int |
getX()
Returns row count. |
int |
getY()
Returns column count. |
void |
init(int x,
int y)
Inits a matrix x rows per y columns. |
void |
init(int rows,
int columns,
int num_nz)
Inits a matrix x rows per y columns with a max of num_nz non-zero elements. |
void |
setElement(int x,
int y,
char value)
Sets an element. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SparseMatrixChar()
public SparseMatrixChar(int x, int y, char[][] in)
public SparseMatrixChar(int rows, int columns, int num_nz)
Method Detail |
---|
public void init(int x, int y)
IMatchMatrix
init
in interface IMatchMatrix
x
- rows county
- column countpublic void init(int rows, int columns, int num_nz)
IMatchMatrix
init
in interface IMatchMatrix
rows
- rows countcolumns
- column countnum_nz
- amount of non-zero elementspublic char getElement(int x, int y)
IMatchMatrix
getElement
in interface IMatchMatrix
x
- rowy
- column
public void setElement(int x, int y, char value)
IMatchMatrix
setElement
in interface IMatchMatrix
x
- rowy
- columnvalue
- a new element valuepublic int getX()
IMatchMatrix
getX
in interface IMatchMatrix
public int getY()
IMatchMatrix
getY
in interface IMatchMatrix
public void endOfRow()
IMatchMatrix
endOfRow
in interface IMatchMatrix
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |