MAiNGO
Using MAiNGO in Other Software

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.

For an example of how to use the MAiNGO object, please refer to the file examples/mainCppApi.cpp. 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. Note that MAiNGO stores a copy of the model internally (or rather, its own representation of the model). Therefore, any changes made to you model object after handing it to MAiNGO (via the constructor or the set_model function) will not change the model that MAiNGO will use in the next call to solve etc. If you want MAiNGO to known about these changes, you need to hand the updated model to MAiNGO again 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 Public License - v2.0. Please refer to the LICENSE file in the root of the MAiNGO repository. Note that the third-party dependencies in the dep folder use different licenses.

Regarding the implementation of MAiNGO, just explore this documentation. If you intend to contribute your changes to 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