Commit 615d47f7 authored by Stéphane Adjemian's avatar Stéphane Adjemian

Fixed renaming issue with +, * and / binary operators…

Occuring when one of the inputs is not a dseries object.

(cherry picked from commit 5ac7ea053a682d8c86ecede0fcdbd1377e92a196)
parent 4390bbca
...@@ -30,7 +30,7 @@ if isnumeric(o) && (isscalar(o) || isvector(o)) ...@@ -30,7 +30,7 @@ if isnumeric(o) && (isscalar(o) || isvector(o))
if ~isdseries(p) if ~isdseries(p)
error('dseries::mrdivide: Second input argument must be a dseries object!') error('dseries::mrdivide: Second input argument must be a dseries object!')
end end
q = dseries(zeros(size(p.data)), p.firstdate); q = copy(p);
q.data = bsxfun(@rdivide, o, p.data); q.data = bsxfun(@rdivide, o, p.data);
for i=1:vobs(q) for i=1:vobs(q)
if isscalar(o) if isscalar(o)
......
...@@ -30,7 +30,7 @@ if isnumeric(o) && (isscalar(o) || isvector(o)) ...@@ -30,7 +30,7 @@ if isnumeric(o) && (isscalar(o) || isvector(o))
if ~isdseries(p) if ~isdseries(p)
error('dseries::mtimes: Second input argument must be a dseries object!') error('dseries::mtimes: Second input argument must be a dseries object!')
end end
q = dseries(zeros(size(p.data)), p.firstdate); q = copy(p);
q.data = bsxfun(@times, o, p.data); q.data = bsxfun(@times, o, p.data);
for i=1:vobs(q) for i=1:vobs(q)
if isscalar(o) if isscalar(o)
......
...@@ -30,7 +30,7 @@ if isnumeric(o) && (isscalar(o) || isvector(o)) ...@@ -30,7 +30,7 @@ if isnumeric(o) && (isscalar(o) || isvector(o))
if ~isdseries(p) if ~isdseries(p)
error('dseries::plus: Second input argument must be a dseries object!') error('dseries::plus: Second input argument must be a dseries object!')
end end
q = dseries(zeros(size(p.data)), p.firstdate); q = copy(p);
q.data = bsxfun(@plus, o, p.data); q.data = bsxfun(@plus, o, p.data);
for i=1:vobs(q) for i=1:vobs(q)
if isscalar(o) if isscalar(o)
......
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