Now that I'm awake, I got a surprise. I us -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Linda Alvord Sent: Tuesday, December 11, 2012 3:16 AM To: [email protected] Subject: Re: [Jprogramming] convert 0,1 coding to _1,1
Sorry, it needs and argument. Lin -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Linda Alvord Sent: Tuesday, December 11, 2012 3:05 AM To: [email protected] Subject: Re: [Jprogramming] convert 0,1 coding to _1,1 {&_1 1 {&_1 1 Roger, you must have typed this incorrectly. Linda Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Roger Hui Sent: Tuesday, December 11, 2012 2:40 AM To: Programming forum Subject: Re: [Jprogramming] convert 0,1 coding to _1,1 Also {&_1 1 . On Mon, Dec 10, 2012 at 11:32 PM, Roger Hui <[email protected]>wrote: > If you really are converting random boolean values to (1,_1) values, > another possibility is _1&^ or _1^]; i.e. 0 to 1 and 1 to _1. > > > > On Mon, Dec 10, 2012 at 8:58 PM, Brian Schott <[email protected]>wrote: > >> timespacex >> 6!:2 , 7!:2@] >> am =:_1& (I.@:-.@]}) >> am2=: ((-&1) @ +:) >> amd=: <:@:+: >> aml=: _1 + +: >> d=: 2 6 50000?.@$ 2 >> timespacex 'am"1 d' >> 0.011278 1.05535e7 >> timespacex 'am2 d' >> 0.187884 8.39091e6 >> timespacex 'amd d' >> 0.004365 1.6779e7 >> timespacex 'aml d' >> 0.004874 1.67789e7 >> >> It looks like David's method is fastest and Peter's is most lean. >> And Linda's method loses nothing relative to David's. >> --------------------------------------------------------------------- >> - For information about J forums see >> http://www.jsoftware.com/forums.htm >> > > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
