linear programming
Modérateur : xcasadmin
Re: linear programming
Then RAND_MAX is the same as INT_MAX, it's the largest value that you can get with int rand(), i.e. the largest signed integer.
About abi compatibility, I'm using an old debian with gcc 4 to build the deb packages, that explains the problem. Thanks for the explanation, it might be useful for other people trying to link with giac.
About abi compatibility, I'm using an old debian with gcc 4 to build the deb packages, that explains the problem. Thanks for the explanation, it might be useful for other people trying to link with giac.
Re: linear programming
I made a change in lpsolve.cc/.h, HAVE_GLPK -> HAVE_LIBGLPK
(autoconf creates by default this define if glpk is detected).
(autoconf creates by default this define if glpk is detected).
Re: linear programming
Thanks, I've mirrored your changes. I also fixed one small bug, lp_maximize=true and lp_verbose=true were not recognized as valid options, only lp_maximize and lp_verbose (without "=true"). Now both alternatives work as expected.
lpsolve.h hasn't actually changed, so you may leave the current version of that file.
lpsolve.h hasn't actually changed, so you may leave the current version of that file.
- Pièces jointes
-
- lpsolve-fix7.zip
- (17.95 Kio) Téléchargé 263 fois
Re: linear programming
I had to update lpsolve.h, because there are new defines. I also had to replace INT_MAX by RAND_MAX. Then it compiles!
Re: linear programming
I've deleted a confusing comment paragraph starting on line 254, it originated from an intermediate version of the code...
- Pièces jointes
-
- lpsolve-fix8.zip
- (15.49 Kio) Téléchargé 267 fois
Re: linear programming
DBL_MAX is not defined when compiling with emscripten, I have added at the beginning of lpsolve.cc:
Code : Tout sélectionner
#ifndef DBL_MAX
#define DBL_MAX 1.79769313486e+308
#endif
Re: linear programming
I have updated the web version, it should contain GLPK code (since numeric is well supported by emscripten, I think it is worth having it in the web version). Let me know if it's ok.
Re: linear programming
Thank you. In my Firefox, lpsolve performs well and fast
Re: linear programming
lpsolve works in Xcas FLTK GUI as well, but messages and progress reports are not printed for some reason... In the code I was using cout to output the messages, and they do show up in Firefox interface.
Re: linear programming
If you replace cout/cerr by *logptr(contextptr) you will get the output in green in xcas native, otherwise the output is written to the terminal that has launched xcas.
Re: linear programming
Thanks, I've updated the code accordingly, only one line had to be changed in lp_problem::message routine.
- Pièces jointes
-
- lpsolve-fix9.zip
- (17.46 Kio) Téléchargé 265 fois
Re: linear programming
The latest version of Giac/Xcas contains up-to-date version of the code, but the documentation entry is still referring to the old version. Could you please update it? I've sent you the TeX file in message from November 20 (on the previous page).
Thanks!
Thanks!
Re: linear programming
Indeed, I missed it, it will be in the next update.
Re: linear programming
I have a small update for lpsolve, now "maximize" can be used instead of "lp_maximize", since the keyword exists in Giac. Also, list of symbolic variables gathered from the input problem is now sorted, so the output is more readable (now we have x,y,z,... instead of, e.g. z,x,y,.. and the order in which variables appear in the input expressions does not affect the output of the solution). Finally, a result from lpsolve is now a vector with subtype list, like in the solve command (the new command nlpsolve in optimization.cc follows the same principle).
Documentation is also slightly altered to mention "maximize" as an alias for "lp_maximize".
Documentation is also slightly altered to mention "maximize" as an alias for "lp_maximize".
- Pièces jointes
-
- lpsolve-fix10.zip
- (25.11 Kio) Téléchargé 262 fois
Re: linear programming
I made a few changes in order to compile with clang: add in lpsolve.cc #include "optimization.h" for at_maximize, and in optimization.cc replaced 5 times delete by delete [] for arrays allocated with new.