Post Reply 
(49g 50g) WEIGH Transform
11-24-2019, 10:12 PM (This post was last modified: 01-21-2020 06:57 PM by John Keith.)
Post: #1
(49g 50g) WEIGH Transform
This program computes the WEIGH transform of a sequence of integers. Some information here.

The program requires the ListExt Library and must be run in exact mode.

Code:

\<< 1 OVER HEAD 2. \->LIST OVER SIZE R\->I \-> a n
  \<< DUP HEAD SWAP 2 n
    FOR k k DIVIS DUP2 LPICK OVER * SWAP REV 1.
      \<< I\->R 2. MOD { 1 } { -1 } IFTE
      \>> DOLIST * LSUM SWAP
    NEXT DROP n \->LIST a 2 n
    FOR j OVER 1 j SUB OVER REV * LSUM j / +
    NEXT NIP
  \>>
\>>
Find all posts by this user
Quote this message in a reply
01-21-2020, 07:00 PM
Post: #2
RE: (49g 50g) WEIGH Transform
Program in first post has been replaced with a new version which is substantially faster. It now runs at a speed comparable to other transforms. Please delete and replace the older version.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)