weka.classifiers.bayes.net
Class ParentSet

java.lang.Object
  extended byweka.classifiers.bayes.net.ParentSet
All Implemented Interfaces:
java.io.Serializable

public class ParentSet
extends java.lang.Object
implements java.io.Serializable

Helper class for Bayes Network classifiers. Provides datastructures to represent a set of parents in a graph.

Version:
$Revision: 1.4 $
Author:
Remco Bouckaert (rrb@xm.co.nz)
See Also:
Serialized Form

Constructor Summary
ParentSet()
          default constructor
ParentSet(int nMaxNrOfParents)
          constructor
ParentSet(ParentSet other)
          copy constructor
 
Method Summary
 void addParent(int nParent, Instances _Instances)
          Add parent to parent set and update internals (specifically the cardinality of the parent set)
 void addParent(int nParent, int iParent, Instances _Instances)
          Add parent to parent set at specific location and update internals (specifically the cardinality of the parent set)
 boolean contains(int iNode)
          test if node is contained in parent set
 void copy(ParentSet other)
          Copy makes current parents set equal to other parent set
 void deleteLastParent(Instances _Instances)
          Delete last added parent from parent set and update internals (specifically the cardinality of the parent set)
 int deleteParent(int nParent, Instances _Instances)
          delete node from parent set
 int getCardinalityOfParents()
          returns cardinality of parents
 int getNrOfParents()
          returns number of parents
 int getParent(int iParent)
          returns index parent of parent specified by index
 void maxParentSetSize(int nSize)
          reserve memory for parent set
 void SetParent(int iParent, int nNode)
          sets index parent of parent specified by index
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParentSet

public ParentSet()
default constructor


ParentSet

public ParentSet(int nMaxNrOfParents)
constructor

Parameters:
nMaxNrOfParents - upper bound on nr of parents

ParentSet

public ParentSet(ParentSet other)
copy constructor

Parameters:
other - other parent set
Method Detail

getParent

public int getParent(int iParent)
returns index parent of parent specified by index

Parameters:
iParent - Index of parent

SetParent

public void SetParent(int iParent,
                      int nNode)
sets index parent of parent specified by index

Parameters:
iParent - Index of parent

getNrOfParents

public int getNrOfParents()
returns number of parents

Returns:
number of parents

contains

public boolean contains(int iNode)
test if node is contained in parent set

Returns:
number of parents

getCardinalityOfParents

public int getCardinalityOfParents()
returns cardinality of parents


maxParentSetSize

public void maxParentSetSize(int nSize)
reserve memory for parent set

Parameters:
nSize - maximum size of parent set to reserver memory for

addParent

public void addParent(int nParent,
                      Instances _Instances)
Add parent to parent set and update internals (specifically the cardinality of the parent set)

Parameters:
nParent - parent to add
_Instances - used for updating the internals

addParent

public void addParent(int nParent,
                      int iParent,
                      Instances _Instances)
Add parent to parent set at specific location and update internals (specifically the cardinality of the parent set)

Parameters:
_Instances - used for updating the internals

deleteParent

public int deleteParent(int nParent,
                        Instances _Instances)
delete node from parent set

Returns:
location of the parent in the parent set. This information can be used to restore the parent set using the addParent method.

deleteLastParent

public void deleteLastParent(Instances _Instances)
Delete last added parent from parent set and update internals (specifically the cardinality of the parent set)

Parameters:
_Instances - used for updating the internals

copy

public void copy(ParentSet other)
Copy makes current parents set equal to other parent set

Parameters:
other - : parent set to make a copy from