opale.matrix
Class Matrix

java.lang.Object
  |
  +--opale.matrix.Matrix

public final class Matrix
extends java.lang.Object

This class implements a full matrix with real coefficients.

Since:
Opale-Matrix 0.1

Constructor Summary
Matrix(double[][] x)
          Constructeur de la classe Matrix à partir d'un tableau de doubles
Matrix(int n, int m)
          Construct an n X m matrix of zeros.
 
Method Summary
 Matrix add(Matrix A)
          Add an another matrix A to the current matrix.
 Matrix copy()
          Make a copy of the current matrix.
 double get(int i, int j)
          Get a coefficient of the matrix.
 double[][] getArrayCopy()
          Get a copy of array of matrix elements.
 int getColumnDim()
          Get the number of columns.
 double[][] getInternalArray()
          Get the internal two-dimensional array.
 int getRowDim()
          Get the number of rows.
 DVect mul(DVect x)
          Multiply the current matrix by a vector.
 void set(int i, int j, double x)
          Set a coefficient of the matrix.
 java.lang.String toString()
          Print the matrix.
 Matrix transpose()
          Return the matrix transpose.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Matrix

public Matrix(int n,
              int m)
Construct an n X m matrix of zeros.
Parameters:
int - n, row dimension.
int - m, colum dimension.

Matrix

public Matrix(double[][] x)
Constructeur de la classe Matrix à partir d'un tableau de doubles
Method Detail

getRowDim

public int getRowDim()
Get the number of rows.
Returns:
int, the row dimension.

getColumnDim

public int getColumnDim()
Get the number of columns.
Returns:
int, the column dimension.

get

public double get(int i,
                  int j)
Get a coefficient of the matrix.
Parameters:
int - i, row index.
int - j, column index.
Returns:
double, coeff(i,j)

set

public void set(int i,
                int j,
                double x)
Set a coefficient of the matrix.
Parameters:
int - i, row index.
int - j, column index.
double - x, the value of coeff(i,j)

copy

public Matrix copy()
Make a copy of the current matrix.
Returns:
Matrix, the copy

add

public Matrix add(Matrix A)
Add an another matrix A to the current matrix.
Parameters:
Matrix - A, an another matrix
Returns:
Matrix, the result

mul

public DVect mul(DVect x)
Multiply the current matrix by a vector.
Parameters:
DVect - x, a vector
DVect, - the result A*x

transpose

public Matrix transpose()
Return the matrix transpose.
Returns:
Matrix.

getInternalArray

public double[][] getInternalArray()
Get the internal two-dimensional array.
Returns:
double[][], Pointer to the array of matrix elements.

getArrayCopy

public double[][] getArrayCopy()
Get a copy of array of matrix elements.
Returns:
double[][], the array of matrix elements.

toString

public java.lang.String toString()
Print the matrix.
Overrides:
toString in class java.lang.Object