Mercurial > repos > public > sbplib
diff SolutionFile.m @ 32:ddfb98209aa2
Fixed a bunch of problems regarding convergence and saving solutions
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 29 Sep 2015 09:22:22 +0200 |
parents | 986e3efd8543 |
children | 61367018c46f |
line wrap: on
line diff
--- a/SolutionFile.m Mon Sep 28 21:56:02 2015 +0200 +++ b/SolutionFile.m Tue Sep 29 09:22:22 2015 +0200 @@ -2,7 +2,6 @@ properties filename matfile - % keyHeaders keys % Cell array of keys. Each key is a structure % entries end @@ -14,18 +13,35 @@ is_new_file = ~exist(filename,'file'); - obj.matfile = matfile(filename,'Writable',true); + % obj.matfile = matfile(filename,'Writable',true); + fprintf('MATLAB SUCKS!!!!\n') if is_new_file obj.matfile.keys = {}; obj.matfile.entries = {}; + else + matObj = matfile(filename,'Writable',true); + obj.matfile.keys = matObj.keys; + obj.matfile.entries = matObj.entries; end - % obj.keyHeaders = obj.matfile.keyHeaders; obj.keys = obj.matfile.keys; end + function stupidSave(obj) + matObj = matfile(obj.filename,'Writable',true); + + keys = obj.matfile.keys; + entries = obj.matfile.entries; + + delete(obj.filename); + + matObj = matfile(obj.filename,'Writable',true); + matObj.keys = keys; + matObj.entries = entries; + end + function list(obj, show_syntax) default_arg('show_syntax',false); for i = 1:length(obj.keys)