Post Reply 
Mersenne Twister implentation
02-05-2017, 05:37 PM
Post: #2
RE: Mersenne Twister implentation
(02-04-2017 04:19 PM)KeithB Wrote:  
Code:
{snip}
LOCAL i;
FOR i FROM 1 TO 624 DO
L9(i):=#0d;
END;
{snip}

Just wondering out loud here...

Is the above quicker than:
Code:
L9:=MAKELIST(#0d,A,1,624);

Somehow I'm guessing that the loop involved in MAKELIST, running at system level, is going to be faster than a FOR loop in user code. Also, no need for the local variable but it will clobber the 'A' home variable and anything in L9 beyond the 624th element, although the latter is a non-problem if this is an initialization function anyway.

Just curious...

Godwin Stewart (happy HP Prime owner since Wednesday)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Mersenne Twister implentation - KeithB - 02-04-2017, 04:19 PM
RE: Mersenne Twister implentation - grsbanks - 02-05-2017 05:37 PM
RE: Mersenne Twister implentation - KeithB - 02-06-2017, 04:42 PM
RE: Mersenne Twister implentation - KeithB - 02-06-2017, 07:08 PM



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