source: trunk/CoinMP/src/CoinSolver.c @ 524

Last change on this file since 524 was 433, checked in by bjarni, 8 years ago

Adding new CoinRegisterXXXCallback functions to the C-API that support UserParam? pointers.

File size: 940 bytes
Line 
1
2/*  CoinSolver.c  */
3
4#include <stdlib.h>
5#include <string.h>
6
7#include "CoinSolver.h"
8
9
10PSOLVER coinCreateSolverObject()
11{
12        PSOLVER pSolver;
13
14        pSolver = (PSOLVER)malloc(sizeof(SOLVERINFO));
15        memset(pSolver, 0, sizeof(SOLVERINFO));
16
17        strcpy(pSolver->LogFilename, "");
18
19        pSolver->MsgLogCB       = NULL;
20        pSolver->LPIterCB       = NULL;
21        pSolver->MipNodeCB      = NULL;
22
23        pSolver->MsgLogParam = NULL;
24        pSolver->LPIterParam = NULL;
25        pSolver->MipNodeParam = NULL;
26
27        pSolver->MsgLogCallback = NULL;
28        pSolver->IterCallback = NULL;
29        pSolver->MipNodeCallback = NULL;
30
31        return pSolver;
32}
33
34
35void coinClearSolverObject(PSOLVER pSolver)
36{
37        if (!pSolver) {
38                return;
39        }
40        free(pSolver);
41}
42
43
44void coinSetLogFilename(PSOLVER pSolver, const char* LogFilename)
45{
46        if (LogFilename) {
47                strcpy(pSolver->LogFilename, LogFilename);
48        }
49}
50
51
52const char* coinGetLogFilename(PSOLVER pSolver)
53{
54        return pSolver->LogFilename;
55}
56
Note: See TracBrowser for help on using the repository browser.