drasys.or.matrix.complex
Interface MatrixI

All Known Subinterfaces:
ContiguousMatrixI, SizableMatrixI
All Known Implementing Classes:
Matrix

public interface MatrixI
extends ComplexContainerI

Abstract interface to a complex matrix.


Method Summary
 java.util.Enumeration columnElements(int column)
          Returns an enumeration of the non-null elements in a column.
 Complex elementAt(int row, int column)
          Gets the value of an element by its row and column index.
 Complex elementAt(int row, int column, Complex results)
          Gets the value of an element by its row and column index.
 java.util.Enumeration elements()
          Returns an enumeration of the non-null elements in the matrix.
 boolean equals(MatrixI matrix)
          Returns true if the matrices are numerically equal.
 double[][] getArray()
          Returns a new two-dimensional array containing the values in matrix.
 boolean isColumnMajor()
          Returns true if the matrix is column-major.
 boolean isNull(int row, int column)
          Returns true if an element has no value associated with it.
 boolean isRowMajor()
          Returns true if the matrix is row-major.
 java.util.Enumeration rowElements(int row)
          Returns an enumeration of the non-null elements in a row.
 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 setElementAt(int row, int column, ComplexI value)
          Sets the value of an element by its row and column index.
 void setElements(ComplexI value)
          Sets the value of all the non-null elements.
 void setElements(MatrixI values)
          Sets the value of the elements.
 void setRow(int row, VectorI values)
          Sets the value of the elements in a row.
 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()
          Returns the sum of all of the elements in the 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 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)}
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 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)}
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 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.
 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)}
If 'results' is null then a new object will be created.
 
Methods inherited from interface drasys.or.matrix.complex.ComplexContainerI
equals, getEpsilon, setEpsilon
 

Method Detail

isNull

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

isRowMajor

public boolean isRowMajor()
Returns true if the matrix is row-major.

isColumnMajor

public boolean isColumnMajor()
Returns true if the matrix is column-major.

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.

setElementAt

public void setElementAt(int row,
                         int column,
                         ComplexI value)
Sets the value of an element by its row and column index.

setElements

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

setElements

public void setElements(MatrixI values)
Sets the value of the elements.

setRow

public void setRow(int row,
                   VectorI values)
Sets the value of the elements in a row.

setColumn

public void setColumn(int column,
                      VectorI values)
Sets the value of the elements in a column.

setDiagonal

public void setDiagonal(VectorI values)
Sets the value of the elements in the diagonal.

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. 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])

elementAt

public Complex elementAt(int row,
                         int column)
Gets the value of an element by its row and column index.
Returns:
zero is the element is null

elementAt

public Complex elementAt(int row,
                         int column,
                         Complex results)
Gets the value of an element by its row and column index. Stores the returned value in 'results'.
Returns:
zero is the element is null

rowElements

public java.util.Enumeration rowElements(int row)
Returns an enumeration of the non-null elements in a row. The Enumeration is free to reuse the same object for each call to 'nextElement', so the contents must be use before getting another element.
Returns:
an enumeration whose elements are mutable and of type 'MatrixElementI'

columnElements

public java.util.Enumeration columnElements(int column)
Returns an enumeration of the non-null elements in a column. The Enumeration is free to reuse the same object for each call to 'nextElement', so the contents must be use before getting another element.
Returns:
an enumeration whose elements are mutable and of type 'MatrixElementI'

elements

public java.util.Enumeration elements()
Returns an enumeration of the non-null elements in the matrix. The Enumeration is free to reuse the same object for each call to 'nextElement', so the contents must be use before getting another element.
Returns:
an enumeration whose elements are mutable and of type 'MatrixElementI'

sum

public Complex sum()
Returns the sum of all of the elements in the 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.

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.

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)}
If 'results' is null then a new object will be created.

sumOfSquares

public Complex sumOfSquares()
Returns the sum of the squares of all of the elements in the 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.

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.

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)}
If 'results' is null then a new object will be created.

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.

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.

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)}
If 'results' is null then a new object will be created.

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 compare.


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