From: Matt J on
"Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hgiapj$p1c$1(a)fred.mathworks.com>...

> This is because Matlab API mxIsSparse() return 0 for RobustSparse object. We can make it works, but it requires a change either on your side or mine. Do you accommodate from your side or I do from my side?
>
> Bruno

No problem, I can add getsparse/setsparse as RobustClass methods.

An unfortunate difficulty with this "wrapper class" solution is that many superclass functions operating on the RobustSparse subclass objects will unfortunately return ordinary superclass sparse objects, unless I overload those functions, and it's very easy to overlook this when coding. For example:

>> B=RobustSparseDouble( speye(3) ), whos B

B=

(1,1) 1
(2,2) 1
(3,3) 1

Name Size Bytes Class Attributes

B 3x3 108 RobustSparseDouble

>> BB=triu(B,1), whos BB

BB =

All zero sparse: 3-by-3

Name Size Bytes Class Attributes

BB 3x3 28 double sparse



I've made an effort to overload some of the common functions (sum, inv, plus, minus, etc...) , but it'll be a pain to do them all, and I certainly couldn't keep up with TMW's release of new functions.

This means that one has to be very careful to preconvert a sparse matrix to robust, before doing logical/linear indexing ....[sigh]
From: Matt J on
"Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hgh3t7$c3m$1(a)fred.mathworks.com>...
>
>
> I guess I'll do seem clean-up then, and put it on the FEX.

It's up there now.

http://www.mathworks.com/matlabcentral/fileexchange/26181

Guess we'll see if it's useful to anyone.