MAiNGO
Using MAiNGO in Other Software

Using MAiNGO as a Standalone Solver

If you want to use MAiNGO as a standalone solver, you can simply work with the files given in the example directory (and the CMakeLists.txt in the trunk of the Git repository) and implement your model as described in Section Modeling in MAiNGO. An example of a C++ model can be found in exampleCppApi/problem.h. An example for a .txt input file can be found in exampleAleParser/problem.txt. After compiling, simply navigate to the folder where the executable was built and execute MAiNGO.exe.

The standalone version of MAiNGO can read settings for solver options from a file. An example file including descriptions and default values of all options can be found in the example folder (MAiNGOSettings.txt). By default, MAiNGO looks for a file called MAiNGOSettings.txt in the directory where the MAiNGO.exe is located, but you can specify a custom file (including path) as a command line argument to MAiNGO.exe. The same applies to the MAiNGO version with parser.

Embedding MAiNGO in your Application

If you would like to embed MAiNGO in your own application, you need to link it to your software project first. Probably the easiest way it to embed MAiNGO as a submodule of your project. For this purpose, please refer to the CMakeLists.txt in the trunk of the MAiNGO repository.

In order to use the MAiNGO object, please refer to the main.cpp in the example folder. In particular, you need to do the following things:

  • Create an instance of the MAiNGO class.
  • Hand an instance of your specialization of MAiNGOmodel to your MAiNGO instance via its constructor or using set_model
  • Specify settings using set_option or read_settings
  • Solve the problem using solve. This function will return a RETCODE.
  • Query solution information using the function provided by the MAiNGO class.

Extending MAiNGO

MAiNGO is published under the ECLIPSE license. Please refer to the LICENSE file in the MAiNGO trunk.

Regarding the implementation of MAiNGO, just explore this documentation. If you expand MAiNGO, please follow our naming conventions:

  • Variable names are written in camel case, starting with a lower case letter
  • Type names are written in camel case, starting with an upper case letter
  • Function names are all lower case, potentially with underscores
  • Enums are all capital letters
  • Private members (both functions and variables) additionally start with an underscore