opale.matrix
Class SymMatrix

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

public final class SymMatrix
extends java.lang.Object

This class implements a symmetrical matrix with real coefficients.

Since:
Opale-Matrix 0.1

Constructor Summary
SymMatrix(int n)
          Construct an n X n matrix of zeros.
 
Method Summary
 void add(SymMatrix A)
          Add an another matrix A to the current matrix.
 SymMatrix 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 getDim()
          Get the dimension.
 double[] getInternalArray()
          Get the internal one-dimensional array.
static void main(java.lang.String[] arg)
           
 DVect mul(DVect x)
           
 void set(int i, int j, double x)
          Set a coefficient of the matrix.
 java.lang.String toString()
          Print the matrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SymMatrix

public SymMatrix(int n)
Construct an n X n matrix of zeros.
Parameters:
int - n, row dimension.
Method Detail

getDim

public int getDim()
Get the dimension.
Returns:
int, the 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 SymMatrix copy()
Make a copy of the current matrix.
Returns:
Matrix, the copy

add

public void add(SymMatrix 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)

getInternalArray

public double[] getInternalArray()
Get the internal one-dimensional array. Type of storage : 0 1 2 3 4 5 .....
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

main

public static void main(java.lang.String[] arg)