Changed behaviour of eq (==) overload method.

If non singleton objects have different number of elements, return
false instead of raising an error message.
parent 89facc6c
......@@ -24,6 +24,11 @@ function l = eq(varargin) % --*-- Unitary tests --*--
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if varargin{1}.ndat>1 && varargin{2}.ndat>1 && ~isequal(varargin{1}.ndat, varargin{2}.ndat)
l = false;
return
end
[o, p] = comparison_arg_checks(varargin{:});
if isequal(o.ndat(), p.ndat())
......
......@@ -41,7 +41,9 @@ end
if ~isequal(varargin{1}.ndat, varargin{2}.ndat) && ~(isequal(varargin{1}.ndat,1) || isequal(varargin{2}.ndat,1))
s = dbstack;
error(sprintf('dates:%s:ArgCheck',s(2).name),'Dimensions are not consistent!')
if ~isequal(s(2).name, 'eq')
error(sprintf('dates:%s:ArgCheck',s(2).name),'Dimensions are not consistent!')
end
end
o = varargin{1};
......
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