PC::PowerCircuitCompMatrix Class Reference

#include <PowerCircuitCompMatrix.h>

Inheritance diagram for PC::PowerCircuitCompMatrix:
PC::PowerCircuit

List of all members.

Classes

struct  ColHdr
struct  IntMarking
struct  IntNode
struct  RowHdr

Public Member Functions

 PowerCircuitCompMatrix (int numInitNodes=0, int numInitCols=0)
virtual ~PowerCircuitCompMatrix ()
virtual void reduce ()
virtual void reduce (std::vector< Node > &nodeVector, std::vector< Marking > &markingVector)
virtual Marking createMarking (int i=0)
virtual Marking createMarking (const std::list< Node > &nodes)
virtual Marking createMarking (const std::list< Node > &nodeList, const std::list< int > &signList)
virtual Node createNode (const Marking &succ)
virtual void connect (const Marking &m, const Marking &p)
virtual void connectInv (const Marking &m, const Marking &q)
virtual void remove (const Marking &m)
virtual Node getReducedNode (unsigned int ord)
virtual std::list< NodegetNodes ()
virtual std::list< MarkinggetMarkings ()
virtual std::list< NodegetMarkingNodes (const Marking &m)
virtual PowerCircuitclone (std::vector< Marking > &markingsToKeep)
virtual void print (std::ostream &os=std::cout)
double getMatrixUsage ()
virtual void printStatistics (std::ostream &os=std::cout)

Private Types

enum  MarkingType { NORMAL, LAMBDA }
typedef std::vector< IntMarkingMarkingVector
typedef std::vector< IntNodeNodeVector

Private Member Functions

bool checkMarkingValid (const Marking &m) const
bool checkNodeValid (Node n) const
void deleteNode (Row node)
void deleteCol (Col col)
void deleteMarking (Marking &mark)
Marking allocateNewMarking (Col col)
Row newNodeFromMarking (const Marking &mark)
Row newOneNode ()
Row cloneNode (Row node)
Marking newOneMarking ()
Marking newZeroMarking ()
Marking newUnitMarking (int onePos)
Marking newCopyColMarking (const Marking &mark)
void separateMarkingFromCol (const Marking &m)
void mergeCols (Col targetCol, Col col2)
int getTreedNodePosToGivenCol (Col col)
void moveNodeIntoTreedPartOfMatrix (Row node, int newPos)
int findNewPosOfCompactCol (Col col, bool &equal)
void compactifyFromBottom (Col col)
void insertNewPowerOfTwoNode (unsigned int power)
unsigned int calculateCompactRepresentation (int n, Sign result[32])
void setBV (Row node)
void newDoubleNode (Row node)
void compactify (Col col)
void removeDoubleNodesFromMarkings (Row oldNode, Row newNode)
int insertCompactMarkingIntoTreed (const Marking &mark)
int insertCompactColIntoTreed (Col col)
int insertNodeIntoTreed (Row node)
void moveColsToTreed (std::list< Col > &colList)
void topSortNode (unsigned int nodeIndex, std::vector< Row > &nodesToSort, std::vector< bool > &visited, std::vector< Row > &topSortPerm)
void extendTree (std::vector< Row > &nodeList, std::vector< Col > &colList)
void checkCyclesRecursive (Row node, std::vector< bool > visited)
void checkCycles ()
virtual void incMarkingRefCount (const Marking &mark)
virtual void decMarkingRefCount (Marking &mark)
virtual Marking addMarkings (const Marking &m1, const Marking &m2)
virtual Marking invMarking (const Marking &m)
virtual Marking incMarking (const Marking &mark)
virtual Marking intersectMarkings (const Marking &m1, const Marking &m2)
virtual Marking cloneMarking (const Marking &mark)
virtual Node cloneNode (Node n)
virtual Marking copyMarking (const Marking &m)
virtual bool isMarkingReduced (const Marking &m) const
virtual int compareMarkings (const Marking &m1, const Marking &m2)
virtual int getRedNodeOrd (Node n)
virtual int getNodeSignInMarking (Node n, const Marking &m) const
virtual bool isSuccessorMarking (const Marking &m) const
virtual Node getIncidentNode (const Marking &m)
virtual Node getSmallestNodeInMarking (const Marking &m)
virtual Marking getSuccMarking (Node n)

Private Attributes

SignMatrix< RowHdr, ColHdr,
unsigned int > 
matrix
unsigned int numTreedCols
unsigned int numTreedNodes

Static Private Attributes

static MarkingVector markings
static NodeVector nodes
static unsigned int totalNumMarkings
static unsigned int totalNumNodes
static int firstDeletedMarking
static int firstDeletedNode

Detailed Description

Definition at line 14 of file PowerCircuitCompMatrix.h.


Member Typedef Documentation

typedef std::vector<IntMarking> PC::PowerCircuitCompMatrix::MarkingVector [private]

Definition at line 65 of file PowerCircuitCompMatrix.h.

typedef std::vector<IntNode> PC::PowerCircuitCompMatrix::NodeVector [private]

Definition at line 66 of file PowerCircuitCompMatrix.h.


Member Enumeration Documentation

Enumerator:
NORMAL 
LAMBDA 

Definition at line 42 of file PowerCircuitCompMatrix.h.


Constructor & Destructor Documentation

PC::PowerCircuitCompMatrix::PowerCircuitCompMatrix ( int  numInitNodes = 0,
int  numInitCols = 0 
)
virtual PC::PowerCircuitCompMatrix::~PowerCircuitCompMatrix (  )  [virtual]

Member Function Documentation

virtual Marking PC::PowerCircuitCompMatrix::addMarkings ( const Marking m1,
const Marking m2 
) [private, virtual]

Implements PC::PowerCircuit.

Marking PC::PowerCircuitCompMatrix::allocateNewMarking ( Col  col  )  [private]
unsigned int PC::PowerCircuitCompMatrix::calculateCompactRepresentation ( int  n,
Sign  result[32] 
) [private]
void PC::PowerCircuitCompMatrix::checkCycles (  )  [private]
void PC::PowerCircuitCompMatrix::checkCyclesRecursive ( Row  node,
std::vector< bool >  visited 
) [private]
bool PC::PowerCircuitCompMatrix::checkMarkingValid ( const Marking m  )  const [private]
bool PC::PowerCircuitCompMatrix::checkNodeValid ( Node  n  )  const [private]
virtual PowerCircuit* PC::PowerCircuitCompMatrix::clone ( std::vector< Marking > &  markingsToClone  )  [virtual]

Makes a copy of a PowerCircuit. Only the markings in the markingsToClone list are available in the cloned circuit. Reduced nodes and markings are remain reduced. The clone has to be deallocated via delete, once it is not needed anymore!

Implements PC::PowerCircuit.

virtual Marking PC::PowerCircuitCompMatrix::cloneMarking ( const Marking mark  )  [private, virtual]

Implements PC::PowerCircuit.

virtual Node PC::PowerCircuitCompMatrix::cloneNode ( Node  n  )  [private, virtual]

Implements PC::PowerCircuit.

Row PC::PowerCircuitCompMatrix::cloneNode ( Row  node  )  [private]
void PC::PowerCircuitCompMatrix::compactify ( Col  col  )  [private]
void PC::PowerCircuitCompMatrix::compactifyFromBottom ( Col  col  )  [private]
virtual int PC::PowerCircuitCompMatrix::compareMarkings ( const Marking m1,
const Marking m2 
) [private, virtual]

Implements PC::PowerCircuit.

virtual void PC::PowerCircuitCompMatrix::connect ( const Marking m,
const Marking p 
) [virtual]

Adds the marking p to all successor markings of nodes in the support of m. (So, if supp(m) and supp(p) are disjoint, that means, that arrows are drawn from all nodes in supp(m) to p). The user has to assure that, for each node, the sum lies in the range [-1,+1] (for example using clone())! The user is required to check that the resulting graph has no cycles and no successor marking becomes negative. All nodes in supp(m) have to be non-reduced (use clone() to assure that).

Implements PC::PowerCircuit.

virtual void PC::PowerCircuitCompMatrix::connectInv ( const Marking m,
const Marking p 
) [virtual]

The same as connect, only that the marking p is subtracted instead of added.

Implements PC::PowerCircuit.

virtual Marking PC::PowerCircuitCompMatrix::copyMarking ( const Marking m  )  [private, virtual]

Implements PC::PowerCircuit.

virtual Marking PC::PowerCircuitCompMatrix::createMarking ( const std::list< Node > &  nodeList,
const std::list< int > &  signList 
) [virtual]

Creates a new marking, with the nodes in nodeList set to the respective sign in signList.

Implements PC::PowerCircuit.

virtual Marking PC::PowerCircuitCompMatrix::createMarking ( const std::list< Node > &  nodes  )  [virtual]

Creates a new marking, with the nodes in nodeList set to 1.

Implements PC::PowerCircuit.

virtual Marking PC::PowerCircuitCompMatrix::createMarking ( int  i = 0  )  [virtual]

Creates a new marking with value val. The therefore required nodes are inserted into the reduced part of the PC.

Implements PC::PowerCircuit.

virtual Node PC::PowerCircuitCompMatrix::createNode ( const Marking succ  )  [virtual]

Creates a new node with a copy of m as successor-marking.

Implements PC::PowerCircuit.

virtual void PC::PowerCircuitCompMatrix::decMarkingRefCount ( Marking mark  )  [private, virtual]

Implements PC::PowerCircuit.

void PC::PowerCircuitCompMatrix::deleteCol ( Col  col  )  [private]
void PC::PowerCircuitCompMatrix::deleteMarking ( Marking mark  )  [private]
void PC::PowerCircuitCompMatrix::deleteNode ( Row  node  )  [private]
void PC::PowerCircuitCompMatrix::extendTree ( std::vector< Row > &  nodeList,
std::vector< Col > &  colList 
) [private]
int PC::PowerCircuitCompMatrix::findNewPosOfCompactCol ( Col  col,
bool &  equal 
) [private]
virtual Node PC::PowerCircuitCompMatrix::getIncidentNode ( const Marking m  )  [private, virtual]

Implements PC::PowerCircuit.

virtual std::list<Node> PC::PowerCircuitCompMatrix::getMarkingNodes ( const Marking m  )  [virtual]

Returns a list of all nodes which are non-zero in the marking m.

Implements PC::PowerCircuit.

virtual std::list<Marking> PC::PowerCircuitCompMatrix::getMarkings (  )  [virtual]

Returns a list of all markings in the PowerCircuit.

Implements PC::PowerCircuit.

double PC::PowerCircuitCompMatrix::getMatrixUsage (  ) 
virtual std::list<Node> PC::PowerCircuitCompMatrix::getNodes (  )  [virtual]

Returns a list of all nodes in the PowerCircuit.

Implements PC::PowerCircuit.

virtual int PC::PowerCircuitCompMatrix::getNodeSignInMarking ( Node  n,
const Marking m 
) const [private, virtual]

Implements PC::PowerCircuit.

virtual int PC::PowerCircuitCompMatrix::getRedNodeOrd ( Node  n  )  [private, virtual]

Implements PC::PowerCircuit.

virtual Node PC::PowerCircuitCompMatrix::getReducedNode ( unsigned int  ord  )  [virtual]

Returns the node with index ord (that means there are ord smaller nodes in the reduced part of the PC) If there are less than ord nodes, the undefined node is returned.

Implements PC::PowerCircuit.

virtual Node PC::PowerCircuitCompMatrix::getSmallestNodeInMarking ( const Marking m  )  [private, virtual]

Implements PC::PowerCircuit.

virtual Marking PC::PowerCircuitCompMatrix::getSuccMarking ( Node  n  )  [private, virtual]

Implements PC::PowerCircuit.

int PC::PowerCircuitCompMatrix::getTreedNodePosToGivenCol ( Col  col  )  [private]
virtual Marking PC::PowerCircuitCompMatrix::incMarking ( const Marking mark  )  [private, virtual]

Implements PC::PowerCircuit.

virtual void PC::PowerCircuitCompMatrix::incMarkingRefCount ( const Marking mark  )  [private, virtual]

Implements PC::PowerCircuit.

int PC::PowerCircuitCompMatrix::insertCompactColIntoTreed ( Col  col  )  [private]
int PC::PowerCircuitCompMatrix::insertCompactMarkingIntoTreed ( const Marking mark  )  [private]
void PC::PowerCircuitCompMatrix::insertNewPowerOfTwoNode ( unsigned int  power  )  [private]
int PC::PowerCircuitCompMatrix::insertNodeIntoTreed ( Row  node  )  [private]
virtual Marking PC::PowerCircuitCompMatrix::intersectMarkings ( const Marking m1,
const Marking m2 
) [private, virtual]

Implements PC::PowerCircuit.

virtual Marking PC::PowerCircuitCompMatrix::invMarking ( const Marking m  )  [private, virtual]

Implements PC::PowerCircuit.

virtual bool PC::PowerCircuitCompMatrix::isMarkingReduced ( const Marking m  )  const [private, virtual]

Implements PC::PowerCircuit.

virtual bool PC::PowerCircuitCompMatrix::isSuccessorMarking ( const Marking m  )  const [private, virtual]

Implements PC::PowerCircuit.

void PC::PowerCircuitCompMatrix::mergeCols ( Col  targetCol,
Col  col2 
) [private]
void PC::PowerCircuitCompMatrix::moveColsToTreed ( std::list< Col > &  colList  )  [private]
void PC::PowerCircuitCompMatrix::moveNodeIntoTreedPartOfMatrix ( Row  node,
int  newPos 
) [private]
Marking PC::PowerCircuitCompMatrix::newCopyColMarking ( const Marking mark  )  [private]
void PC::PowerCircuitCompMatrix::newDoubleNode ( Row  node  )  [private]
Row PC::PowerCircuitCompMatrix::newNodeFromMarking ( const Marking mark  )  [private]
Marking PC::PowerCircuitCompMatrix::newOneMarking (  )  [private]
Row PC::PowerCircuitCompMatrix::newOneNode (  )  [private]
Marking PC::PowerCircuitCompMatrix::newUnitMarking ( int  onePos  )  [private]
Marking PC::PowerCircuitCompMatrix::newZeroMarking (  )  [private]
virtual void PC::PowerCircuitCompMatrix::print ( std::ostream &  os = std::cout  )  [virtual]

Prints the adjacency matrix of the underlying graph.

Implements PC::PowerCircuit.

virtual void PC::PowerCircuitCompMatrix::printStatistics ( std::ostream &  os = std::cout  )  [virtual]

Prints some statistical data.

Reimplemented from PC::PowerCircuit.

virtual void PC::PowerCircuitCompMatrix::reduce ( std::vector< Node > &  nodeVector,
std::vector< Marking > &  markingVector 
) [virtual]

Moves all nodes in nodeList and markings in markingList to the reduced part of the PC. Nodes in nodeList MUST NOT be reduced! The support of markings in markingList has to be in nodeList or the already reduced part of the PC.

Implements PC::PowerCircuit.

virtual void PC::PowerCircuitCompMatrix::reduce (  )  [virtual]

Reduces the whole PC and all its markings.

Implements PC::PowerCircuit.

virtual void PC::PowerCircuitCompMatrix::remove ( const Marking m  )  [virtual]

Deletes all nodes in the given marking. (So if other markings use those nodes, their values may be changed!)

Implements PC::PowerCircuit.

void PC::PowerCircuitCompMatrix::removeDoubleNodesFromMarkings ( Row  oldNode,
Row  newNode 
) [private]
void PC::PowerCircuitCompMatrix::separateMarkingFromCol ( const Marking m  )  [private]
void PC::PowerCircuitCompMatrix::setBV ( Row  node  )  [private]
void PC::PowerCircuitCompMatrix::topSortNode ( unsigned int  nodeIndex,
std::vector< Row > &  nodesToSort,
std::vector< bool > &  visited,
std::vector< Row > &  topSortPerm 
) [private]

Member Data Documentation

Definition at line 72 of file PowerCircuitCompMatrix.h.

Definition at line 73 of file PowerCircuitCompMatrix.h.

Definition at line 68 of file PowerCircuitCompMatrix.h.

Definition at line 35 of file PowerCircuitCompMatrix.h.

Definition at line 69 of file PowerCircuitCompMatrix.h.

Definition at line 36 of file PowerCircuitCompMatrix.h.

Definition at line 37 of file PowerCircuitCompMatrix.h.

unsigned int PC::PowerCircuitCompMatrix::totalNumMarkings [static, private]

Definition at line 70 of file PowerCircuitCompMatrix.h.

unsigned int PC::PowerCircuitCompMatrix::totalNumNodes [static, private]

Definition at line 71 of file PowerCircuitCompMatrix.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Mon Sep 26 18:43:54 2011 for CRyptography And Groups (CRAG) by  doxygen 1.6.1