Re: Incorect result in Gnumeric solver



  According to my last message (Incorrect result in solver),
when LP-solver was given an objective function of the form:

  sum   (c_i * x_i) + K
(i=1..n)

the original problem was transformed into incorrect one,
the first variable x_1 having decreased the coefficients in
matrix of constraints by -K.
The constant K is also stripped from obj. function, which is O.K.

  We are talking about Gnumeric 1.4.3 official version sources.
  I replaced in solver.c the line 419 which reads:

                x0 = base;

with lines:

                cell_eval (target);
                x0 = base = value_get_as_float (target->value);

  I have no full (maybe, nor partial :-) understanding of source code,
but x0=base referred here to "base" - variable assigned on line 363,  
when we dealt with objective function. Now, the constraints settings  
for solver are to be made  - why we nead refer to something 
about obj. function?

  The above-mentioned change fixed for me the problem. Maybe, it breaks
something else, etc. But, I think, this additional information can help
the developers to identify the problem (it must be either 
in function "get_lp_coeff", or in something like above    
- incorrect initialization of variables.)

                                     Mike



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]