Commit 2e69ae22 authored by Johannes Pfeifer 's avatar Johannes Pfeifer

Make Octave error message more constructive and informative

See the discussion at http://savannah.gnu.org/bugs/?52569
parent 9be04a44
......@@ -53,9 +53,9 @@ switch pshape(indx)
infbound = gaminv(truncprior,p6(indx),p7(indx))+p3(indx);
supbound = gaminv(1-truncprior,p6(indx),p7(indx))+p3(indx);
catch
% Workaround for ticket #161
% Workaround for ticket #161, see http://savannah.gnu.org/bugs/?52569
if isoctave
error(['Due to a bug in Octave, you must choose other values for mean and/or variance of your prior on ' bayestopt_.name{indx} ', or use another shape'])
error(['Due to a computational limitation in Octave, the prior cannot be plotted. You must either use plot_priors=0 or choose other values for mean and/or variance of your prior on ' bayestopt_.name{indx} ', or use another shape'])
else
rethrow(lasterror)
end
......@@ -72,9 +72,9 @@ switch pshape(indx)
infbound = 1/sqrt(gaminv(1-10*truncprior, p7(indx)/2, 2/p6(indx)))+p3(indx);
supbound = 1/sqrt(gaminv(10*truncprior, p7(indx)/2, 2/p6(indx)))+p3(indx);
catch
% Workaround for ticket #161
% Workaround for ticket #161, see http://savannah.gnu.org/bugs/?52569
if isoctave
error(['Due to a bug in Octave, you must choose other values for mean and/or variance of your prior on ' bayestopt_.name{indx} ', or use another shape'])
error(['Due to a computational limitation in Octave, the prior cannot be plotted. You must either use plot_priors=0 or choose other values for mean and/or variance of your prior on ' bayestopt_.name{indx} ', or use another shape'])
else
rethrow(lasterror)
end
......@@ -91,9 +91,9 @@ switch pshape(indx)
infbound = 1/(gaminv(1-10*truncprior, p7(indx)/2, 2/p6(indx)))+p3(indx);
supbound = 1/(gaminv(10*truncprior, p7(indx)/2, 2/p6(indx)))+p3(indx);
catch
% Workaround for ticket #161
% Workaround for ticket #161, see http://savannah.gnu.org/bugs/?52569
if isoctave
error(['Due to a bug in Octave, you must choose other values for mean and/or variance of your prior on ' bayestopt_.name{indx} ', or use another shape'])
error(['Due to a computational limitation in Octave, the prior cannot be plotted. You must either use plot_priors=0 or choose other values for mean and/or variance of your prior on ' bayestopt_.name{indx} ', or use another shape'])
else
rethrow(lasterror)
end
......
......@@ -92,9 +92,9 @@ for i=1:length(p6)
bounds.lb(i) = gaminv(prior_trunc,p6(i),p7(i))+p3(i);
bounds.ub(i) = gaminv(1-prior_trunc,p6(i),p7(i))+p3(i);
catch
% Workaround for ticket #161
% Workaround for ticket #161, see http://savannah.gnu.org/bugs/?52569
if isoctave
error(['Due to a bug in Octave, you must choose other values for mean and/or variance of your prior on ' bayestopt.name{i} ', or use another shape'])
error(['Due to a computational limitation in Octave, the prior bounds cannot be computed. You must either use prior_trunc=0 or choose other values for mean and/or variance of your prior on ' bayestopt.name{i} ', or use another shape'])
else
rethrow(lasterror)
end
......@@ -117,9 +117,9 @@ for i=1:length(p6)
bounds.lb(i) = 1/sqrt(gaminv(1-prior_trunc, p7(i)/2, 2/p6(i)))+p3(i);
bounds.ub(i) = 1/sqrt(gaminv(prior_trunc, p7(i)/2, 2/p6(i)))+p3(i);
catch
% Workaround for ticket #161
% Workaround for ticket #161, see http://savannah.gnu.org/bugs/?52569
if isoctave
error(['Due to a bug in Octave, you must choose other values for mean and/or variance of your prior on ' bayestopt.name{i} ', or use another shape'])
error(['Due to a computational limitation in Octave, the prior bounds cannot be computed. You must either use prior_trunc=0 or choose other values for mean and/or variance of your prior on ' bayestopt.name{i} ', or use another shape'])
else
rethrow(lasterror)
end
......@@ -142,9 +142,9 @@ for i=1:length(p6)
bounds.lb(i) = 1/gaminv(1-prior_trunc, p7(i)/2, 2/p6(i))+p3(i);
bounds.ub(i) = 1/gaminv(prior_trunc, p7(i)/2, 2/p6(i))+ p3(i);
catch
% Workaround for ticket #161
% Workaround for ticket #161, see http://savannah.gnu.org/bugs/?52569
if isoctave
error(['Due to a bug in Octave, you must choose other values for mean and/or variance of your prior on ' bayestopt.name{i} ', or use another shape'])
error(['Due to a computational limitation in Octave, the prior bounds cannot be computed. You must either use prior_trunc=0 or choose other values for mean and/or variance of your prior on ' bayestopt.name{i} ', or use another shape'])
else
rethrow(lasterror)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment