<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks for the reply.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Please see, I have attached the code.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
HABEEB<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Roberto Bagnara <bagnara@cs.unipr.it><br>
<b>Sent:</b> Sunday, March 6, 2022 12:45 PM<br>
<b>To:</b> Habeeb P <habeebp@iisc.ac.in><br>
<b>Cc:</b> The Parma Polyhedra Library developers' list <ppl-devel@cs.unipr.it><br>
<b>Subject:</b> Re: [PPL-devel] Help regarding floating point constraints</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">External Email<br>
<br>
<br>
Hello Habeeb.<br>
<br>
Can you please attach a self-contained C++ program we<br>
can use to try reproducing your problem?<br>
<br>
Which version of the PPL are you using?<br>
We recommend  the current Git version, devel branch.<br>
You can find the repository at:<br>
<br>
   git://git.bugseng.com/ppl/ppl.git<br>
<br>
Thanks,<br>
<br>
    Roberto<br>
<br>
<br>
<br>
On 23/01/22 18:54, Habeeb P wrote:<br>
> Hi,<br>
><br>
> I am a Ph.D. student at the Indian Institute of Science, Bangalore, India.<br>
><br>
><br>
> I have been working on a project that requires a polyhedron.<br>
><br>
> The polyhedron has constraints with floating-point variables, as shown below in the following code snippet.<br>
> Wher /*p,u,v */and w are f*loating-poin*t values *between 0 and 1, u+v+w =1.*<br>
><br>
><br>
> Variablexp0(0);<br>
> Variableyp0(1);<br>
> Variablezp0(2);<br>
><br>
> Variableu(0);<br>
> Variablev(1);<br>
> Variablew(2);<br>
> Variablep(0);<br>
><br>
><br>
> int x0 = vertices[insideVertex*3+0];<br>
> int y0 = vertices[insideVertex*3+1];<br>
> int z0 = vertices[insideVertex*3+2];<br>
><br>
> int x1 = vertices[outsideVertex*3+0];<br>
> int y1 = vertices[outsideVertex*3+1];<br>
> int z1 = vertices[outsideVertex*3+2];<br>
><br>
><br>
> pd->add_constraint( u+v+w == 1);<br>
> pd->add_constraint(  u>=0) ;<br>
> pd->add_constraint( v>=0);<br>
> pd->add_constraint( w>=0);<br>
> pd->add_constraint( p>=0);<br>
> // pd->add_constraint( q>=0);<br>
> //  pd->add_constraint( p+q ==1);<br>
> pd->add_constraint(  ( (( p*(x0 - xp0)+ (1-p)*(x1 - xp0)) == (u*-35821+v*0+(w)*35821)) );<br>
> pd->add_constraint( ((p*(y0 - yp0)+  (1-p)*(y1 - yp0)) == (u*35821+v*0+(w)*35821)) );<br>
> pd->add_constraint( ((p*(z0 - zp0)+  (1-p)*(z1 - zp0)) == (u*-100000+v*0+(w)*-100000)));<br>
><br>
> pd->add_constraint( -( (24*p*(x0-xp0))+(24*(1-p)*(x1-xp0))) >= ((PixelX - 24)*(p*(z0-zp0)+ (1-p)*(z1-zp0)) ) );<br>
> pd->add_constraint( -( (24*p*(x0-xp0))+(24*(1-p)*(x1-xp0))) < ((PixelX+1 - 24)*(p*(z0-zp0)+ (1-p)*(z1-zp0)) ) );<br>
><br>
> pd->add_constraint( ( 24*p*(y0-yp0) + 24* (1-p)*(y1-yp0) ) >= ( (PixelY-24) * (p*(z0-zp0)+ (1-p)*(z1-zp0)) ) );<br>
> pd->add_constraint( ( 24*p*(y0-yp0) + 24* (1-p)*(y1-yp0) ) < ( (PixelY-24+1) * (p*(z0-zp0)+ (1-p)*(z1-zp0)) ) );<br>
><br>
><br>
><br>
><br>
><br>
> While compiling the program, I am getting the following error;<br>
><br>
><br>
> error: no match for ‘operator*’ (operand types are ‘Parma_Polyhedra_Library::Variable’ and ‘Parma_Polyhedra_Library::Linear_Expression’)<br>
>    116 |                  pd->add_constraint(  ( (( p*(x0 - xp0)+ (1-p)*(x1 - xp0)) == (u*-35821+v*0+(w)*35821)) );<br>
>        |                                            ~^~~~~~~~~~~<br>
>        |                                            |     |<br>
>        |                                            |     Parma_Polyhedra_Library::Linear_Expression<br>
>        |                                            Parma_Polyhedra_Library::Variable<br>
><br>
><br>
> Is there any way to get rid of this error?<br>
><br>
><br>
> Is it possible to write my constraints using PPL (using either floating-point expression or intervals)?<br>
><br>
><br>
><br>
> Thanks<br>
> HABEEB<br>
><br>
> _______________________________________________<br>
> PPL-devel mailing list<br>
> PPL-devel@cs.unipr.it<br>
> <a href="https://www.cs.unipr.it/mailman/listinfo/ppl-devel">https://www.cs.unipr.it/mailman/listinfo/ppl-devel</a><br>
</div>
</span></font></div>
</body>
</html>