org.ujmp.core.interfaces
Interface CoordinateFunctions

All Known Subinterfaces:
BigDecimalMatrix, BigDecimalMatrix2D, BigIntegerMatrix, BigIntegerMatrix2D, BooleanMatrix, BooleanMatrix2D, ByteMatrix, ByteMatrix2D, CharMatrix, CharMatrix2D, DateMatrix, DateMatrix2D, DenseBigDecimalMatrix, DenseBigDecimalMatrix2D, DenseBigIntegerMatrix, DenseBigIntegerMatrix2D, DenseBooleanMatrix, DenseBooleanMatrix2D, DenseByteMatrix, DenseByteMatrix2D, DenseCharMatrix, DenseCharMatrix2D, DenseDateMatrix, DenseDateMatrix2D, DenseDoubleMatrix, DenseDoubleMatrix2D, DenseFloatMatrix, DenseFloatMatrix2D, DenseGenericMatrix<A>, DenseGenericMatrix2D<A>, DenseIntMatrix, DenseIntMatrix2D, DenseLongMatrix, DenseLongMatrix2D, DenseMatrix, DenseMatrix2D, DenseObjectMatrix, DenseObjectMatrix2D, DenseShortMatrix, DenseShortMatrix2D, DenseStringMatrix, DenseStringMatrix2D, DoubleMatrix, DoubleMatrix2D, FloatMatrix, FloatMatrix2D, GenericMatrix<A>, GenericMatrix2D<A>, GraphMatrix<N,E>, IntMatrix, IntMatrix2D, ListMatrix<A>, LongMatrix, LongMatrix2D, MapMatrix<K,V>, Matrix, Matrix2D, ObjectMatrix, ObjectMatrix2D, SetMatrix<A>, ShortMatrix, ShortMatrix2D, SparseBigDecimalMatrix, SparseBigDecimalMatrix2D, SparseBigIntegerMatrix, SparseBigIntegerMatrix2D, SparseBooleanMatrix, SparseBooleanMatrix2D, SparseByteMatrix, SparseByteMatrix2D, SparseCharMatrix, SparseCharMatrix2D, SparseDateMatrix, SparseDateMatrix2D, SparseDoubleMatrix, SparseDoubleMatrix2D, SparseFloatMatrix, SparseFloatMatrix2D, SparseGenericMatrix<A>, SparseGenericMatrix2D<A>, SparseIntMatrix, SparseIntMatrix2D, SparseLongMatrix, SparseLongMatrix2D, SparseMatrix, SparseMatrix2D, SparseObjectMatrix, SparseObjectMatrix2D, SparseShortMatrix, SparseShortMatrix2D, SparseStringMatrix, SparseStringMatrix2D, StringMatrix, StringMatrix2D, TreeMatrix
All Known Implementing Classes:
AbstractBigDecimalMatrix, AbstractBigIntegerMatrix, AbstractBooleanMatrix, AbstractByteMatrix, AbstractCharMatrix, AbstractDateMatrix, AbstractDenseBigDecimalMatrix, AbstractDenseBigDecimalMatrix2D, AbstractDenseBigIntegerMatrix, AbstractDenseBigIntegerMatrix2D, AbstractDenseBooleanMatrix, AbstractDenseBooleanMatrix2D, AbstractDenseByteMatrix, AbstractDenseByteMatrix2D, AbstractDenseCharMatrix, AbstractDenseCharMatrix2D, AbstractDenseDateMatrix, AbstractDenseDateMatrix2D, AbstractDenseDoubleMatrix, AbstractDenseDoubleMatrix2D, AbstractDenseFloatMatrix, AbstractDenseFloatMatrix2D, AbstractDenseGenericMatrix, AbstractDenseGenericMatrix2D, AbstractDenseIntMatrix, AbstractDenseIntMatrix2D, AbstractDenseLongMatrix, AbstractDenseLongMatrix2D, AbstractDenseObjectMatrix, AbstractDenseObjectMatrix2D, AbstractDenseShortMatrix, AbstractDenseShortMatrix2D, AbstractDenseStringMatrix, AbstractDenseStringMatrix2D, AbstractDoubleMatrix, AbstractFloatMatrix, AbstractGenericMatrix, AbstractGraphMatrix, AbstractIntMatrix, AbstractListMatrix, AbstractLongMatrix, AbstractMapMatrix, AbstractMapToSparseMatrixWrapper, AbstractMapToTiledMatrix2DWrapper, AbstractMatrix, AbstractObjectMatrix, AbstractSetMatrix, AbstractShortMatrix, AbstractSparseBigDecimalMatrix, AbstractSparseBigDecimalMatrix2D, AbstractSparseBigIntegerMatrix, AbstractSparseBigIntegerMatrix2D, AbstractSparseBooleanMatrix, AbstractSparseBooleanMatrix2D, AbstractSparseByteMatrix, AbstractSparseByteMatrix2D, AbstractSparseCharMatrix, AbstractSparseCharMatrix2D, AbstractSparseDateMatrix, AbstractSparseDateMatrix2D, AbstractSparseDoubleMatrix, AbstractSparseDoubleMatrix2D, AbstractSparseFloatMatrix, AbstractSparseFloatMatrix2D, AbstractSparseGenericMatrix, AbstractSparseGenericMatrix2D, AbstractSparseIntMatrix, AbstractSparseIntMatrix2D, AbstractSparseLongMatrix, AbstractSparseLongMatrix2D, AbstractSparseObjectMatrix, AbstractSparseObjectMatrix2D, AbstractSparseShortMatrix, AbstractSparseShortMatrix2D, AbstractSparseStringMatrix, AbstractSparseStringMatrix2D, AbstractStringMatrix, AbstractTreeMatrix, ArrayDenseBigDecimalMatrix2D, ArrayDenseBigIntegerMatrix2D, ArrayDenseByteMatrix2D, ArrayDenseCharMatrix2D, ArrayDenseDoubleMatrix2D, ArrayDenseFloatMatrix2D, BenchmarkConfig, BigDecimalCalculationMatrix, BigIntegerCalculationMatrix, BlockDenseDoubleMatrix2D, BooleanCalculationMatrix, BufferedObjectMatrix, ByteCalculationMatrix, CharCalculationMatrix, CSVMatrix, DateCalculationMatrix, DefaultDenseBigDecimalMatrix2D, DefaultDenseBigIntegerMatrix2D, DefaultDenseBooleanMatrix2D, DefaultDenseByteMatrix2D, DefaultDenseCharMatrix2D, DefaultDenseDateMatrix2D, DefaultDenseDoubleMatrix2D, DefaultDenseDoubleMatrixMultiD, DefaultDenseFloatMatrix2D, DefaultDenseGenericMatrix2D, DefaultDenseIntMatrix2D, DefaultDenseLongMatrix2D, DefaultDenseObjectMatrix2D, DefaultDenseObjectMatrixMultiD, DefaultDenseShortMatrix2D, DefaultDenseStringMatrix2D, DefaultGraphMatrix, DefaultListMatrix, DefaultMapMatrix, DefaultSetMatrix, DefaultSparseBigDecimalMatrix, DefaultSparseBigIntegerMatrix, DefaultSparseBooleanMatrix, DefaultSparseByteMatrix, DefaultSparseCharMatrix, DefaultSparseColumnObjectMatrix2D, DefaultSparseDateMatrix, DefaultSparseDoubleMatrix, DefaultSparseFloatMatrix, DefaultSparseGenericMatrix, DefaultSparseIntMatrix, DefaultSparseLongMatrix, DefaultSparseObjectMatrix, DefaultSparseRowDoubleMatrix2D, DefaultSparseRowObjectMatrix2D, DefaultSparseShortMatrix, DefaultSparseStringMatrix, DefaultTiledObjectMatrix2D, DefaultTreeMatrix, DenseFileMatrix, DoubleCalculationMatrix, EmptyMatrix, FileFormatMatrix, FileListMatrix, FileMatrix, FloatCalculationMatrix, ImageMatrix, IntCalculationMatrix, IrisMatrix, LongCalculationMatrix, MatrixAvailableProcessors, MatrixLibraries, MatrixMemoryUsage, MatrixRandomSeed, MatrixRunningThreads, MatrixSystemEnvironment, MatrixSystemProperties, MatrixSystemTime, MortonDenseDoubleMartrix2D, ObjectCalculationMatrix, ObjectTreeMatrix, RemoteObjectMatrixUDP, SerializedSparseObjectMatrix, ServerObjectMatrixUDP, ShortCalculationMatrix, SimpleDenseDateMatrix2D, SimpleDenseIntMatrix2D, SimpleDenseLongMatrix2D, SimpleDenseObjectMatrix2D, SimpleDenseShortMatrix2D, SimpleDenseStringMatrix2D, SparseCSVMatrix, StringCalculationMatrix, SynchronizedGenericMatrix, TimeSeriesMatrix, UJMPPluginsMatrix, VolatileSparseObjectMatrix, WaveMatrix, WelcomeMatrix

public interface CoordinateFunctions

This interface defines functions on a Matrix that have to do with the coordinates of the entries.

Author:
Holger Arndt

Method Summary
 Iterable<long[]> allCoordinates()
          Returns an Iterator that goes over all coordinates in the Matrix.
 Iterable<long[]> availableCoordinates()
          Returns an Iterator that only goes over the coordinates in the Matrix that are stored.
 boolean contains(long... coordinates)
          Determines if the given Coordinates are part of the Matrix.
 long[] getCoordinatesOfMaximum()
          Returns the position of the maximum value in a Matrix.
 long[] getCoordinatesOfMinimum()
          Returns the position of the minimum value in a Matrix.
 Iterable<long[]> nonZeroCoordinates()
           
 Iterable<long[]> selectedCoordinates(long[]... selection)
          Returns an Iterator that goes only over the Coordinates defined by the selection.
 Iterable<long[]> selectedCoordinates(String selection)
          Returns an Iterator that goes only over the Coordinates defined by the selection.
 

Method Detail

nonZeroCoordinates

Iterable<long[]> nonZeroCoordinates()
                                    throws MatrixException
Throws:
MatrixException

allCoordinates

Iterable<long[]> allCoordinates()
                                throws MatrixException
Returns an Iterator that goes over all coordinates in the Matrix. It goes from 0,0 to the size of the Matrix.

Returns:
Iterable over all coordinates within a Matrix.
Throws:
MatrixException

availableCoordinates

Iterable<long[]> availableCoordinates()
                                      throws MatrixException
Returns an Iterator that only goes over the coordinates in the Matrix that are stored. For most Matrices, this is the same as allCoordinates(). For sparse Matrices, it iterates only over the entries in it.

Returns:
Iterable over the saved entries in a Matrix.
Throws:
MatrixException

selectedCoordinates

Iterable<long[]> selectedCoordinates(String selection)
                                     throws MatrixException
Returns an Iterator that goes only over the Coordinates defined by the selection. The selection is a Matlab/Octave style String, to define what rows or columns should be considered. E.g. "(2:5,[1,3,5,7:9])" to select rows 2 to 5 and the columns 1, 3, 5, 7, 8 and 9. Note that, in UJMP numbering starts at 0 unlike in Matlab and Octave

Parameters:
selection - The String defining the selection of rows or columns
Returns:
Iterable over the desired Coordinates
Throws:
MatrixException

selectedCoordinates

Iterable<long[]> selectedCoordinates(long[]... selection)
                                     throws MatrixException
Returns an Iterator that goes only over the Coordinates defined by the selection. The selections consists of a list of long arrays, one for each dimension. The first array contains the row numbers that should be selected, the second the column numbers, and so on.

Parameters:
selection - A list of long arrays defining the desired rows or columns
Returns:
Iterable over the desired Coordinates
Throws:
MatrixException

getCoordinatesOfMaximum

long[] getCoordinatesOfMaximum()
                               throws MatrixException
Returns the position of the maximum value in a Matrix. If there is more than one equal maximum values, the first that is found is returned (not necessarily with the lowest coordinates). If no maximum can be found (because there are no numbers in the matrix or all numbers are NaN), the coordinates -1,-1 are returned.

Returns:
Coordinates of the maximum value
Throws:
MatrixException

getCoordinatesOfMinimum

long[] getCoordinatesOfMinimum()
                               throws MatrixException
Returns the position of the minimum value in a Matrix. If there is more than one equal minimum values, the first that is found is returned (not necessarily with the lowest coordinates). If no minimum can be found (because there are no numbers in the matrix or all numbers are NaN), the coordinates -1,-1 are returned.

Returns:
Coordinates of the minimum value
Throws:
MatrixException

contains

boolean contains(long... coordinates)
                 throws MatrixException
Determines if the given Coordinates are part of the Matrix. If the Matrix is dense, true is returned for all Coordinates smaller than the Matrix's size. For sparse Matrices, this function checks if the coordinates are actually stored in the matrix or not.

Parameters:
coordinates - The coordinates to check
Returns:
a boolean stating if the coordinates are part of the Matrix
Throws:
MatrixException


Copyright © 2010. All Rights Reserved.