5 #include "ordergraph.h"
7 Order *allocOrder(OrderType type, Set *set) {
8 Order *This = (Order *)ourmalloc(sizeof(Order));
10 initDefVectorBooleanOrder(&This->constraints);
12 initOrderEncoding(&This->order, This);
13 This->orderPairTable = NULL;
18 void initializeOrderHashTable(Order *This) {
19 This->orderPairTable = allocHashTableOrderPair(HT_INITIAL_CAPACITY, HT_DEFAULT_FACTOR);
22 void addOrderConstraint(Order *This, BooleanOrder *constraint) {
23 pushVectorBooleanOrder( &This->constraints, constraint);
26 void setOrderEncodingType(Order *This, OrderEncodingType type) {
27 This->order.type = type;
30 void deleteOrder(Order *This) {
31 deleteVectorArrayBooleanOrder(&This->constraints);
32 deleteOrderEncoding(&This->order);
33 if (This->orderPairTable != NULL) {
34 resetAndDeleteHashTableOrderPair(This->orderPairTable);
35 deleteHashTableOrderPair(This->orderPairTable);
37 if (This->graph != NULL) {
38 deleteOrderGraph(This->graph);