    

 ## On this page

  

 

 # /home/lgraenin/develop/optiSLang/protos/mopsolver/mopsolver\_api2\_shared.h File Reference

 Last update: 16.07.2025 

`#include "mopsolver_api_shared.h"`  


[Go to the source code of this file.](mopsolver__api2__shared_8h_source.xhtml)

## <a id="enum-members" name="enum-members"></a>Enumerations

enum [DMOP2\_SOLVE\_FLAG](mopsolver__api2__shared_8h.xhtml#a9d02108e77fa0ce32247bd4478fa2b0b) {   
 [SOLVE\_EXTRAPOLATE](mopsolver__api2__shared_8h.xhtml#a9d02108e77fa0ce32247bd4478fa2b0babdf84129bd1eddedb34a7cb60847a038) = 1 , [SOLVE\_RESPONSES](mopsolver__api2__shared_8h.xhtml#a9d02108e77fa0ce32247bd4478fa2b0bab5ca18a75197776540aecf4572c1d5fe) = 2 , [SOLVE\_CRITERIA](mopsolver__api2__shared_8h.xhtml#a9d02108e77fa0ce32247bd4478fa2b0bae833c1cfeacab058c7651d5f52a331a3) = 4 , [SOLVE\_DENSITIES](mopsolver__api2__shared_8h.xhtml#a9d02108e77fa0ce32247bd4478fa2b0ba0f075abe0480ae5dba49361542105e93) = 8 ,   
 [SOLVE\_ERRORS](mopsolver__api2__shared_8h.xhtml#a9d02108e77fa0ce32247bd4478fa2b0ba4d0e54817eeefe0b4d3c80da29954879) = 16   
 } enum [DMOP2\_DIMENSION\_FLAG](mopsolver__api2__shared_8h.xhtml#ae71ebc38d8f28e122d564249414ea519) { [DIM\_INPUTS](mopsolver__api2__shared_8h.xhtml#ae71ebc38d8f28e122d564249414ea519adb23389bbc1ccb64fa2bfda339aa782d) = 1 , [DIM\_RESPONSES](mopsolver__api2__shared_8h.xhtml#ae71ebc38d8f28e122d564249414ea519a4cbae4944616299dfcc52ddf1e490b61) = 2 , [DIM\_CRITERIA](mopsolver__api2__shared_8h.xhtml#ae71ebc38d8f28e122d564249414ea519a205872b5445eefc8aab6dfd4588ddd52) = 4 } enum [DMOP2\_NAME\_FLAG](mopsolver__api2__shared_8h.xhtml#a919e4b2e211e2d3c06a2cd81f75a5993) { [NAME\_INPUTS](mopsolver__api2__shared_8h.xhtml#a919e4b2e211e2d3c06a2cd81f75a5993a79c10bd78049e47bfed6b564d27b62ad) = 1 , [NAME\_RESPONSES](mopsolver__api2__shared_8h.xhtml#a919e4b2e211e2d3c06a2cd81f75a5993a7b78423d9c98ddad4e690a2c3b9f8f47) = 2 , [NAME\_CRITERIA](mopsolver__api2__shared_8h.xhtml#a919e4b2e211e2d3c06a2cd81f75a5993a3d616f3b9eac8bbf7945fce33b42d0d8) = 4 } enum [DMOP2\_PER\_RESPONSE\_FLAG](mopsolver__api2__shared_8h.xhtml#a5d50d64a9e5bf93f7e479f274f39a2e8) { [RESP\_EXTRAPOLATE](mopsolver__api2__shared_8h.xhtml#a5d50d64a9e5bf93f7e479f274f39a2e8a2bf0649346449ad52f658321010a4356) = 1 , [RESP\_GRADIENTS](mopsolver__api2__shared_8h.xhtml#a5d50d64a9e5bf93f7e479f274f39a2e8a7acef09112df0227f429ceacc6d64b34) = 2 , [RESP\_DENSITIES](mopsolver__api2__shared_8h.xhtml#a5d50d64a9e5bf93f7e479f274f39a2e8afb1a9998534e839d59740c5d98655f57) = 4 , [RESP\_ERRORS](mopsolver__api2__shared_8h.xhtml#a5d50d64a9e5bf93f7e479f274f39a2e8ac7007812a879e80f3b9e14d93e715dea) = 8 } enum [DMOP2\_RETURN\_CODES](mopsolver__api2__shared_8h.xhtml#afc0920966340b6d1cc6122f8c44b689f) {   
 **dmop2\_success** = 0 , **dmop2\_error** = 1 , **dmop2\_exception\_occured** = 2 , **dmop2\_custom\_interface\_not\_enabled** = 4 ,   
 **dmop2\_wrong\_input\_argument** = 41   
 } ## <a id="func-members" name="func-members"></a>Functions

DYNARDO\_MOPSOLVER\_API const char \* [dmop2\_getLastError](mopsolver__api2__shared_8h.xhtml#abd7972e7a1687d4b1708bc9fac570aa1) () DYNARDO\_MOPSOLVER\_API int [dmop2\_free](mopsolver__api2__shared_8h.xhtml#a932cf054e78fd8f1069a1ea8d9a88cbe) (void \*\_pointer) DYNARDO\_MOPSOLVER\_API const char \* [dmop2\_get\_version\_str](mopsolver__api2__shared_8h.xhtml#a3de6521ea7642d7979ad944643edea2b) () DYNARDO\_MOPSOLVER\_API int [dmop2\_cleanup](mopsolver__api2__shared_8h.xhtml#abaaf6eb148aeb3e5368597475f6b7a75) () DYNARDO\_MOPSOLVER\_API int [dmop2\_set\_paths\_for\_custom\_interface](mopsolver__api2__shared_8h.xhtml#a3b7b35bbecdf38a33b2eb150e61add8f) (const char \*\_program\_path, const char \*\_python\_home, const char \*const \*\_python\_paths, unsigned int \_num\_python\_paths, const char \*const \*\_script\_paths, unsigned int \_num\_script\_paths, const char \*\_oop\_path) <a id="details" name="details"></a>## Detailed Description

Version$Rev$ 

## Enumeration Type Documentation

<a id="ae71ebc38d8f28e122d564249414ea519" name="ae71ebc38d8f28e122d564249414ea519"></a>## [◆ ](#ae71ebc38d8f28e122d564249414ea519)DMOP2\_DIMENSION\_FLAG

 enum [DMOP2\_DIMENSION\_FLAG](mopsolver__api2__shared_8h.xhtml#ae71ebc38d8f28e122d564249414ea519)

Enum containing the flags to control the behaviour of the getDimensions method

Enumerator<a id="ae71ebc38d8f28e122d564249414ea519adb23389bbc1ccb64fa2bfda339aa782d" name="ae71ebc38d8f28e122d564249414ea519adb23389bbc1ccb64fa2bfda339aa782d"></a>DIM\_INPUTS if set, the number of inputs is written to the output array

<a id="ae71ebc38d8f28e122d564249414ea519a4cbae4944616299dfcc52ddf1e490b61" name="ae71ebc38d8f28e122d564249414ea519a4cbae4944616299dfcc52ddf1e490b61"></a>DIM\_RESPONSES if set, the number of responses is written to the output array

<a id="ae71ebc38d8f28e122d564249414ea519a205872b5445eefc8aab6dfd4588ddd52" name="ae71ebc38d8f28e122d564249414ea519a205872b5445eefc8aab6dfd4588ddd52"></a>DIM\_CRITERIA if set, the number of criteria is written to the output array





<a id="a919e4b2e211e2d3c06a2cd81f75a5993" name="a919e4b2e211e2d3c06a2cd81f75a5993"></a>## [◆ ](#a919e4b2e211e2d3c06a2cd81f75a5993)DMOP2\_NAME\_FLAG

 enum [DMOP2\_NAME\_FLAG](mopsolver__api2__shared_8h.xhtml#a919e4b2e211e2d3c06a2cd81f75a5993)

Enum containing the flags to control the behaviour of the getNames method

Enumerator<a id="a919e4b2e211e2d3c06a2cd81f75a5993a79c10bd78049e47bfed6b564d27b62ad" name="a919e4b2e211e2d3c06a2cd81f75a5993a79c10bd78049e47bfed6b564d27b62ad"></a>NAME\_INPUTS if set, the names of the inputs are returned

<a id="a919e4b2e211e2d3c06a2cd81f75a5993a7b78423d9c98ddad4e690a2c3b9f8f47" name="a919e4b2e211e2d3c06a2cd81f75a5993a7b78423d9c98ddad4e690a2c3b9f8f47"></a>NAME\_RESPONSES if set, the names of the outputs are returned

<a id="a919e4b2e211e2d3c06a2cd81f75a5993a3d616f3b9eac8bbf7945fce33b42d0d8" name="a919e4b2e211e2d3c06a2cd81f75a5993a3d616f3b9eac8bbf7945fce33b42d0d8"></a>NAME\_CRITERIA if set, the names of the criteria are returned





<a id="a5d50d64a9e5bf93f7e479f274f39a2e8" name="a5d50d64a9e5bf93f7e479f274f39a2e8"></a>## [◆ ](#a5d50d64a9e5bf93f7e479f274f39a2e8)DMOP2\_PER\_RESPONSE\_FLAG

 enum [DMOP2\_PER\_RESPONSE\_FLAG](mopsolver__api2__shared_8h.xhtml#a5d50d64a9e5bf93f7e479f274f39a2e8)

Enum containing the flags to control the behaviour of the get\_per\_response method

Enumerator<a id="a5d50d64a9e5bf93f7e479f274f39a2e8a2bf0649346449ad52f658321010a4356" name="a5d50d64a9e5bf93f7e479f274f39a2e8a2bf0649346449ad52f658321010a4356"></a>RESP\_EXTRAPOLATE if set, extrapolation is activated

<a id="a5d50d64a9e5bf93f7e479f274f39a2e8a7acef09112df0227f429ceacc6d64b34" name="a5d50d64a9e5bf93f7e479f274f39a2e8a7acef09112df0227f429ceacc6d64b34"></a>RESP\_GRADIENTS if set, the gradient values of the response are written to the output array

<a id="a5d50d64a9e5bf93f7e479f274f39a2e8afb1a9998534e839d59740c5d98655f57" name="a5d50d64a9e5bf93f7e479f274f39a2e8afb1a9998534e839d59740c5d98655f57"></a>RESP\_DENSITIES if set, the density value of the response is written to the output array

<a id="a5d50d64a9e5bf93f7e479f274f39a2e8ac7007812a879e80f3b9e14d93e715dea" name="a5d50d64a9e5bf93f7e479f274f39a2e8ac7007812a879e80f3b9e14d93e715dea"></a>RESP\_ERRORS if set, the errors of the response are written to the output array





<a id="afc0920966340b6d1cc6122f8c44b689f" name="afc0920966340b6d1cc6122f8c44b689f"></a>## [◆ ](#afc0920966340b6d1cc6122f8c44b689f)DMOP2\_RETURN\_CODES

 enum [DMOP2\_RETURN\_CODES](mopsolver__api2__shared_8h.xhtml#afc0920966340b6d1cc6122f8c44b689f)

Enum containing the return codes used by the dmop2 methods, similar to the mop\_api.h codes





<a id="a9d02108e77fa0ce32247bd4478fa2b0b" name="a9d02108e77fa0ce32247bd4478fa2b0b"></a>## [◆ ](#a9d02108e77fa0ce32247bd4478fa2b0b)DMOP2\_SOLVE\_FLAG

 enum [DMOP2\_SOLVE\_FLAG](mopsolver__api2__shared_8h.xhtml#a9d02108e77fa0ce32247bd4478fa2b0b)

Enum containing the flags to control the behaviour of the solve method

Enumerator<a id="a9d02108e77fa0ce32247bd4478fa2b0babdf84129bd1eddedb34a7cb60847a038" name="a9d02108e77fa0ce32247bd4478fa2b0babdf84129bd1eddedb34a7cb60847a038"></a>SOLVE\_EXTRAPOLATE if set, extrapolation is activated

<a id="a9d02108e77fa0ce32247bd4478fa2b0bab5ca18a75197776540aecf4572c1d5fe" name="a9d02108e77fa0ce32247bd4478fa2b0bab5ca18a75197776540aecf4572c1d5fe"></a>SOLVE\_RESPONSES if set, the response values are written to the output array

<a id="a9d02108e77fa0ce32247bd4478fa2b0bae833c1cfeacab058c7651d5f52a331a3" name="a9d02108e77fa0ce32247bd4478fa2b0bae833c1cfeacab058c7651d5f52a331a3"></a>SOLVE\_CRITERIA if set, the criteria values are written to the output array

<a id="a9d02108e77fa0ce32247bd4478fa2b0ba0f075abe0480ae5dba49361542105e93" name="a9d02108e77fa0ce32247bd4478fa2b0ba0f075abe0480ae5dba49361542105e93"></a>SOLVE\_DENSITIES if set, the density values are written to the output array

<a id="a9d02108e77fa0ce32247bd4478fa2b0ba4d0e54817eeefe0b4d3c80da29954879" name="a9d02108e77fa0ce32247bd4478fa2b0ba4d0e54817eeefe0b4d3c80da29954879"></a>SOLVE\_ERRORS if set, the error values (CoP, RMSE, error, absolute error) are written to the output array





## Function Documentation

<a id="abaaf6eb148aeb3e5368597475f6b7a75" name="abaaf6eb148aeb3e5368597475f6b7a75"></a>## [◆ ](#abaaf6eb148aeb3e5368597475f6b7a75)dmop2\_cleanup()

 DYNARDO\_MOPSOLVER\_API int dmop2\_cleanup  ( ) 

cleans-up all the memory allocated by the API, use this after you've finished using the API. Objects pointing to memory provided by this API are going to be invalidated.

Returnszero 



<a id="a932cf054e78fd8f1069a1ea8d9a88cbe" name="a932cf054e78fd8f1069a1ea8d9a88cbe"></a>## [◆ ](#a932cf054e78fd8f1069a1ea8d9a88cbe)dmop2\_free()

 DYNARDO\_MOPSOLVER\_API int dmop2\_free  ( void \*  *\_pointer*) 

Frees the memory allocated at the specified pointer

Parameters \[in\]\_pointerPointer to the memory that should be freed Returnszero if the memory was successfully freed 



<a id="a3de6521ea7642d7979ad944643edea2b" name="a3de6521ea7642d7979ad944643edea2b"></a>## [◆ ](#a3de6521ea7642d7979ad944643edea2b)dmop2\_get\_version\_str()

 DYNARDO\_MOPSOLVER\_API const char \* dmop2\_get\_version\_str  ( ) 

Retrieves the current OptiSLang version and returns it as a string

ReturnsString containing the current OptiSLang version 



<a id="abd7972e7a1687d4b1708bc9fac570aa1" name="abd7972e7a1687d4b1708bc9fac570aa1"></a>## [◆ ](#abd7972e7a1687d4b1708bc9fac570aa1)dmop2\_getLastError()

 DYNARDO\_MOPSOLVER\_API const char \* dmop2\_getLastError  ( ) 

Calling a solver API function will reset the string, so you'll need to check for errors immediately after the function call.

ReturnsString describing last error or `nullptr` if no error occured. 



<a id="a3b7b35bbecdf38a33b2eb150e61add8f" name="a3b7b35bbecdf38a33b2eb150e61add8f"></a>## [◆ ](#a3b7b35bbecdf38a33b2eb150e61add8f)dmop2\_set\_paths\_for\_custom\_interface()

 DYNARDO\_MOPSOLVER\_API int dmop2\_set\_paths\_for\_custom\_interface  ( const char \*  *\_program\_path*,    const char \*  *\_python\_home*,    const char \*const \*  *\_python\_paths*,    unsigned int  *\_num\_python\_paths*,    const char \*const \*  *\_script\_paths*,    unsigned int  *\_num\_script\_paths*,    const char \*  *\_oop\_path*   ) 

set up custom interface application-wide