Re: [eigen] Simplex solver
• To: eigen@xxxxxxxxxxxxxxxxxxx
• Subject: Re: [eigen] Simplex solver
• From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
• Date: Mon, 27 Aug 2012 15:51:50 +0200
• Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=mKO3z6mBoajUEzs38mZD3y56ruPlT7TAZ2/blQl7luc=; b=EiqCZ0MEPGlCod1og9KBieVgwXcEhl7Cp+S8y5otvSHKTZ5QIG7sqZA7gentyBHo2l VBgYvzvZnNNRNYnDLgRlCIZ7nAfzjsetD67OFPhU0dLeE8qe3qxJImESOre0C2EaL1RR tIDw6UJsurOsWjV1+Kv0Wemu3qcMJYuwJhUCUoQQMM2GmdN/AgzELoeJFQTsE1AlAwJH rq1ND+PejalSIZBI7o1ZfT7MHIH2wgcGmByuIkShvmVvo4z7Vxa1Xi5N2oPYX0kY7uzw CgdXXxUITF3eHynzNUtUAKt43y2j7AvVlXIRlZ0yWfRdl11BdXM5UeY1sD/GrFxCjKBq q+jw==

```Hi Tamas,

> 1. Does Eigen (or an extension) have a built-in simplex solver, or any
> linear programming-related functionality? Or, is any open source
> implementation available? (I did some google searches, and found none)

Note really what you're looking for, but somewhat related, I've

> 2. Does Eigen have method for a single pivot operation? Like:
> M.pivotOperation(2, 3); If not, then would row-level operations give the
> best performance?

You can swap columns or rows:

M.row(i).swap(M.row(j));
M.col(i).swap(M.col(j));

Store the transpositions into a Transpositions<>
(http://eigen.tuxfamily.org/dox-devel/classEigen_1_1Transpositions.html)
that you apply to matrices or vectors, and also convert it into a
PermutationMatrix<>
(http://eigen.tuxfamily.org/dox-devel/classEigen_1_1PermutationMatrix.html).
The file Eigen/src/LU/PartialPivLU.cpp is a good example.

Best,
Gael.

>
> And I have to mention that I discovered Eigen some weeks ago, and I liked it
> immediately :) It has a really nice API.
>