fhm.edu.fem.calc.objects.matrix
Interface Matrix

All Superinterfaces:
MathObject
All Known Implementing Classes:
MatrixHull, MatrixHullChain, MatrixStandard

public interface Matrix
extends MathObject

Class Description: The interface defining a matrix class

Author:
Thomas Woellert (thomas@woellert.net), Stefan Weissbach (weissbst@gmx.de)

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
 

Method Detail

add

Matrix add(Matrix m)
Add a given matrix to this matrix

Parameters:
m, - the matrix to add
Returns:
the new matrix, the original matrix is not changed

asArray

double[][] asArray()
Convert all data in the matrix to a quadratic double array

Returns:
double[][]

cholesky

Matrix cholesky()
                throws CholeskyFailedException
Do the cholesky for this matrix

Returns:
the matrix L as result of the cholesky
Throws:
CholeskyFailedException

clone

java.lang.Object clone()
Clone the matrix

Returns:
the colned matrix

getName

java.lang.String getName()
Retrieve the name of this matrix

Returns:
the name

getRequiredMemory

long getRequiredMemory()
Retrieve the amount of required memory in this matrix (in byte)

Returns:
the amount of required memory in byte

getValue

double getValue(int row,
                int column)
                throws java.lang.IndexOutOfBoundsException
Retrieve a value from the matrix

Parameters:
row, - the row index
colum, - the column index
Returns:
the value
Throws:
java.lang.IndexOutOfBoundsException

isMainDiagonalNotZero

boolean isMainDiagonalNotZero()
Test if the main diagonal of this matrix is not zero

Returns:
true if it is not zero, false otherwise

isSymmetric

boolean isSymmetric()
Test if the Matrix is symmetric

Returns:
false if it is not symmetric, true otherwise

mult

Matrix mult(double multiplicator)
Multiply all values in the matrix by the given value

Parameters:
multiplicator, - the value to multiply the matrix with
Returns:
the new matrix, the original matrix is not changed

mult

Matrix mult(Matrix m)
Multiply this Matrix with the given Matrix (have to be the same size)

Parameters:
m, - the matrix
Returns:
Matrix, the result matrix

mult

Vector mult(Vector m)
Multiply this Matrix with the given vector (have to be the same size)

Parameters:
m, - the vector
Returns:
Vector, the result vector

setLineAndColumn

void setLineAndColumn(int index,
                      double value)
Set a whole column to the given value in the matrix at the given column number

Parameters:
columnNumber, - where to store the column
value, - the sole value we want to fill the column with

setName

void setName(java.lang.String name)
Set a new name for this matrix

Parameters:
name -

setValue

void setValue(int row,
              int column,
              double value)
              throws java.lang.IndexOutOfBoundsException
Set a new value in the matrix

Parameters:
row, - the row index
colum, - the column index
value, - the value to set
Throws:
java.lang.IndexOutOfBoundsException

size

int size()
Get the number of rows and columns in the matrix (square matrix only!)

Returns:
the number of rows and columns

storeLine

void storeLine(int lineNumber,
               double[] line)
Store a whole line in the matrix at the given line number

Parameters:
lineNumber, - where to store the line
line, - the array holding the line's data

toString

java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

java.lang.String toString(int number)
Variable toString method

Parameters:
number, - the number of rows and columns to display (starting at the upper left)
Returns:
String

transponate

Matrix transponate()
Transponate the Matrix

Returns:
the new transponated Matrix