numEclipse - An Eclipse based workbench for

Numerical Computing

Home

Downloads

Documents

Links

Interface classes

In this appendix, we show the interface class defining the numEclipse data types.

/*
* Created on Mar 23, 2004
*
*/
package org.jmatlab.linalg;

import org.jmatlab.semantic.SemanticException;

/**
* @author Ali
*
*/
public interface IComplex extends INumber {

/**
* This method returns the real part of
* the complex number, i.e., x + iy
* @return x
*/
public double getReal();

/**
* This method returns the imaginary part of
* the complex number, i.e, x + iy
* @return y
*/
public double getImag();

/**
* This method sets the real part of
* the complex number, i.e., x + iy
* @param x
*/
public void setReal(double d);

/**
* This method sets the imaginary part of
* the complex number, i.e., x + iy
* @param x
*/
public void setImag(double x);

/**
* Compares the complex number
* this with the complex number z passed
* as an argument.
* @param z
* @return true if this == z otherwise false
*/
public boolean equals(IComplex z);


/**
* Compares the complex number
* this with the real number d passed
* as an argument.
* @param d
* @return true if this == d otherwise false
*/
public boolean equals(double d);

/**
* Compares the complex number
* this with the argument object obj.
* @param z
* @return true if this == obj otherwise false
*/
public boolean equals(Object obj);

/**
* Subtract a complex number from another
* complex number
* @param z
* @return this - z
*/
public IComplex minus(IComplex z);

/**
* Subtracts a real number from a complex
* number
* @param d
* @return this - d
*/
public IComplex minus(double d);

/**
* Subtracts a complex number from a
* real number
* @param d
* @return d - this
*/
public IComplex minusReverse(double d);

/**
* Divides a complex number with another
* complex number
* @param z
* @return this / z
*/
public IComplex dividedBy(IComplex z);


/**
* Divides a complex number with a
* real number
* @param d
* @return this / d
*/
public IComplex dividedBy(double d);

/**
* Divides a real number with a
* complex number
* @param d
* @return d / this
*/
public IComplex dividedByReverse(double d);

/**
* Adds a complex number with a complex number
* @param z
* @return this + z
*/
public IComplex plus(IComplex z);

/**
* Adds a complex number with a real number
* @param d
* @return this + d
*/
public IComplex plus(double d);

/**
* Multiplies a complex number with a
* complex number
* @param z
* @return this * z
*/
public IComplex times(IComplex z);

/**
* Multiplies a complex number with a
* real number
* @param d
* @return this * d
*/
public IComplex times(double d);

/**
* Formats a complex number into a string
* @return String "x + iy"
*/
public String toString();

/**
* Formats a complex number into a string
* @param fmt
* @return String "x + iy"
* @throws SemanticException if fails to parse
* the complex number
*/
public String toString(String fmt) throws SemanticException;

/**
* Checks if the complex number is
* not a number NaN
* @return true if either real or imaginary
* part is NaN
*/
public boolean isNAN();

/**
* Compute the complex conjugate of a
* complex number
* @return x - iy
*/
public IComplex conjugate();

/**
* Compute the negative of a complex number
* @return -x - iy
*/
public IComplex negative();

/**
* Compute the real power of a complex number
* @param x
* @return this ^ x
*/
public IComplex pow(double x);

/**
* Compute the complex power of a real number
* @param x
* @return x ^ this
*/
public IComplex powReverse(double x);

/**
* Compute the complex power of a complex number
* @param z
* @return this ^ z
*/
public IComplex pow(IComplex z);

/**
* Compute the absolute value of a complex
* number, z = x + iy
* @return sqrt(x^2 + y^2)
*/
public double abs();

/**
* Compute the argument of a complex number
* @return atan (y / x)
*/
public double argument();

/**
* Compares a complex number with another
* complex number z
* @param z
* @return true if this < z otherwise false
*/
public boolean lessThan(IComplex z);

/**
* Compares a complex number with a real
* number
* @param d
* @return true if this < d otherwise false
*/
public boolean lessThan(double d);

/**
* Compares a complex number with another
* complex number z
* @param z
* @return true if this > z otherwise false
*/
public boolean greaterThan(IComplex z);

/**
* Compares a complex number with a
* real number d
* @param d
* @return true if this > d otherwise false
*/
public boolean greaterThan(double d);

/**
* Compares a complex number with another
* complex number z
* @param z
* @return true if this <= z otherwise false
*/
public boolean lessThanEqual(IComplex z);

/**
* Compares a complex number with a real
* number
* @param d
* @return true if this <= d otherwise false
*/
public boolean lessThanEqual(double d);

/**
* Compares a complex number with another
* complex number z
* @param z
* @return true if this >= z otherwise false
*/
public boolean greaterThanEqual(IComplex z);

/**
* Compares a complex number with a
* real number d
* @param d
* @return true if this >= d otherwise false
*/
public boolean greaterThanEqual(double d);

/**
* Computes if the imaginary part is zero
* @return true if y = 0 otherwise false
*/
public boolean isReal();

/**
* Computes if the imaginary part is
* other than zero
* @return true if y != 0 otherwise false
*/
public boolean isComplex();

/**
* Compute the square of a complex number
* @return this ^2
*/
public IComplex sqr();
}
 

 

/*
* Created on Apr 1, 2004
*/
package org.jmatlab.linalg;

import org.jmatlab.semantic.SemanticException;

/**
* @author Ali
*/
public interface IMatrix extends INumber {

/**
* Compute the number of rows of a matrix
* @return rows
*/
public int getRows();

/**
* Compute the number of columns of a matrix
* @return cols
*/
public int getCols();

/**
* Compare a matrix with another
* matrix
* @param m
* @return true if they are Element-wise equal
* this == m otherwise false
*/
public IMatrix equals(IMatrix m);


/**
* Compare a matrix with a complex number
* @param z
* @return true if each element is equal to z
*/
public IMatrix equals(IComplex z);

/**
* Compare a matrix with a real number
* @param d
* @return true if each element is equal to d
*/
public IMatrix equals(double d);

/**
* Compare a matrix with another matrix
* @param m
* @return true if this != m Element-wise
*/
public IMatrix nequals(IMatrix m);


/**
* Compare a matrix with a complex number
* @param z
* @return true if each element is not equal to z
*/
public IMatrix nequals(IComplex z);

/**
* Compare a matrix with a real number
* @param d
* @return true if each element is not equal to d
*/
public IMatrix nequals(double d);

/**
* Compute a 2-dimensional array of
* complex numbers
* @return a 2D array of objects IComplex
*/
public IComplex[][] getMatrix();

/**
* Compute a column vector from the rows of
* a matrix
* @return column vector
*/
public IMatrix getMatrixAll();

/**
* Compute a column vector from the columns of
* a matrix
* @return column vector
*/
public IMatrix getMatrixAllCols();

/**
* Compute a sub-matrix
* @param m
* @return sub-matrix such that m is the index
* of the elements
*/
public IMatrix getMatrix(IMatrix m);

/**
* Compute a sub-matrix
* @param m
* @param n
* @return sub-matrix such that m & n are the
* index of the elements
*/
public IMatrix getMatrix(IMatrix m, IMatrix n);


/**
* Compute a sub-matrix
* @param m
* @param n
* @return sub-matrix such that m & n are the
* index of the elements
*/
public IMatrix getMatrix(double m, IMatrix n);

/**
* Compute a sub-matrix
* @param m
* @param n
* @return sub-matrix such that m & n are the
* index of the elements
*/
public IMatrix getMatrix(IMatrix m, double n);

/**
* Compute an element of a matrix
* @param i
* @param j
* @return an element of a matrix using the
* the index i & j
*/
public IComplex getMatrixElement(int i, int j);

/**
* Compute an element of a matrix
* @param i
* @param j
* @return an element of a matrix using the
* the index i
*/
public IComplex getMatrixElement(int i);

/**
* Set i'th element of a matrix to complex value z
* @param i
* @param z
*/
public void setMatrixElement(int i, IComplex z);

/**
* Set (i, j)th element of a matrix to matrix value m
* @param i
* @param z
*/
public void setMatrixElement(int i, int j, IMatrix m);

/**
* Set (i, j)th element of a matrix to value m
* @param i
* @param j
* @param z
*/
public void setMatrixElement(int i, int j, IComplex z);

/**
* Set (i, j)th element of a matrix to real value d
* @param i
* @param j
* @param d
*/
public void setMatrixElement(int i, int j, double d);

/**
* Set (i, j)th element of a matrix to matrix value m
* @param i
* @param j
* @param m
*/
public void setMatrixElement(IMatrix i, int j, IMatrix m);

/**
* Set (i, j)th element of a matrix to complex value z
* @param i
* @param j
* @param z
*/
public void setMatrixElement(int i, IMatrix j, IMatrix z);

/**
* Set (i, j)th element of a matrix to matrix value m
* @param i
* @param j
* @param m
*/
public void setMatrixElement(IMatrix i, IMatrix j, IMatrix m);

/**
* Set (i, j)th element of a matrix to complex value z
* @param i
* @param j
* @param z
*/
public void setMatrixElement(IMatrix i, IMatrix j, IComplex z);

/**
* Set (i, j)th element of a matrix to real value d
* @param i
* @param j
* @param d
*/
public void setMatrixElement(IMatrix i, IMatrix j, double d);

/**
* Formats a matrix into a string
* @return matrix as a string
*/
public String toString();

/**
* Formats a matrix into a string based on the
* given format
* @param fmt
* @return
* @throws SemanticException in case it fails to parse
*/
public String toString(String fmt) throws SemanticException;

/**
* Format the size of matrix [rows X cols]
* to a string
* @return "[rows X cols]"
*/
public String toSizeString();

/**
* Compute the 2-dimensional array of strings
* for a matrix
* @return string array
*/
public String[][] getStringArr();

/**
* Compute the type of the elements of the matrix
* @return type number as given in class DataType
*/
public int getType();

/**
* Compute the transpose of a matrix
* @return this'
*/
public IMatrix transpose();

/**
* Compute complex conjugate transpose of a matrix
* called hermitian matrix
* @return this*
*/
public IMatrix ctranspose();

/**
* Compute the negative a matrix
* @return -this
*/
public IMatrix negative();

/**
* Compute the real power of a matrix
* @param n
* @return this ^ n
*/
public IMatrix pow(double n);

/**
* Compute the matrix power of a real number
* @param d
* @return d ^ this
*/
public IMatrix powReverse(double d);

/**
* Compute the matrix power of a complex number
* @param z
* @return z ^ this
*/
public IMatrix powReverse(IComplex z);

/**
* Compute matrix power of a matrix
* @param m
* @return m ^ this
*/
public IMatrix powReverse(IMatrix m);

/**
* Compute Element-wise power of a matrix
* @param m
* @return this .^ m
*/
public IMatrix dotpow(IMatrix m);

/**
* Compute Element-wise power of matrix
* @param d
* @return this .^ d
*/
public IMatrix dotpow(double d);

/**
* Compute Element-wise power of a real number
* @param d
* @return d .^ this
*/
public IMatrix dotpowReverse(double d);

/**
* Compute Element-wise complex power of
* a matrix
* @param z
* @return this .^ z
*/
public IMatrix dotpow(IComplex z);

/**
* Compute Element-wise power of complex number
* @param z
* @return z .^ this
*/
public IMatrix dotpowReverse(IComplex z);

/**
* Multiply a matrix with another matrix
* @param m
* @return this * m
*/
public IMatrix mult(IMatrix m);

/**
* Element-wise multiply a matrix with another
* @param m
* @return this .* m
*/
public IMatrix dotmult(IMatrix m);

/**
* Element-wise multiply a matrix with a complex number
* @param z
* @return this .* z
*/
public IMatrix dotmult(IComplex z);

/**
* Element-wise multiply a matrix with a real number
* @param d
* @return
*/
public IMatrix dotmult(double d);

/**
* Multiply a matrix with a complex number
* @param z
* @return this * z
*/
public IMatrix mult(IComplex z);

/**
* Multiply a matrix with a real number
* @param d
* @return this * d
*/
public IMatrix mult(double d);

/**
* Compute the logical and operation between
* a matrix a boolean value
* @param b
* @return this && b
*/
public IMatrix and(boolean b);

/**
* Compute the logical and operation between
* a matrix a real number
* @param d
* @return this && d
*/
public IMatrix and(double d);

/**
* Compute the logical and operation between
* a matrix a complex number
* @param z
* @return
*/
public IMatrix and(IComplex z);

/**
* Compute the logical and operation between
* one matrix and another matrix
* @param m
* @return this && m
*/
public IMatrix and(IMatrix m);

/**
* Compute the logical operation between a
* matrix and a boolean value
* @param b
* @return this || b
*/
public IMatrix or(boolean b);

/**
* Compute the logical or operation between a
* matrix and a real value
* @param d
* @return this || d
*/
public IMatrix or(double d);

/**
* Compute the logical or operation between a
* matrix and a complex value
* @param z
* @return this || z
*/
public IMatrix or(IComplex z);

/**
* Compute the logical or operation between one
* matrix and another
* @param m
* @return this || m
*/
public IMatrix or(IMatrix m);

/**
* Divide a matrix with another matrix
* @param m
* @return this / m
*/
public IMatrix dividedBy(IMatrix m);

/**
* Divide a matrix with a complex number
* @param z
* @return this / z
*/
public IMatrix dividedBy(IComplex z);

/**
* Divide a matrix with a real number
* @param d
* @return this / d
*/
public IMatrix dividedBy(double d);

/**
* Divide a complex number with a matrix
* @param z
* @return z / this
*/
public IMatrix dividedByReverse(IComplex z);

/**
* Divide a real number with a matrix
* @param d
* @return d / this
*/
public IMatrix dividedByReverse(double d);

/**
* Element-wise divide a matrix with another matrix
* @param m
* @return this ./ m
*/
public IMatrix dotdividedBy(IMatrix m);

/**
* Element-wise divide a complex number by a matrix
* @param z
* @return z ./ this
*/
public IMatrix dotDividedByReverse(IComplex z);

/**
* Element-wise divide a real number by a matrix
* @param d
* @return d ./ this
*/
public IMatrix dotDividedByReverse(double d);

/**
* Compare a matrix with another matrix
* @param m
* @return true if this < m otherwise false
*/
public IMatrix lessThan(IMatrix m);

/**
* Compare a matrix with a complex number
* @param z
* @return true if this < z otherwise false
*/
public IMatrix lessThan(IComplex z);

/**
* Compare a matrix with a real number
* @param d
* @return true if this < d otherwise false
*/
public IMatrix lessThan(double d);

/**
* Compare a matrix with another matrix
* @param m
* @return true if this > m otherwise false
*/
public IMatrix greaterThan(IMatrix m);

/**
* Compare a matrix with a complex number
* @param z
* @return true if this > z otherwise false
*/
public IMatrix greaterThan(IComplex z);

/**
* Compare a matrix with a real number
* @param d
* @return true if this > d otherwise false
*/
public IMatrix greaterThan(double d);

/**
* Compare a matrix with another matrix
* @param m
* @return true if this <= m otherwise false
*/
public IMatrix lessThanEqual(IMatrix m);

/**
* Compare a matrix with a complex number
* @param z
* @return true if this <= z otherwise false
*/
public IMatrix lessThanEqual(IComplex z);

/**
* Compare a matrix with a real number
* @param d
* @return true if this <= d otherwise false
*/
public IMatrix lessThanEqual(double d);

/**
* Compare a matrix with another matrix
* @param m
* @return true if this >= m otherwise false
*/
public IMatrix greaterThanEqual(IMatrix m);

/**
* Compare a matrix with a complex number
* @param z
* @return true if this >= z otherwise false
*/
public IMatrix greaterThanEqual(IComplex z);

/**
* Compare a matrix with a real number
* @param d
* @return true if this >= d otherwise false
*/
public IMatrix greaterThanEqual(double d);

/**
* Add a matrix to another matrix
* @param m
* @return this + m
*/
public IMatrix plus(IMatrix m);

/**
* Add a matrix and a complex number
* @param z
* @return this + z
*/
public IMatrix plus(IComplex z);

/**
* Add a matrix and a real number
* @param d
* @return this + d
*/
public IMatrix plus(double d);

/**
* Subtract a matrix from another matrix
* @param m
* @return this - m
*/
public IMatrix minus(IMatrix m);

/**
* Subtract a complex number from a matrix
* @param z
* @return this - z
*/
public INumber minus(IComplex z);

/**
* Subtract a real number from a matrix
* @param d
* @return this - d
*/
public INumber minus(double d);

/**
* Subtract a matrix from a complex number
* @param z
* @return z - this
*/
public INumber minusReverse(IComplex z);

/**
* Subtract a matrix from a real number
* @param d
* @return d - this
*/
public INumber minusReverse(double d);

/**
* Find the minimum of a matrix
* @return
*/
public double min();

/**
* Find a maximum of a matrix
* @return
*/
public double max();

/**
* Compute if all matrix elements are real
* @return true if all element have imaginary part equal to zero
*/
public boolean isAllReal();

/**
* Compute if any matrix element is complex
* @return true if atleast one element has imaginary
* part not equal to zero
*/
public boolean isAnyComplex();

/**
* Compute of all matrix elements are positive
* @return true if all elements are greater than zero
*/
public boolean isAllPositive();

/**
* Compute the real part of a matrix
* @return a 2-d array of double containing
* real part of the matrix
*/
public double[][] getRealMatrix();

/**
* Compute the imaginary part of a matrix
* @return a 2-d array of double containing
* imaginary part of the matrix
*/
public double[][] getImagMatrix();

/**
* Compute the real part of i'th row of a matrix
* @return a 1-d array of double containing
* real part of i'th row of a matrix
*/
public double[] getRealRow(int i);

/**
* Compute the imaginary part of i'th row of a matrix
* @return a 1-d array of double containing
* imaginary part of i'th row of a matrix
*/
public double[] getImagRow(int i);

/**
* Compute the real part of i'th column of a matrix
* @return a 1-d array of double containing
* real part of i'th column of a matrix
*/
public double[] getRealCol(int i);

/**
* Compute the imaginary part of i'th column of a matrix
* @return a 1-d array of double containing
* imaginary part of i'th column of a matrix
*/
public double[] getImagCol(int i);

/**
* Compute the i'th row of a matrix
* @return i'th row of a matrix
*/
public IComplex[] getComplexRow(int i);

/**
* Compute i'th column of a matrix
*/
public IComplex[] getComplexCol(int i);

/**
* Compute the length of a matrix
* @param m
* @return number of columns for a 2-d matrix
* otherwise simply the number of elements
*/
public int length(IMatrix m);

/**
* Compute the String array of a matrix
* @return a 2-d array of strings containing
* matrix elements if the matrix is a string matrix
*/
public String[][] getMatrixAsStringArray();

/**
* Compute if the matrix is empty
* @return true if there are no elements in th
* matrix
*/
public boolean isEmpty();

/**
* Compute if there is only one element in the matrix
* @return true if there is only one element in the
* matrix
*/
public boolean isScalar();

/**
* Check if the matrix is a matrix of strings
* @return true if the matrix elements are strings
*/
public boolean isString();
 

}
 

/*
* Created on Sep 24, 2004
*
*/
package org.jmatlab.linalg;

import java.util.Map;

import org.jmatlab.semantic.Symbol;

/**
* @author Ali
*
*/
public interface IStruct {

/**
* This method sets the value of a structure field
* this.name = symbol
* @param name
* @param symbol
*/
public void setField(String name, Symbol symbol);

/**
* This method sets the field value of i'th element of the
* structure array
* this(i).name = symbol
* @param i
* @param name
* @param symbol
*/
public void setField(int i, String name, Symbol symbol);

/**
* This method sets the field value of (i, j)'th element of the
* structure array
* this(i, j).name = symbol
* @param i
* @param j
* @param name
* @param symbol
*/
public void setField(int i, int j, String name, Symbol symbol);

/**
* Get the value of field
* @param name
* @return this.name
*/
public Symbol getField(String name);

/**
* Get the field value of i'th element of structure array
* @param i
* @param name
* @return this(i).name
*/
public Symbol getField(int i, String name);

/**
* Get the field value of (i, j)'th element of structure array
* @param i
* @param j
* @param name
* @return this(i, j).name
*/
public Symbol getField(int i, int j, String name);

/**
* Compute the column array from the 2-d array of structures
* @return column array of structures
*/
public IStruct getStructAll();

/**
* Compute the i'th element of structure array
* @param i
* @return this(i)
*/
public IStruct getStruct(int i);

/**
* Compute the (i, j)'th element of structure array
* @param i
* @param j
* @return
*/
public IStruct getStruct(int i, int j);

/**
* Compute the sub-array of structures using
* the argument matrix as an index
* @param m
* @return
*/
public IStruct getStruct(IMatrix m);

/**
* Compute the sub-array of structures using
* index (m, n)
* @param m
* @param n
* @return this(m, n)
*/
public IStruct getStruct(IMatrix m, IMatrix n);

/**
* Compute the sub-array of structures using
* index (m , d)
* @param m
* @param d
* @return this(m, d)
*/
public IStruct getStruct(IMatrix m, double d);

/**
* Compute sub-array of structures using
* index (d, n)
* @param d
* @param n
* @return this(d, n)
*/
public IStruct getStruct(double d, IMatrix n);

/**
* Set the i'th element in an array of structures
* this(i) = struct
* @param i
* @param struct
*/
public void setStruct(int i, IStruct struct);

/**
* Set the (i. j)'th element in an array of structures
* this(i, j) = struct
* @param i
* @param j
* @param struct
*/
public void setStruct(int i, int j, IStruct struct);

/**
* Get the map of all structures
* @return map containing structures
*/
public Map getMap();

/**
* Get the (i, j)'th structure as a map
* @param i
* @param j
* @return this(i, j)
*/
public Map getMap(int i, int j);

/**
* Compute number of rows of the structure array
* @return rows
*/
public int getRows();

/**
* Compute number of columns of the structure array
* @return cols
*/
public int getCols();

/**
* Format the array of structures as a string
* @return formatted string
*/
public String toString();
}
 

/*
* Created on Sep 28, 2004
*
*/
package org.jmatlab.linalg;

import org.jmatlab.semantic.Symbol;

/**
* @author MQWF
*
*/
public interface ICell {

/**
* Set the cell value
* this = symbol
* @param symbol
*/
public void setCell(Symbol symbol);

/**
* Set the i'th cell in an array
* this(i) = symbol
* @param i
* @param symbol
*/
public void setCell(int i, Symbol symbol);

/**
* Set the (i, j)'th cell in an array
* @param i
* @param j
* @param symbol
*/
public void setCell(int i, int j, Symbol symbol);

/**
* Get the cell value
* @return this.value
*/
public Symbol getCell();

/**
* Get the i'th cell in an array
* @param i
* @return this(i)
*/
public Symbol getCell(int i);

/**
* Get the i'th cell in an array
* and create if it does not exist
* @param i
* @return this(i)
*/
public Symbol getCellOrCreate(int i);

/**
* Get the (i, j)'th cell in an array
* @param i
* @param j
* @return this(i, j)
*/
public Symbol getCell(int i, int j);

/**
* Get the (i, j)'th cell in an array
* and create if does not exist
* @param i
* @param j
* @return
*/
public Symbol getCellOrCreate(int i, int j);

/**
* Get a column array of cells from a cell
* @return column array of cells
*/
public ICell getCellsAll();

/**
* Get i'th row of cells
* @param i
* @return i'th row of cells
*/
public ICell getCellsRow(int i);

/**
* Get i'th column of cells
* @param i
* @return i'th column of cells
*/
public ICell getCellsCol(int i);

/**
* Get sub-array of cells using the
* argument matrix m as an index of
* sub-array
* @param m
* @return
*/
public ICell getCells(IMatrix m);

/**
* Get sub-array of cells using the
* argument matrix m as an index of
* sub-array
* Create if the sub-array elements do
* not exist
* @param m
* @return
*/
public ICell getCellsOrCreate(IMatrix m);

/**
* Get sub-array of cells using the
* index (i, j)
* @param m
* @return this(i, j)
*/
public ICell getCells(IMatrix i, int j);

/**
* Get sub-array of cells using the
* index (i, j)
* create if elements do not exist
* @param m
* @return this(i, j)
*/
public ICell getCellsOrCreate(IMatrix i, int j);

/**
* Get sub-array of cells using the
* index (i, j)
* @param m
* @return this(i, j)
*/
public ICell getCells(int i, IMatrix j);

/**
* Get sub-array of cells using the
* index (i, j)
* Create if the elements do not exist
* @param m
* @return this(i, j)
*/
public ICell getCellsOrCreate(int i, IMatrix j);

/**
* Get sub-array of cells using the
* index (i, j)
* @param m
* @return this(i, j)
*/
public ICell getCells(IMatrix i, IMatrix j);

/**
* Get sub-array of cells using the
* index (i, j)
* Create if elements do not exist
* @param m
* @return this(i, j)
*/
public ICell getCellsOrCreate(IMatrix i, IMatrix j);

/**
* Format the cell array into a string
* @return formatted string
*/
public String toString();

/**
* Get the cell by name from an array
* @param name
* @return this(name)
*/
public Symbol getCell(String name);

/**
* Compute the rows of the cell array
* @return rows
*/
public int getRows();

/**
* Compute the columns of the cell array
* @return columns
*/
public int getCols();

}
 

/*
* Created on Jul 12, 2004
*
*/
package org.jmatlab.linalg;

import java.math.BigDecimal;
import java.util.Hashtable;
import java.util.Map;

import org.jmatlab.semantic.Symbol;

/**
* @author Ali
*
*/
public interface LinearAlgebra {

/**
* Create a complex number
* @return 0 + 0 i
*/
public abstract IComplex createComplex();

/**
* Create a complex number
* @param d
* @return d + 0 i
*/
public abstract IComplex createComplex(double d);

/**
* Create a complex number
* @param real
* @param imag
* @return real + imag i
*/
public abstract IComplex createComplex(double real, double imag);

/**
* Create a complex number
* @param z
* @return a new instance of complex number z
*/
public abstract IComplex createComplex(IComplex z);

/**
* Create a matrix
* @param z
* @return a matrix created from the 2-dimensional complex
* array
*/
public abstract IMatrix createMatrix(IComplex[][] z);

/**
* Create a matrix
* @param m
* @return a new instance of matrix m
*/
public abstract IMatrix createMatrix(IMatrix m);

/**
* Create a matrix
* @param m
* @param n
* @return a matrix with dimension m X n
*/
public abstract IMatrix createMatrix(int m, int n);

/**
* Create a matrix of strings
* @param str
* @return a matrix of strings created from a 2-dimensional
* array of strings
*/
public abstract IMatrix createMatrix(String[][] str);

/**
* Create a matrix
* @param hash
* @param m
* @param n
* @return a m X n matrix created from a hashtable
*/
public abstract IMatrix createMatrix(Hashtable hash, int m, int n);

/**
* Create a matrix
* @param b
* @return a matrix created from a 2-d array of big decimals
*/
public abstract IMatrix createMatrix(BigDecimal[][] b);

/**
* Create a structure
* @return a structure object
*/
public abstract IStruct createStruct();

/**
* Create a structure
* @param map
* @return a structure object from a map of fields
*/
public abstract IStruct createStruct(Map map);

/**
* Create a structure array
* @param n
* @return a structure array of size n X 1
*/
public abstract IStruct createStruct(int n);


/**
* Create a structure array
* @param m
* @param n
* @return a structure array of size m X n
*/
public abstract IStruct createStruct(int m, int n);

/**
* Create a cell object
* @return a cell object
*/
public abstract ICell createCell();

/**
* Create a cell array
* @param n
* @return a cell array of size n X 1
*/
public abstract ICell createCell(int n);

/**
* Create a cell array
* @param m
* @param n
* @return a cell array of size m X n
*/
public abstract ICell createCell(int m, int n);

/**
* Create a cell array
* @param symbol
* @return a cell with one element symbol
*/
public abstract ICell createCell(Symbol symbol);

/**
* Create an empty matrix
* @return matrix of size 0 X 0
*/
public abstract IMatrix getEmptyMatrix();

/**
* Create an empty array of cell
* @return cell array of size 0 X 0
*/
public abstract ICell getEmptyCell();

/**
* Create a cell array
* @param hash
* @param m
* @param n
* @return a m X n cell array from a hash table of elements
*/
public abstract ICell createCell(Hashtable hash, int m, int n);
}