Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

DAGNode Class Reference

This class represents a node of an object of class DAG. More...

#include <DAGNode.h>

Inheritance diagram for DAGNode:

GGNode SGNode List of all members.

Public Methods

 DAGNode (NODE_LABEL lbl=NODE_LBL_DEFAULT_VAL)
 DAGNode constructor.

virtual DAGNode * CreateObject () const=0
 This function is required by the SmartPtr class.

virtual ~DAGNode ()
 Necessary virtual destructor.

virtual DAGNode & operator= (const DAGNode &rhs)
 Copies the info of <rhs> into the corresponding member variables.

virtual void Clear ()
 Initializes the contents of the object to their original values.

virtual istream & Read (istream &is)
virtual ostream & Write (ostream &os) const
virtual void Print (ostream &os=cout) const
 Prints the DAGNode to the specified stream.

virtual void ComputeDerivedValues ()
void Set (NODE_LABEL nl, double el)
 Similarity function for two nodes.

void SetChildrenTSV (const TSV &tsv)
 Sets the node's TSV assosiated with its adjacent nodes.

TSV GetTSV (int nDim) const

Detailed Description

This class represents a node of an object of class DAG.

DAGNode is an abstract class intended to provide the basic functionality of a DAG node and to specify which functions must be overloaded (the pure virtual ones).

At this moment, many functions that could belong to the DAGNode class, such as NodeDistance() and so on, are implemented in the DAG class. The reason for this is that some of these functions require information about the neighbours of the node, and that information is contained in the DAG class. However, if a node had a member variable of type leda_node that links it to the associated node in the graph, all the above functions could be implemented in the DAGNode class. Remember that given a leda_node v, we can retrieve the graph it belongs to by calling graph_of(v). A drawback of this approach would be that we introduce some risk of inconsistency because when we move a node from one graph to another, we need to change the value of its reference to the leda_node accordingly.

/see DAG and DAGNodePtr.

Definition at line 80 of file DAGNode.h.


Member Function Documentation

void DAGNode::ComputeDerivedValues   [virtual]
 

Computes the node's TSV norm considering that the TSV includes the eigenvalue of the node too.

Reimplemented in SGNode.

Definition at line 177 of file DAGNode.cpp.

References TSV::Norm2().

Referenced by SGNode::ComputeDerivedValues().

TSV DAGNode::GetTSV int    nDim const
 

Returns the node's TSV with dimension equal <nDim>. The TSV is filled with extra zeros if necessary.

The TSV of a node is composed of the eigen sums of its adjacent nodes and its own eigen sum.

Parameters:
nDim  specified the desired dimension. If zero, the current TSV dimension is used.

Definition at line 150 of file DAGNode.cpp.

References SmartArray< double >::GetSize().

istream & DAGNode::Read istream &    is [virtual]
 

Reads a DAGNode from the specified stream.

Precondition:
nodeLbl is a leda_string. Otherwise, this functios has to be modified.

Reimplemented in GGNode, and SGNode.

Definition at line 105 of file DAGNode.cpp.

References SmartArray< double >::Read(), and String::Read().

Referenced by SGNode::Read(), and GGNode::Read().

ostream & DAGNode::Write ostream &    os const [virtual]
 

Writes the DAGNode to the specified stream.

Precondition:
nodeLbl is a leda_string. Otherwise, this functios has to be modified.

Reimplemented in GGNode, and SGNode.

Definition at line 126 of file DAGNode.cpp.

References SmartArray< double >::Write(), and SmartArray< char >::Write().

Referenced by SGNode::Write(), and GGNode::Write().


The documentation for this class was generated from the following files:
Generated on Sat Nov 13 11:21:29 2004 for Noisy DAG Matcher by doxygen1.2.18