On Sat, 8 Aug 2009, Allin Cottrell wrote:

> On Sat, 8 Aug 2009, Sven Schreiber quoted:
> > > That is, you can use the keyword "rfunc" to indicate that you're
> > > giving a constraint function rather than explicit statement of a
> > > restriction.  As in Jack's script, this function should take as
> > > its single argument the coefficient vector (in "pointer" form),
> > > and it should return a vector that is zero under H0, non-zero
> > > under the alternative...

and replied:
> >
> > Certainly a very nice feature!
> >
> > Why is the pointer form necessary?

And I reponded:

> Ah, it's not actually necessary, though it is a bit more
> efficient.  However, we do need to standardize on pointer-form or
> not. I suppose the straight, non-pointer form is more "natural".

Fixed in CVS.  The signature for the callback function for a
nonlinear restriction, in the context of the "restrict" command,
should now be:

function foo (const matrix m)

(replace "foo" and "m" as desired).

This is linked to a general modification of the effect of the
"const" qualifier for matrix arguments: if you promise not to
modify a matrix argument then you get the matrix "directly", not a
copy.  That is, it's the same, speed-wise, as passing a "pointer
to matrix" (but it's an error if you try to modify the argument).

I think the business of using the pointer formulation purely for
speed-up in gretl was potentially a bit confusing; it's no longer
necessary for matrices, just use "const" instead.

Allin


Reply via email to