[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] confusion on constraints
From: |
arun gaikwad |
Subject: |
Re: [Help-glpk] confusion on constraints |
Date: |
Mon, 5 Jul 2004 16:01:40 -0700 (PDT) |
--- address@hidden wrote:
> How does one attempt to add a constraint which does
> not involve every
> structural variable (i.e. x[m+1]...x[m+n]) using
> lpx_load_matrix? It
> would seem that if I had three structural variables
> (x1, x2, x3) and a
> constraint of the form x1 + x2 = 4, that I would
> have the following
>
> ia[1] = 1, ja[1] = 1, ar[1] = 1.0;
> ia[2] = 1, ja[2] = 2, ar[2] = 1.0;
> ia[3] = 1, ja[3] = 3, ar[3] = 0.0;
>
> but, I receive the following run-time error if I
> attempt to do this:
>
> lpx_load_matrix: ar[1] = 0; zero element not allowed
>
>
> Don
>
> [Please reply to me as well as the list. I am not
> subscribed to the
> list.]>
_______________________________________________
> Help-glpk mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-glpk
>
You are supposed to add ONLY non-zero array elements.
ia[1] = 1, ja[1] = 1, ar[1] = 1.0;
ia[2] = 1, ja[2] = 2, ar[2] = 1.0;
and
lpx_load_matrix(2,...)