Skip to content
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

numerical.MIP: named constraints and variables, methods, structure, etc #7270

Closed
nathanncohen mannequin opened this issue Oct 23, 2009 · 10 comments
Closed

numerical.MIP: named constraints and variables, methods, structure, etc #7270

nathanncohen mannequin opened this issue Oct 23, 2009 · 10 comments

Comments

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Oct 23, 2009

Hello everybody !!!

This is the last "fundamental" modification of class numerical.MIP. From now on, the methods' names should not change anymore, and the patches based upon this class should not have to be updated each time an update is sent for numerical.mip.

This patch changes mainly comports changes of structure in this class. Here is the list of what is includes :

  • The line

    from sage.numerical.mip import * 
    

    has been replaced by

    from sage.numerical.mip import MixedIntegerLinearProgram
    

    as asked in clean up sage/numerical/mip.pyx #7012

  • Private variables have been renamed with a '_' in front of their names. The user is not interested in them

    • x to _x
    • values to _values
    • all the variables defining the Linear Program ( variables types, bounds, name, objective, etc ) have been renamed. The new structure is easier to understand, and the code includes as a comment a Tree of these variables to explain it better.
  • The __eq__ method has been added ( asked in __eq__ methods for the classes in numerical.MIP #6913 )

  • Names in the Linear Program

    • Methods have been added to define names for :
      • The whole problem : set_problem_same
      • The objective function : set_objective_name
    • Methods have been modified to define names for :
      • The variables : new_variable now can take a name as part of its input
      • The constraints : similarly for add_constraint
  • A function _update_variables_name. The name of variables are only computed before
    the LP is written to a file. They are obviously useless in the solving process.

  • A function constraints to list the constraints of the LP.

  • Function write_mps and write_lp to export the problem to MPS and LP file format ( see the docstrings for more information )

  • Class MIPSolverException includes doctests of exceptions for GLPK ( CBC will follow )

  • Some comments have been added to the code to ease reviews :-)

Warnings :

Thank you for your help !!!

Nathann

Component: numerical

Author: Nathann Cohen

Reviewer: Martin Albrecht

Merged: sage-4.3.alpha1

Issue created by migration from https://trac.sagemath.org/ticket/7270

@nathanncohen nathanncohen mannequin added this to the sage-4.3 milestone Oct 23, 2009
@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Oct 23, 2009

Attachment: trac_7270.patch.gz

@nathanncohen

This comment has been minimized.

@nathanncohen nathanncohen mannequin added the s: needs review label Oct 23, 2009
@nathanncohen

This comment has been minimized.

@nathanncohen

This comment has been minimized.

@malb
Copy link
Member

malb commented Dec 1, 2009

comment:4

Looks good, positive review.

@mwhansen
Copy link
Contributor

mwhansen commented Dec 2, 2009

Author: Nathann Cohen

@mwhansen
Copy link
Contributor

mwhansen commented Dec 2, 2009

Reviewer: Martin Albrecht

@mwhansen
Copy link
Contributor

mwhansen commented Dec 2, 2009

comment:5

I had to add a missing #optional on line 550.

@mwhansen
Copy link
Contributor

mwhansen commented Dec 2, 2009

Merged: sage-4.3.alpha1

@mwhansen mwhansen closed this as completed Dec 2, 2009
@sagetrac-mvngu sagetrac-mvngu mannequin changed the title numerical.MIP : named constraints and variables, methods, structure, etc ... numerical.MIP: named constraints and variables, methods, structure, etc Dec 26, 2009
@fchapoton

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants