drasys.or.matrix
Class ArrayMatrix

java.lang.Object
  |
  +--drasys.or.matrix.RealContainer
        |
        +--drasys.or.matrix.Matrix
              |
              +--drasys.or.matrix.ArrayMatrix
Direct Known Subclasses:
ColumnArrayMatrix, RowArrayMatrix

public abstract class ArrayMatrix
extends Matrix
implements SizableMatrixI

Abstract base class for array matrices. An array matrix is a dense matrix which holds the rows/columns a java two-dimensional array.

References:

Matrix Computations (Johns Hopkins Studies in the Mathematical Sciences)
    Gene H. Golub, Charles F. Van Loan (Contributor) / Paperback / Published 1996
Numerical Recipes in C : The Art of Scientific Computing
    William H. Press, et al / Hardcover / Published 1993
Parallel Algorithms for Matrix Computations
    K.A. Gallivan / Paperback / Published 1990

See Also:
Serialized Form

Fields inherited from class drasys.or.matrix.RealContainer
_epsilon, _globalEpsilon
 
Constructor Summary
ArrayMatrix(double[][] array)
          Constructs a dense matrix the same size as 'array'.
ArrayMatrix(int sizeOfRows, int sizeOfColumns)
          Constructs a dense matrix with an explicit size.
 
Method Summary
 double[][] getArray()
          Returns a new two-dimensional array containing the values in matrix.
 double[][] getValueArray()
          Returns the internal java two-dimensional array that is used to hold the element values.
 boolean isNull(int row, int column)
          Returns true if an element has no value associated with it in a sparse matrix.
 void setElements(double value)
          Sets the value of all the non-null elements in the matrix.
 int sizeOfColumns()
          Returns the number of columns in the matrix.
 int sizeOfRows()
          Returns the number of rows in the matrix.
 
Methods inherited from class drasys.or.matrix.Matrix
columnElements, elements, equals, equals, rowElements, setColumn, setDiagonal, setElements, setRow, sum, sum, sum, sumOfSquaredDifferences, sumOfSquaredDifferences, sumOfSquaredDifferences, sumOfSquares, sumOfSquares, sumOfSquares, toString
 
Methods inherited from class drasys.or.matrix.RealContainer
equals, getEpsilon, getGlobalEpsilon, setEpsilon, setGlobalEpsilon
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayMatrix

public ArrayMatrix(int sizeOfRows,
                   int sizeOfColumns)
Constructs a dense matrix with an explicit size.

ArrayMatrix

public ArrayMatrix(double[][] array)
Constructs a dense matrix the same size as 'array'.
Method Detail

setElements

public void setElements(double value)
Sets the value of all the non-null elements in the matrix.

sizeOfRows

public int sizeOfRows()
Returns the number of rows in the matrix.

sizeOfColumns

public int sizeOfColumns()
Returns the number of columns in the matrix.

isNull

public boolean isNull(int row,
                      int column)
Returns true if an element has no value associated with it in a sparse matrix. Elements which have no value assigned return 0.0 when accessed.

getValueArray

public double[][] getValueArray()
Returns the internal java two-dimensional array that is used to hold the element values. The rows of the array hold the rows or columns of the matrix depending on the subclass.

getArray

public double[][] getArray()
Returns a new two-dimensional array containing the values in matrix. The rows of the array hold the rows of the matrix.
Overrides:
getArray in class Matrix


Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com