Changeset 2019 for trunk/Clp/src


Ignore:
Timestamp:
Jan 31, 2014 12:18:01 AM (6 years ago)
Author:
stefan
Message:

add function Clp_freeRay to C interface to free a ray given by Clp_infeasibility/unboundedRay; add functions to get Clp version number from library

Location:
trunk/Clp/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/Clp_C_Interface.cpp

    r1926 r2019  
    1111
    1212#include "CoinHelperFunctions.hpp"
     13#include "ClpConfig.h"
    1314#include "ClpSimplex.hpp"
    1415#include "ClpInterior.hpp"
     
    198199#pragma export on
    199200#endif
     201
     202
     203COINLIBAPI const char* COINLINKAGE
     204Clp_Version(void)
     205{
     206   return CLP_VERSION;
     207}
     208COINLIBAPI int COINLINKAGE
     209Clp_VersionMajor(void)
     210{
     211   return CLP_VERSION_MAJOR;
     212}
     213COINLIBAPI int COINLINKAGE Clp_VersionMinor(void)
     214{
     215   return CLP_VERSION_MINOR;
     216}
     217COINLIBAPI int COINLINKAGE Clp_VersionRelease(void)
     218{
     219   return CLP_VERSION_RELEASE;
     220}
     221
    200222/* Default constructor */
    201223COINLIBAPI Clp_Simplex *  COINLINKAGE
     
    668690     }
    669691     return array;
     692}
     693COINLIBAPI void COINLINKAGE
     694Clp_freeRay(Clp_Simplex * model, double * ray)
     695{
     696     free(ray);
    670697}
    671698/* See if status array exists (partly for OsiClp) */
  • trunk/Clp/src/Clp_C_Interface.h

    r1902 r2019  
    2828extern "C" {
    2929#endif
     30
     31     /**@name Version info
     32      *
     33      * A Clp library has a version number of the form <major>.<minor>.<release>,
     34      * where each of major, minor, and release are nonnegative integers.
     35      * For a checkout of the Clp stable branch, release is 9999.
     36      * For a checkout of the Clp development branch, major, minor, and release are 9999.
     37      */
     38     /*@{*/
     39     /** Clp library version number as string. */
     40     COINLIBAPI const char* COINLINKAGE Clp_Version(void);
     41     /** Major number of Clp library version. */
     42     COINLIBAPI int COINLINKAGE Clp_VersionMajor(void);
     43     /** Minor number of Clp library version. */
     44     COINLIBAPI int COINLINKAGE Clp_VersionMinor(void);
     45     /** Release number of Clp library version. */
     46     COINLIBAPI int COINLINKAGE Clp_VersionRelease(void);
     47     /*@}*/
    3048
    3149     /**@name Constructors and destructor
     
    213231     /** Integer information */
    214232     COINLIBAPI char * COINLINKAGE Clp_integerInformation(Clp_Simplex * model);
    215      /** Infeasibility/unbounded ray (NULL returned if none/wrong)
    216          Up to user to use free() on these arrays.  */
     233     /** Gives Infeasibility ray.
     234      *
     235      * Use Clp_freeRay to free the returned array.
     236      *
     237      * @return infeasibility ray, or NULL returned if none/wrong.
     238      */
    217239     COINLIBAPI double * COINLINKAGE Clp_infeasibilityRay(Clp_Simplex * model);
     240     /** Gives ray in which the problem is unbounded.
     241      *
     242      * Use Clp_freeRay to free the returned array.
     243      *
     244      * @return unbounded ray, or NULL returned if none/wrong.
     245      */
    218246     COINLIBAPI double * COINLINKAGE Clp_unboundedRay(Clp_Simplex * model);
     247     /** Frees a infeasibility or unbounded ray. */
     248     COINLIBAPI void COINLINKAGE Clp_freeRay(Clp_Simplex * model, double * ray);
    219249     /** See if status array exists (partly for OsiClp) */
    220250     COINLIBAPI int COINLINKAGE Clp_statusExists(Clp_Simplex * model);
Note: See TracChangeset for help on using the changeset viewer.