Ask Your Question
1

linear programming in cython

asked 2012-05-04 22:27:38 +0100

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 23:17:53 +0100

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-05 00:34:45 +0100 )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 22:27:38 +0100

Seen: 399 times

Last updated: May 04 '12