Am 14.09.2021 14:10 schrieb Allin Cottrell:
On Tue, 14 Sep 2021, Riccardo (Jack) Lucchetti wrote:

On Tue, 14 Sep 2021, atecon wrote:

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.

Exactly zero, I'd say. In hansl you need to call rows() or cols() to
get the dimensions of a matrix but internally, in C, rows and cols are
members of the matrix struct so no computation is required, just a
read.

Thanks for the clarification.

Best,
Artur
_______________________________________________
Gretl-devel mailing list -- gretl-devel@gretlml.univpm.it
To unsubscribe send an email to gretl-devel-le...@gretlml.univpm.it
Website: 
https://gretlml.univpm.it/postorius/lists/gretl-devel.gretlml.univpm.it/

Reply via email to