Post Reply 
MC: Faster User-RPL HILBERT
08-05-2018, 02:05 PM
Post: #13
RE: MC: Faster User-RPL HILBERT
(07-09-2018 01:28 PM)Joe Horn Wrote:  Disclaimer: This is a mini-challenge rather than simply an entry in the software library because nobody needs fast Hilbert matrices.

Perhaps not every day Smile , but the same method can be used to generate any Hankel or Cauchy matrix, of which the Hilbert matrix are sub-types.

As an example, the following variation on Thomas's program returns the N x N Catalan Hankel matrix as described here.
It pre-calculates a list of Catalan numbers using an efficient recurrence.

The 50 x 50 matrix is returned in about 5.7 seconds (exact mode). Note that the resulting matrix is about 48K bytes in size.

Code:

\<< DUP 1 - DUP2 + \-> n n1 n2
  \<< 1 DUPDUP n2 2 -
    FOR n n DUP 4 * 2 + PICK3 * SWAP 2 + /
    NEXT n2 \->LIST \-> c
    \<< c 1. n SUB EVAL n DUP 1 + SWAP n1 +
      FOR i n1 DUPN c i GET
      NEXT n DUP 2. \->LIST \->ARRY
    \>>
  \>>
\>>

Of course, I am equally sure that nobody needs a 50 x 50 matrix of Catalan numbers either. Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
MC: Faster User-RPL HILBERT - Joe Horn - 07-09-2018, 01:28 PM
RE: MC: Faster User-RPL HILBERT - Joe Horn - 07-09-2018, 05:25 PM
RE: MC: Faster User-RPL HILBERT - Joe Horn - 07-09-2018, 11:43 PM
RE: MC: Faster User-RPL HILBERT - Gerald H - 07-10-2018, 09:50 AM
RE: MC: Faster User-RPL HILBERT - ttw - 07-09-2018, 05:10 PM
RE: MC: Faster User-RPL HILBERT - Werner - 07-10-2018, 07:20 AM
RE: MC: Faster User-RPL HILBERT - John Keith - 08-05-2018 02:05 PM
RE: MC: Faster User-RPL HILBERT - Juan14 - 08-05-2018, 06:31 PM



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