Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MATLAB primme_svds/record_history error #50

Open
jeremy-myers opened this issue Jul 7, 2021 · 2 comments
Open

MATLAB primme_svds/record_history error #50

jeremy-myers opened this issue Jul 7, 2021 · 2 comments

Comments

@jeremy-myers
Copy link

An error occurs in MATLAB prime_svds() with the following minimum working example:

>> A = randn(1000,1000);
>> opts = struct();
>> opts.tol = 1e-10;
>> [U,S,V,R,STAT,HIST]=primme_svds(A,10,'L',opts);
Operands to the || and && operators must be convertible to logical scalar values.
Error in primme_svds/record_history (line 635)
      if stage == 0 && methodStage2 ~= 0
Error in primme_svds>@(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)record_history(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) (line 528)
               @(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)record_history(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13));
Error in primme_svds (line 560)
      [ierr, svals, norms, svecsl, svecsr] = primme_mex(xprimme_svds, init{1}, ... 

It appears methodStage2 returns a vector and the if statement cannot parse this (MATLAB 2020a). A workaround is to change methodStage2 ~= 0 to any(methodStage2 ~= 0).

@eromero-vlc
Copy link
Collaborator

Thanks, Jeremy, for reporting the issue. I was able to replicated it on MATLAB 2021.

methodStage2 should be one number, which indicates the method used for the second stage. I'll dig in and figure out why primme_mex is returning a vector of numbers instead.

@eromero-vlc
Copy link
Collaborator

I pushed the fix on the master branch. Give it a try when you have a sec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants