Question

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).
Was it helpful?

Solution

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.

OTHER TIPS

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.

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...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top