using isequal while testing options_.mode_compute

time-shift
Michel Juillard 2011-07-24 23:00:32 +02:00
parent 2de9113889
commit 50c085e5a3
4 changed files with 8 additions and 8 deletions

View File

@ -54,14 +54,14 @@ end
%------------------------------------------------------------------------------
% 1. Get the structural parameters & define penalties
%------------------------------------------------------------------------------
if options_.mode_compute ~= 1 && any(xparam1 < bayestopt_.lb)
if ~isequal(options_.mode_compute,1) && any(xparam1 < bayestopt_.lb)
k = find(xparam1 < bayestopt_.lb);
fval = bayestopt_.penalty+sum((bayestopt_.lb(k)-xparam1(k)).^2);
cost_flag = 0;
info = 41;
return;
end
if options_.mode_compute ~= 1 && any(xparam1 > bayestopt_.ub)
if ~isequal(options_.mode_compute,1) && any(xparam1 > bayestopt_.ub)
k = find(xparam1 > bayestopt_.ub);
fval = bayestopt_.penalty+sum((xparam1(k)-bayestopt_.ub(k)).^2);
cost_flag = 0;

View File

@ -48,14 +48,14 @@ llik=NaN;
%------------------------------------------------------------------------------
% 1. Get the structural parameters & define penalties
%------------------------------------------------------------------------------
if options_.mode_compute ~= 1 && any(xparam1 < bayestopt_.lb)
if ~isequal(options_.mode_compute,1) && any(xparam1 < bayestopt_.lb)
k = find(xparam1 < bayestopt_.lb);
fval = bayestopt_.penalty+sum((bayestopt_.lb(k)-xparam1(k)).^2);
cost_flag = 0;
info = 41;
return;
end
if options_.mode_compute ~= 1 && any(xparam1 > bayestopt_.ub)
if ~isequal(options_.mode_compute,1) && any(xparam1 > bayestopt_.ub)
k = find(xparam1 > bayestopt_.ub);
fval = bayestopt_.penalty+sum((xparam1(k)-bayestopt_.ub(k)).^2);
cost_flag = 0;

View File

@ -59,7 +59,7 @@ mXX = evalin('base', 'mXX');
fval = [];
cost_flag = 1;
if options_.mode_compute ~= 1 && any(xparam1 < bayestopt_.lb)
if ~isequal(options_.mode_compute,1) && any(xparam1 < bayestopt_.lb)
k = find(xparam1 < bayestopt_.lb);
fval = bayestopt_.penalty+sum((bayestopt_.lb(k)-xparam1(k)).^2);
cost_flag = 0;
@ -67,7 +67,7 @@ if options_.mode_compute ~= 1 && any(xparam1 < bayestopt_.lb)
return;
end
if options_.mode_compute ~= 1 && any(xparam1 > bayestopt_.ub)
if ~isequal(options_.mode_compute,11) && any(xparam1 > bayestopt_.ub)
k = find(xparam1 > bayestopt_.ub);
fval = bayestopt_.penalty+sum((xparam1(k)-bayestopt_.ub(k)).^2);
cost_flag = 0;

View File

@ -47,14 +47,14 @@ nobs = size(options_.varobs,1);
%------------------------------------------------------------------------------
% 1. Get the structural parameters & define penalties
%------------------------------------------------------------------------------
if options_.mode_compute ~= 1 && any(xparam1 < bayestopt_.lb)
if ~isequal(options_.mode_compute,1) && any(xparam1 < bayestopt_.lb)
k = find(xparam1 < bayestopt_.lb);
fval = bayestopt_.penalty+sum((bayestopt_.lb(k)-xparam1(k)).^2);
cost_flag = 0;
info = 41;
return;
end
if options_.mode_compute ~= 1 && any(xparam1 > bayestopt_.ub)
if ~isequal(options_.mode_compute,1) && any(xparam1 > bayestopt_.ub)
k = find(xparam1 > bayestopt_.ub);
fval = bayestopt_.penalty+sum((xparam1(k)-bayestopt_.ub(k)).^2);
cost_flag = 0;