Commit 48391018 authored by David Speck's avatar David Speck

improved version of restrict

parent 7a7c38a9
This diff is collapsed.
......@@ -44,6 +44,9 @@ bool SymSearch::reconstructSolution(MEDDLY::dd_edge &target,
std::sort(
g_operators.begin(), g_operators.end(),
std::bind(higherCost, std::placeholders::_1, std::placeholders::_2));
} else {
//std::cout << "shuffle" << std::endl;
//std::reverse(g_operators.begin(), g_operators.end());
}
std::cout << "Beginning plan reconstruction: " << std::endl;
......
......@@ -10,8 +10,6 @@ FILES = ../meddly_extensions/genericBinaryOperator.h \
../meddly_extensions/userDefiniedOperators.h \
../meddly_extensions/restrict.h \
../meddly_extensions/swapVarPrimed.h \
../meddly_extensions/lessThan.h \
../meddly_extensions/lessThanApprox.h \
../meddly_extensions/swapToPrimedVar.h \
../meddly_extensions/partialComplement.h \
../meddly_extensions/minVar.h \
......
......@@ -467,7 +467,7 @@ TEST(minStates, random) {
}
}
TEST(lessThan, examplePaper) {
/*TEST(lessThan, examplePaper) {
int max = std::numeric_limits<int>::max();
int nVars = 3;
int limits[] = { 2, 2, 3 };
......@@ -693,4 +693,4 @@ TEST(lessThanApprox, examplePaper2) {
}
delete assigns;
assigns = nullptr;
}
}*/
......@@ -124,7 +124,7 @@ class restrictOp: public MEDDLY::unary_operation {
rp = resF->linkNode(ap);
rv = av;
MEDDLY::unpacked_node::recycle(A);
delete Key;
saveResult(Key, ap, rv, rp);
return;
}
// Is a node which we want to restrict to a value
......@@ -133,17 +133,12 @@ class restrictOp: public MEDDLY::unary_operation {
// this link is important
if (A->d(val) == -1) rp = -1;
else rp = resF->linkNode(A->d(val));
MEDDLY::unpacked_node::recycle(A);
saveResult(Key, ap, A->ei(val), rp);
rv = av + A->ei(val);
/*int tmp = av + A->ei(val);
if (av > 0 && A->ei(val) > 0 && tmp < 0) {
rv = std::numeric_limits<int>::max();
} else {
rv = tmp;
}*/
if (rv < 0)
rv = std::numeric_limits<int>::max();
MEDDLY::unpacked_node::recycle(A);
delete Key;
return;
}
......
......@@ -15,8 +15,6 @@ void initializeUserDefiniedOps() {
initializeSwapToPrimedVar();
initializeUnionMin();
initializeIntersectionMax();
initializeLessThan();
initializeLessThanApprox();
initializePartialComplement();
initializeMinStates();
}
......
......@@ -13,8 +13,6 @@
#include "./minVar.h"
#include "./swapVarPrimed.h"
#include "./swapToPrimedVar.h"
#include "./lessThan.h"
#include "./lessThanApprox.h"
#include "./partialComplement.h"
#include "./minStates.h"
#include "../resourcesHandle.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment