[Jprogramming] convert 0,1 coding to _1,1

Linda Alvord lindaalvord at verizon.net
Tue Dec 11 08:50:32 UTC 2012


Now that I'm awake, I got a surprise.  I us

-----Original Message-----
From: programming-bounces at forums.jsoftware.com
[mailto:programming-bounces at forums.jsoftware.com] On Behalf Of Linda Alvord
Sent: Tuesday, December 11, 2012 3:16 AM
To: programming at jsoftware.com
Subject: Re: [Jprogramming] convert 0,1 coding to _1,1

Sorry, it needs and argument.

Lin

-----Original Message-----
From: programming-bounces at forums.jsoftware.com
[mailto:programming-bounces at forums.jsoftware.com] On Behalf Of Linda Alvord
Sent: Tuesday, December 11, 2012 3:05 AM
To: programming at jsoftware.com
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: programming-bounces at forums.jsoftware.com
[mailto:programming-bounces at forums.jsoftware.com] 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
<rogerhui.canada at gmail.com>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
<schott.brian at gmail.com>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



More information about the Programming mailing list