|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfhm.edu.fem.calc.objects.matrix.MatrixStandard
public class MatrixStandard
Class Description: This class represents the matrix (we start at index 1 not 0 for both the rows and the columns)
Field Summary | |
---|---|
protected double[][] |
data
|
protected static Logger |
localLogger
|
protected java.lang.String |
name
|
protected int |
size
|
Constructor Summary | |
---|---|
MatrixStandard(java.lang.String name,
double[][] values)
Matrix with the given name, filled with the given values |
|
MatrixStandard(java.lang.String name,
int size)
Matrix with the size (x rows and x columns) (all fields are initialized with zeros) |
Method Summary | |
---|---|
Matrix |
add(Matrix m)
Add a given matrix to this matrix |
double[][] |
asArray()
Convert all data in the matrix to a quadratic double array |
Matrix |
cholesky()
Do the cholesky for this matrix |
java.lang.Object |
clone()
Clone the matrix |
java.lang.String |
getName()
Retrieve the name of this matrix |
long |
getRequiredMemory()
Retrieve the amount of required memory in this matrix (in byte) |
double |
getValue(int row,
int column)
Retrieve a value from the matrix |
boolean |
isMainDiagonalNotZero()
Test if the main diagonal of this matrix is not zero |
boolean |
isSymmetric()
Test if the Matrix is symmetric |
Matrix |
mult(double multiplicator)
Multiply all values in the matrix by the given value |
Matrix |
mult(Matrix m)
Multiply this Matrix with the given Matrix (have to be the same size) |
Vector |
mult(Vector m)
Multiply this Matrix with the given vector (have to be the same size) |
void |
setLineAndColumn(int index,
double value)
Set a whole column to the given value in the matrix at the given column number |
void |
setName(java.lang.String name)
Set a new name for this matrix |
void |
setValue(int row,
int column,
double value)
Set a new value in the matrix |
int |
size()
Get the number of rows and columns in the matrix (square matrix only!) |
void |
storeLine(int lineNumber,
double[] line)
Store a whole line in the matrix at the given line number |
java.lang.String |
toString()
|
java.lang.String |
toString(int number)
Variable toString method |
Matrix |
transponate()
Transponate the Matrix |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected double[][] data
protected static Logger localLogger
protected java.lang.String name
protected int size
Constructor Detail |
---|
public MatrixStandard(java.lang.String name, double[][] values)
name,
- namevalues,
- quadraticpublic MatrixStandard(java.lang.String name, int size)
name,
- the name of the matrixsize,
- the number of rows and columns (square matrix only!)Method Detail |
---|
public Matrix add(Matrix m)
add
in interface Matrix
m,
- the matrix to add
public double[][] asArray()
asArray
in interface Matrix
public Matrix cholesky() throws CholeskyFailedException
cholesky
in interface Matrix
CholeskyFailedException
public java.lang.Object clone()
clone
in interface Matrix
clone
in class java.lang.Object
public java.lang.String getName()
getName
in interface Matrix
public long getRequiredMemory()
getRequiredMemory
in interface Matrix
public double getValue(int row, int column) throws java.lang.IndexOutOfBoundsException
getValue
in interface Matrix
row,
- the row indexcolum,
- the column index
java.lang.IndexOutOfBoundsException
public boolean isMainDiagonalNotZero()
isMainDiagonalNotZero
in interface Matrix
public boolean isSymmetric()
isSymmetric
in interface Matrix
public Matrix mult(double multiplicator)
mult
in interface Matrix
multiplicator,
- the value to multiply the matrix with
public Matrix mult(Matrix m)
mult
in interface Matrix
m,
- the matrix
public Vector mult(Vector m)
mult
in interface Matrix
m,
- the vector
public void setLineAndColumn(int index, double value)
setLineAndColumn
in interface Matrix
columnNumber,
- where to store the columnvalue,
- the sole value we want to fill the column withpublic void setName(java.lang.String name)
setName
in interface Matrix
name
- public void setValue(int row, int column, double value) throws java.lang.IndexOutOfBoundsException
setValue
in interface Matrix
row,
- the row indexcolum,
- the column indexvalue,
- the value to set
java.lang.IndexOutOfBoundsException
public int size()
size
in interface Matrix
public void storeLine(int lineNumber, double[] line)
storeLine
in interface Matrix
lineNumber,
- where to store the lineline,
- the array holding the line's datapublic java.lang.String toString()
toString
in interface Matrix
toString
in class java.lang.Object
public java.lang.String toString(int number)
toString
in interface Matrix
number,
- the number of rows and columns to display (starting at the upper left)
public Matrix transponate()
transponate
in interface Matrix
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |