jmathlib.toolbox.jmathlib.matrix._private.Jampack
Class Zmat

java.lang.Object
  extended by jmathlib.toolbox.jmathlib.matrix._private.Jampack.Zmat
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ErrorCodes, TokenConstants
Direct Known Subclasses:
Zltmat, Zpsdmat, Zutmat

public class Zmat
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable, ErrorCodes, TokenConstants

Zmat implements general complex matrix stored in a rectangular array class Z.

Version:
Pre-alpha
Author:
G. W. Stewart
See Also:
Serialized Form

Field Summary
protected  int basex
          The base index
 int bx
          The base index
protected  Zchol CHOL
          Points to a Cholesky decompoistion of the matrix provided one exists
 int cx
          The upper column index
protected  boolean dirty
          True if the matrix has been altered
protected  Zhqrd HQR
          Points to a Householder QR decompoistion of the matrix provided one exists
protected  double[][] im
          The imaginary part of the matrix
protected  Zludpp LU
          Points to an LU decompoistion of the matrix provided one exists
 int nc
          The number of columns
protected  int ncol
          The number of columns
 int nr
          The number of rows
protected  int nrow
          The number of rows
protected  double[][] re
          The real part of the matrix
 int rx
          The upper row index
 
Fields inherited from interface jmathlib.core.constants.ErrorCodes
ERR_BRACKET_OPEN, ERR_BRACKET_ORDER, ERR_FUNCTION_NOT_FOUND, ERR_FUNCTION_NOT_IMPLEMENTED, ERR_INSUFFICIENT_PARAMETERS, ERR_INVALID_PARAMETER, ERR_LVALUE_REQUIRED, ERR_MATRIX_SINGULAR, ERR_NOT_SQUARE_MATRIX, ERR_OPNOTSUPPORTED, ERR_TOO_MANY_PARAMETERS, ERR_USER_ERROR, ERR_VARIABLE_NOTDEFINED, OK, OK_FUNCTION_PROCESS
 
Fields inherited from interface jmathlib.core.constants.TokenConstants
ADDSUB_PRIORITY, AND_PRIORITY, ANDAND_PRIORITY, ASSIGN_PRIORITY, BRACKET_PRIORITY, COMPARE_PRIORITY, CONCAT, MATRIX, MULDIV_PRIORITY, OR_PRIORITY, OROR_PRIORITY, PARAMETER, POWER_PRIORITY, RELATION_PRIORITY, SINGLE, ttDelimiter, ttNotSet, ttOperand, ttOperator
 
Constructor Summary
Zmat(double[][] A)
          Creates a Zmat and initializes its real part to to an array of class double.
Zmat(double[][] re, double[][] im)
          Creates a Zmat and initializes its real and imaginary parts to a pair of arrays.
Zmat(int nrow, int ncol)
          Creates a Zmat and initializes it to zero.
Zmat(Z[][] A)
          Creates a Zmat and initializes it to an array of class Z.
Zmat(Z1 A)
          Creates a Zmat and initialize it to a Z1.
Zmat(Zmat A)
          Creates a Zmat and intitializes it to a Zmat.
 
Method Summary
protected  void clean()
          Nullifies the history pointers if the matrix is dirty and sets the dirty flag to false.
 Zmat get(int[] ii, int[] jj)
          Returns the submatrix (ii[], jj[]).
 Zmat get(int[] ii, int jj1, int jj2)
          Returns the submatrix (ii[], jj1:jj2).
 Z get(int ii, int jj)
          Returns the (ii,jj)-element of a Zmat.
 Zmat get(int ii1, int ii2, int[] jj)
          Returns the submatrix (ii1:ii2, jj[]).
 Zmat get(int ii1, int ii2, int jj1, int jj2)
          Returns the submatrix (ii1:ii2, jj1:jj2).
 Z get0(int i, int j)
          Returns the zero-based (i,j)-element of a Zmat.
 double[][] getIm()
          Returns a copy of the imaginary part of a Zmat.
 void getProperties()
          Sets the public parameters.
 double[][] getRe()
          Returns a copy of the real part of a Zmat.
 Z[][] getZ()
          Returns a copy of the real and imaginary parts as a complex array.
 void put(int[] ii, int[] jj, Zmat A)
          Overwrites the submatrix (ii[], jj[]) with a Zmat.
 void put(int[] ii, int jj1, int jj2, Zmat A)
          Overwrites the submatrix (ii[], jj1:jj2) with a Zmat.
 void put(int ii1, int ii2, int[] jj, Zmat A)
          Overwrites the submatrix (ii1:ii2, jj[]) with a Zmat.
 void put(int ii1, int ii2, int jj1, int jj2, Zmat A)
          Overwrites the submatrix (ii1:ii2, jj1:jj2) with a Zmat.
 void put(int ii, int jj, Z a)
          Writes the (ii,jj) element of a Zmat.
 void put0(int i, int j, Z a)
          Writes the zero-based (i,j)-element of a Zmat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nrow

protected int nrow
The number of rows


ncol

protected int ncol
The number of columns


basex

protected int basex
The base index


re

protected double[][] re
The real part of the matrix


im

protected double[][] im
The imaginary part of the matrix


dirty

protected boolean dirty
True if the matrix has been altered


bx

public int bx
The base index


rx

public int rx
The upper row index


nr

public int nr
The number of rows


LU

protected Zludpp LU
Points to an LU decompoistion of the matrix provided one exists


HQR

protected Zhqrd HQR
Points to a Householder QR decompoistion of the matrix provided one exists


CHOL

protected Zchol CHOL
Points to a Cholesky decompoistion of the matrix provided one exists


cx

public int cx
The upper column index


nc

public int nc
The number of columns

Constructor Detail

Zmat

public Zmat(double[][] re,
            double[][] im)
     throws JampackException
Creates a Zmat and initializes its real and imaginary parts to a pair of arrays.

Parameters:
re - Contains the real part.
im - Contains the imaginary part.
Throws:
JampackException - if the dimensions of re and im do not match

Zmat

public Zmat(Z[][] A)
Creates a Zmat and initializes it to an array of class Z.


Zmat

public Zmat(double[][] A)
Creates a Zmat and initializes its real part to to an array of class double. The imaginary part is set to zero.


Zmat

public Zmat(Zmat A)
Creates a Zmat and intitializes it to a Zmat.


Zmat

public Zmat(Z1 A)
Creates a Zmat and initialize it to a Z1.


Zmat

public Zmat(int nrow,
            int ncol)
Creates a Zmat and initializes it to zero.

Method Detail

getProperties

public void getProperties()
Sets the public parameters.


getRe

public double[][] getRe()
Returns a copy of the real part of a Zmat.


getIm

public double[][] getIm()
Returns a copy of the imaginary part of a Zmat.


getZ

public Z[][] getZ()
Returns a copy of the real and imaginary parts as a complex array.


get

public Z get(int ii,
             int jj)
Returns the (ii,jj)-element of a Zmat.

Parameters:
ii - The row index of the element
jj - The column index of the element

get0

public Z get0(int i,
              int j)
Returns the zero-based (i,j)-element of a Zmat.

Parameters:
i - The row index of the element
j - The column index of the element

put

public void put(int ii,
                int jj,
                Z a)
Writes the (ii,jj) element of a Zmat.

Parameters:
ii - The row index of the element
jj - The column index of the element
a - The new value of the element

put0

public void put0(int i,
                 int j,
                 Z a)
Writes the zero-based (i,j)-element of a Zmat.

Parameters:
i - The row index of the element
j - The column index of the element
a - The new value of the element

get

public Zmat get(int ii1,
                int ii2,
                int jj1,
                int jj2)
Returns the submatrix (ii1:ii2, jj1:jj2).

Parameters:
ii1 - The lower column index
ii2 - The upper column index
jj1 - The lower row index
jj2 - The upper row index

put

public void put(int ii1,
                int ii2,
                int jj1,
                int jj2,
                Zmat A)
Overwrites the submatrix (ii1:ii2, jj1:jj2) with a Zmat.

Parameters:
ii1 - The lower column index
ii2 - The upper column index
jj1 - The lower row index
jj2 - The upper row index
A - The new value of the submatrix

get

public Zmat get(int[] ii,
                int jj1,
                int jj2)
Returns the submatrix (ii[], jj1:jj2).

Parameters:
i[] - Contains the row indices of the submatrix
jj1 - The lower column index
jj2 - The upper column index

put

public void put(int[] ii,
                int jj1,
                int jj2,
                Zmat A)
Overwrites the submatrix (ii[], jj1:jj2) with a Zmat.

Parameters:
i[] - Contains the row indices of the submatrix
jj1 - The lower column index
jj2 - The upper column index
A - The new value of the submatrix.

get

public Zmat get(int ii1,
                int ii2,
                int[] jj)
Returns the submatrix (ii1:ii2, jj[]).

Parameters:
ii1 - The lower row index
ii2 - The upper row index
jj[] - Contains the column indices of the submatrix

put

public void put(int ii1,
                int ii2,
                int[] jj,
                Zmat A)
Overwrites the submatrix (ii1:ii2, jj[]) with a Zmat.

Parameters:
ii1 - The lower row index
ii2 - The upper row index
jj[] - Contains the column indices of the submatrix
A - The new value of the submatrix

get

public Zmat get(int[] ii,
                int[] jj)
Returns the submatrix (ii[], jj[]).

Parameters:
ii[] - Contains the row indices of the submatrix
jj[] - Contains the column indices of the submatrix

put

public void put(int[] ii,
                int[] jj,
                Zmat A)
Overwrites the submatrix (ii[], jj[]) with a Zmat. Returns the submatrix (ii[], jj[])

Parameters:
ii[] - Contains the row indices of the submatrix
jj[] - Contains the column indices of the submatrix
A - The value of the new submatrix

clean

protected void clean()
Nullifies the history pointers if the matrix is dirty and sets the dirty flag to false.