org.decisiondeck.xmcda_oo.utils.matrix
Interface IRdFloatMatrix<RowType,ColumnType>

Type Parameters:
RowType - the type of objects used to designate the row part of a position.
ColumnType - the type of objects used to designate the column part of a position.
All Known Subinterfaces:
IAltZeroToOneMatrix, IEvaluations, IFloatMatrix<RowType,ColumnType>, IRdEvaluations, IRdZeroToOneMatrix<RowType,ColumnType>, IZeroToOneMatrix<RowType,ColumnType>
All Known Implementing Classes:
AltFuzzyMatrix, ConstantCompleteMatrix, ConstrainedMatrix, EvaluationMatrix, EvaluationsByRows, EvaluationsDoubleView, EvaluationsView, FloatMatrix, FloatMatrixRestrictedView, FuzzyMatrix, OneMinusInverseMatrix

public interface IRdFloatMatrix<RowType,ColumnType>

A matrix which is able to retrieve double values at a set of positions, each position being represented by a row and a column entries.

Vocabulary note: an entry can be a value or can be null, a value is a float between zero and one.

Note that, although this interface is read-only, the underlying object may be mutable.


Method Summary
 boolean approxEquals(IRdFloatMatrix<RowType,ColumnType> m2, double imprecision)
          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.
 boolean equals(Object obj)
          Two matrix are equal iff they are the same type and contain the same values at the same positions.
 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.
 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.
 

Method Detail

approxEquals

boolean approxEquals(IRdFloatMatrix<RowType,ColumnType> m2,
                     double imprecision)
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.

Parameters:
m2 - the matrix to which to compare this object for approximate equality. If null, this method returns false.
imprecision - the maximal imprecision allowed.
Returns:
true iff the given matrix is approximately equal to this one.

equals

boolean equals(Object obj)
Two matrix are equal iff they are the same type and contain the same values at the same positions. Note that the values are compared exactly, thus a very small difference in one value will cause two matrixes to be unequal. See approxEquals(IRdFloatMatrix, double) if this can be a problem.

Overrides:
equals in class Object
Parameters:
obj - the object to compare. May be null.
Returns:
true iff the given object is equal to this matrix.
See Also:
Object.equals(java.lang.Object)

getColumns

Set<ColumnType> getColumns()
Returns a read-only view of the columns existing in this matrix. The returned set "read through" to the matrix, thus modifications of this matrix are reflected in the returned set.

Returns:
the objects such that at least one value exists in this matrix at a position having the object as column. Not null. Empty iff this matrix is empty.

getEntry

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.

Parameters:
row - not null.
column - not null.
Returns:
the double value at that position, or null.

getRows

Set<RowType> getRows()
Returns a view of the rows existing in this matrix. The returned set "read through" to the matrix, thus modifications of this matrix are reflected in the returned set. The view may be read-only (some objects may also support objects removal from the returned set).

Returns:
the objects such that at least one value exists in this matrix at a position having the object as row. Not null. Empty iff this matrix is empty.

getValueCount

int getValueCount()

Gets 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.

Returns:
the count of values.

isComplete

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). An empty matrix is complete.

Returns:
true iff this matrix is complete.

isEmpty

boolean isEmpty()
Checks whether this matrix contains no value.

Returns:
true iff the matrix contains no value.


Copyright © 2011. All Rights Reserved.