drasys.or.matrix.complex
Class Matrix

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

public abstract class Matrix
extends ComplexContainer
implements MatrixI, java.io.Serializable

Abstract base class for complex matrices.

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.complex.ComplexContainer
_epsilon, _globalEpsilon
 
Constructor Summary
Matrix()
           
Matrix(double epsilon)
           
 
Method Summary
 boolean equals(MatrixI matrix)
          Returns true if the matrices are numerically equal.
 boolean equals(java.lang.Object o)
           
 void setColumn(int column, VectorI values)
          Sets the value of the elements in a column.
 void setDiagonal(VectorI values)
          Sets the value of the elements in the diagonal.
 void setElements(MatrixI values)
          Sets the value of the elements from the non-null values in 'values'.
 void setRow(int row, VectorI values)
          Sets the value of the elements in a row.
 Complex sum()
          Returns the sum of all of the elements in the sub-matrix.
Computes sum(a[i][j]).
Where: i = {0,...,(sizeOfRows-1)}
j = {0,...,(sizeofColumns-1)}
If 'results' is null then a new object will be created.
 Complex sum(int begin)
          Returns the sum of all of the elements in the sub-matrix.
Computes sum(a[i][j]).
Where: i = {begin,...,(sizeOfRows-1)}
j = {begin,...,(sizeofColumns-1)}
If 'results' is null then a new object will be created.
 Complex sumOfSquaredDifferences(ComplexI scaler)
          Returns the sum of the squared differences between the elements and a scaler.
Computes sum((a[i][j]-scaler)^2).
Where: i = {0,...,(sizeOfRows-1)}
j = {0,...,(sizeofColumns-1)}
If 'results' is null then a new object will be created.
 Complex sumOfSquaredDifferences(int begin, ComplexI scaler)
          Returns the sum of the squared differences between the elements and a scaler.
Computes sum((a[i][j]-scaler)^2).
Where: i = {begin,...,(sizeOfRows-1)}
j = {begin,...,(sizeofColumns-1)}
If 'results' is null then a new object will be created.
 Complex sumOfSquares()
          Returns the sum of the squares of all of the elements in the sub-matrix.
Computes sum(a[i][j]^2).
Where: i = {0,...,(sizeOfRows-1)}
j = {0,...,(sizeofColumns-1)}
If 'results' is null then a new object will be created.
 Complex sumOfSquares(int begin)
          Returns the sum of the squares of all of the elements in the sub-matrix.
Computes sum(a[i][j]^2).
Where: i = {begin,...,(sizeOfRows-1)}
j = {begin,...,(sizeofColumns-1)}
If 'results' is null then a new object will be created.
 java.lang.String 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

Matrix

public Matrix()

Matrix

public Matrix(double epsilon)
Method Detail

sum

public Complex sum()
Returns the sum of all of the elements in the sub-matrix.
Computes sum(a[i][j]).
Where: i = {0,...,(sizeOfRows-1)}
j = {0,...,(sizeofColumns-1)}
If 'results' is null then a new object will be created.
Specified by:
sum in interface MatrixI

sumOfSquares

public Complex sumOfSquares()
Returns the sum of the squares of all of the elements in the sub-matrix.
Computes sum(a[i][j]^2).
Where: i = {0,...,(sizeOfRows-1)}
j = {0,...,(sizeofColumns-1)}
If 'results' is null then a new object will be created.
Specified by:
sumOfSquares in interface MatrixI

sumOfSquaredDifferences

public Complex sumOfSquaredDifferences(ComplexI scaler)
Returns the sum of the squared differences between the elements and a scaler.
Computes sum((a[i][j]-scaler)^2).
Where: i = {0,...,(sizeOfRows-1)}
j = {0,...,(sizeofColumns-1)}
If 'results' is null then a new object will be created.
Specified by:
sumOfSquaredDifferences in interface MatrixI

sum

public Complex sum(int begin)
Returns the sum of all of the elements in the sub-matrix.
Computes sum(a[i][j]).
Where: i = {begin,...,(sizeOfRows-1)}
j = {begin,...,(sizeofColumns-1)}
If 'results' is null then a new object will be created.
Specified by:
sum in interface MatrixI

sumOfSquares

public Complex sumOfSquares(int begin)
Returns the sum of the squares of all of the elements in the sub-matrix.
Computes sum(a[i][j]^2).
Where: i = {begin,...,(sizeOfRows-1)}
j = {begin,...,(sizeofColumns-1)}
If 'results' is null then a new object will be created.
Specified by:
sumOfSquares in interface MatrixI

sumOfSquaredDifferences

public Complex sumOfSquaredDifferences(int begin,
                                       ComplexI scaler)
Returns the sum of the squared differences between the elements and a scaler.
Computes sum((a[i][j]-scaler)^2).
Where: i = {begin,...,(sizeOfRows-1)}
j = {begin,...,(sizeofColumns-1)}
If 'results' is null then a new object will be created.
Specified by:
sumOfSquaredDifferences in interface MatrixI

setElements

public void setElements(MatrixI values)
Sets the value of the elements from the non-null values in 'values'. Elements corresponding to null elements in 'values' are not changed.
Specified by:
setElements in interface MatrixI

setRow

public void setRow(int row,
                   VectorI values)
Sets the value of the elements in a row. Elements corresponding to null elements in 'values' are not changed.
Specified by:
setRow in interface MatrixI

setColumn

public void setColumn(int column,
                      VectorI values)
Sets the value of the elements in a column. Elements corresponding to null elements in 'values' are not changed.
Specified by:
setColumn in interface MatrixI

setDiagonal

public void setDiagonal(VectorI values)
Sets the value of the elements in the diagonal. Elements corresponding to null elements in 'values' are not changed.
Specified by:
setDiagonal in interface MatrixI

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

equals

public boolean equals(MatrixI matrix)
Returns true if the matrices are numerically equal. To be numerically equal the matrices must be the same size and all the elements must be equal to within this vector's 'epsilon'. All null elements have a value of zero for the comparison.
Specified by:
equals in interface MatrixI

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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