Seeking Your Suggested Matrix Test Program for the HP-15C
|
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:
Best regards. V. All My Articles & other Materials here: Valentin Albillo's HP Collection |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)