| 1 |
|
| 2 |
/* CoinResult.h */ |
| 3 |
|
| 4 |
|
| 5 |
#include <stdlib.h> |
| 6 |
#include <string.h> |
| 7 |
|
| 8 |
#include "CoinResult.h" |
| 9 |
|
| 10 |
|
| 11 |
PRESULT coinCreateResultObject(void) |
| 12 |
{ |
| 13 |
PRESULT pResult; |
| 14 |
|
| 15 |
pResult = (PRESULT)malloc(sizeof(RESULTINFO)); |
| 16 |
memset(pResult, 0, sizeof(RESULTINFO)); |
| 17 |
|
| 18 |
pResult->SolutionStatus = 0; |
| 19 |
strcpy(pResult->SolutionText, ""); |
| 20 |
|
| 21 |
pResult->ObjectValue = 0.0; |
| 22 |
pResult->MipBestBound = 0.0; |
| 23 |
pResult->IterCount = 0; |
| 24 |
pResult->MipNodeCount = 0; |
| 25 |
|
| 26 |
pResult->ColActivity = NULL; |
| 27 |
pResult->ReducedCost = NULL; |
| 28 |
pResult->RowActivity = NULL; |
| 29 |
pResult->SlackValues = NULL; |
| 30 |
pResult->ShadowPrice = NULL; |
| 31 |
|
| 32 |
pResult->ObjLoRange = NULL; |
| 33 |
pResult->ObjUpRange = NULL; |
| 34 |
pResult->RhsLoRange = NULL; |
| 35 |
pResult->RhsUpRange = NULL; |
| 36 |
|
| 37 |
pResult->ColStatus = NULL; |
| 38 |
pResult->RowStatus = NULL; |
| 39 |
|
| 40 |
return pResult; |
| 41 |
} |
| 42 |
|
| 43 |
|
| 44 |
void coinClearResultObject(PRESULT pResult) |
| 45 |
{ |
| 46 |
if (!pResult) { |
| 47 |
return; |
| 48 |
} |
| 49 |
if (pResult->ColActivity) free(pResult->ColActivity); |
| 50 |
if (pResult->ReducedCost) free(pResult->ReducedCost); |
| 51 |
if (pResult->RowActivity) free(pResult->RowActivity); |
| 52 |
if (pResult->SlackValues) free(pResult->SlackValues); |
| 53 |
if (pResult->ShadowPrice) free(pResult->ShadowPrice); |
| 54 |
|
| 55 |
if (pResult->ObjLoRange) free(pResult->ObjLoRange); |
| 56 |
if (pResult->ObjUpRange) free(pResult->ObjUpRange); |
| 57 |
if (pResult->ObjUpRange) free(pResult->ObjUpRange); |
| 58 |
if (pResult->RhsUpRange) free(pResult->RhsUpRange); |
| 59 |
|
| 60 |
if (pResult->ColStatus) free(pResult->ColStatus); |
| 61 |
if (pResult->ColStatus) free(pResult->ColStatus); |
| 62 |
free(pResult); |
| 63 |
} |
| 64 |
|
| 65 |
|