-
-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linear Program Solver and Mixed Integer Program Solver in Sage #6502
Comments
Class sage.numerical.mip |
comment:1
Attachment: 12428.patch.gz If you want to try this code, you will find a short example there : http://groups.google.com/group/sage-devel/browse_thread/thread/7c13a0a4ba3d87b6 |
comment:2
Compiles and installs successfully on Sage 4.0.1 on Ubuntu x86. The methods in MIP should have doctests/docstrings. e.g. I should be able to type
and see a nice example for how to add a bound. |
comment:3
I agree, this needs docstrings. Installation of the spkg went fine on a macbook running 10.4.11. The patch seemed to apply okay. sage -testall on 4.1.rc1 passed except for failures in parallel/decorate (DeprecationWarning: os.popen2 is deprecated. ) and interfaces/sage0 (which could not be replicated). The examples given in the sage-devel email (below) seemed to work okay, though I am not an expert on this stuff.
|
comment:5
Patch numerical.mip-2.patch applies on top of 2428.patch I hope you will like it !! I spent a lot of time on this LP for SAGE ! ;-) |
Attachment: numerical.mip-2.patch.gz |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:8
A small mistake in the detection of COIN -- fixed ! ;-) |
comment:9
Attachment: numerical.mip-3.patch.gz Once this ticket has positive review, the SPKG at #6602 should also be merged in the standard packages repository. So in a sense, that SPKG is dependent on this ticket. |
comment:10
I got this problem:
Any suggestions? |
comment:11
Replying to @wdjoyner: > Any suggestions? I suggest we wait until 4.1.1 is out. |
comment:12
New patch including all the previously announced features and probably a bit more. It encompasses the previous patches, so you need only apply this one and forget about the others ! ;-) |
comment:13
Attachment: MIP-1.patch.gz This was applied to 4.1.1.a0 and the following test failed:
Does this make sense? |
comment:14
It seems Sage does not like something dealing with the indentation in the doctest of the class, as the example works when I am copying it manually... If you know the standard ( if there are any ) in this situation, please tell me because I am trying to fix this and changing the indentation ten thousand times hoping it will work is not my preferred way of debugging ^^; |
comment:15
Fixed in patch MIP-2.patch As a sidenote, this ranks as the least interesting debugging I ever did, and I just achieved it because there was another example of a loop in a dosctring in Sage. Thanks to the brave developper of sage.combinat.dlx who conquered the docstrings ! ;-) |
Attachment: MIP-2.patch.gz |
comment:16
I usually debug by just running sage -t with the file open in an editor until it passes:-) Am I to apply MIP1 then MIP2? If so, there was a problem compiling (amd64, ubuntu 9.04):
Do you know what this means? |
comment:17
Yes, this time I know !!! ;-) The first error is : sage/numerical/mip.cpp:132:38: error: ../../local/include/glpk.h: No such file or directory And this is because you did not install GLPK ( #6602 ) which is to be a standanrd package. And MIP-2 applies on top of MIP-1 ! Sorry for these details I may have forgotten ! ;-) |
comment:18
These patches applies to an amd64 ubuntu 9.04 machine passes sage -testall (except for the already reported errors for sage 4.1.1.a1). Things are improving but there are some remaining issues:
might have a sign error and should I think be
|
comment:19
You were right about the typo. And I hope you will find in MIP-3.patch all the docstrings you need ;-) |
comment:46
The patches and GLPK should be wrapped up into an spkg. The patch |
comment:47
New patch AllMIP-2 available. All the calls to solve() are flagged optional. This class should now compile even without the libraries glpk ( which have been removed from module_list ) : all is left in this class except the call to solveGlpk, which is now a function defined in the new version of the spkg ( see #6817 ). It is a bit better this way, as this was already the case with package CBC ( now, the code is "symmetric" between Glpk and Cbc, as both are optional packages ) In the end :
This spkg being currently reviewed at #6817 ( it should be pretty quick, there is nothing new in this patch except a function which had already been reviewed here ! ) |
Attachment: AllMIP-2.patch.gz Now without solveGlpk ! |
comment:48
Lets make it :
|
comment:50
I can only test this with glpk installed (having build problems...). Is that okay? |
comment:51
Replying to @wdjoyner:
That is fine by me. But note that since the patch
The line
requires GLPK and some other patches. But it should be written like this:
to flag it as requiring an optional package. Any other tests that require the functionalities of an optional spkg must be flagged as such. When testing these, one would do something along this line:
|
comment:52
Okay, because of this comment, I'm changing it back to needs work. |
comment:53
Hmmm... There's something I do not understand here ^^; At first I thought I had made a mistake by not uploading the last version of my patch, in which I added the required "optional" flags, but in the end it seems there are included already... You can see they are by looking (Ctrl - f) for the word "optional" on the page https://github.com/sagemath/sage-prod/files/10645489/AllMIP-2.patch.gz I just installed this patch on a brand new install without GLPK, it compiled fine and there were no warnings during the test ( without the -optional flag, obiously) Could you please check that you downloaded the last version and did not apply a cached file ?? Just to be sure, I upload a flattened version of patch named AllMIP-2-flattened.patch |
comment:54
Attachment: AllMIP-2-flattened.patch.gz BTW, the ALLMIP2 patch applied fine for me, as before, and passes sage -testall (mod the known unrelated failures already described). So, positive review from me, but I am testing on a clone of Sage which has glpk installed. |
comment:55
I tested it on a copy of Sage without GLPK... But as I posted this patch I guess it does not count ^^; |
comment:56
As the functions dealing with LP have not been reviewed, I prefer to rewrite the MIP class for Sage to make it easier to use. I will post a new version of the MIP patch as soon as possible, along with all the patches for functions using it. Sorry for the trouble, I'll try to make it quick ! Nathann |
comment:57
This ticket should be deleted. A new ticket has been created #6869 with a new version of the class, now using symbolics ! Nathann |
Following this message on SAGE-devel :
http://groups.google.com/group/sage-devel/browse_thread/thread/9da47e06bcdfc49f
This is the class sage.numerical.mip which is meant to be the common interface between SAGE and 3 different LP solvers : GLPK, Coin-Or, and CPLEX.
Trac ticket for GLPK : #6602
Trac ticker for COIN : #6603
CC: @haraldschilly
Component: numerical
Issue created by migration from https://trac.sagemath.org/ticket/6502
The text was updated successfully, but these errors were encountered: