Bruno,
Thanks a lot! Now there's a new error on the last line...
At first I thought, maybe there's a missing brace, however the I found that was not the case. The new code was working with matlab 32 bit build-in compiler, but not the LCC on linux.
Rui
-----------------------
minkmex.c: In function ?MinMaxResult?:
minkmex.c:293: warning: incompatible implicit declaration of built-in function ?memset?
minkmex.c: In function ?LocResult?:
minkmex.c:322: warning: incompatible implicit declaration of built-in function ?memset?
minkmex.c: In function ?mexFunction?:
minkmex.c:580: error: expected declaration or statement at end of input
mex: compile of ' "minkmex.c"' failed.
??? Error using ==> mex at 208
Unable to complete successfully.
Error in ==> minmax_install at 46
mex(mexopts{:},'minkmex.c');
Comment only
26 Apr 2013
Min/Max selection
Search for k smallest or largest elements in the array
Rui,
The error is in line #544 (look at the error message). Try to replace the C++ comment style
// in case the positive set is unordered
by C comment style
/* in case the positive set is unordered */
Comment only
26 Apr 2013
Min/Max selection
Search for k smallest or largest elements in the array
Hi Bruno,
I like this function. I got a lot of fun with it on Windows, but when I switched to Linux server with GCC compiler, it did not work. The error was the same as jianbo posted two years ago. I tried to modify minkmex.c file as you suggested, (replace "memset((data+p0), 0, sizeof(double)*nz)" with "memset((void*)(data+p0), 0, sizeof(double)*nz)") but it did not work. I tired both matlab 2012a and 2010b on our server, but neither worked. Could you help me on it? Thanks in advance!
--------------------
minkmex.c: In function ?MinMaxResult?:
minkmex.c:293: warning: incompatible implicit declaration of built-in function ?memset?
minkmex.c: In function ?LocResult?:
minkmex.c:322: warning: incompatible implicit declaration of built-in function ?memset?
minkmex.c: In function ?mexFunction?:
minkmex.c:544: error: expected expression before ?/? token
mex: compile of ' "minkmex.c"' failed.
??? Error using ==> mex at 208
Unable to complete successfully.
Error in ==> minmax_install at 46
mex(mexopts{:},'minkmex.c');
Comment only