Skip to main content

VBasis/CBasis get and set

Answered

Comments

4 comments

  • Marika Karbstein
    Gurobi Staff Gurobi Staff

    Hi Thomas,

    The function Model.setAttr() already exists.

    Cheers,
    Marika

    -1
  • Thomas Schlechte
    Gurobi-versary
    First Question
    First Comment

    Hi Marika,

    ah okay, I did not see the call with 3 arguments. So it should work like this

    // solve
    ...
    vBasis = self.model.getAttr("VBasis", self.model.getVars())
    cBasis = self.model.getAttr("CBasis", self.model.getConstrs())

    // do for example a problem specific RENS
    ...

    // set lp solution
    self.model.setAttr("VBasis", model.getVars(), vBasis)
    self.model.setAttr("CBasis", model.getConstr(), cBasis)

    Thanks

    Thomas

     

    1
  • noah smith
    Gurobi-versary
    First Comment

    Hi, Thomas's second comment here is very useful. Could highly recommend that his code-snippet, or something like it, be included in discussions of lp warm start. A simple 'hello world style' example model doing this would also be useful. Multiple examples of warm start would be helpful.

    Concrete 'how to' with examples that pop up when googling 'gurobi warm start'.

    Understood this stuff is apparently totally obvious for gurobi employees.

    It's not for every gurobi user, have learned that the hard way over the last few days.

    Thanks

    Noah

     

    0
  • Gwyneth Butera
    Gurobi Staff Gurobi Staff

    Thanks for the suggestion Noah! I have added this to my list of potential improvements for the Knowledge Base. -G

    1

Please sign in to leave a comment.