|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.decisiondeck.xmcda_oo.utils.matrix.FloatMatrix<RowType,ColumnType>
public class FloatMatrix<RowType,ColumnType>
| Constructor Summary | |
|---|---|
FloatMatrix()
|
|
FloatMatrix(ConstrainedMatrix<RowType,ColumnType> mat)
|
|
FloatMatrix(FloatMatrix<RowType,ColumnType> matrix)
Copy constructor, by reference. |
|
| Method Summary | ||
|---|---|---|
boolean |
approxEquals(IRdFloatMatrix<RowType,ColumnType> m2,
double precision)
Two matrix are "approximately equal" to a given degree of precision iff they contain values for the same mappings and the value they contain for each mapping are not more different than the given allowed imprecision. |
|
static
|
copy(IRdFloatMatrix<RowT,ColumnT> matrix)
Creates a new matrix containing the same values as the one given. |
|
boolean |
equals(Object obj)
Two matrix are equal iff they are the same type and contain the same values at the same positions. |
|
IZeroToOneMatrix<RowType,ColumnType> |
getAsFuzzy()
Produces a fuzzy matrix view of this matrix. |
|
Set<ColumnType> |
getColumns()
Returns a read-only view of the columns existing in this matrix. |
|
Double |
getEntry(RowType row,
ColumnType column)
Returns the value at the position composed by the given row and column, or null if there is none. |
|
Set<RowType> |
getRows()
Returns a view of the rows existing in this matrix. |
|
int |
getValueCount()
Gets the number of values in this matrix. |
|
int |
hashCode()
|
|
boolean |
isComplete()
A matrix is complete iff it contains a value for every possible position (row, column) where row and column are rows and columns existing in this matrix (i.e. corresponding to at least one value). |
|
boolean |
isEmpty()
Checks whether this matrix contains no value. |
|
boolean |
isFuzzy()
Tells whether this matrix may be converted to a fuzzy matrix. |
|
void |
put(RowType row,
ColumnType column,
double value)
Puts a value in this matrix at the position specified by the given row and column. |
|
Double |
remove(RowType row,
ColumnType column)
Remove the value in this matrix at the position specified by the given row and column. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FloatMatrix()
public FloatMatrix(FloatMatrix<RowType,ColumnType> matrix)
matrix - not null.public FloatMatrix(ConstrainedMatrix<RowType,ColumnType> mat)
| Method Detail |
|---|
public static <RowT,ColumnT> FloatMatrix<RowT,ColumnT> copy(IRdFloatMatrix<RowT,ColumnT> matrix)
RowT - the type of row for the matrix to create and the matrix to convert from.ColumnT - the type of column for the matrix to create and the matrix to convert from.matrix - the matrix to copy the values from. Not null (but may be empty).
null.
public boolean approxEquals(IRdFloatMatrix<RowType,ColumnType> m2,
double precision)
IRdFloatMatrix
approxEquals in interface IRdFloatMatrix<RowType,ColumnType>m2 - the matrix to which to compare this object for approximate equality. If null, this method
returns false.precision - the maximal imprecision allowed.
true iff the given matrix is approximately equal to this one.public boolean equals(Object obj)
IRdFloatMatrixIRdFloatMatrix.approxEquals(IRdFloatMatrix, double) if this can be a problem.
equals in interface IRdFloatMatrix<RowType,ColumnType>equals in class Objectobj - the object to compare. May be null.
true iff the given object is equal to this matrix.Object.equals(java.lang.Object)public Set<ColumnType> getColumns()
IRdFloatMatrix
getColumns in interface IRdFloatMatrix<RowType,ColumnType>null. Empty iff this matrix is empty.
public Double getEntry(RowType row,
ColumnType column)
IRdFloatMatrixnull if there is none.
getEntry in interface IRdFloatMatrix<RowType,ColumnType>row - not null.column - not null.
null.public Set<RowType> getRows()
IRdFloatMatrix
getRows in interface IRdFloatMatrix<RowType,ColumnType>null. Empty iff this matrix is empty.public int getValueCount()
IRdFloatMatrixGets the number of values in this matrix.
Note that the word "size" is not used here because the size of the matrix could be understood as meaning its row count times its column count, which is the same as its value count only if it is complete.
getValueCount in interface IRdFloatMatrix<RowType,ColumnType>public int hashCode()
hashCode in class Objectpublic boolean isComplete()
IRdFloatMatrixA matrix is complete iff it contains a value for every possible position (row, column) where row and column are rows and columns existing in this matrix (i.e. corresponding to at least one value). An empty matrix is complete.
isComplete in interface IRdFloatMatrix<RowType,ColumnType>true iff this matrix is complete.public boolean isEmpty()
IRdFloatMatrix
isEmpty in interface IRdFloatMatrix<RowType,ColumnType>true iff the matrix contains no value.
public void put(RowType row,
ColumnType column,
double value)
IFloatMatrix
put in interface IFloatMatrix<RowType,ColumnType>row - not null.column - not null.value - any double.
public Double remove(RowType row,
ColumnType column)
IFloatMatrix
remove in interface IFloatMatrix<RowType,ColumnType>row - not null.column - not null.
null iff there was no value at
that position (and, hence, nothing was removed).public String toString()
toString in class Objectpublic IZeroToOneMatrix<RowType,ColumnType> getAsFuzzy()
IFloatMatrix
getAsFuzzy in interface IFloatMatrix<RowType,ColumnType>null if this matrix cannot be converted to a fuzzy matrix.public boolean isFuzzy()
IFloatMatrix
isFuzzy in interface IFloatMatrix<RowType,ColumnType>true iff all the values contained in this matrix are between zero and one.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||