org.lsmp.djep.vectorJep.values
Class Matrix

java.lang.Object
  extended byjava.lang.Number
      extended byorg.lsmp.djep.vectorJep.values.Matrix
All Implemented Interfaces:
MatrixValueI, java.io.Serializable

public class Matrix
extends java.lang.Number
implements MatrixValueI

Represents a matrix.

Since:
2.3.2 Added equals method.
Version:
2.3.0.2 now extends number, 2.3.1.1 Bug with non square matricies fixed.
Author:
Rich Morris Created on 07-Jul-2003
See Also:
Serialized Form

Constructor Summary
Matrix(int rows, int cols)
          Construct a matrix with given rows and cols.
 
Method Summary
 double doubleValue()
          value of ele(1,1).
 boolean equals(java.lang.Object obj)
          Are two matricies equal, element by element Overrides Object.
 float floatValue()
          value of ele(1,1).
 Dimensions getDim()
          Returns the dimension of this object.
 java.lang.Object getEle(int n)
          gets the i-th element, treats data a a linear array.
 java.lang.Object getEle(int i, int j)
           
 java.lang.Object[][] getEles()
           
 int getNumCols()
           
 int getNumEles()
          The total number of elements.
 int getNumRows()
           
 int hashCode()
          Always override hashCode when you override equals.
 int intValue()
          value of ele(1,1).
 long longValue()
          value of ele(1,1).
 void setEle(int i, int j, java.lang.Object value)
           
 void setEle(int n, java.lang.Object value)
          sets the i-th element, treats data a a linear array.
 void setEles(MatrixValueI val)
          sets the elements to those of the arguments.
 java.lang.String toString()
          Returns a string rep of matrix.
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Matrix

public Matrix(int rows,
              int cols)
Construct a matrix with given rows and cols.

Method Detail

toString

public java.lang.String toString()
Returns a string rep of matrix. Uses [[a,b],[c,d]] syntax.


getDim

public Dimensions getDim()
Description copied from interface: MatrixValueI
Returns the dimension of this object.

Specified by:
getDim in interface MatrixValueI

getNumEles

public int getNumEles()
Description copied from interface: MatrixValueI
The total number of elements.

Specified by:
getNumEles in interface MatrixValueI

getNumRows

public int getNumRows()

getNumCols

public int getNumCols()

setEle

public void setEle(int n,
                   java.lang.Object value)
Description copied from interface: MatrixValueI
sets the i-th element, treats data a a linear array.

Specified by:
setEle in interface MatrixValueI

setEle

public void setEle(int i,
                   int j,
                   java.lang.Object value)

getEle

public java.lang.Object getEle(int n)
Description copied from interface: MatrixValueI
gets the i-th element, treats data a a linear array.

Specified by:
getEle in interface MatrixValueI

getEle

public java.lang.Object getEle(int i,
                               int j)

getEles

public java.lang.Object[][] getEles()

setEles

public void setEles(MatrixValueI val)
sets the elements to those of the arguments.

Specified by:
setEles in interface MatrixValueI

intValue

public int intValue()
value of ele(1,1).


longValue

public long longValue()
value of ele(1,1).


floatValue

public float floatValue()
value of ele(1,1).


doubleValue

public double doubleValue()
value of ele(1,1).


equals

public boolean equals(java.lang.Object obj)
Are two matricies equal, element by element Overrides Object.


hashCode

public int hashCode()
Always override hashCode when you override equals. Efective Java, Joshua Bloch, Sun Press



http://www.singularsys.com/jep Copyright © 2004 Singular Systems