choco.kernel.common.util.objects
Class BooleanSparseMatrix

java.lang.Object
  extended by choco.kernel.common.util.objects.BooleanSparseMatrix
All Implemented Interfaces:
ISparseMatrix

public class BooleanSparseMatrix
extends Object
implements ISparseMatrix

A simple representation of a 0-1 sparse matrix


Constructor Summary
BooleanSparseMatrix(int n)
           
 
Method Summary
 void add(int i, int j)
          Add a new element in the matrix
 int getNbElement()
          get the number of element contained in the matrix
 Iterator<Long> iterator()
          Return an iterator over the values
 void prepare()
          Prepare the matrix for correct iteration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanSparseMatrix

public BooleanSparseMatrix(int n)
Method Detail

add

public void add(int i,
                int j)
Add a new element in the matrix

Specified by:
add in interface ISparseMatrix
Parameters:
i -
j -

getNbElement

public int getNbElement()
get the number of element contained in the matrix

Specified by:
getNbElement in interface ISparseMatrix
Returns:
the number of element

iterator

public Iterator<Long> iterator()
Return an iterator over the values

Specified by:
iterator in interface ISparseMatrix
Returns:
an iterator

prepare

public void prepare()
Prepare the matrix for correct iteration.

Specified by:
prepare in interface ISparseMatrix


Copyright © 2012. All Rights Reserved.