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


Groups > comp.lang.forth > #20514

Re: pde2 floating point benchmark code

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!news2.euro.net!postnews2.euro.net!news.wanadoo.nl!not-for-mail
From mhx@iae.nl (Marcel Hendrix)
Subject Re: pde2 floating point benchmark code
Newsgroups comp.lang.forth
Message-ID <83701793008434@frunobulax.edu> (permalink)
Date Sun, 10 Mar 2013 18:33:52 +0200
References <513c87ea$0$32115$14726298@news.sunsite.dk>
X-Newsreader iForth 2.0 console (October 21, 2006)
Lines 40
Organization Wanadoo
NNTP-Posting-Date 10 Mar 2013 17:33:49 GMT
NNTP-Posting-Host s529d937f.adsl.online.nl
X-Trace 1362936829 dr5.euro.net 250 82.157.147.127:60559
X-Complaints-To abuse@wanadoo.nl
Xref csiph.com comp.lang.forth:20514

Show key headers only | View raw


Doug Hoffman <glidedog@gmail.com> writes Re: pde2 floating point benchmark code

> On 3/6/13 4:06 PM, Marcel Hendrix wrote:

>> : EVOLVE ( n -- )
>> 	u_i u_ip1 GCOPY
>> 	0 ?DO	nx 1- 1 DO  LET u_ip1[i]=kk*(u_i[i+1]-2*u_i[i]+u_i[i-1])+u_i[i]:  LOOP

> I like the infix notation for array indexes.

> How are 2-dim arrays handled, like this?:

> a[[i+1,i*i+2]]   ??

Like   a[i+1,i*i+2] . (Thanks for asking, I have not had a need to use this yet!
There a many efficient ways to rewrite matrix ops to vectors.)

XOPG works for integers, floats, dfloats, sfloats, complex, and arbitrary float/complex.
Therefore, for index operations (between [ and ]) the interpreter switches to
the integer XOPG tables. If the current type *is* integer, one can write 
a(i+1,i*i+2), too.

Wil Baden let the "comma" handle lists, so a function/index calculation can return
multiple values, which fits the syntax nicely.

> Do you have valid index checking?

No, the idea is to make XOPG code as fast as possible. But of course, checks can
be added. In the ideal case the compiler will warn during compilation - XOPG is 
a JIT. It would be good idea to warn that the address *IS* calculated at run-time.

> Is your version of Baden's OPG available?

I am continuously working on it, but a snapshot will be in the upcoming iForth
release. Currently, some matrix operations are being added. At some point 
type conversion will need to be implemented. For the time being there are 
functions like double() and integer() that handle the most frequent cases.

-marcel

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


Thread

pde2 floating point benchmark code krishna.myneni@ccreweb.org - 2013-03-04 18:02 -0800
  Re: pde2 floating point benchmark code Mark Wills <markrobertwills@yahoo.co.uk> - 2013-03-04 23:23 -0800
    Re: pde2 floating point benchmark code krishna.myneni@ccreweb.org - 2013-03-05 05:22 -0800
  Re: pde2 floating point benchmark code Doug Hoffman <glidedog@gmail.com> - 2013-03-05 12:11 -0500
    Re: pde2 floating point benchmark code krishna.myneni@ccreweb.org - 2013-03-05 16:11 -0800
      Re: pde2 floating point benchmark code Doug Hoffman <glidedog@gmail.com> - 2013-03-06 04:26 -0500
        Re: pde2 floating point benchmark code krishna.myneni@ccreweb.org - 2013-03-06 05:22 -0800
          Re: pde2 floating point benchmark code Doug Hoffman <glidedog@gmail.com> - 2013-03-06 09:44 -0500
  Re: pde2 floating point benchmark code krishna.myneni@ccreweb.org - 2013-03-05 16:17 -0800
    Re: pde2 floating point benchmark code mhx@iae.nl (Marcel Hendrix) - 2013-03-06 23:06 +0200
      Re: pde2 floating point benchmark code krishna.myneni@ccreweb.org - 2013-03-07 04:57 -0800
        Re: pde2 floating point benchmark code m.a.m.hendrix@tue.nl - 2013-03-07 05:49 -0800
        Re: pde2 floating point benchmark code mhx@iae.nl (Marcel Hendrix) - 2013-03-07 21:12 +0200
          Re: pde2 floating point benchmark code krishna.myneni@ccreweb.org - 2013-03-07 16:07 -0800
      Re: pde2 floating point benchmark code Doug Hoffman <glidedog@gmail.com> - 2013-03-10 09:17 -0400
        Re: pde2 floating point benchmark code mhx@iae.nl (Marcel Hendrix) - 2013-03-10 18:33 +0200
          Re: pde2 floating point benchmark code Doug Hoffman <glidedog@gmail.com> - 2013-03-11 04:54 -0400
    Re: pde2 floating point benchmark code humptydumpty <ouatubi@gmail.com> - 2013-03-07 22:32 -0800
      Re: pde2 floating point benchmark code Krishna Myneni <krishna.myneni@ccreweb.org> - 2013-03-08 05:19 -0800
        Re: pde2 floating point benchmark code mhx@iae.nl (Marcel Hendrix) - 2013-03-08 21:04 +0200
          Re: pde2 floating point benchmark code Krishna Myneni <krishna.myneni@ccreweb.org> - 2013-03-08 16:31 -0800
            Re: pde2 floating point benchmark code Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-03-09 00:56 +0000
              Re: pde2 floating point benchmark code Krishna Myneni <krishna.myneni@ccreweb.org> - 2013-03-08 19:52 -0800
                Re: pde2 floating point benchmark code Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-03-09 09:09 +0000
            Re: pde2 floating point benchmark code mhx@iae.nl (Marcel Hendrix) - 2013-03-09 13:37 +0200
              Re: pde2 floating point benchmark code Krishna Myneni <krishna.myneni@ccreweb.org> - 2013-03-09 06:28 -0800
              Re: pde2 floating point benchmark code mhx@iae.nl (Marcel Hendrix) - 2013-03-09 17:58 +0200
        Re: pde2 floating point benchmark code humptydumpty <ouatubi@gmail.com> - 2013-03-08 12:23 -0800
          Re: pde2 floating point benchmark code Krishna Myneni <krishna.myneni@ccreweb.org> - 2013-03-08 16:43 -0800

csiph-web