Post Reply 
RPL mini-challenge: Create an anti-Identity Matrix
05-14-2018, 03:49 PM
Post: #31
RE: RPL mini-challenge: Create an anti-Identity Matrix
Lots of great work happening here!

@Joe:
Color me surprised re: the small size of your most recent contribution. The null-tagging method is something I must have missed in the comp.sys.hp48 discussions, and it's a neat way to delay execution of a single command. That would also have nice uses for other list processing commands when a single command is needed for processing. Smile

@Didier:
Thanks for the pointer to LCXM. It's yet another RPL command that I've never become acquainted with up until now. While not a speed demon, I can see where it might be really useful in situations where you need to build a 2d matrix whose elements have a defined relationship to their position.

@Pier:
Thanks for your updated (and excellent) submission. You captured the essence of what I was suspecting might be the winning algorithm, and your solution is better than my own attempt at it before I posted the challenge (see below). Great job!

@Claudio:
Interesting notes about the newRPL differences, which are IMHO improvements that will be useful. Thanks also for "taking the time" to time the various approaches with newRPL implementations (pun slightly intended) -- once again we can clearly see what the hardware platform is truly capable of when not being constrained by the emulated Saturn environment. Your efforts are succeeding in creating a great new platform.

@3298:
Bravo! Your adaptation of Pier's approach is a model of efficiency and optimization. You've definitely set the target for any future UserRPL implementations, and I suspect it will be hard to beat. Great job!

@All:
I was hesitant to post my own submission before, but now that others have already done a much better job of implementing what I was attempting to do with it, I don't mind sharing it:

Code:
\<<
  1. DUP2 - UNROT OVER +
  \-> lp dim cnt
  \<<
    0.
    1. dim NDUPN NOT
    WHILE
      'lp' DECR
    REPEAT
      cnt DUPN
    END
    { dim dim } \->ARRY
  \>>
\>>

Although it performed reasonably well (0.30s for approximate results), I knew that the indefinite loop and use of named locals was slowing it down. While these would have been easy to overcome in SysRPL, I was struggling to come up with UserRPL fixes. It was great to see both Pier's and 3298's better solutions which overcame the problems I was having.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: RPL mini-challenge: Create an anti-Identity Matrix - DavidM - 05-14-2018 03:49 PM



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