csolve_VPSC.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * \brief Bridge for C programs to access solve_VPSC (which is in C++)
  3. *
  4. * Authors:
  5. * Tim Dwyer <[email protected]>
  6. *
  7. * Copyright (C) 2005 Authors
  8. *
  9. * This version is released under the CPL (Common Public License) with
  10. * the Graphviz distribution.
  11. * A version is also available under the LGPL as part of the Adaptagrams
  12. * project: https://github.com/mjwybrow/adaptagrams.
  13. * If you make improvements or bug fixes to this code it would be much
  14. * appreciated if you could also contribute those changes back to the
  15. * Adaptagrams repository.
  16. */
  17. #pragma once
  18. #include <stdbool.h>
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. typedef struct Variable Variable;
  23. Variable* newVariable(int id, double desiredPos, double weight);
  24. void setVariableDesiredPos(Variable *, double desiredPos);
  25. double getVariablePos(const Variable*);
  26. typedef struct Constraint Constraint;
  27. Constraint* newConstraint(Variable* left, Variable* right, double gap);
  28. typedef struct VPSC VPSC;
  29. void deleteVPSC(VPSC*);
  30. void deleteConstraint(Constraint*);
  31. void deleteVariable(Variable*);
  32. Constraint** newConstraints(int m);
  33. void deleteConstraints(int m,Constraint**);
  34. void remapInConstraints(Variable *u, Variable *v, double dgap);
  35. void remapOutConstraints(Variable *u, Variable *v, double dgap);
  36. #ifndef HAVE_POINTF_S
  37. typedef struct pointf_s { double x, y; } pointf;
  38. typedef struct { pointf LL, UR; } boxf;
  39. #endif
  40. int genXConstraints(int n, boxf[], Variable** vs, Constraint*** cs,
  41. bool transitiveClosure);
  42. int genYConstraints(int n, boxf[], Variable** vs, Constraint*** cs);
  43. void satisfyVPSC(VPSC*);
  44. void solveVPSC(VPSC*);
  45. typedef struct IncVPSC IncVPSC;
  46. VPSC* newIncVPSC(int n, Variable* vs[], int m, Constraint* cs[]);
  47. #ifdef __cplusplus
  48. }
  49. #endif