Raul and R.E. Boss,

I just ran some metrics of our algorithms on my real dataset:

           fn fmt TS
        Name     Time   Space 
        -------- ------ ------
        canon         _      _
        bron00   23.547  5.500
        boss00    1.341  1.000
        miller00  1.000  1.000

see postscript for the definitions of these verbs.  Raul's results match mine, 
and his timings are so superior that I threw out my code.  

R.E. Boss' verb doesn't match the canonical results even in nominal cases:

        
           ws   =:  2 : '(m&i.)`(,~ n $"_ 0~ $) } :. (  (n&i.)`(,~ m $"_ 0~ $) 
})'
        
           NB.  'X' means data, '.' means space, 
           NB. '=' means TAB, '/' means LF
           w    =:  '.=/' ws (' ',TAB,LF)

           NB.  Here's the first line from one of my files.
           line =:  w LF -.~ noun define
        XXXXXXXX=.XXXXXXX...=.XXX.XXXXX.=.....XXXX=............=.XXX
        XX=....XXXX=............XXX=...XXXXX..=........=...........X
        XX=.XXX=..X=.....XXXXXX=...........=..........=........=....
        ....=.......XXXXXX/
           )
        
           _60 ]\ w^:_1 bron00 line
        XXXXXXXX=XXXXXXX=XXX.XXXXX=XXXX==XXXXX=XXXX=XXX=XXXXX==XXX=X
        XX=X=XXXXXX=====XXXXXX/


           _60 ]\ w^:_1 miller00 line
        XXXXXXXX=XXXXXXX=XXX.XXXXX=XXXX==XXXXX=XXXX=XXX=XXXXX==XXX=X
        XX=X=XXXXXX=====XXXXXX/


           _60 ]\ w^:_1 boss00 line
        XXXXXXXX=.XXXXXXX...=.XXX.XXXXX.=.....XXXX=............=.XXX
        XX=....XXXX=............XXX=...XXXXX..=........=...........X
        XX=.XXX=..X=.....XXXXXX=...........=..........=........=....
        ....=.......XXXXXX/


Thanks to both of you,

-Dan

PS:  Verb definitions:

        NB.  All verbs may assume y ends with an LF
        canon    =: [: ; [: (dltb@:}: , {:)&.> e.&(10 9{a.) <;.2 ] 
        
        bron00   =: verb define
         
          TAB bron00 y
        
        :
                s =. y ~: ' '
                d =. y e. LF,x
        
                l =. d ([: ; <@(+./\ );.2) s 
        
                d =. 1 (0)} d  
                t =. d ([: ; <@(+./\.);.1) s 
                
                e =. l*.t
                y =. e#y
        
        )
        
        bossS=. _2]\"1 }.".;._2 (0 : 0) 
        ''' ''   x;LF    Z ']0
        1       1       3       1       4       1
        1       0       3       1       4       1
        2       0       3       1       4       2
        1       2       3       2       4       2
        2       2       3       2       4       2
        )
        boss00 =: (1;bossS;<:+/2 1*(<a.)[EMAIL PROTECTED]&>' ';'+',LF   )&;: "1
        
        
        NB. other SPACE DELIM
        millerS=.0 10#:10*".;._2]0 :0
              2.1   0.0   1.1
              2.2   0.3   1.2
              2.0   3.2   1.2
              2.2   3.0   1.1
        )
        miller00=: (1;millerS;(a.=' ')+2*a.e.LF,TAB)&;:
        
        
        NB. w =: fread  jpath '~temp\fw2dl.txt'
        
        (verb define) bron00`boss00`miller00 NB. canon`
                TS =: 0 $~ 2,~#y
        
                for_v. y do.
                        smoutput 'timing ',;v
                        TS =: (6!:2 '0 0 $',(;v),' W') (<v_index;0) } TS
                        6!:3]0.5
                        smoutput 'spacing ',;v
                        TS =: (7!:2 '0 0 $',(;v),' W') (<v_index;1) } TS
                        6!:3]0.5
                end.
        )


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to