On Tue, 14 Sep 2021, atecon wrote:
Hi,
I also think that this is desirable: I so often thought that this may be
useful in the contexts of a matrix and of an array (even series?).
In the case of a series, the presence of missing entries could be a
problem, I think.
One question: How would such an "end" operator work
"under the hood"?
a) Is it triggering the computation of rows(X) AND cols(X) each time "end" is
called, or
b) is it a property of matrix X, meaning that once X is initialized, the
number of rows and columns is automatically computed and this information
stored as a property of the object X?
It's (b). The computational cost of the rows() and cols() function is
nearly zero. The "matrix" struct definition is in lib/src/gretl_matrix.h,
line 77.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------