Post Reply 
newRPL: Simplified matrices proposal
06-02-2015, 12:46 AM
Post: #4
RE: newRPL: Simplified matrices proposal
(06-01-2015 08:48 PM)Werner Wrote:  Vectors and matrices in RPL are the same object type DOARRY. One of the first parameters in its definition is the number of dimensions - you can create tensors if you like (in ML).

OK, yes, sort of, same prolog maybe, but it's not the same object by the fact it's a one-dimensional matrix. Commands that work on vectors are different than for matrices. And from the user perspective, matrices use double [[ ]] and vectors use single, so they even appear different too.

(06-01-2015 08:48 PM)Werner Wrote:  Accessing numeric arrays is much faster than accessing symbolic ones, because the elements are all the same length. For that reason alone, I'd vote against the Grand Unification.
You hit it right in the nail. In newRPL, real numbers are arbitrary precision and therefore different length, so that advantage is gone even on numeric matrices.

(06-01-2015 08:48 PM)Werner Wrote:  There IS another array type that is not exposed to RPL: the linked array. The type of all elements is still the same, but their lengths may vary (eg decimal integers), and the arry starts with the NxM offsets of all elements, followed by all element 'bodies';
Yes, newRPL matrices are already (by necessity) implemented as linked arrays, because of the variable size of the objects. The offsets is the only way to get some decent speed with such a format. I even went a step further, allowing the bodies to be shared by more than one element. For instance, an identity matrix only needs to store one zero and one 1, then the links point to the same objects to save space.

(06-01-2015 08:48 PM)Werner Wrote:  My 2 cents ;-)
Your comments are always worth a lot more than that...
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: newRPL: Simplified matrices proposal - Claudio L. - 06-02-2015 12:46 AM



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