cudd  3.0.0
The University of Colorado Decision Diagram Package
mtr.h
Go to the documentation of this file.
1 
58 #ifndef MTR_H_
59 #define MTR_H_
60 
61 /*---------------------------------------------------------------------------*/
62 /* Nested includes */
63 /*---------------------------------------------------------------------------*/
64 
65 #include <stdio.h>
66 
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70 
71 /*---------------------------------------------------------------------------*/
72 /* Constant declarations */
73 /*---------------------------------------------------------------------------*/
74 
75 /* Flag definitions */
76 #define MTR_DEFAULT 0x00000000
77 #define MTR_TERMINAL 0x00000001
78 #define MTR_SOFT 0x00000002
79 #define MTR_FIXED 0x00000004
80 #define MTR_NEWNODE 0x00000008
81 
82 /*---------------------------------------------------------------------------*/
83 /* Stucture declarations */
84 /*---------------------------------------------------------------------------*/
85 
86 
87 /*---------------------------------------------------------------------------*/
88 /* Type declarations */
89 /*---------------------------------------------------------------------------*/
90 
94 typedef struct MtrNode_ MtrNode;
95 
96 /*---------------------------------------------------------------------------*/
97 /* Variable declarations */
98 /*---------------------------------------------------------------------------*/
99 
100 
101 /*---------------------------------------------------------------------------*/
102 /* Macro declarations */
103 /*---------------------------------------------------------------------------*/
104 
105 /*---------------------------------------------------------------------------*/
106 /* Function prototypes */
107 /*---------------------------------------------------------------------------*/
108 
109 MtrNode * Mtr_AllocNode(void);
110 void Mtr_DeallocNode(MtrNode *node);
111 MtrNode * Mtr_InitTree(void);
112 void Mtr_FreeTree(MtrNode *node);
113 MtrNode * Mtr_CopyTree(MtrNode const *node, int expansion);
114 void Mtr_MakeFirstChild(MtrNode *parent, MtrNode *child);
115 void Mtr_MakeLastChild(MtrNode *parent, MtrNode *child);
118 void Mtr_MakeNextSibling(MtrNode *first, MtrNode *second);
119 void Mtr_PrintTree(MtrNode const *node);
120 MtrNode * Mtr_InitGroupTree(int lower, int size);
121 MtrNode * Mtr_MakeGroup(MtrNode *root, unsigned int low, unsigned int high, unsigned int flags);
123 MtrNode * Mtr_FindGroup(MtrNode *root, unsigned int low, unsigned int high);
124 int Mtr_SwapGroups(MtrNode *first, MtrNode *second);
125 void Mtr_ReorderGroups(MtrNode *treenode, int *permutation);
126 void Mtr_PrintGroups(MtrNode const *root, int silent);
127 int Mtr_PrintGroupedOrder(MtrNode const * root, int const *invperm, FILE *fp);
128 MtrNode * Mtr_ReadGroups(FILE *fp, int nleaves);
129 
130 #ifdef __cplusplus
131 }
132 #endif
133 
134 #endif /* MTR_H_ */
void Mtr_PrintGroups(MtrNode const *root, int silent)
Prints the groups as a parenthesized list.
Definition: mtrGroup.c:565
void Mtr_MakeLastChild(MtrNode *parent, MtrNode *child)
Makes child the last child of parent.
Definition: mtrBasic.c:266
multi-way tree node.
Definition: mtrInt.h:109
void Mtr_FreeTree(MtrNode *node)
Disposes of tree rooted at node.
Definition: mtrBasic.c:160
void Mtr_MakeNextSibling(MtrNode *first, MtrNode *second)
Makes second the next sibling of first.
Definition: mtrBasic.c:351
void Mtr_ReorderGroups(MtrNode *treenode, int *permutation)
Fix variable tree at the end of tree sifting.
Definition: mtrGroup.c:497
MtrNode * Mtr_DissolveGroup(MtrNode *group)
Merges the children of ‘group’ with the children of its parent.
Definition: mtrGroup.c:329
int Mtr_PrintGroupedOrder(MtrNode const *root, int const *invperm, FILE *fp)
Prints the variable order as a parenthesized list.
Definition: mtrGroup.c:631
MtrNode * Mtr_CopyTree(MtrNode const *node, int expansion)
Makes a copy of tree.
Definition: mtrBasic.c:187
MtrNode * Mtr_ReadGroups(FILE *fp, int nleaves)
Reads groups from a file and creates a group tree.
Definition: mtrGroup.c:724
void Mtr_MakeFirstChild(MtrNode *parent, MtrNode *child)
Makes child the first child of parent.
Definition: mtrBasic.c:238
MtrNode * Mtr_AllocNode(void)
Allocates new tree node.
Definition: mtrBasic.c:97
MtrNode * Mtr_CreateFirstChild(MtrNode *parent)
Creates a new node and makes it the first child of parent.
Definition: mtrBasic.c:301
void Mtr_DeallocNode(MtrNode *node)
Deallocates tree node.
Definition: mtrBasic.c:117
MtrNode * Mtr_InitGroupTree(int lower, int size)
Allocate new tree.
Definition: mtrGroup.c:101
MtrNode * Mtr_InitTree(void)
Initializes tree with one node.
Definition: mtrBasic.c:137
void Mtr_PrintTree(MtrNode const *node)
Prints a tree, one node per line.
Definition: mtrBasic.c:376
MtrNode * Mtr_CreateLastChild(MtrNode *parent)
Creates a new node and makes it the last child of parent.
Definition: mtrBasic.c:327
int Mtr_SwapGroups(MtrNode *first, MtrNode *second)
Swaps two children of a tree node.
Definition: mtrGroup.c:438
MtrNode * Mtr_MakeGroup(MtrNode *root, unsigned int low, unsigned int high, unsigned int flags)
Makes a new group with size leaves starting at low.
Definition: mtrGroup.c:137
MtrNode * Mtr_FindGroup(MtrNode *root, unsigned int low, unsigned int high)
Finds a group with size leaves starting at low, if it exists.
Definition: mtrGroup.c:379