|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectslib.utils.impl.MatrixDouble<C,R>
C
- Object to index ColumnsR
- Object to index Rowspublic class MatrixDouble<C,R>
Class used to represent a Matrix which can be used to store values associated to pairs of elements.
Constructor Summary | |
---|---|
MatrixDouble(Set<C> columResources,
Set<R> rowResources)
Create a matrix filled with null values considering the given indexes. |
|
MatrixDouble(Set<C> columResources,
Set<R> rowResources,
Double initValue)
Create a matrix filled with null values considering the given indexes |
Method Summary | |
---|---|
Double |
getAverage()
Return the average of contained valued. |
Double[] |
getColumn(C r)
Return the column associated to the given element |
Set<C> |
getColumnElements()
|
Double[][] |
getMatrix()
|
Double |
getMax()
|
Double |
getMaxColumn(C v)
|
Double |
getMaxRow(R v)
|
Double |
getMin()
Return the minimal value stored in the matrix |
int |
getNbColumns()
|
int |
getNbRows()
|
Double[] |
getRow(R r)
Return the row associated to the given element |
Set<R> |
getRowElements()
|
Double |
getSum()
Compute the sum of the values contained in the matrix. |
Double |
getValue(C colResource,
R rowResource)
|
Double |
getValueCheckIndex(C colResource,
R rowResource)
|
boolean |
isInColumnIndex(C r)
|
boolean |
isInRowIndex(R r)
|
boolean |
isSquare()
|
void |
setValue(C colResource,
R rowResource,
Double value)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MatrixDouble(Set<C> columResources, Set<R> rowResources)
columResources
- the columnsrowResources
- the rowspublic MatrixDouble(Set<C> columResources, Set<R> rowResources, Double initValue)
columResources
- rowResources
- initValue
- default valueMethod Detail |
---|
public Double[] getColumn(C r)
r
- the element
public Double[] getRow(R r)
r
-
public Double getValueCheckIndex(C colResource, R rowResource)
colResource
- rowResource
-
public Double getValue(C colResource, R rowResource) throws SLIB_Ex_Critic
colResource
- rowResource
-
SLIB_Ex_Critic
public void setValue(C colResource, R rowResource, Double value)
colResource
- rowResource
- value
- public boolean isInRowIndex(R r)
r
-
public boolean isInColumnIndex(C r)
r
-
public int getNbColumns()
public int getNbRows()
public boolean isSquare()
public Double getMax()
public Double getMaxColumn(C v)
IllegalArgumentException
- if the given value cannot be associated to a columnpublic Double getMaxRow(R v)
IllegalArgumentException
- if the given value cannot be associated to a rowpublic Double getMin()
public Double getAverage()
public Double[][] getMatrix()
public String toString()
toString
in class Object
public Set<C> getColumnElements()
public Set<R> getRowElements()
public Double getSum()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |