index b78b01054fa715871f200336d4fc3ac53cc948fb..bd7db5ab21ffb0b41d7d3f1b4bd4a2a3ec8a979e 100644 (file)
#include "generate-constraints.h"
#include "solve_VPSC.h"
#include "csolve_VPSC.h"
+using namespace vpsc;
extern "C" {
Variable* newVariable(int id, double desiredPos, double weight) {
return new Variable(id,desiredPos,weight);
Constraint* newConstraint(Variable* left, Variable* right, double gap) {
return new Constraint(left,right,gap);
}
-VPSC* newVPSC(int n, Variable* vs[], int m, Constraint* cs[]) {
- return new VPSC(n,vs,m,cs);
+Solver* newSolver(int n, Variable* vs[], int m, Constraint* cs[]) {
+ return new Solver(n,vs,m,cs);
}
-VPSC* newIncVPSC(int n, Variable* vs[], int m, Constraint* cs[]) {
- return (VPSC*)new IncVPSC(n,vs,m,cs);
+Solver* newIncSolver(int n, Variable* vs[], int m, Constraint* cs[]) {
+ return (Solver*)new vpsc::IncSolver(n,vs,m,cs);
}
int genXConstraints(int n, boxf* bb, Variable** vs, Constraint*** cs,int transitiveClosure) {
void deleteVariable(Variable* v) {
delete v;
}
-void satisfyVPSC(VPSC* vpsc) {
+void satisfyVPSC(Solver* vpsc) {
try {
vpsc->satisfy();
} catch(const char *e) {
exit(1);
}
}
-int getSplitCnt(IncVPSC *vpsc) {
+int getSplitCnt(IncSolver *vpsc) {
return vpsc->splitCnt;
}
-void deleteVPSC(VPSC *vpsc) {
+void deleteVPSC(Solver *vpsc) {
assert(vpsc!=NULL);
delete vpsc;
}
-void solveVPSC(VPSC* vpsc) {
+void solveVPSC(Solver* vpsc) {
vpsc->solve();
}
-void splitIncVPSC(IncVPSC* vpsc) {
+void splitIncVPSC(IncSolver* vpsc) {
vpsc->splitBlocks();
}
void setVariableDesiredPos(Variable *v, double desiredPos) {