|
From: | Giorgio Sartor |
Subject: | [Help-glpk] Installing GLPKMEX, the glp_long problem |
Date: | Tue, 23 Apr 2013 17:59:21 +0200 |
glpkcc.cpp:374: error: `glp_long #39; was not declared in this scope glpkcc.cpp:374: error: expected `; #39; before "tpeak" glpkcc.cpp:375: error: `tpeak #39; was not declared in this scope
The code is:glp_long tpeak;
In fact, I suppose that the declaration of glp_mem_usage is changed from the past and now is:
void glp_mem_usage(int *count, int *cpeak, size_t *total, size_t *tpeak);
A simple solution for this problem is by changing the code as:
size_t tpeak;
glp_mem_usage(NULL, NULL, NULL, &tpeak);
*mem=(double) tpeak / (1024);
I recall that *tpeak is the peak value of *total reached since the initialization of the GLPK library environment and *total is the total amount, in bytes, of currently allocated memory blocks. So, the division by 1024 has the only purpose to convert bytes in kilobytes.
I hope it can help someone.
Best,
Gioker
[Prev in Thread] | Current Thread | [Next in Thread] |