dgleich / matlab-bgl

A graph library for Matlab based on the boost graph library
http://dgleich.github.com/matlab-bgl
107 stars 70 forks source link

c file not recognized : 'matlab_bgl_sp_mex' #25

Open megalulu opened 2 years ago

megalulu commented 2 years ago

Hello,

Thank you for creating this algorithm! I downloaded it because it seems to be a dependency for the code of directional connectivity index (DCI). I want to calculate the DCI for a riparian ecosystem in two directions (along the river axis and perpendicular to the river axis).

I'm new to Matlab, but I get this error when running the code:

Error in shortest_paths (line 131) [d pred] = matlab_bgl_sp_mex(A,u,target,lower(options.algname),options.inf,...

Error in DCIu (line 29) d = shortest_paths(distance, start_nodes(ii)); %A vector of the shortest path between starting/source node and all other nodes

Error in connectivity_at_angle (line 117) fval = DCIu(distance, dx, pixelx)

the 'matlab_bgl_sp_mex.c' function seems to be written in c, and Matlab doesn't recognize it. There should be a matlab_bgl_sp_mex.h file associated to it?

Thank you for any help! Meghana

dgleich commented 2 years ago

Hi there -- you might have to rename some of the mex files if you are on windows. What system do you have?

Abhay2412 commented 1 year ago

Undefined function or variable 'matlab_bgl_sp_mex'.

Error in shortest_paths (line 131) [d pred] = matlab_bgl_sp_mex(A,u,target,lower(options.algname),options.inf,...

Error in dijkstra_sp (line 53) [d pred] = shortest_paths(A,u,options);

Error in OCY_assign_dist (line 70) [d,~]=dijkstra_sp(A,cels(i).node);

Error in OCY_main (line 71) [node,link,cell] = OCY_assign_dist(node,link,cells,A); %this is the step that takes longest, preallocate the struct for speed

Error in OCY_analyze_all (line 19) OCY_main(path{i},'*.tif'); Hello, I have come across a similar situation as well when using this and I am new to MatLab as well. I am currently on Windows hoping to see if there was a resolution to this. Do I have to rename the .c files which end with _mex to something else?

dgleich commented 1 year ago

No, you may need to rename the .dll files to .mexw32 ...

Abhay2412 commented 1 year ago

Sorry, but where would I find these .dll files

dgleich commented 1 year ago

They should be in the private directory

On Mon, Oct 3, 2022 at 10:00 AM Abhay Khosla @.***> wrote:

Sorry, but where would I find these .dll files

— Reply to this email directly, view it on GitHub https://github.com/dgleich/matlab-bgl/issues/25#issuecomment-1265488430, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIJS24ZR2J6SW3TQ4HBMDWBLRJFANCNFSM5BHADIIA . You are receiving this because you commented.Message ID: @.***>

Abhay2412 commented 1 year ago

privateDirectory This is all I see in the private directory

dgleich commented 1 year ago

Please download the library from mathworks https://www.mathworks.com/matlabcentral/fileexchange/10922-matlabbgl

Abhay2412 commented 1 year ago

Should I remove the old matlab-bgl-master from the MATLAB path as the link you shared once I added the private folder has more files and even with .mexw32 and .mexw64. And thank you so much for your help means alot 👍

dgleich commented 1 year ago

Correct, you don't need the old one.

Abhay2412 commented 1 year ago

Just wanted to say a huge thanks for resolving the issue I was having. I appreciate your swift responses.