Programming challenges: processing vectors and matrices
12-28-2022, 08:57 PM
Post: #21
 pier4r Senior Member Posts: 2,248 Joined: Nov 2014
RE: Programming challenges: processing vectors and matrices
(12-28-2022 08:32 PM)John Keith Wrote:  Not unless David manages to add that functionality to ListExt.

Seriously though, AXL n MPOS is quite fast and efficient. I tend to use lists rather than arrays unless I need linear algebra operations (matrix inversion, determinants, etc.).

There is one issue to watch out for when using AXL however. AXL always converts a list into a type 29 (symbolic) array. The command AXM will convert a type 29 array into an approximate (type 3 or 4) array but it is slow. If you need to convert a list of reals into a type 3 array, it may be better just to use OBJ-> and ->ARRY.

Thanks you, and yes I remember we discussed that AXL is pretty quick. Anyway AXL is a sort of problem when the array is too large for the memory available. Further the part about type 29 is also important (could be tricky to debug that).

But I got it, there is likely none. I created sort of equivalent to POS on my own (not quick, but they work) due to memory constraints in using AXL.

Wikis are great, Contribute :)
12-31-2022, 06:02 PM (This post was last modified: 12-31-2022 06:08 PM by John Keith.)
Post: #22
 John Keith Senior Member Posts: 1,034 Joined: Dec 2013
RE: Programming challenges: processing vectors and matrices
This simple program will reverse a vector and it is at least as fast as AXL REVLIST AXL. It does not change a type 3 or 4 array to a type 29 array as AXL does. It will work on any RPL calculator.

To reverse the elements of a matrix, one would need to change the 1 GET in line 2 to OBJ\-> DROP *. Changing 1 GET to 1 + \PILIST would allow the program to work with either vectors or matrices but would restrict it to the 48G or newer.
Code:
 \<< OBJ\-> \-> d   \<< 2. d 1. GET     FOR k k ROLL     NEXT d \->ARRY   \>> \>>
 « Next Oldest | Next Newest »

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