I thought I needed to add new method to the mp class in order to overload MATLAB's accumarray only when using mp. Do you think of overloading accumarray permanently and use something like...
function result = accumarray(subs, val, ...)
if isa(val, 'mp')
...perform fallback implementation
else
...use MATLAB's accumarray
end
Although I do not like putting my code into a code of someone else, I do hate "if"s even more :-). Anyway, the best solution would be an "official" implementation ;-). I'll leave it up to you.
Dear Pavel,
thank you very much for the subsref()!
I thought I needed to add new method to the mp class in order to overload MATLAB's accumarray only when using mp. Do you think of overloading accumarray permanently and use something like...
function result = accumarray(subs, val, ...)
if isa(val, 'mp')
...perform fallback implementation
else
...use MATLAB's accumarray
end
Although I do not like putting my code into a code of someone else, I do hate "if"s even more :-). Anyway, the best solution would be an "official" implementation ;-). I'll leave it up to you.