drasys.or.matrix.complex
Class ContiguousMatrix

java.lang.Object
  |
  +--drasys.or.matrix.complex.ComplexContainer
        |
        +--drasys.or.matrix.complex.Matrix
              |
              +--drasys.or.matrix.complex.ContiguousMatrix
Direct Known Subclasses:
ColumnMajorMatrix, RowMajorMatrix

public abstract class ContiguousMatrix
extends Matrix
implements ContiguousMatrixI, SizableMatrixI

Abstract base class for contiguous complex matrices. A contiguous matrix is a dense matrix which holds the elements in a single memory block.

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

Inner Class Summary
static class ContiguousMatrix.Sub
           
 
Fields inherited from class drasys.or.matrix.complex.ComplexContainer
_epsilon, _globalEpsilon
 
Constructor Summary
ContiguousMatrix(double[][] array)
           
ContiguousMatrix(double[][] real, double[][] imag)
           
ContiguousMatrix(int sizeOfRows, int sizeOfColumns, int capacityOfRows, int capacityOfColumns)
           
ContiguousMatrix(MatrixI matrix)
           
ContiguousMatrix(VectorI vector)
           
 
Method Summary
 int capacityOfColumns()
          Returns the number of columns the matrix can hold without allocating more memory.
 int capacityOfRows()
          Returns the number of rows the matrix can hold without allocating more memory.
 ContiguousVectorI columnVector(int column)
          Returns a reference to the column.
 ContiguousVectorI diagonalVector()
          Returns a reference to the diagonal.
 double[] getValueArray()
          Returns the internal array that is used to hold the element values.
 boolean isNull(int row, int column)
          Always returns false.
 ContiguousVectorI rowVector(int row)
          Returns a reference to the row.
 void setElements(ComplexI value)
          Sets the value of all the non-null elements.
 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.
 Complex sum(int rowBegin, int rowEnd, int columnBegin, int columnEnd)
          Returns the sum of all of the elements in the sub-matrix.
Computes sum(a[i][j]).
Where: i = {rowBegin,...,(rowEnd-1)}
j = {columBegin,...,(columnEnd-1)}
 Complex sumOfSquaredDifferences(int rowBegin, int rowEnd, int columnBegin, int columnEnd, ComplexI scaler)
          Returns the sum of the squared differences between the elements and a scaler.
Computes sum((a[i][j]-scaler)^2).
Where: i = {rowBegin,...,(rowEnd-1)}
j = {columBegin,...,(columnEnd-1)}
 Complex sumOfSquares(int rowBegin, int rowEnd, int columnBegin, int columnEnd)
          Returns the sum of the squares of all of the elements in the sub-matrix.
Computes sum(a[i][j]^2).
Where: i = {rowBegin,...,(rowEnd-1)}
j = {columBegin,...,(columnEnd-1)}
 
Methods inherited from class drasys.or.matrix.complex.Matrix
equals, equals, setColumn, setDiagonal, setElements, setRow, sum, sum, sumOfSquaredDifferences, sumOfSquaredDifferences, sumOfSquares, sumOfSquares, toString
 
Methods inherited from class drasys.or.matrix.complex.ComplexContainer
equals, equals, getEpsilon, getGlobalEpsilon, setEpsilon, setGlobalEpsilon
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContiguousMatrix

public ContiguousMatrix(int sizeOfRows,
                        int sizeOfColumns,
                        int capacityOfRows,
                        int capacityOfColumns)

ContiguousMatrix

public ContiguousMatrix(double[][] array)

ContiguousMatrix

public ContiguousMatrix(double[][] real,
                        double[][] imag)

ContiguousMatrix

public ContiguousMatrix(MatrixI matrix)

ContiguousMatrix

public ContiguousMatrix(VectorI vector)
Method Detail

setElements

public void setElements(ComplexI value)
Sets the value of all the non-null elements.

rowVector

public ContiguousVectorI rowVector(int row)
Returns a reference to the row.
Specified by:
rowVector in interface ContiguousMatrixI

columnVector

public ContiguousVectorI columnVector(int column)
Returns a reference to the column.
Specified by:
columnVector in interface ContiguousMatrixI

diagonalVector

public ContiguousVectorI diagonalVector()
Returns a reference to the diagonal.
Specified by:
diagonalVector in interface ContiguousMatrixI

getValueArray

public double[] getValueArray()
Returns the internal array that is used to hold the element values. The element values are stored in a single contiguous block of memory in this array. Each complex element occupies two adjacent array positions, the real component has an even index and the imaginary component has the next higher index.
EG: complex[0] = (array[0],array[1])
Specified by:
getValueArray in interface ContiguousMatrixI

isNull

public boolean isNull(int row,
                      int column)
Always returns false.

sizeOfRows

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

sizeOfColumns

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

sizeOfElements

public int sizeOfElements()
Returns the number of non-null elements in the matrix.

capacityOfRows

public int capacityOfRows()
Returns the number of rows the matrix can hold without allocating more memory.
Specified by:
capacityOfRows in interface SizableMatrixI

capacityOfColumns

public int capacityOfColumns()
Returns the number of columns the matrix can hold without allocating more memory.
Specified by:
capacityOfColumns in interface SizableMatrixI

sum

public Complex sum(int rowBegin,
                   int rowEnd,
                   int columnBegin,
                   int columnEnd)
Returns the sum of all of the elements in the sub-matrix.
Computes sum(a[i][j]).
Where: i = {rowBegin,...,(rowEnd-1)}
j = {columBegin,...,(columnEnd-1)}

sumOfSquares

public Complex sumOfSquares(int rowBegin,
                            int rowEnd,
                            int columnBegin,
                            int columnEnd)
Returns the sum of the squares of all of the elements in the sub-matrix.
Computes sum(a[i][j]^2).
Where: i = {rowBegin,...,(rowEnd-1)}
j = {columBegin,...,(columnEnd-1)}

sumOfSquaredDifferences

public Complex sumOfSquaredDifferences(int rowBegin,
                                       int rowEnd,
                                       int columnBegin,
                                       int columnEnd,
                                       ComplexI scaler)
Returns the sum of the squared differences between the elements and a scaler.
Computes sum((a[i][j]-scaler)^2).
Where: i = {rowBegin,...,(rowEnd-1)}
j = {columBegin,...,(columnEnd-1)}


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