I solved what I yesterday did not understand:
ts'#: i.50000'
0.001647 1311360
datatype i.50000
integer
(i.50000)-:0.5-~0.5+i.50000
1
datatype 0.5-~0.5+i.50000
floating
ts'#: 0.5-~0.5+i.50000'
0.9603186 11864064
So my verb should be made integer:
ncb=: [:|.@; [:(+&.><@;\.)/ [ */&(2<[EMAIL PROTECTED]|[EMAIL
PROTECTED]) >:@-~
(#: nct^:(i.5!28) 31)-: #:5 ncb 28
1
[score=: 5&ts&> '#: nc^:(i.5!28) 31' ;'#: nct^:(i.5!28) 31';'#: 5 ncb 28'
1.7895653 12984256
0.63956285 12984256
0.0072934627 4719552
rnkng=:',0.2,0.2,0.2'(8!:1) ([:(,~/:@/:@{.) [:(%<./)"1(,~*/)) &.|: score
rnkng=:('place';'relperf';'rel et';'rel es'),:rnkng
[rnkng=:(,.($0);'nc', 'nct',:'ncb'),.rnkng
+---+-----+-------+------+------+
| |place|relperf|rel et|rel es|
+---+-----+-------+------+------+
|nc |2 |675.04 |245.37|2.75 |
|nct|1 |241.25 | 87.69|2.75 |
|ncb|0 | 1.00 | 1.00|1.00 |
+---+-----+-------+------+------+
R.E. Boss
> -----Oorspronkelijk bericht-----
> Van: [EMAIL PROTECTED] [mailto:programming-
> [EMAIL PROTECTED] Namens R.E. Boss
> Verzonden: woensdag 29 augustus 2007 23:02
> Aan: 'Programming forum'
> Onderwerp: RE: [Jprogramming] Permutations of a sort.
>
> (nct^:(i.5!28)31 )-: 5([([:|.@; [:(+&.><@;\.)/ */&(2^|[EMAIL
> PROTECTED]))>:@-~)28
> 1
>
> '(nct^:(i.5!28)31 )',:&ts '5([([:|.@; [:(+&.><@;\.)/
> */&(2^|[EMAIL PROTECTED]))>:@-~)28' NB. line wrap
>
> 0.59775966 8790272
> 0.004366199 3246144
>
>
> However, what I do not understand:
>
> ts'#: x'[x=. nct^:(i.5!28) 31
> 0.0050329073 4194880
> ts'#: y'[y=. 5([([:|.@; [:(+&.><@;\.)/ */&(2^|[EMAIL PROTECTED]))>:@-~)28
> 3.137659 37881472
>
> x-:&(;#:) y
> 1
>
>
> R.E. Boss
>
>
>
> > -----Oorspronkelijk bericht-----
> > Van: [EMAIL PROTECTED] [mailto:programming-
> > [EMAIL PROTECTED] Namens Jose Mario Quintana
> > Verzonden: woensdag 29 augustus 2007 22:32
> > Aan: 'Programming forum'
> > Onderwerp: RE: [Jprogramming] Permutations of a sort.
> >
> >
> > nct=. ((] or _2 c shift -~ <[EMAIL PROTECTED] ] xor [) ] + (] xor ] and
> > ] - 1:))
> f.
> >
> > nct
> > (] 23 b. (_2"_) 33 b. -~ <[EMAIL PROTECTED] ] 22 b. [) (] + ] 22 b. ] 17 b.
> > ] - 1:)
> >
> > ts'#: nc ^:(i.5!28) 31'
> > 4.95167207 12984256
> > ts'#: nct^:(i.5!28) 31'
> > 1.87179656 12984256
> >
> > ((#: nct^:(i.5!28))-:(#: nct^:(i.5!28))) 31
> > 1
> >
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED] [mailto:programming-
> > > [EMAIL PROTECTED] On Behalf Of Roger Hui
> > > Sent: Tuesday, August 28, 2007 7:45 PM
> > > To: Programming forum
> > > Subject: Re: [Jprogramming] Permutations of a sort.
> > >
> > > nc is a translation of the c code given by Andew Nikitin.
> > > Its domain is machine-word (4-byte) integers. In the same
> > > msg that contains the defn of nc there was an example:
> > >
> > > #: nc^:(i.3!5) 7
> > >
> > > Expanding the example:
> > >
> > > nc 7
> > > 11
> > > nc 11
> > > 13
> > > nc 13
> > > 14
> > > nc^:(i.3!5) 7
> > > 7 11 13 14 19 21 22 25 26 28
> > > #: nc^:(i.3!5) 7
> > > 0 0 1 1 1
> > > 0 1 0 1 1
> > > 0 1 1 0 1
> > > 0 1 1 1 0
> > > 1 0 0 1 1
> > > 1 0 1 0 1
> > > 1 0 1 1 0
> > > 1 1 0 0 1
> > > 1 1 0 1 0
> > > 1 1 1 0 0
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: Ralph G Selfridge <[EMAIL PROTECTED]>
> > > Date: Tuesday, August 28, 2007 15:50
> > > Subject: Re: [Jprogramming] Permutations of a sort.
> > > To: Programming forum <[email protected]>
> > >
> > > > I wrote this in as typed, if I use a binary string input I get
> > > > rubbish.
> > > > What am I mis-understanding? There is, for example, n and n-1.
> > > > Doesn't this
> > > > imply some integer to binary conversion (and back again)?
> > > >
> > > > Ralph
> > > >
> > > >
> > > > On Tue, 28 Aug 2007, Roger Hui wrote:
> > > >
> > > > > and =: 17 b.
> > > > > xor =: 22 b.
> > > > > or =: 23 b.
> > > > > shift=: 33 b.
> > > > >
> > > > > nc=: 3 : 0
> > > > > n=. y
> > > > > t=. n xor n and n-1
> > > > > b=. t+n
> > > > > b or _2 shift (b xor n) <[EMAIL PROTECTED] t
> > > > > )
> > > ----------------------------------------------------------------------
> > > 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