Open szhorvat opened 9 years ago
Yeah, this is definitely a good idea. Heh, we put it down as a todo but forgot :) (and seems like it wasn't missed much).
Since we're talking about large multidimensional arrays, perhaps we should avoid having to do ArrayQ[arr, testIfZeroOneIntegers]
in the definition? I'm not sure if this would unpack. Perhaps something like MLogical[..., "Integer" -> True]
and then we don't do Boole@
on it?
Either way, definitely a +1.
MCell
can be used to explicitly cast an expression to a cell, i.e. force interpretation as a cell.It would be useful to add support to cast to logical arrays explicitly, i.e.
MFunction["class"][MLogical@UnitStep@Range[-5,5]]
should return"logical"
.This is because some functions only take logical arrays. An example is
bwdistgeodesic
. Large logical arrays, e.g. ones that represent binary images, are just not practical to be represented as arrays ofTrue
andFalse
. A packed integer array is much better.It's been a long time. What do you think?