Ric,
It looks like I have reversed the behavior of bm to
be [EMAIL PROTECTED] Sorry about that.
Your bm 2 15 is acceptable, too. Your alternative
would be better, but I don't think it would be required.
I read recently that the big name photo revision
packages do this in a more intelligent way by creating the
mask based on dropping columns of the picture which have
little color variety according to some mysterious measures
of color variety. They probably also assure some
minimum distribution.
(B=)
On Mon, 4 Feb 2008, Sherlock, Ric wrote:
+ ---Sherlock, Ric wrote:
+ > > bm=: 3 : 0
+ > > 'n d'=. y
+ > > t=. >.n % >:d-n
+ > > d$(>:t) {. t#1
+ > > )
+ > >
+ > > bm 4 5
+ > > 1 1 0 1 1
+ > > bm 7 10
+ > > 1 1 0 1 1 0 1 1 0 1
+ > >
+ >
+ > but only for rational numbers >: 1r2 !!!
+
+ bm=: 3 : 0
+ 'n d'=. y
+ if. s=. 1r2 > n%d do. n=. d-n end.
+ t=. >.n % >:d-n
+ r=. d$(>:t) {. t#1
+ if. s do. -.r end.
+ )
+
+ bm is now really ugly, but at least it sort of works.
+ What result is required for something like 2r15?
+ Is this OK?
+ bm 2 15
+ 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0
+ or would this be better?
+ 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0
+
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm