Post Reply 
Seeking Your Suggested Matrix Test Program for the HP-15C
08-03-2023, 07:40 PM
Post: #1
Seeking Your Suggested Matrix Test Program for the HP-15C
Hi All,

As part of comparing the timings between different versions of the 15C, I have included programs for testing individual functions AND a few stand-alone apps. I would like to add a matrix test program. What do you suggest? I would like to get a reasonably short program that I can repeat in a loop... maybe one that solves a system of linear equations or invert a matrix.

Thanks!

Namir
Find all posts by this user
Quote this message in a reply
08-03-2023, 08:09 PM
Post: #2
RE: Seeking Your Suggested Matrix Test Program for the HP-15C
(08-03-2023 07:40 PM)Namir Wrote:  Hi All,

As part of comparing the timings between different versions of the 15C, I have included programs for testing individual functions AND a few stand-alone apps. I would like to add a matrix test program. What do you suggest? I would like to get a reasonably short program that I can repeat in a loop... maybe one that solves a system of linear equations or invert a matrix.

Thanks!

Namir

Stay tuned another day or two Namir, I believe the program that Valentin is polishing now will be the best candidate for such detailed performance testing, as it works on all 15C models and is likely to be as finely-tuned as anything you will find.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
08-03-2023, 09:51 PM
Post: #3
RE: Seeking Your Suggested Matrix Test Program for the HP-15C
Will do! Thanks Robert!

Namir
Find all posts by this user
Quote this message in a reply
08-04-2023, 04:39 PM
Post: #4
RE: Seeking Your Suggested Matrix Test Program for the HP-15C
  
Hi, Bob,

(08-03-2023 08:09 PM)rprosperi Wrote:  Stay tuned another day or two Namir, I believe the program that Valentin is polishing now will be the best candidate for such detailed performance testing [...]

Thanks for your appreciation re my program being ideal for Namir's purposes but in this particular case, I beg to differ.

Namir's needs would be best served using this little 20-step HP-15C routine I've just written for him right now, which takes the number of loops to perform from the X stack register and repeatedly executes any desired function(s). In this case it creates a 7x7 matrix, populates it with random values, and computes its inverse, rinse and repeat. The [1/x] at step 17, which computes the inverse, can be replaced by other functions or even call (GSB) some program.

Here's the commented listing and pertinent Notes:

  01  LBL E        assumes the number of loops is in the display
  02  STO I        store # of loops in RI, the indez register
  03   1           specify R1 as the last data register ...
  04  DIM (i)      ... so allocating all the memory to the common pool
  05  MATRIX 0     redimension all five matrices to 0x0
  06   7           7 in stack X
  07  ENTER        7 in stack Y too
  08  DIM A        dimension A to 7x7 (8x8 wouldn't fit in the original 15C)
  09  MATRIX 1     reset the row/col indexes to the first element of A

  10  LBL 0        loop to fill up A with random values
  11    RAN#       generate a random number [0..1)
  12u   STO A      store it in A's current element and update indexes
  13  GTO 0        if still not at the last element, loop for more

  14  RESULT A     all elements filled up, A will be the result matrix
  15  RCL MATRIX A recall matrix A to the X stack register

  16  LBL 1        loop to perform some matrix operation(s) repeatedly
  17    1/x        in this case, the matrix operation is inverting A
  18    DSE I      decrement the loop counter
  19  GTO 1        if not done with the loops, go loop once again

  20  RTN          all loops done, end program

Run it like this: #loops, GSB E (or just E in User mode).

Notes:
  • You can specify a smaller matrix by changing the 7 al step 6 by a lower value
  • you can replace the 1/x at step 17 with one or more operations of your choice or even call some program if you know what you're doing (they will be repeated in every loop)
  • the STO at step 12 *must* be entered in User mode (uSTO)
  • if repeatability is desired, initialize the RNG with: (some seed), STO RAN#
  • take into account the particular 15C version when specifiying the number of loops, as the original HP-15C is quite slow. These timings are typical when inverting a matrix using it:

         1x1: 0.5", 2x2: 1.8", 3x3: 5.3", 4x4: 12", 5x5: 22", 6x6: 36", 7x7: 55"

    and 8x8 would take 80" but specifying such big matrix would leave no memory at all for any program. Other 15C versions are much faster and usually have significantly more memory, from 1.5x (CE/96) to 3x (CE/192) to 3.58x (DM15/M1B). On the other hand, the CE takes less than 0.5" to invert a 7x7 matrix.
Hope this helps. Now back to finish the documentation for my incoming programs on the double, so very busy.  Smile

Best regards.
V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
08-04-2023, 06:26 PM
Post: #5
RE: Seeking Your Suggested Matrix Test Program for the HP-15C
(08-04-2023 04:39 PM)Valentin Albillo Wrote:  Thanks for your appreciation re my program being ideal for Namir's purposes but in this particular case, I beg to differ...
[snip]

You certainly know best Valentin, I was simply pointing out what I thought would be a good candidate in case Namir had not seen that, though having not seen your new program, this was premature.

After you've published your (other) new program, could you add a comment (here or there, most interested readers will be following both threads) explaining why the program above is better suited for Namir's needs, seemingly implying this is a more general-purpose use of Matrix operations?

Thanks for generating and publishing this alternate test code and documentation (btw, very helpful for folks just learning the 15C), and sorry for distracting you from the main thrust you were working on.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
08-05-2023, 11:55 PM
Post: #6
RE: Seeking Your Suggested Matrix Test Program for the HP-15C
.
Hi, Bob,

rprosperi Wrote:I was simply pointing out what I thought would be a good candidate in case Namir had not seen that, [...]

And I thank you for doing it, much appreciated.

Quote:After you've published your (other) new program, could you add a comment (here or there, most interested readers will be following both threads) explaining why the program above is better suited for Namir's needs, [...]

Glad to obligue. If you have a look at the thread I created today and the promised programs and documentation I posted to it, you'll quickly see that using them for Namir's stated purpose would be like "matar moscas a cañonazos" ("to use a sledgehammer to crack a nut"), as it requires a certain way to set up the matrix data that is geared to processing large matrices, 9x9 and beyond, and this would be overkill for Namir's needs; the short 20-line procedure I posted above is much more convenient and easier to use or modify.

Quote:Thanks for generating and publishing this alternate test code and documentation (btw, very helpful for folks just learning the 15C), and sorry for distracting you from the main thrust you were working on.

You're welcome and don't worry, I managed to finish before my self-imposed deadline expired. And BTW, I also concur that commented code is the best way to learn a new language/device and to understand how a program works. I'd change an ungainly bunch of lengthy, unfathomable docs and cryptic syntax references for some actually working, well-commented code and detailed worked examples any day.

Best regards.
V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
08-06-2023, 12:06 AM
Post: #7
RE: Seeking Your Suggested Matrix Test Program for the HP-15C
Thank you very much Valentin for your code. Now if only the CE would arrive to my house as DHL has originally promised. The CE should have arrived yesterday and it's still a no-show!

Namir
Find all posts by this user
Quote this message in a reply
08-06-2023, 12:55 AM
Post: #8
RE: Seeking Your Suggested Matrix Test Program for the HP-15C
(08-06-2023 12:06 AM)Namir Wrote:  Thank you very much Valentin for your code. Now if only the CE would arrive to my house as DHL has originally promised. The CE should have arrived yesterday and it's still a no-show!

You're welcome, Namir, and sorry for your wait. Where did you order your CE ? Gerson (Brazil) bought his from José G. Divasson's TCS (Barcelona, Spain) and they told him he wout get it next Aug, 8, i.e. within 2 days from now.

Best of luck. There will be much weeping and gnashing of teeth among those who still didn't order their HP-15C CE's, they're losing so much fun !

Regards.
V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
08-06-2023, 01:34 AM
Post: #9
RE: Seeking Your Suggested Matrix Test Program for the HP-15C
Hi Valentin!

(08-05-2023 11:55 PM)Valentin Albillo Wrote:  .
Hi, Bob,

rprosperi Wrote:I was simply pointing out what I thought would be a good candidate in case Namir had not seen that, [...]

And I thank you for doing it, much appreciated.

Quote:After you've published your (other) new program, could you add a comment (here or there, most interested readers will be following both threads) explaining why the program above is better suited for Namir's needs, [...]

Glad to obligue. If you have a look at the thread I created today and the promised programs and documentation I posted to it, you'll quickly see that using them for Namir's stated purpose would be like "matar moscas a cañonazos" ("to use a sledgehammer to crack a nut"), as it requires a certain way to set up the matrix data that is geared to processing large matrices, 9x9 and beyond, and this would be overkill for Namir's needs; the short 20-line procedure I posted above is much more convenient and easier to use or modify.

Indeed this example, though of great interest in its own right for the stated purpose and an impressive work of VA art, it truly would have been unwieldy and awkward if not impossible to use for Namir's performance testing. Glad you killed that idea quickly and then generously went on to submit an appropriate tool for that job. Many thanks!

(08-05-2023 11:55 PM)Valentin Albillo Wrote:  
rprosperi Wrote:Thanks for generating and publishing this alternate test code and documentation (btw, very helpful for folks just learning the 15C), and sorry for distracting you from the main thrust you were working on.

You're welcome and don't worry, I managed to finish before my self-imposed deadline expired. And BTW, I also concur that commented code is the best way to learn a new language/device and to understand how a program works. I'd change an ungainly bunch of lengthy, unfathomable docs and cryptic syntax references for some actually working, well-commented code and detailed worked examples any day.

Best regards.
V.

I agree and think this can't be overstated. This is one of the reasons many/most of the early HP manuals were so useful, they provided well-explained example programs, even though the problems themselves were often tongue-in-cheek and even borderline comical. Surley as time went on the quality of both the programs and the associated explanations went downhill slowly and then rather quickly after the 48SX. But they established a quality expectation most of us revere to this day and your work is true homage to that inspiration.

Your new [VA] SRC #015 is my new Gold Standard for program documentation which I will point to when new members ask about proper format for submissions - not as a requirement to meet, etc. but rather as inspiration for how good it can get and how useful it is when proper time and attention to detail is used to create docs.

Thank you for the huge time you invest in these postings, they are truly appreciated! Smile

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
08-09-2023, 12:40 AM
Post: #10
RE: Seeking Your Suggested Matrix Test Program for the HP-15C
.
Hi, Bob,

(08-06-2023 01:34 AM)rprosperi Wrote:  Glad you killed that idea quickly and then generously went on to submit an appropriate tool for that job. Many thanks!

You're welcome. It was my pleasure.

Quote:I agree and think this can't be overstated. This is one of the reasons many/most of the early HP manuals were so useful, they provided well-explained example programs, even though the problems themselves were often tongue-in-cheek and even borderline comical.

I enjoyed them immensely at the time and was amazed no end when I got my very first HP calculator, the then brand-new HP-25, with its incredible manual. It certainly taught me RPN programming in a most enjoyable way and probably inspired my future career.

The HP-67 manual was as good or even better, certainly much longer and more complex but equally good and enjoyable. Those were the days ! But the HP-41C manual, on the other hand, I did like it but not that much. It was a bit of a letdown compared to the others.

Quote:But they established a quality expectation most of us revere to this day and your work is true homage to that inspiration.

Hehe, more like it's the product of that inspiration. Would you believe I reread the HP-25 and HP-67 manuals at times, to try and reminisce those wonderful sensations of the distant past ?

Quote:Your new [VA] SRC #015 is my new Gold Standard for program documentation which I will point to [...] as inspiration for how good it can get and how useful it is when proper time and attention to detail is used to create docs.

Thank you very much, I feel honored. I certainly put a lot of time and attention to detail (though I've already detected 3 typos 3 despite exhaustively proofreading it) and I consider the exposition to be adequate but I must work on its length (aka verbosity). Wink

Quote:Thank you for the huge time you invest in these postings, they are truly appreciated! Smile

Again, you're welcome and thanks to you for your appreciation and support, it does wonders for me. Now, let's hear from Namir, I'm itching to know if he succeeded with his stated goal (and I ask for his forgiveness for hijacking his thread !.)

Best regards.
V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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