com.tensegrity.generic.math
Class Matrix

java.lang.Object
  extended bycom.tensegrity.generic.math.Matrix

public final class Matrix
extends java.lang.Object

Class Matrix represents a generic matrix of size n * m. If an instance has a size of (n, n + 1) and has been initialized with a system of linear equations, the solutions can be computed automatically by means of gaussian elimination.

Version:
$Id: Matrix.java,v 1.13 2005/05/12 13:59:37 KevinCVS Exp $
Author:
S. Rutz

Constructor Summary
Matrix(int rows, int columns)
          Constructs a 3x3 matrix with the specified numer of row and column, and initializes the corresponding transform.
Matrix(Matrix template)
          Constructs a 3x3 matrix and initializes all fields of the matrix with the corresponding values from another matrix.
 
Method Summary
 double get(int row, int column)
          Returns the value at position (row, column).
 int getColumnCount()
          Returns the number of columns in the matrix.
 double[] getGaussianSolution()
          Solves a linear equation system.
 int getRowCount()
          Returns the number of rows in the matrix.
 void set(int row, int column, double value)
          Sets the value at position (row, column) to value.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Matrix

public Matrix(int rows,
              int columns)
Constructs a 3x3 matrix with the specified numer of row and column, and initializes the corresponding transform.

Parameters:
rows - number of rows.
columns - number of columns.

Matrix

public Matrix(Matrix template)
Constructs a 3x3 matrix and initializes all fields of the matrix with the corresponding values from another matrix.

Parameters:
template - the other matrix whose values are copied into this object.
Method Detail

set

public final void set(int row,
                      int column,
                      double value)
Sets the value at position (row, column) to value.

Parameters:
row - the row identifier.
column - the column identifier.
value - the value to set.

get

public final double get(int row,
                        int column)
Returns the value at position (row, column).

Parameters:
row - the row identifier.
column - the column identifier.
Returns:
the value at the specified position.

getRowCount

public final int getRowCount()
Returns the number of rows in the matrix.

Returns:
number of rows in the matrix.

getColumnCount

public final int getColumnCount()
Returns the number of columns in the matrix.

Returns:
number of columns in the matrix.

getGaussianSolution

public double[] getGaussianSolution()
Solves a linear equation system.

Returns:
the solutions to the linear equation system.

toString

public java.lang.String toString()
Returns a string representation of this object.

Returns:
a string representation of this object.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.