<html><head><style type="text/css"><!-- DIV {margin:0px} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hi All,<br><br>I'm working on the problem of portfolio
optimization. I'm modifying the stampl.cpp written
by Tim. A basic feature we're adding is a MP_variable Liability at each
stage to denote the liability. From one year to another we can compute
a "total return" by<br><br>MP_variable total return = sum(new asset value)/sum(asset value one-year ago)<br><br>Then we'll calculate<br><br>MP_variable Liability() = parent-&gt;Liability() * (some function based on total return);<br><br>In
FlopC++ the operation of division of two "sum"s is not computable, so
we need to circumvent it. What I did is to write it as a constraint:<br><br>MP_constraint PortfReturn( ) = sum( INSTR, parent-&gt;Buy( INSTR ) ) * TotalReturn() &gt;= sum(INSTR,
 parent-&gt;Buy(INSTR) * Return(INSTR));<br><br>Then another constraint to compute the new liability:<br><br>MP_constraint NewLiability( ) = Liability( ) == parent-&gt;Liability( ) * TotalReturn( );<br><br>The
problem is that these two lines won't compile. For the first line the
error is ".\portfopt.cpp(81) : error C2678: binary '*' : no operator
found which takes a left-hand operand of type 'flopc::MP_expression'
(or there is no acceptable conversion)"; for the second is
".\portfopt.cpp(82) : error C2678: binary '*' : no operator found which
takes a left-hand operand of type 'const flopc::VariableRef' (or there
is no acceptable conversion)".<br><br>It seems that it's not a feasible
way to describe the problem to FlopC++. Could you offer any help or
advice on the issue? Thanks in advance.<br><br>With best regards,<br><br>Jia Li</div></div></body></html>