GLPK/C-Sharp

C# is a programming language, designed by Microsoft, and described by some as similar to Java. An open source implementation of C# is provided by the Mono project.

C# has been standardized under the following documents:


 * ECMA-334 &mdash; C# Language Specification
 * ISO/IEC 23270:2006 &mdash; Information technology – Programming languages – C#.

GLPK for C#/CLI
GLPK for C#/CLI provides a C# and common language interface (CLI) binding for GLPK. It is licensed under GPL V3. The coding is generated using SWIG.

GLPK for C#/CLI supports callback and terminal listeners. Errors occurring in the GLPK native library are thrown as C# exceptions. All functions of the GLPK API are available as methods of the GLPK object as shown in the example below:

Marshalling
C# can call C library functions directly using marshalling. The following program invokes glp_version to output the version of the GLPK library. To compile the program with Mono use To compile the program with Visual C# use

Visual Studio
When GLPK is compiled with Visual Studio C++, both .dll and .lib files are created. The easiest (usual) way to the use GLPK in a Visual Studio C# project in this case is to make the C++ GLPK project a dependency for the C# project and include the .lib file.

GLPK#
GLPK# (GLPK Sharp) provides a C# language binding for GLPK and is licensed under CeCILL version 2.

GLPK# is written in C++/CLI and would normally be statically linked to GLPK. As at July 2012, GLPK# supports most of the GLPK 4.45 API, including terminal callbacks and branch-and-cut callbacks. See the dual French/English project website for details.