Ask Your Question
1

linear programming in cython

asked 2012-05-04 15:27:38 -0600

markus gravatar image

hi, i am trying to speed up a sage code in cython and i am having difficulties with calling the linear programming routine.

my algorithm requires me to solve a large number of linear programs. currently, i am doing this in sage by calling MixedLinearProgram inside a loop and updating variables depending on the solution.

is there a way to call that program inside a cython function? i would need a cython program that accepts arrays as inputs, solves a linear program and outputs an array.

many thanks for your help markus

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2012-05-04 16:17:53 -0600

Volker Braun gravatar image

Presumably you have lots of relatively simple linear programs. Have a look at the PPL Cython interface in sage/libs/ppl.pyx, and in particular maximize()

edit flag offensive delete link more

Comments

Thanks Volker! I think that is exactly what I need. I am new to Sage and Cython so it might take me a while but thanks for pointing me in the right direction. Also, do you have feeling for what time saving I can expect relative to MixedIntegerLinearProgam? Markus

markus gravatar imagemarkus ( 2012-05-04 17:34:45 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-05-04 15:27:38 -0600

Seen: 166 times

Last updated: May 04 '12