help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Viewing input constraints in Java


From: Nigel Galloway
Subject: Re: [Help-glpk] Viewing input constraints in Java
Date: Fri, 30 Dec 2011 07:08:07 -0800

Your problem is discussed:

http://stackoverflow.com/questions/1528148/swig-pointers-and-java-arrays

Two suggestions:
  use carrays.i
  write a wrapper.

IAJAAR does the latter, see
http://en.wikibooks.org/wiki/GLPK/IAJAAR.H_project or download:
 
https://sourceforge.net/projects/iajaarh/files/IAJAAR.H.20111120-144507.tar.xz/download.

To the version described in the wiki you may want to add a Get
procedure, to do what you want. In the latest version (IAJAAR_PY) I have
added an iterator to obtain each triple or double as appropriate, but
currently only in Python and not using SWIG.

-- 
  Nigel Galloway
  address@hidden


On Thu, Dec 29, 2011, at 02:11 PM, Powers II II, Raymond J wrote:
> Hello,
> 
> I am using glpk-java to solve a network flow LP using the simplex solver
> (smcp). The solver has solved a few instances correctly, but not all
> (even simple ones).
> My belief is that one of the constraints I am building is not getting
> input correctly. The problem is, I do not know how to view a constraint
> in Java after it is built.
> 
> I know the function glp_get_mat_row returns the number of variables in
> row i, as well as stores which variables and coefficients in ind and val.
> The problem is that in Java there is no way to access the individual
> indices of SWIGTYPE_p_int or SWIGTYPE_p_double that I can find.
> 
> Any help would be greatly appreciated.
> 
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-glpk
> 

-- 
http://www.fastmail.fm - The way an email service should be




reply via email to

[Prev in Thread] Current Thread [Next in Thread]