<div dir="ltr"><div class="markdown-here-wrapper" style="font-family:'Courier New'"><p style="margin:1.2em 0px!important">Hello Dr. Kisil,</p>
<p style="margin:1.2em 0px!important">The question from C. Trophime is not about evaluating the function but to define it.<br> <a href="http://www.feelpp.org">Feel++</a> is a Finite Element library that main goal is to solve the variational problem <code style="font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;margin:0px 0.15em;padding:0px 0.15em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">a(u,v)=f(v)</code> that arises from a lot of physical problems.</p>
<p style="margin:1.2em 0px!important">We use GiNaC to dynamically define the right hand side of our problem, or our boundaries conditions and whatever can be expressed with it.</p>
<p style="margin:1.2em 0px!important">The question - I guess - can be explained like that :<br>I would like to define </p>
<ul style="margin:1.2em 0px;padding-left:2em">
<li style="margin:0.2em 0px"><p style="margin:1.2em 0px!important;margin:0.5em 0px!important"><code style="font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;margin:0px 0.15em;padding:0px 0.15em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">f(x) = 2*x</code> if <code style="font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;margin:0px 0.15em;padding:0px 0.15em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">x>0</code> </p>
</li>
<li style="margin:0.2em 0px"><p style="margin:1.2em 0px!important;margin:0.5em 0px!important"><code style="font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;margin:0px 0.15em;padding:0px 0.15em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">f(x) = 3*x</code> if <code style="font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;margin:0px 0.15em;padding:0px 0.15em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">x<=0</code>.</p>
</li>
</ul>
<p style="margin:1.2em 0px!important">Thus, basically, I would like to write</p>
<pre style="font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="hljs language-c++" style="font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;margin:0px 0.15em;padding:0px 0.15em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248);white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)">
ex MyEx = (x<=<span class="hljs-number" style="color:rgb(0,128,128)">0</span>)?<span class="hljs-number" style="color:rgb(0,128,128)">3</span>*x:<span class="hljs-number" style="color:rgb(0,128,128)">2</span>*x
</code></pre>
<p style="margin:1.2em 0px!important">To my best knowledge, boolean expression are not handled in GiNaC, isn’t it ?</p>
<p style="margin:1.2em 0px!important">all the best,</p>
<p style="margin:1.2em 0px!important">Vincent H.</p>
<div title="MDH:PGRpdiBjbGFzcz0iZ21haWxfZGVmYXVsdCIgc3R5bGU9ImZvbnQtZmFtaWx5OiAnY291cmllciBu
ZXcnLCBtb25vc3BhY2U7Ij48ZGl2IGNsYXNzPSIiPkhlbGxvIERyLiBLaXNpbCw8L2Rpdj48ZGl2
IGNsYXNzPSIiPjxicj48L2Rpdj48ZGl2IHN0eWxlPSJmb250LWZhbWlseTogYXJpYWwsIHNhbnMt
c2VyaWY7Ij48ZGl2IGNsYXNzPSIiIHN0eWxlPSJmb250LWZ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iZ21haWxfZGVmYXVsdCIgc3R5bGU9ImRpc3BsYXk6IGlubGluZTsiPjxicj48L2Rpdj48
L2Rpdj48ZGl2IGNsYXNzPSIiPjxkaXYgY2xhc3M9ImdtYWlsX2RlZmF1bHQiIHN0eWxlPSJkaXNw
bGF5OiBpbmxpbmU7Ij5WaW5jZW50IEguPC9kaXY+PC9kaXY+PC9kaXY+PGRpdj48YnI+PC9kaXY+" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0"></div></div>-- <br><div class="gmail_signature"><div dir="ltr"><font face="courier new, monospace">Docteur Ingénieur de recherche</font><div><font face="courier new, monospace"><a href="http://www.cemosis.fr" target="_blank">CeMoSiS</a> - <a href="mailto:vincent.huber@cemosis.fr" target="_blank">vincent.huber@cemosis.fr</a></font></div><div><font face="courier new, monospace">Tel: +33 (0)3 68 8<b>5 02 06</b></font></div><div><font face="courier new, monospace">IRMA - 7, rue René Descartes</font></div><div><font face="courier new, monospace">67 000 Strasbourg</font></div><div><br></div><div><img src="http://www.google.com/a/cpanel/cemosis.fr/images/logo.gif"></div></div></div>
</div>