drasys.or.matrix
Class FunctionMatrix

java.lang.Object
  |
  +--drasys.or.matrix.RealContainer
        |
        +--drasys.or.matrix.Matrix
              |
              +--drasys.or.matrix.FunctionMatrix
Direct Known Subclasses:
PolynomialMatrix, QuadraticMatrix

public abstract class FunctionMatrix
extends Matrix
implements MatrixI

A matrix that computes some or all of the elements with the abstract method 'functionElementAt' that must be defined in a subclass. It is typically used to extend the rows or columns of a matrix with computations based on the exsisting rows and columns. The subclass constructor must set the two inherited variables '_sizeOfRows' and '_sizeOfColumns'.

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

Field Summary
protected  int _sizeOfColumns
           
protected  int _sizeOfRows
           
 
Fields inherited from class drasys.or.matrix.RealContainer
_epsilon, _globalEpsilon
 
Constructor Summary
FunctionMatrix()
           
 
Method Summary
 double elementAt(int row, int column)
          Gets the value of the element at 'row' and 'column' by calling 'functionElementAt' after checking the validity of the indices.
abstract  double functionElementAt(int row, int column)
          Computes the value of the element at 'row' and 'column'.
 boolean isColumnMajor()
          Returns the value from the underlying matrix.
 boolean isNull(int row, int column)
          Returns the value from the underlying matrix if 'row' and 'column' are in its range.
 boolean isRowMajor()
          Returns the value from the underlying matrix.
 void setElementAt(int row, int column, double value)
          Sets the value in the underlying matrix if 'row' and 'column' are in its range.
 void setElements(double value)
          Sets the value of all the non-null elements in the underlying matrix.
 int sizeOfColumns()
          Returns the number of columns in the matrix.
 int sizeOfElements()
          Returns the number of non-null elements 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, getArray, 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
 

Field Detail

_sizeOfRows

protected int _sizeOfRows

_sizeOfColumns

protected int _sizeOfColumns
Constructor Detail

FunctionMatrix

public FunctionMatrix()
Method Detail

setElements

public void setElements(double value)
Sets the value of all the non-null elements in the underlying matrix.
Specified by:
setElements in interface MatrixI

sizeOfRows

public int sizeOfRows()
Returns the number of rows in the matrix.
Specified by:
sizeOfRows in interface MatrixI

sizeOfColumns

public int sizeOfColumns()
Returns the number of columns in the matrix.
Specified by:
sizeOfColumns in interface MatrixI

isNull

public boolean isNull(int row,
                      int column)
Returns the value from the underlying matrix if 'row' and 'column' are in its range. Otherwise; it returns 'false';
Specified by:
isNull in interface MatrixI

setElementAt

public void setElementAt(int row,
                         int column,
                         double value)
Sets the value in the underlying matrix if 'row' and 'column' are in its range. Otherwise; it has no effect.
Specified by:
setElementAt in interface MatrixI

sizeOfElements

public int sizeOfElements()
Returns the number of non-null elements in the matrix. The functional elements are all counted as non-null.
Specified by:
sizeOfElements in interface MatrixI

isRowMajor

public boolean isRowMajor()
Returns the value from the underlying matrix.
Specified by:
isRowMajor in interface MatrixI

isColumnMajor

public boolean isColumnMajor()
Returns the value from the underlying matrix.
Specified by:
isColumnMajor in interface MatrixI

elementAt

public double elementAt(int row,
                        int column)
Gets the value of the element at 'row' and 'column' by calling 'functionElementAt' after checking the validity of the indices.
Specified by:
elementAt in interface MatrixI
Tags copied from interface: MatrixI
Returns:
zero is the element is null

functionElementAt

public abstract double functionElementAt(int row,
                                         int column)
Computes the value of the element at 'row' and 'column'.


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