commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Neidhart <thomas.neidh...@gmail.com>
Subject Re: [math] Solving SLP problem
Date Thu, 07 Mar 2013 16:37:51 GMT
On Thu, Mar 7, 2013 at 5:13 PM, Alexander Sehlström
<alexander@sehlstrom.se>wrote:

> Hi,
>
> I wish to solve the following problem:
>
> /* Problem --------------------------------------------------------
>  * Starting from double[] s0, determine double[] s, the solution of:
>  *
>  *     | min   f' * s
>  *     |
>  *     | s.t.  s_l <= s <= s_u
>  *
>  * where double[] f has the same length as the double [] s.
>  *
>  * The double[] s_l and double[] s_u are lower and upper bounds of s,
>  * respectively.
>  * ----------------------------------------------------------------
>  */
>
> I have tried to understand what solution algorithm in Apache Commons Math
> to use. I have tried the SimplexSolver, but it seams unable to handle
> SimpleBounds and demands LinearConstraint which I do not have any.
>
> Any suggestions of how to use the library for this problem?


Hi Alexander,

you can also see your bounds as linear constraints:

s_l <= s <= s_u is equivalent to

linear constraint s_i >= s_l
linear constraint s_i <= s_u

where s_i is your respective entry in the s array.

Hope this helps,

Thomas

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message