Hi,
further trying to use arrays, it seems that gretl sometimes is confused
about the '+=' operator:
<hansl>
matrices mc
mc += ones(3,2) # += refers to whole array
mc[1] += ones(3,2) # += should refer to 1st array element
</hansl>
The last line gives a "datatype mismatch" error or something like that.
Apparently gretl sees that 'mc' is an array, then sees '+=' and thinks
this wants to append another array to mc, but on the RHS there is only a
single matrix. In reality of course on the LHS there is also just a
matrix which lives inside mc. (The long form "mc[1] = mc[1] + ..." works.)
Somewhat related perhaps, it is currently impossible to write something
like:
"matrix mc[1] = ones(3,2)"
because gretl complains that "variable mc is of type array, not
acceptable here". Not a big deal per se, but having to write "matrices"
instead feels awkward, since the operation really is just about one
element, not about the whole array.
I guess there is a logical connection to my complaint from a couple of
days back about a matrix inside a bundle (like mybundle.mymatrix) not
being 100% usable in hansl code as a standard matrix syntactically.
Allin answered that filling this gap would not be trivial. Here the
problem is about a matrix inside an array. I can imagine this is not
trivial, either. But somehow these limitations are starting to feel
restrictive.
thanks,
sven