On Tue, 1 Nov 2011, Allin Cottrell wrote:
The point is that the gretl_matrix type knows nothing about column
or row names. [...]
The main reason that the names are attached to the "user_matrix"
wrapper and not the gretl_matrix itself is to keep the
gretl_matrix type lean and mean. [...]
On the other hand, I can see a use-case for wanting to return a
matrix from a user-defined function with row and/or column names
attached. Right now, I'm not sure how to resolve this.
A brief follow-up. I may be missing a better alternative (and I'll
continue to think about what that might be), but as I see it right
now, enabling user-functions to return matrices with row or column
names attached would require either:
(a) Functions can return the user_matrix wrapper-type, not just
plain gretl_matrix. I think this is a non-starter. Gretl's geneval.c
is complex enough, and hard enough to maintain, at present. This
would be bug-heaven; or
(b) Row and/or column names are attached to the gretl_matrix struct
itself, rather than the wrapper. That is more plausible, but I still
don't like it much. The extra memory required for an empty
gretl_matrix would only be two pointers (8 bytes on a 32-bit system)
but it represents additional complexity that I'd prefer to keep out
of what is in concept a mathematical type.
Allin