|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object infomat.vectorspace.IMatrix
public class IMatrix
IMatrix represents the relations between two IObjectSet:s. The IMatrixCell class represents the elements of this IMatrix. This is implemented considering sparse matrixes. The IMatrixCells are stored in a DoubleHashMap and are the non-zero matrix elements.
Field Summary | |
---|---|
private DoubleHashMap |
cellMap
|
private java.util.HashMap<IObject,java.lang.Float> |
colIObjectGlobalWeightMap
|
private IObjectSet |
cols
|
private java.util.HashMap<IObject,java.lang.Float> |
rowIObjectGlobalWeightMap
|
private IObjectSet |
rows
|
Constructor Summary | |
---|---|
IMatrix(IMatrix m)
Copy constructor. |
|
IMatrix(java.lang.String columnLabel,
java.lang.String rowLabel)
|
Method Summary | |
---|---|
boolean |
addCell(IMatrixCell mc)
Add a IMatrixCell. |
boolean |
addCell(int ri,
int ci,
float weight)
Add the value of a column in a row |
boolean |
addCell(int ri,
int ci,
float localCount,
float weight)
Add the value of a column in a row |
boolean |
addCell(int ri,
int ci,
float localCount,
float localWeight,
float weight)
Add the value of a column in a row |
void |
addColumnIObject(IObject colObj)
Adds a Column IObject to the matrix. |
void |
addRowIObject(IObject rowObj)
Adds a Row IObject to the matrix. |
double |
avgColsInRows()
|
double |
avgRowsInCols()
|
boolean |
columnIObjectSet(IObjectSet ios)
|
IObjectGroup |
constructCorrespondingGroup(IObjectGroup group)
Returns the corresponding group, i.e. |
java.util.Vector |
getAllCells()
Returns the DoubleHashMap containing all non zero elements of the IMatrix. |
IMatrixCell |
getCell(IObject row,
IObject col)
Returns the IMatrixCell for the IObject "row" in the "row" IObjectSet and the IObject "col" in the "column" IObjectSet |
DoubleHashMap |
getCellMap()
Returns the DoubleHashMap containing all non zero elements of the IMatrix. |
java.util.Vector |
getCellsWith(IObject co)
Returns a Vector of all the IMatrixCells that contains the given IObject. |
java.util.Vector |
getCellsWithIObjectRestrictedToGroup(IObject io,
IObjectGroup restrictionGroup)
Returns a Vector of the IMatrixCell:s that contains the given IObject AND any of the IObjects in the restrictionGroup. |
java.util.HashSet |
getColumnIMatrixCellsForRowObject(IObject rowObject)
|
float |
getColumnIObjectGlobalWeight(IObject io)
Returns 0 if the IObject has not been weighted. |
IObjectSet |
getColumnIObjectSet()
Returns the "column" IObjectSet. |
IVector<IMatrixCell> |
getIVectorOfElements()
Returns an IVector with all cells and their weights. |
java.lang.String |
getNumberOfRowsColumnsCellsString()
|
java.util.HashSet<IObject> |
getOtherIObjectsForIObject(IObject io)
Returns all IObject:s the specified IObject share a IMatrixCell with. |
java.util.HashSet |
getRowIMatrixCellsForColumnObject(IObject colObject)
Returns a Vector of the IMatrixCells that contains the given IObject. |
float |
getRowIObjectGlobalWeight(IObject io)
Returns 0 if the IObject has not been weighted. |
IObjectSet |
getRowIObjectSet()
Returns the "row" IObjectSet. |
java.awt.Dimension |
getSize()
Returns a Dimension with x-size as the number of "columns" and y-size as the number of "rows" of the IMatrix. |
java.util.HashMap<IObject,java.lang.Float> |
getTotalWeight(boolean row,
boolean localWeight)
Returns the total weight for each object along the specified dimension. |
void |
invertMatrix()
|
void |
purgeMatrixToGroups(IObjectGroup rowGroup,
IObjectGroup columnGroup)
Removes all IObjects that's not in the specified row and colum group. |
void |
removeAllCells()
Revmove all IMatrixCell from the IMatrix. |
void |
removeCell(IMatrixCell mc)
Removes a IMatrixCell from the IMatrix. |
void |
removeCells(IVector<IMatrixCell> ivec)
|
void |
removeColumnIObjectGlobalWeight(IObject io)
|
void |
removeRowIObjectGlobalWeight(IObject io)
|
boolean |
rowIObjectSet(IObjectSet ios)
|
void |
saveIMatrix(java.io.File file)
|
void |
saveIObjectGroupingFile(IObjectGrouping grouping,
java.io.File file)
|
void |
setColumnIObjectGlobalWeight(IObject io,
float globalWeight)
|
void |
setColumnIObjectSet(IObjectSet set)
Sets the "column" IObjectSet. |
void |
setRowIObjectGlobalWeight(IObject io,
float globalWeight)
|
void |
setRowIObjectSet(IObjectSet set)
Sets the "row" IObjectSet. |
IMatrix |
subMatrix(IObjectGroup rowGroup,
IObjectGroup colGroup)
Returns a copy of the specified portion of the matrix. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private IObjectSet rows
private IObjectSet cols
private DoubleHashMap cellMap
private java.util.HashMap<IObject,java.lang.Float> rowIObjectGlobalWeightMap
private java.util.HashMap<IObject,java.lang.Float> colIObjectGlobalWeightMap
Constructor Detail |
---|
public IMatrix(java.lang.String columnLabel, java.lang.String rowLabel)
public IMatrix(IMatrix m)
Method Detail |
---|
public IMatrix subMatrix(IObjectGroup rowGroup, IObjectGroup colGroup)
public void addColumnIObject(IObject colObj)
public void addRowIObject(IObject rowObj)
public boolean addCell(IMatrixCell mc)
mc
- the Matrix cell
public boolean addCell(int ri, int ci, float weight)
ri
- The unique identifier of the rowci
- The unique identifier of the columnweight
- The value of the column in the row
public boolean addCell(int ri, int ci, float localCount, float weight)
ri
- The unique identifier of the rowci
- The unique identifier of the columnweight
- The value of the column in the row
public boolean addCell(int ri, int ci, float localCount, float localWeight, float weight)
ri
- The unique identifier of the rowci
- The unique identifier of the columnweight
- The value of the column in the row
public IObjectGroup constructCorrespondingGroup(IObjectGroup group)
public java.util.Vector getCellsWith(IObject co)
public java.lang.String getNumberOfRowsColumnsCellsString()
public boolean rowIObjectSet(IObjectSet ios)
public boolean columnIObjectSet(IObjectSet ios)
public java.util.HashMap<IObject,java.lang.Float> getTotalWeight(boolean row, boolean localWeight)
row
- - true: weight for row objects,
false: weight for column objectslocalWeight
- - true: the localWeght,
false: the weightpublic void purgeMatrixToGroups(IObjectGroup rowGroup, IObjectGroup columnGroup)
public void invertMatrix()
public IObjectSet getRowIObjectSet()
public IObjectSet getColumnIObjectSet()
public void setRowIObjectSet(IObjectSet set)
public void setColumnIObjectSet(IObjectSet set)
public IVector<IMatrixCell> getIVectorOfElements()
public DoubleHashMap getCellMap()
public java.util.Vector getAllCells()
public IMatrixCell getCell(IObject row, IObject col)
public void removeCell(IMatrixCell mc)
mc
- An IMatrixCellpublic void removeCells(IVector<IMatrixCell> ivec)
public void removeAllCells()
public java.awt.Dimension getSize()
public java.util.Vector getCellsWithIObjectRestrictedToGroup(IObject io, IObjectGroup restrictionGroup)
public java.util.HashSet getRowIMatrixCellsForColumnObject(IObject colObject)
public java.util.HashSet getColumnIMatrixCellsForRowObject(IObject rowObject)
public java.util.HashSet<IObject> getOtherIObjectsForIObject(IObject io)
public void saveIMatrix(java.io.File file)
public void saveIObjectGroupingFile(IObjectGrouping grouping, java.io.File file)
public double avgColsInRows()
public double avgRowsInCols()
public void setRowIObjectGlobalWeight(IObject io, float globalWeight)
public void setColumnIObjectGlobalWeight(IObject io, float globalWeight)
public void removeRowIObjectGlobalWeight(IObject io)
public void removeColumnIObjectGlobalWeight(IObject io)
public float getRowIObjectGlobalWeight(IObject io)
public float getColumnIObjectGlobalWeight(IObject io)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |