|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--edu.buffalo.fs7.mathlib.MathObject
|
+--edu.buffalo.fs7.mathlib.Argument
|
+--edu.buffalo.fs7.mathlib.Matrix
Class representing a mathematical matrix object.
BinaryOp| Field Summary | |
protected boolean |
conjugate
holds conjugate information |
protected Complex[][] |
data
holds the complex components |
protected int |
m
holds dimension information |
protected int |
n
holds dimension information |
protected boolean |
transpose
holds transpose information |
| Fields inherited from class edu.buffalo.fs7.mathlib.MathObject |
mathlib |
| Constructor Summary | |
Matrix(int n)
constructs a zero (n x n) matrix |
|
Matrix(int n,
int m)
constructs a zero (n x m) matrix (n rows, m columns) |
|
Matrix(MathObject o)
clone constructor |
|
| Method Summary | |
java.lang.Object |
clone()
clone method |
void |
conjugate()
complex conjugates the matrix |
boolean |
equals(MathObject m1)
equality predicate |
Complex |
getElement(int n,
int m)
returns the element in row n, col m. |
int |
m()
returns the number of columns |
int |
n()
returns the number of rows. |
void |
negative()
negates the matrix |
static Matrix |
parseMatrix(java.lang.String str)
parses a matrix from a string. |
void |
setElement(int n,
int m,
Complex value)
sets the element in row n, col m to a certain value. |
java.lang.String |
toParseableString()
returns a parsable string representation of the matrix (complex numbers in machine precision). |
java.lang.String |
toString()
returns a string representation of the object |
void |
transpose()
transposes the matrix |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Complex[][] data
protected int n
protected int m
protected boolean transpose
protected boolean conjugate
| Constructor Detail |
public Matrix(int n,
int m)
public Matrix(int n)
public Matrix(MathObject o)
| Method Detail |
public java.lang.Object clone()
clone in class MathObject
public static Matrix parseMatrix(java.lang.String str)
throws java.lang.IllegalArgumentException,
java.lang.NumberFormatException
parses a matrix from a string. The matrix given by [a b c, d e f, g h i] is parsed into
a b c
d e f
g h i
The method throws an IllegalArgumentException of a NumberFormatException if the parse process fails.public void transpose()
public void conjugate()
public void negative()
public boolean equals(MathObject m1)
equals in class Argument
public Complex getElement(int n,
int m)
n - rowm - col
public void setElement(int n,
int m,
Complex value)
n - rowm - colvalue - new component valuepublic int n()
public int m()
public java.lang.String toString()
toString in class MathObjectedu.buffalo.fs7.mathlib.MathObjectMathObject.toParseableString()public java.lang.String toParseableString()
toParseableString in class MathObjectedu.buffalo.fs7.mathlib.MathObjectMathObject.toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||