Re: [Fwd: C# Examples for glp_term_hook() and glp_error_hook()]

"Heinrich Schuchardt" <[email protected]>
Newsgroups gmane.comp.gnu.glpk
Message-ID <trinity-c4bed854-57df-4639-8fb2-88e292089e31-1497860478739@msvc-mesg-gmx107>
Hello Edmund,

please, call GlpkCallback.addListener to attach your callback method, cf. examples/csharp/Gmpl.cs

Call Glpk.glp_ios_terminate(tree) in the callback method when requested by the user.

Best regards

Heinrich Schuchardt

http://www.xypron.de

Am 19.06.17 um 08:18 schrieb Andrew Makhorin

> -------- Forwarded Message --------
> To: [email protected] <[email protected]>
> Subject: C# Examples for glp_term_hook() and glp_error_hook()
> Date: Mon, 19 Jun 2017 03:37:06 +0000 (UTC)
> 
> Hi GLPK developers,
> 
> 
> I am writing a MIP optimisation software using GLPK for C# as the
> engine.
> 
> 
> I intend to build an "abort" function in my software, this function will
> become active once GLPK finds a feasible solution, after which, if the
> user clicks on "abort", it terminates GLPK's branch-and-bound search and
> outputs the current best solution.
> 
> 
> Looking through the help manual, I thought of using glp_term_hook() to
> read whether a feasible solution had been found, then use glp_error_hook
> to terminate and output the current best solution. However documentation
> for these 2 methods for C# seems lacking. Appreciate if you can provide
> me some examples. I have little experience in C/ C++.
> 
>  
> Thanks and best regards
> Edmund Chen
> 
> 
> 
> 
> 
> _______________________________________________
> Help-glpk mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/help-glpk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.