-
Notifications
You must be signed in to change notification settings - Fork 0
/
ppl_solver.hpp
90 lines (81 loc) · 3.37 KB
/
ppl_solver.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#ifndef __PPL_SOLVER_HPP_
#define __PPL_SOLVER_HPP_
/*****************************************************************************\
* This file is part of DynGB. *
* *
* DynGB is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 2 of the License, or *
* (at your option) any later version. *
* *
* DynGB is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with DynGB. If not, see <http://www.gnu.org/licenses/>. *
\*****************************************************************************/
#include <ppl.hh>
namespace PPL = Parma_Polyhedra_Library;
#include "system_constants.hpp"
#include "lp_solver.hpp"
namespace LP_Solvers {
/**
@brief approximate skeleton of a polyhedral cone, using PPL linear solver
@author John Perry
\version 1.0
@date January 2017
@copyright The University of Southern Mississippi
@ingroup CLSSolvers
@details This class serves as an interface to PPL @cite BagnaraHZ08SCP,
which we can use to find the skeleton to a polyhedral cone.
*/
class PPL_Solver : public LP_Solver {
public:
/** @name Construction */
///@{
/** @brief initializes solver for @f$ n @f$ variables */
explicit PPL_Solver(NVAR_TYPE n);
/** @brief copy constructor (deep copy) */
explicit PPL_Solver(const PPL_Solver &);
virtual bool copy(const LP_Solver *) override;
///@}
/** @name Destruction */
///@{
virtual ~PPL_Solver();
///@}
/** @name Basic properties */
///@{
virtual NVAR_TYPE get_dimension() const override { return n; }
virtual unsigned long get_number_of_constraints() const override { return m; }
///@}
/** @name Modification */
///@{
PPL_Solver & operator = (const PPL_Solver &);
virtual bool solve(const Constraint &) override;
virtual bool solve(const vector<Constraint> &) override;
/** @brief clear the current set of rays and extracts the ones contained in lp */
virtual void setup_rays();
///@}
/** @name I/O */
///@{
friend ostream & operator<<(ostream & os, const PPL_Solver & s);
///@}
protected:
PPL::NNC_Polyhedron * lp; /**< @brief PPL problem interface */
NVAR_TYPE n; /**< @brief number of variables */
unsigned m; /**< @brief number of constraints */
static unsigned instances; /**< @brief number of PPL instances */
PPL::Variable ** X; /**< @brief array of variables */
RAYENT_TYPE * ray_data; /**< @brief used to retrieve rays */
};
/**
@brief prints out the constraints, then the rays, then the edges of @p s.
@param os output stream to print to
@param s skeleton to print
@return the output stream
*/
ostream & operator<<(ostream & os, const PPL_Solver & s);
}
#endif