xmltorng.i2s.util
Class NNIntMatrix

java.lang.Object
  extended by xmltorng.i2s.util.NNIntMatrix

public final class NNIntMatrix
extends java.lang.Object

This object represents a matix of n x n integer values.


Constructor Summary
NNIntMatrix()
          Default constructor.
NNIntMatrix(int n)
          Constructor with dimension argument.
 
Method Summary
 int collectConnectedElements(int[] groupIndexes)
          Considering a symetrical or anti-symetrical matrix that represents associations between n elements, this method collects the n elements by groups.
 int get(int index1, int index2)
           
 int getDimension()
           
 void set(int index1, int index2, int value)
           
 void setAntisymetricaly(int index1, int index2, int value)
           
 void setDimension(int n)
           
 void setSymetricaly(int index1, int index2, int value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NNIntMatrix

public NNIntMatrix()
Default constructor. Set n to 0.


NNIntMatrix

public NNIntMatrix(int n)
Constructor with dimension argument.

Method Detail

getDimension

public int getDimension()

setDimension

public void setDimension(int n)

get

public int get(int index1,
               int index2)

set

public void set(int index1,
                int index2,
                int value)

setSymetricaly

public void setSymetricaly(int index1,
                           int index2,
                           int value)

setAntisymetricaly

public void setAntisymetricaly(int index1,
                               int index2,
                               int value)

collectConnectedElements

public int collectConnectedElements(int[] groupIndexes)
Considering a symetrical or anti-symetrical matrix that represents associations between n elements, this method collects the n elements by groups. Two elements associated by a not null value belong to the same group. Elements of a group take the same number. Groups are numbered from 1. The group index of each element is returned in groupIndexes. Return the group count.