I&#39;ve just realized that my objective function (minimizing the difference) makes the problem unbounded.<br>(I want to use the maximization with the division anyway.)<br>I will have to find out how to get the solver to warn me of such problems as infeasibles and undounded. But I assume this would be a question for the solver list.<br>
(I still need most of my previous questions answered though.)<br>Thanks again.<br><br><div class="gmail_quote">On Sat, Nov 28, 2009 at 7:46 PM, Mario Rappi <span dir="ltr">&lt;<a href="mailto:marappi@wichita.edu">marappi@wichita.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">First I include the model, then the output, and at the end the questions:<br><br>*****model************************<br>
// $Id$<br>
#include &quot;flopc.hpp&quot;<br>
using namespace flopc;<br>
#include &lt;OsiClpSolverInterface.hpp&gt;<br>
<br>
int main() {<br>
<br>
    MP_model &amp;model = MP_model::getDefaultModel();<br>
    model.setSolver(new OsiClpSolverInterface);<br>
    model.verbose();<br>
<br>
    enum {storeA, storeB, storeC, storeD, numS}; <br>
    enum {Input1, Input2, numI};<br>
    enum {Output1, numO};<br>
<br>
    MP_set S(numS);         // Stores<br>
    MP_set I(numI);            // Inputs<br>
    MP_set O(numO);            // Outputs<br>
<br>
    MP_subset&lt;2&gt; Input(S,I);<br>
    Input.insert(S,I);<br>
    Input.display(&quot;Input&quot;);<br>
    MP_subset&lt;2&gt; Output(S,O);<br>
    Output.insert(S,O);<br>
    Output.display(&quot;Output&quot;);<br>   
<br>    //this will be easier with an array??<br>
    MP_data InputVal(Input);<br>
    InputVal(storeA,Input1)=1; InputVal(storeA,Input2)=3;<br>
    InputVal(storeB,Input1)=3; InputVal(storeB,Input2)=3;<br>
    InputVal(storeC,Input1)=4; InputVal(storeC,Input2)=2;<br>
    InputVal(storeD,Input1)=3; InputVal(storeD,Input2)=1;<br>
<br>
    MP_data OutputVal(Output);<br>
    OutputVal(storeA,Output1)=1;<br>
    OutputVal(storeB,Output1)=1.5;<br>
    OutputVal(storeC,Output1)=2;<br>
    OutputVal(storeD,Output1)=1;<br>
<br>
    MP_variable x(I), y(O);<br>
    x.lowerLimit(I)=0;<br>
    y.lowerLimit(O)=0;<br>
<br>
    MP_constraint efficiency(S);<br>
    efficiency(S) = sum(I, InputVal(S, I) * x(I)) &lt;= sum(O, OutputVal(S, O) * y(O));<br>
<br>
    minimize( (sum(O, OutputVal(storeB, O) * y(O))) - (sum(I, InputVal(storeB, I) * x(I))));<br>
    <br>
    efficiency.display(&quot;constraints&quot;);<br>
    x.display(&quot;x&quot;);<br>
    y.display(&quot;y&quot;);<br>
<br>
    cout&lt;&lt;&quot;Test dea passed.&quot;&lt;&lt;endl;<br>
}<br>*****model end************************<br><br>*****output************************<br>Input<br>Output<br>FlopCpp: Constraint <br>0   1  0  0<br>1   1  0  0<br>2   1  0  0<br>3   1  0  0<br>0   2  0  0<br>1   2  0  0<br>

2   2  0  0<br>3   2  0  0<br>0   0  -0  0<br>1   0  -0  0<br>2   0  -0  0<br>3   0  -0  0<br>
FlopCpp: Number of constraint blocks: 1<br>FlopCpp: Number of individual constraints: 4<br>FlopCpp: Number of variable blocks: 2<br>FlopCpp: Number of individual variables: 3<br>FlopCpp: Number of non-zeroes (including rhs): 12<br>


Objective <br>-1   0  0<br>-1   1  -0<br>-1   2  -0<br>FlopCpp: Generation time: -2.64274e-19<br>Clp0000I Optimal - objective value 0<br>Clp0032I Optimal objective 0 - 0 iterations time 0.002<br>FlopCpp: Optimal obj. value = 0<br>


FlopCpp: Solver(m, n, nz) = 4  3  0<br>constraints<br>0  -1.79769e+308  0  0  -0<br>1  -1.79769e+308  0  0  -0<br>2  -1.79769e+308  0  0  -0<br>3  -1.79769e+308  0  0  -0<br>x<br>0   0<br>1   0<br>y<br>0   0<br>Test dea passed.<br>


*****output end************************<br><br>*****Questions:******************<br>I would like to define a set A that includes all members of O and I and then derive O and I from A.<br>This is what I am thinking in GAMS terms:<br>

A        / Input1, Input2, Output1 /<br>O(A)   /  Input1, Input2 /<br>I(A)    / Output1  /<br>Is this possible?. I thought it would allow me to write the model more easily (but may be not)<br>*******************<br>I tried to display the constraints but I didn&#39;t get what I was expecting (the actual mathematical expression). Is it possible to see the constraints in any other way?<br>

*******************<br>When I compile I get the following two warnings. Should I be concerned? How do I fix them?<br><br>c:\program files\coin-flopcpp\flopcpp\src\mp_set.hpp(259) : warning C4267: &#39;return&#39; : conversion from &#39;size_t&#39; to &#39;int&#39;, possible loss of data<br>

        c:\program files\coin-flopcpp\flopcpp\src\mp_set.hpp(258) : while compiling class template member function &#39;int flopc::MP_subset&lt;nbr&gt;::size(void) const&#39;<br>        with<br>        [<br>            nbr=2<br>

        ]<br>        c:\program files\coin-flopcpp\flopcpp\examples\dea.cpp(21) : see reference to class template instantiation &#39;flopc::MP_subset&lt;nbr&gt;&#39; being compiled<br>        with<br>        [<br>            nbr=2<br>

        ]<br>c:\program files\coin-flopcpp\flopcpp\src\mp_set.hpp(243) : warning C4267: &#39;initializing&#39; : conversion from &#39;size_t&#39; to &#39;const int&#39;, possible loss of data<br>        c:\program files\coin-flopcpp\flopcpp\src\mp_set.hpp(232) : while compiling class template member function &#39;void flopc::MP_subset&lt;nbr&gt;::insert(const std::vector&lt;_Ty&gt; &amp;)&#39;<br>

        with<br>        [<br>            nbr=2,<br>            _Ty=int<br>        ]<br><br>*******************<br>The objective function that I really want to use is<br>maximize( (sum(O, OutputVal(storeB, O) * y(O))) / (sum(I, InputVal(storeB, I) * x(I))));<br>

But it doesn&#39;t compile, I get this error:<br><br>c:\program files\coin-flopcpp\flopcpp\examples\dea.cpp(51) : error C2678: binary &#39;/&#39; : no operator found which takes a left-hand operand of type &#39;flopc::MP_expression&#39; (or there is no acceptable conversion)<br>

        c:\program files\coin-flopcpp\flopcpp\src\mp_constant.hpp(141): could be &#39;flopc::Constant flopc::operator /(const flopc::Constant &amp;,const flopc::Constant &amp;)&#39;<br>        c:\program files\coin-flopcpp\coinutils\src\coinpackedvector.hpp(483): or       &#39;CoinPackedVector operator /(const CoinPackedVectorBase &amp;,const CoinPackedVectorBase &amp;)&#39;<br>

        c:\program files\coin-flopcpp\coinutils\src\coinpackedvector.hpp(583): or       &#39;CoinPackedVector operator /(const CoinPackedVectorBase &amp;,double)&#39;<br>        c:\program files\coin-flopcpp\coinutils\src\coinpackedvector.hpp(625): or       &#39;CoinPackedVector operator /(double,const CoinPackedVectorBase &amp;)&#39;<br>

        while trying to match the argument list &#39;(flopc::MP_expression, flopc::MP_expression)&#39;<br><br>I am using MSVCPP, I read of some problems specific to VCPP so I tried the same in Linux(I think it is build-essential in Ubuntu) but I get the same errors.<br>

How can I fix this problem with the division operation?<br>*******************<br>Is my formulation of the objective function OK in how I sum only for storeB or do I have to use such_that or any other type of control?<br>

How do I display the objective function?<br>*******************<br>What are these numbers in the output?<br>constraints<br>
0  -1.79769e+308  0  0  -0<br>
1  -1.79769e+308  0  0  -0<br>
2  -1.79769e+308  0  0  -0<br>
3  -1.79769e+308  0  0  -0<br>My four constraints are supposed to have only three terms (two on the left and one on the right)<br>********************<br>What is this?<br>Objective <br>
-1   0  0<br>
-1   1  -0<br>
-1   2  -0<br>********************<br><br>If it helps at all: the model is a simple DEA formulation (primal).<br>I understand some of my questions may be more C++ than flopcpp questions but I can&#39;t tell.<br>I will appreciate help on any of these questions and on any other comments you may have on the model formulation.<br>

Thanks in advance.<br><font color="#888888">Mario<br>
</font></blockquote></div><br>