Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #13696

Re: Permutation Tensor

From Gerry Jackson <gerry@jackson9000.fsnet.co.uk>
Newsgroups comp.lang.forth
Subject Re: Permutation Tensor
Date 2012-07-08 08:09 +0100
Organization A noiseless patient Spider
Message-ID <jtbbmf$r0s$1@dont-email.me> (permalink)
References <9b0e8738-1608-4239-9851-1f39a77ae48a@r3g2000yqh.googlegroups.com> <17621796968435@frunobulax.edu> <35ca7dcb-0581-43b2-bdff-26108340ecfa@b20g2000yqg.googlegroups.com> <jtbaf2$mtr$1@dont-email.me>

Show all headers | View raw


On 08/07/2012 07:48, Gerry Jackson wrote:
> On 07/07/2012 20:24, Krishna Myneni wrote:
>> On Jul 7, 11:41 am, m...@iae.nl (Marcel Hendrix) wrote:
>>> Krishna Myneni <krishna.myn...@ccreweb.org> writes Re: Permutation
>>> Tensor
>>>
>
>>
>>
>> \ Speed Comparison
>> 1 [IF]
>> : ms@ ( -- u )  utime 1 1000 m*/ d>s ;
>>
>> : TEST   ( -- n )  0  4 1 DO 4 1 DO  4 1 DO  K J I lcsymbol  +  LOOP
>> LOOP LOOP ;
>> : TEST2  ( -- n )  0  4 1 DO 4 1 DO  4 1 DO  K J I lcsymbol2 +  LOOP
>> LOOP LOOP ;
>> : TEST3  ( -- n )  0  4 1 DO 4 1 DO  4 1 DO  K J I lcsymbol3 +  LOOP
>> LOOP LOOP ;
>> : TEST4  ( -- n )  0  3 0 DO 3 0 DO  3 0 DO  K J I lcsymbol4 +  LOOP
>> LOOP LOOP ;
>> : TESTe  ( -- n )  0  4 0 DO 4 0 DO  4 0 DO  K J I eps       +  LOOP
>> LOOP LOOP ;
>> : TESTe2 ( -- n )  0  4 0 DO 4 0 DO  4 0 DO  K J I eps2      +  LOOP
>> LOOP LOOP ;
>>
>> : .elapsed ( msstart msend -- ) swap - . ;
>>
>> 1000000 value #times
>> : TOPTEST ( u -- )
>>          CR ms@ 0  #times 0 ?DO TEST    + LOOP ms@ swap . .elapsed
>>          CR ms@ 0  #times 0 ?DO TEST2   + LOOP ms@ swap . .elapsed
>>          CR ms@ 0  #times 0 ?DO TEST3   + LOOP ms@ swap . .elapsed
>>          CR ms@ 0  #times 0 ?DO TEST4   + LOOP ms@ swap . .elapsed
>>          CR ms@ 0  #times 0 ?DO TESTe   + LOOP ms@ swap . .elapsed
>>          CR ms@ 0  #times 0 ?DO TESTe2  + LOOP ms@ swap . .elapsed
>> ;
>>
>> toptest cr
>> bye
>> [THEN]
>>
>>
>
> How does this version compare?
>
> \ Using a byte-wide look-up table
> \ Assumes i, j , k are all in the range [1..3]
> create dat
>      2 c,  5 c,  8 c,
>     11 c, 15 c, 13 c,
>     12 c, 11 c, 17 c,
>     16 c, 14 c, 11 c,
>      1 c,  1 c,  1 c,
>      2 c,  1 c,  1 c,
>      0 c,  1 c,  1 c,
>
> : (eps)  ( u -- u2 )  dat + + c@ ;
>
> : eps  ( i j k -- n )  -1 (eps) (eps) (eps) 1- ;
>

Sorry the stack comment for (eps) should be

: (eps)  ( u1 u2 -- u3 ) ...

-- 
Gerry

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Permutation Tensor Arnold Doray <invalid@invalid.com> - 2012-07-05 07:13 +0000
  Re: Permutation Tensor "A. K." <akk@nospam.org> - 2012-07-05 09:25 +0200
    Re: Permutation Tensor Arnold Doray <invalid@invalid.com> - 2012-07-05 08:42 +0000
      Re: Permutation Tensor "A. K." <akk@nospam.org> - 2012-07-05 11:25 +0200
        Re: Permutation Tensor Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-07-06 18:49 -0700
          Re: Permutation Tensor mhx@iae.nl (Marcel Hendrix) - 2012-07-07 08:32 +0200
            Re: Permutation Tensor "A. K." <akk@nospam.org> - 2012-07-07 09:49 +0200
            Re: Permutation Tensor Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-07-07 05:35 -0700
               Re: Permutation Tensor mhx@iae.nl (Marcel Hendrix) - 2012-07-07 15:45 +0200
                Re: Permutation Tensor Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-07-07 07:32 -0700
                Re: Permutation Tensor mhx@iae.nl (Marcel Hendrix) - 2012-07-07 17:53 +0200
                Re: Permutation Tensor Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-07-07 09:10 -0700
                Re: Permutation Tensor mhx@iae.nl (Marcel Hendrix) - 2012-07-07 18:41 +0200
                Re: Permutation Tensor Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-07-07 12:24 -0700
                Re: Permutation Tensor Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2012-07-08 07:48 +0100
                Re: Permutation Tensor Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2012-07-08 08:09 +0100
                Re: Permutation Tensor mhx@iae.nl (Marcel Hendrix) - 2012-07-08 09:23 +0200
                Re: Permutation Tensor Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-07-08 05:55 -0700
                Re: Permutation Tensor Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2012-07-08 20:14 +0100
                Re: Permutation Tensor Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-07-08 13:49 -0700
                Re: Permutation Tensor Paul Rubin <no.email@nospam.invalid> - 2012-07-07 13:03 -0700
                Re: Permutation Tensor mhx@iae.nl (Marcel Hendrix) - 2012-07-07 23:54 +0200
                Re: Permutation Tensor Paul Rubin <no.email@nospam.invalid> - 2012-07-07 16:43 -0700
                Re: Permutation Tensor mhx@iae.nl (Marcel Hendrix) - 2012-07-08 09:07 +0200
                Re: Permutation Tensor Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-08 13:03 +0000
                Re: Permutation Tensor anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-09 14:50 +0000
                Re: Permutation Tensor m.a.m.hendrix@tue.nl - 2012-07-10 00:28 -0700
                Re: Permutation Tensor anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-10 10:11 +0000
                Re: Permutation Tensor mhx@iae.nl (Marcel Hendrix) - 2012-07-10 21:37 +0200
                Re: Permutation Tensor anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-11 13:50 +0000
                Re: Permutation Tensor Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-07-10 05:10 -0700
        Re: Permutation Tensor Paul Rubin <no.email@nospam.invalid> - 2012-07-06 20:46 -0700
          Re: Permutation Tensor Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-07-07 05:36 -0700
  Re: Permutation Tensor Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-07-06 18:18 -0700
    Re: Permutation Tensor Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-07-06 18:33 -0700
    Re: Permutation Tensor Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-07-07 07:28 -0700
      Re: Permutation Tensor Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-07-07 08:02 -0700
  Re: Permutation Tensor Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-07 19:58 +0000
    Re: Permutation Tensor Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-07-08 05:45 -0700
      Re: Permutation Tensor Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-08 20:05 +0000
  Re: Permutation Tensor awegel@arcor.de (Alex Wegel) - 2012-07-08 14:24 +0200
    Re: Permutation Tensor awegel@arcor.de (Alex Wegel) - 2012-07-11 07:09 +0200
      Re: Permutation Tensor awegel@arcor.de (Alex Wegel) - 2012-07-11 18:42 +0200
        Re: Permutation Tensor mhx@iae.nl (Marcel Hendrix) - 2012-07-11 20:18 +0200
          Re: Permutation Tensor awegel@arcor.de (Alex Wegel) - 2012-07-12 12:43 +0200
  Re: Permutation Tensor awegel@arcor.de (Alex Wegel) - 2012-07-08 23:44 +0200
    Re: Permutation Tensor Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-07-10 17:06 -0700
      Re: Permutation Tensor awegel@arcor.de (Alex Wegel) - 2012-07-11 07:09 +0200

csiph-web