
-------- Original Message -------- Subject: Re: [PPL-devel] Linear constraint solving example with floating point co-efficients Date: Wed, 24 Aug 2011 02:55:32 -0400 From: Mahesh Nanjundappa knmahesh@vt.edu To: Roberto Bagnara bagnara@cs.unipr.it
Hello Dr. Bagnara,
Sorry if I bothered you and thanks for getting back to me despite your busy schedule. I've been going through the documentation and the sample examples from past 2 days. My purpose is more than the solving the linear system. But frankly speaking, I've not been to get any simple example compiled with floating point coefficients. I was looking for a pointer to any example which is solved with floating point coefficients.
Again, thanks for getting back to me.
Regards, Mahesh
On Wed, Aug 24, 2011 at 2:34 AM, Roberto Bagnara <bagnara@cs.unipr.it mailto:bagnara@cs.unipr.it> wrote:
On 08/23/11 15:31, Mahesh Nanjundappa wrote:
Hi all,
Please don't feel annoyed by this request. I did try for looking for examples in the folder I downloaded and in the manual. But couldnt find what I was looking for.
I'm looking for a simple example where a linear constraint system with floating point coefficients (variables can also take floating point values) is solved and output is printed to either file or stdout. I don't have strict requirement to number of decimal points it has to be accurately computed. I'm fine with just 2 decimal points.
The system can be as simple as this,
1.2*x + 2.3y <= 8.2 2.2*x + 1.4*y <= 7.1
This one example I tried out but with integer coefficients. #include <ppl.hh> #include "ppl_c.h"
using namespace Parma_Polyhedra_Library;
int main() {
Variable x(0); Variable y(1); Constraint_System CS;
Linear_Expression LE1 = 1*x + 2*y; Linear_Expression LE2 = 2*x + 1*y;
CS.insert(LE1 <= 7); CS.insert(LE2 <= 5);
C_Polyhedron P(CS);
return 0; }
It would be great if someone can help me out with this by providing an example or code for the system I described earlier.
Thanks in advance, Mahesh
Hi Mahesh.
There is really no way you can use the PPL without even looking at its documentation. Good luck,
Roberto
-- Prof. Roberto Bagnara Applied Formal Methods Laboratory Department of Mathematics, University of Parma, Italy http://www.cs.unipr.it/~__bagnara/ http://www.cs.unipr.it/~bagnara/ mailto:bagnara@cs.unipr.it mailto:bagnara@cs.unipr.it