Back to Top page.

EGTSubGraph< TN > Class Template Reference

Base class template for a SubGraph. More...

#include <EGTSubGraph.h>

Inheritance diagram for EGTSubGraph< TN >:

Inheritance graph
[legend]
Collaboration diagram for EGTSubGraph< TN >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef TN::Term Term
typedef EGTVector< Term * > Terms
typedef TN Node
typedef EGTVector< Node * > Nodes
typedef Nodes::Iterator NodesIterator
typedef Nodes::ConstIterator NodesConstIterator
typedef EGTAbstractNode< TermBase
typedef EGTSubGraph< NodeSelf

Public Methods

 EGTSubGraph ()
 Creates an empty SubGraph.

 EGTSubGraph (const Self &, bool)
 Initializes this SubGraph with the specified SubGraph.

 EGTSubGraph (const Nodes &, bool)
 Initializes this SubGraph with the specified array of Nodes.

virtual ~EGTSubGraph ()
 Destructor.

virtual bool InitSubGraph (UInt uNumIn, UInt uNumOut, UInt arg=0)
 Initializes this SubGraph having the specific number of input/output Terminals.

virtual bool IsCompatible (const Self &) const
 Checks whether this SubGraph has the compatible cut set with the specified SubGraph.

virtual bool ConnectSubGraph (Self &)
 Connects this SubGraph with the specified SubGraph.

virtual void SaveSubGraph (std::ostream &) const
 Saves the data of this SubGraph.

virtual void Display (std::ostream &) const
 Outputs the data of this SubGraph.

void Release (Nodes *dest)
 Moves all the Nodes to the specified array of Nodes.

void SetOrigin (UInt n)
UInt GetNumNodes () const
 Returns the number of Nodes.

const NodesGetNodes () const
 Returns the array of Nodes.

bool operator== (const Self &rhs) const
 Checks whether this SubGraph is equal to the specified SubGraph.


Static Public Attributes

Nodem_tCreator = 0

Protected Types

enum  { LOOP_TIMES = 10 }
 Maximum number of iterations for generating SubGraphs. More...

enum  { BASE_NODE_SIZE = 5 }
 Initial number of Nodes for generating SubGraphs. More...


Protected Methods

virtual void DeepCopy (const Nodes &)
 Initializes this SubGraph. Initializes this SubGraph with a deep copy of the specified array of Nodes.

virtual void RegistTerms ()
 Registers input/output Terminals.

virtual void ConnectNodes (UInt uNumIn, UInt uNumOut)
 Adjusts the number of unconnected input/output Terminals according to the specified numbers.

NodeGetNode (UInt uNodeID)
 Returns the Node with specified Node ID number.

virtual void AddNode (Node *, UInt)
 Adds the specified Node to this SubGraph.

void AddNodeNormal (Node *, UInt)
 Adds the specified Node to this SubGraph.

void AddNodeCompleteCircuitForest (Node *, UInt)
 Adds the specified Node to this SubGraph. (for CompleteCircuitForest).

void AssignNodeID ()
 Assigns Node ID number to each Node.

void Clear ()
 Deletes all the Nodes and Terminals of this SubGraph.

void RemoveInTerm (UInt uTermNum)
 Removes the specified input Terminal.

void RemoveOutTerm (UInt uTermNum)
 Removes the specified output Terminal.

void AddInTerm (Term *pt)
 Adds an input Terminal to this SubGraph.

void AddOutTerm (Term *pt)
 Adds an output Terminal to this SubGraph.

bool IsTermUnconnected (Term *) const
 Checks whether the specified Terminal is unconnected.


Protected Attributes

Nodes m_tNodes
 Array of Nodes.

bool m_bOwner
 Ownership of the array of Nodes.


Detailed Description

template<class TN>
class EGTSubGraph< TN >

Base class template for a SubGraph.

It is assumed that <TN> is a subclass of EGTNode.


Member Typedef Documentation

template<class TN>
typedef EGTAbstractNode<Term> EGTSubGraph< TN >::Base
 

template<class TN>
typedef TN EGTSubGraph< TN >::Node
 

template<class TN>
typedef EGTVector<Node*> EGTSubGraph< TN >::Nodes
 

template<class TN>
typedef Nodes::ConstIterator EGTSubGraph< TN >::NodesConstIterator
 

template<class TN>
typedef Nodes::Iterator EGTSubGraph< TN >::NodesIterator
 

template<class TN>
typedef EGTSubGraph<Node> EGTSubGraph< TN >::Self
 

Reimplemented from EGTAbstractNode< TN::Term >.

template<class TN>
typedef TN::Term EGTSubGraph< TN >::Term
 

Reimplemented from EGTAbstractNode< TN::Term >.

template<class TN>
typedef EGTVector<Term*> EGTSubGraph< TN >::Terms
 

Reimplemented from EGTAbstractNode< TN::Term >.


Member Enumeration Documentation

template<class TN>
anonymous enum [protected]
 

Maximum number of iterations for generating SubGraphs.

Enumeration values:
LOOP_TIMES 

template<class TN>
anonymous enum [protected]
 

Initial number of Nodes for generating SubGraphs.

Enumeration values:
BASE_NODE_SIZE 


Constructor & Destructor Documentation

template<class TN>
EGTSubGraph< TN >::EGTSubGraph   [inline]
 

Creates an empty SubGraph.

template<class TN>
EGTSubGraph< TN >::EGTSubGraph const Self   rhs,
bool    owns = true
 

Initializes this SubGraph with the specified SubGraph.

Copies the specified SubGraph.
If the 2nd argument "owns" is true, this function makes a deep copy of the 1st argument.
Otherwise, this function makes a shallow copy of the 1st argument.

Parameters:
rhs  [in] SubGraph
owns  [in] Ownership (Flag indicating whether a deep copy is carried out.)

template<class TN>
EGTSubGraph< TN >::EGTSubGraph const Nodes   rhs,
bool    owns = true
 

Initializes this SubGraph with the specified array of Nodes.

Parameters:
rhs  [in] Array of Nodes
owns  [in] Ownership (Flag indicating whether a deep copy is carried out.)

template<class TN>
virtual EGTSubGraph< TN >::~EGTSubGraph   [inline, virtual]
 

Destructor.


Member Function Documentation

template<class TN>
void EGTSubGraph< TN >::AddInTerm Term   pt [inline, protected]
 

Adds an input Terminal to this SubGraph.

template<class TN>
void EGTSubGraph< TN >::AddNode Node   pn,
UInt    uOut
[protected, virtual]
 

Adds the specified Node to this SubGraph.

Adds also the input/output Terminals of the Node to this SubGraph.

Parameters:
pn  [in] Node
uOut  [in] Number of outputs of the target circuit.

template<class TN>
void EGTSubGraph< TN >::AddNodeCompleteCircuitForest Node   pn,
UInt    uOut
[protected]
 

Adds the specified Node to this SubGraph. (for CompleteCircuitForest).

Adds also the input/output Terminals of the Node to this SubGraph.

Parameters:
pn  [in] Node
uOut  [in] Number of outputs of the target circuit.

template<class TN>
void EGTSubGraph< TN >::AddNodeNormal Node   pn,
UInt    uOut
[protected]
 

Adds the specified Node to this SubGraph.

Adds also the input/output Terminals of the Node to this SubGraph.

Parameters:
pn  [in] Node
uOut  [in] Number of outputs of the target circuit.

template<class TN>
void EGTSubGraph< TN >::AddOutTerm Term   pt [inline, protected]
 

Adds an output Terminal to this SubGraph.

template<class TN>
void EGTSubGraph< TN >::AssignNodeID   [protected]
 

Assigns Node ID number to each Node.

template<class TN>
void EGTSubGraph< TN >::Clear   [protected]
 

Deletes all the Nodes and Terminals of this SubGraph.

template<class TN>
void EGTSubGraph< TN >::ConnectNodes UInt    uNumIn,
UInt    uNumOut
[protected, virtual]
 

Adjusts the number of unconnected input/output Terminals according to the specified numbers.

Parameters:
uNumIn  [in] Number of input Terminals
uNumOut  [in] Number of output Terminals

template<class TN>
bool EGTSubGraph< TN >::ConnectSubGraph Self   rhs [virtual]
 

Connects this SubGraph with the specified SubGraph.

Parameters:
rhs  [i/o] SubGraph

template<class TN>
void EGTSubGraph< TN >::DeepCopy const Nodes   rhs [protected, virtual]
 

Initializes this SubGraph. Initializes this SubGraph with a deep copy of the specified array of Nodes.

Parameters:
rhs  [in] Array of Nodes.

template<class TN>
void EGTSubGraph< TN >::Display std::ostream &    out const [virtual]
 

Outputs the data of this SubGraph.

Parameters:
out  [out] Output stream

Reimplemented from EGTAbstractNode< TN::Term >.

template<class TN>
TN * EGTSubGraph< TN >::GetNode UInt    uNodeID [protected]
 

Returns the Node with specified Node ID number.

Parameters:
uNodeID  [in] Node ID number
Returns:
Node with the specified Node ID number

template<class TN>
const Nodes* EGTSubGraph< TN >::GetNodes   const [inline]
 

Returns the array of Nodes.

template<class TN>
UInt EGTSubGraph< TN >::GetNumNodes   const [inline]
 

Returns the number of Nodes.

template<class TN>
bool EGTSubGraph< TN >::InitSubGraph UInt    uNumIn,
UInt    uNumOut,
UInt    arg = 0
[virtual]
 

Initializes this SubGraph having the specific number of input/output Terminals.

Parameters:
uNumIn  [in] Number of input Terminals
uNumOut  [in] Number of output Terminals
arg  [in]
Return values:
true  The initialization succeeded.
false  The initialization failed. (This SubGraph is empty.)

template<class TN>
bool EGTSubGraph< TN >::IsCompatible const Self   rhs const [virtual]
 

Checks whether this SubGraph has the compatible cut set with the specified SubGraph.

Parameters:
rhs  [in] SubGraph
Return values:
true  Compatible.
false  Not compatible.

template<class TN>
bool EGTSubGraph< TN >::IsTermUnconnected Term   pt const [protected]
 

Checks whether the specified Terminal is unconnected.

Parameters:
pt  [in] Terminal
Return values:
true  The specified Terminal is unconnected.
false  Otherwise.

template<class TN>
bool EGTSubGraph< TN >::operator== const Self   rhs const
 

Checks whether this SubGraph is equal to the specified SubGraph.

Parameters:
rhs  [in] SubGraph
Return values:
true  This SubGraph is equal to the specified SubGraph.
false  Otherwise.

template<class TN>
void EGTSubGraph< TN >::RegistTerms   [protected, virtual]
 

Registers input/output Terminals.

Registers unconnected Terminals of this SubGraph.

template<class TN>
void EGTSubGraph< TN >::Release Nodes   dest
 

Moves all the Nodes to the specified array of Nodes.

Parameters:
dest  [out] Arrary of Nodes

template<class TN>
void EGTSubGraph< TN >::RemoveInTerm UInt    uTermNum [inline, protected]
 

Removes the specified input Terminal.

template<class TN>
void EGTSubGraph< TN >::RemoveOutTerm UInt    uTermNum [inline, protected]
 

Removes the specified output Terminal.

template<class TN>
void EGTSubGraph< TN >::SaveSubGraph std::ostream &    out const [virtual]
 

Saves the data of this SubGraph.

Parameters:
out  [out] Output stream

template<class TN>
void EGTSubGraph< TN >::SetOrigin UInt    n
 

Parameters:
n  [in]


Member Data Documentation

template<class TN>
bool EGTSubGraph< TN >::m_bOwner [protected]
 

Ownership of the array of Nodes.

template<class TN>
TN * EGTSubGraph< TN >::m_tCreator = 0 [static]
 

template<class TN>
Nodes EGTSubGraph< TN >::m_tNodes [protected]
 

Array of Nodes.


The documentation for this class was generated from the following file: