RBNpackage
Class SparseRel

java.lang.Object
  extended by RBNpackage.RelInt
      extended by RBNpackage.SparseRel

public class SparseRel
extends RelInt


Field Summary
 
Fields inherited from class RBNpackage.RelInt
relation
 
Constructor Summary
SparseRel()
          Creates new SparseRel
SparseRel(Rel r)
           
SparseRel(Rel r, java.util.Vector v)
           
 
Method Summary
 int addTuple(int[] tup)
          Add tup to interpretation (equivalent: set relation(tup)=true).
 int[][] allTrue()
          Returns an array of all tuples that are true according to this RelInt
 void deleteNode(int node)
           
 void deleteTuple(int[] tup)
          Delete tup from interpretation (equivalent: set relation(tup)=false).
 java.util.Vector getBinDirs(int node)
           
 java.util.Vector getTuples()
          Return all tuples in the interpretation as a vector of int[]
 boolean isInInterpretation(int[] tup)
          Returns true if the tuple is in the relation; otherwise returns false
 boolean match(int i, int[] tuple)
           
 int size()
           
 int[] tupleAt(int i)
           
 
Methods inherited from class RBNpackage.RelInt
rel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SparseRel

public SparseRel()
Creates new SparseRel


SparseRel

public SparseRel(Rel r)

SparseRel

public SparseRel(Rel r,
                 java.util.Vector v)
Method Detail

size

public int size()

tupleAt

public int[] tupleAt(int i)

getTuples

public java.util.Vector getTuples()
Description copied from class: RelInt
Return all tuples in the interpretation as a vector of int[]

Specified by:
getTuples in class RelInt

allTrue

public int[][] allTrue()
Description copied from class: RelInt
Returns an array of all tuples that are true according to this RelInt

Specified by:
allTrue in class RelInt

addTuple

public int addTuple(int[] tup)
Description copied from class: RelInt
Add tup to interpretation (equivalent: set relation(tup)=true). No effect if tup already in interpretation Returns 1 if tup was not in relation already; else -1

Specified by:
addTuple in class RelInt

deleteTuple

public void deleteTuple(int[] tup)
Description copied from class: RelInt
Delete tup from interpretation (equivalent: set relation(tup)=false). No effect if tup not contained in interpretation

Specified by:
deleteTuple in class RelInt

deleteNode

public void deleteNode(int node)

isInInterpretation

public boolean isInInterpretation(int[] tup)
Description copied from class: RelInt
Returns true if the tuple is in the relation; otherwise returns false

Specified by:
isInInterpretation in class RelInt

getBinDirs

public java.util.Vector getBinDirs(int node)

match

public boolean match(int i,
                     int[] tuple)