opale.matrix
Class SymMatrix

java.lang.Object
  |
  +--opale.matrix.SymMatrix
All Implemented Interfaces:
java.lang.Cloneable

public final class SymMatrix
extends java.lang.Object
implements java.lang.Cloneable

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.
 java.lang.Object clone()
          Creates and return a copy of this object.
 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
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

clone

public java.lang.Object clone()
Creates and return a copy of this object.
Overrides:
clone in class java.lang.Object
Returns:
Object a copy of this object.
Throws:
OutOfMemoryError - if not enough memory.
Since:
Opale-Matrix 0.11
See Also:
Cloneable

main

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