Normalized cuts with Matlab 2013a
Asked Answered
F

3

8

I am using the normalized cuts package from http://www.cis.upenn.edu/~jshi/software/Ncut_9.zip (on Windows 7)

This used to work fine with Matlab2010a. However I have upgraded to Matlab2013a (32 bit student version) and I now get the following error:

Error using arpackc
Expect 2 output arguments

Error in eigs_new (line 240)
        arpackc( aupdfun, ido, ...

Error in ncut (line 83)
[vbar,s,convergence] =
eigs_new(@mex_w_times_x_symmetric,size(P,1),nbEigenValues,'LA',options,tril(P));

Error in ncutW (line 9)
[NcutEigenvectors,NcutEigenvalues] =
ncut(W,nbcluster);

Error in NcutImage (line 18)
[NcutDiscrete,NcutEigenvectors,NcutEigenvalues]
= ncutW(W,nbSegments);

Error in demoNcutImage (line 25)
[SegLabel,NcutDiscrete,NcutEigenvectors,NcutEigenvalues,W,imageEdges]=
NcutImage(I,nbSegments);

Obviously the new_eigs() function in ncuts is incompatible with the ARPACK version in the latest Matlab.

  • Does anybody know of a workaround for this?
  • Normalised uses a modified version of Matlab's eigs() function. Why can't I just use Matlab's built-in eigs() instead of eigs_new() (it does seem to work).
Farica answered 8/5, 2013 at 14:23 Comment(1)
can you explain why eigs() does not work for you?Mandymandych
F
8

There are two solutions to this:

  1. Use Matlab's eigs() function instead of the eigs_new() provided in the normalized cuts package. I guess eigs_new() was designed to solve some compatibility issue with a previous version of Matlab, and is now itself causing an issue.

  2. Modify eigs_new(). Where there is a call to arpackc() in eigs_new(), make the call like in the tool box version of eigs(). So, e.g.:

    arpackc( aupdfun, ido, ...
     bmat, intconvert(n), whch, nev, tol, resid, ncv, ...
        v, ldv, iparam, ipntr, workd, workl, lworkl, info );
    

becomes

    [ido, info] = arpackc( aupdfun, ido, bmat, intconvert(n), whch, ...
        nev, tol, resid, ncv, v, ldv, iparam, ipntr, workd, workl, ...
        lworkl, info );

There were only two places where this had to be changed to make it work (although there other calls to arpackc() which don't actually get executed).

I am still not sure why eigs_new() exists at all.

Farica answered 8/5, 2013 at 15:10 Comment(0)
M
6

In matlab2014a 64bit windows, you only change

[vbar,s,convergence] = eigs_new(@mex_w_times_x_symmetric,size(P,1),nbEigenValues,'LA',options,tril(P));

in line 81 of ncut.m into

[vbar,s,convergence] = eigs(@mex_w_times_x_symmetric,size(P,1),nbEigenValues,'LA',options,tril(P));

and then eigs_new.m is useless which don't care. Becaus in 2014 (or more than 2009 ) arpackc has been replaced with eigs. And you can read the help of eigs for more help.

Morpheus answered 22/12, 2014 at 3:59 Comment(0)
M
0

I used to work with this code a while ago. For 32-64 bit issues I made some changes. I also changed this eigs_new line into

[vbar,s,convergence] = eigs2(@mex_w_times_x_symmetric,size(P,1),nbEigenValues,'LA',options,tril(P)); 

Should work...

Mandymandych answered 8/5, 2013 at 14:33 Comment(3)
There doesn't seem to an eigs2() in my version of Matlab, so this unfortunately doesn't help.Farica
@user2151446 try oifii.org/ns-org/nsd/ar/cp/music_marsyas-0.4.5/marsyas-0.4/…Mandymandych
Thanks, however this version of eigs2() has the same incompatibility with arpackc() in Matlab2013a as eigs_new()Farica

© 2022 - 2024 — McMap. All rights reserved.