msiplab / SaivDr

System object definitions for sparsity-aware image and volumetric data restoration
http://jp.mathworks.com/matlabcentral/fileexchange/45084-saivdr-package
BSD 2-Clause "Simplified" License
6 stars 9 forks source link

MYTEST fails several times until all MEX files are compiled. #1

Closed shodimaggio closed 7 years ago

shodimaggio commented 8 years ago

MYTEST fails when CODEGEN operations are called many times during the process. Try MYTEST until all MEX files are compiled.

shodimaggio commented 8 years ago

I've experienced on MATLAB R2016a that the completion of the compile may require conducting MYTEST four times.

shodimaggio commented 8 years ago

MYTEST does not fail on MATLAB R2015a/b.

shodimaggio commented 8 years ago

On R2016a,

  1. The 1st trial occurs error at saivdr.testcase.dictionary.olpprfb.OLpPrFbFactoryTestCase,
  2. The 2nd trial occurs error at saivdr.testcase.dictionary.nsoltx.NsoltAnalysis2dSystemTestCase,
  3. The 3rd trial occurs error at saivdr.testcase.dictionary.nsoltx.design.AprxErrorWithSparseRepTestCase,
  4. The 4th trial occurs error at saivdr.testcase.dictionary.generalfb.AnalysisSynthesisTestCase and
  5. The 5th trial finishes successfully.
shodimaggio commented 7 years ago

On R2016b,

Test case saivdr.testcase.dictionary.nsoltx.design.NsoltDesignerFrqTestCase always fails.

This problem can be avoided by setting UseParallel option to false.

shodimaggio commented 7 years ago

The above problem is caused by a bug of fmincon (Bug ID: 1563824). I put the following code in private function setHybridFmincon_ of saivdr.dictionary.nsoltx.design.AbstNsoltDesignerGaFmin:

strver = version('-release');
if strcmp(strver,'2016b') || strcmp(strver,'2017a')
      % Bug ID: 1563824
      hybridopts = optimoptions(hybridopts,...
      'Algorithm','interior-point');
end
shodimaggio commented 7 years ago

The automatic code generation function was abolished. Instead, I prepared a code generation script MYBUILD.