[Coin-discuss] Re: FlopC++ with Visual C++.NET

Jan-Willem Goossens j.goossens at t75.nl
Fri Feb 10 13:06:44 EST 2006


Hi,

Sorry for this short email..

I had a brief look at my MP_constraint.hpp, and notice two changes with
the original code:

1) In the original code, the implementation of the operators is done like:
	friend Constraint operator<=(const VariableRef& l, const VariableRef& r) {
	    return *new Constraint(l, r, LE);
}

within the class definition. I moved the implementation to outside the
class def, and declared it inline.
I dont remember if this was significant to get it all to work.

2) (and more importantly) I changed the above example to

inline Constraint operator<=(const VariableRef& l, const VariableRef& r) {
#ifdef _MSC_VER
	return Constraint(MP_expression(l), MP_expression(r), LE); //*new
#else
	return Constraint(l, r, LE); //*new
#endif
}

So I explicitly tell it to convert the VariableRef first to an
MP_expression, and put it into the new constraint.

To put the new constraint on the heap, it might be a good idea to revert
to Tim's

        return *new Constraint......


Sorry, I have to get going.

Regards,

Jan-Willem


> Hi,
>
> thanks for your reply! I can't solve the error message:
>
> c:\flopc\win32\MP_model.cpp(135): error C2678: binary '>=' : no operator
> found which takes a left-hand operand of type 'const flopc::VariableRef'
> (or
> there is no acceptable conversion).
>
> All the operators used, like "+", "-", etc. are producing these error
> messages, e.g. compiling the sample aircraft.cpp.
>
> How did you change the code in mp_constant.cpp & .hpp and
> mp_constraints.cpp
> &.hpp (I think the major changes have to be done  there!?) ?
>
> Maybe is it possible to publish or sent these four files? That is  maybe a
> faster solution than thinking about how you solved the problem months
> ago.
>
> Thanks in advance,
>
> Christian
> _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-discuss
>




More information about the Coin-discuss mailing list