From 95fd6a649060398c9890fa60815af9f4f8ddfcb8 Mon Sep 17 00:00:00 2001 From: Stefan Vigerske Date: Wed, 3 Jan 2024 09:36:05 +0700 Subject: [PATCH] add function to C interface to access ClpSimplex* member of Clp_Simplex* - closes #283 --- src/Clp_C_Interface.cpp | 6 ++++++ src/Clp_C_Interface.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/Clp_C_Interface.cpp b/src/Clp_C_Interface.cpp index 8b5ec473d..b2954d3de 100644 --- a/src/Clp_C_Interface.cpp +++ b/src/Clp_C_Interface.cpp @@ -1385,6 +1385,12 @@ ClpSolveSetIntProperty(setInfeasibleReturn) ClpSolveGetIntProperty(substitution) ClpSolveSetIntProperty(setSubstitution) +/** give pointer to ClpSimplex object (C++ class) */ +void* CLP_LINKAGE Clp_getClpSimplex(Clp_Simplex *model) +{ + return static_cast(model->model_); +} + #if defined(__MWERKS__) #pragma export off #endif diff --git a/src/Clp_C_Interface.h b/src/Clp_C_Interface.h index 567a8e289..d9c1aebaf 100644 --- a/src/Clp_C_Interface.h +++ b/src/Clp_C_Interface.h @@ -546,8 +546,14 @@ CLPLIB_EXPORT void CLP_LINKAGE ClpSolve_setPresolveActions(Clp_Solve *, int acti CLPLIB_EXPORT int CLP_LINKAGE ClpSolve_substitution(Clp_Solve *); CLPLIB_EXPORT void CLP_LINKAGE ClpSolve_setSubstitution(Clp_Solve *, int value); +/*@}*/ +/**@name Functions for expert users */ +/*@{*/ +/** gives pointer to ClpSimplex object (C++ class), return should be cast to ClpSimplex* */ +CLPLIB_EXPORT void* CLP_LINKAGE Clp_getClpSimplex(Clp_Simplex *model); /*@}*/ + #ifdef __cplusplus } #endif