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

IRSparsity fails to run #3

Open
dimkab opened this issue Mar 3, 2020 · 5 comments
Open

IRSparsity fails to run #3

dimkab opened this issue Mar 3, 2020 · 5 comments

Comments

@dimkab
Copy link

dimkab commented Mar 3, 2020

The error message when running IRSparsity:

Dot indexing is not supported for variables of this type.

Error in IRget>IRgetfast (line 103)
    value = defaultopt.(name);

Error in IRget (line 33)
    val = IRgetfast(options,name,value);

Error in IRhybrid_fgmres (line 191)
discrflat = IRget(options, 'discrflatTol', [], 'fast');

Error in IRell1 (line 151)
    [X, info] = IRhybrid_fgmres(A, b, options);

Error in EXsparsity (line 30)
[Xell1_GCV, info_ell1_GCV] = IRell1(A, bn, options);
@jjwadams
Copy link

jjwadams commented Apr 14, 2020

I believe this issue is due to the fact that most of the IR*.m files in the IRtools folder got updated relatively recently, but they depend on some IR*.m files in the Extras folder that were not updated. Not sure if you found your own temp fixes by now, but what I found to work on some similar issues was to add the following snippets to a few files:

IRoption_fields.m at line 71, but really could go anywhere in the allfields cell:

    'warmrestart';    
    'SparsityTrans';    
    'wname';            
    'wlevels';          
    'discrflatTol';      

IRset.m at line 287 (again could be anywhere in the switch):

  case {'warmrestart'} % off, on                   
    [validvalue, errmsg] = onOffType(field,value);
  case {'SparsityTrans'} % none, dwt               
    [validvalue, errmsg] = sparsityTransType(field,value);
  case {'wname'} % db1 default, probably others...  
    [validvalue, errmsg] = wnameType(field,value);
  case {'wlevels'} % probably a positive value?      
    [validvalue, errmsg] = nonNegscalar(field,value);
  case {'discrflatTol'} % probably a positive value? 

and then also the newly defined functions for sparsity and wname that I threw at the end of the file:

%------------------------------------------------------------------------

function [valid, errmsg] = sparsityTransType(field,value)
% One of these strings: none, dwt
valid =  (ischar(value) && any(strcmpi(value,{'none';'dwt'})));
if ~valid
  errmsg = sprintf('Invalid value for OPTIONS parameter %s: must be ''dwt'' or ''none''.',field);
else
  errmsg = '';
end

%------------------------------------------------------------------------

function [valid, errmsg] = wnameType(field,value)
% One of these strings: none, dwt
valid =  (ischar(value) && any(strcmpi(value,{'none';'db1'})));
if ~valid
  errmsg = sprintf('Invalid value for OPTIONS parameter %s: must be ''db1''.',field);
else
  errmsg = '';
end 

I'm sure there's other things missing, but this at least has me up and running so far.

@LTurton
Copy link

LTurton commented Oct 15, 2020

Experiencing a similar issue with a number of the algorithms which I hope I can fix using the above suggestions.

@LTurton
Copy link

LTurton commented Oct 16, 2020

I believe this issue is due to the fact that most of the IR*.m files in the IRtools folder got updated relatively recently, but they depend on some IR*.m files in the Extras folder that were not updated. Not sure if you found your own temp fixes by now, but what I found to work on some similar issues was to add the following snippets to a few files:

IRoption_fields.m at line 71, but really could go anywhere in the allfields cell:

    'warmrestart';    
    'SparsityTrans';    
    'wname';            
    'wlevels';          
    'discrflatTol';      

IRset.m at line 287 (again could be anywhere in the switch):

  case {'warmrestart'} % off, on                   
    [validvalue, errmsg] = onOffType(field,value);
  case {'SparsityTrans'} % none, dwt               
    [validvalue, errmsg] = sparsityTransType(field,value);
  case {'wname'} % db1 default, probably others...  
    [validvalue, errmsg] = wnameType(field,value);
  case {'wlevels'} % probably a positive value?      
    [validvalue, errmsg] = nonNegscalar(field,value);
  case {'discrflatTol'} % probably a positive value? 

and then also the newly defined functions for sparsity and wname that I threw at the end of the file:

%------------------------------------------------------------------------

function [valid, errmsg] = sparsityTransType(field,value)
% One of these strings: none, dwt
valid =  (ischar(value) && any(strcmpi(value,{'none';'dwt'})));
if ~valid
  errmsg = sprintf('Invalid value for OPTIONS parameter %s: must be ''dwt'' or ''none''.',field);
else
  errmsg = '';
end

%------------------------------------------------------------------------

function [valid, errmsg] = wnameType(field,value)
% One of these strings: none, dwt
valid =  (ischar(value) && any(strcmpi(value,{'none';'db1'})));
if ~valid
  errmsg = sprintf('Invalid value for OPTIONS parameter %s: must be ''db1''.',field);
else
  errmsg = '';
end 

I'm sure there's other things missing, but this at least has me up and running so far.

Do you have a case for discflatTol? the ell1 solver doesn't run without it

@jjwadams
Copy link

I don't have access to my code right now, but I'd guess it's the same as the wlevels case. I.e. Checking for a non neg scalar. Sorry, I probably just didn't copy the next line like I should have!

@LTurton
Copy link

LTurton commented Oct 16, 2020

I don't have access to my code right now, but I'd guess it's the same as the wlevels case. I.e. Checking for a non neg scalar. Sorry, I probably just didn't copy the next line like I should have!

That allowed the code to proceed but then it crashes at 'hybridvariant' more to figure out. Thanks very much for the help!!

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

3 participants