2
* \brief Bridge for C programs to access solve_VPSC (which is in C++)
5
* Tim Dwyer <tgdwyer@gmail.com>
7
* Copyright (C) 2005 Authors
9
* Released under GNU LGPL. Read the file 'COPYING' for more information.
11
#ifndef _CSOLVE_VPSC_H_
12
#define _CSOLVE_VPSC_H_
15
class vpsc::Constraint;
17
class vpsc::IncSolver;
21
typedef struct Variable Variable;
22
typedef struct Constraint Constraint;
23
typedef struct Solver Solver;
24
typedef struct IncSolver IncSolver;
26
Variable* newVariable(int id, double desiredPos, double weight);
27
void setVariableDesiredPos(Variable *, double desiredPos);
28
double getVariablePos(Variable*);
30
Constraint* newConstraint(Variable* left, Variable* right, double gap);
32
Solver* newSolver(int n, Variable* vs[], int m, Constraint* cs[]);
33
void deleteSolver(Solver*);
34
void deleteConstraint(Constraint*);
35
void deleteVariable(Variable*);
36
Constraint** newConstraints(int m);
37
void deleteConstraints(int m,Constraint**);
38
void remapInConstraints(Variable *u, Variable *v, double dgap);
39
void remapOutConstraints(Variable *u, Variable *v, double dgap);
40
int getLeftVarID(Constraint *c);
41
int getRightVarID(Constraint *c);
42
double getSeparation(Constraint *c);
45
typedef struct pointf_s { double x, y; } pointf;
46
typedef struct { pointf LL, UR; } boxf;
48
int genXConstraints(int n, boxf[], Variable** vs, Constraint*** cs,
49
int transitiveClosure);
50
int genYConstraints(int n, boxf[], Variable** vs, Constraint*** cs);
52
void satisfyVPSC(Solver*);
53
void solveVPSC(Solver*);
54
Solver* newIncSolver(int n, Variable* vs[], int m, Constraint* cs[]);
55
void splitIncSolver(IncSolver*);
56
int getSplitCnt(IncSolver *vpsc);
60
#endif /* _CSOLVE_VPSC_H_ */