[ADMB Users] Implementing a convolution in the GLOBAL_SECTION

Øigård Tor Arne tor.arne.oeigaard at imr.no
Sat May 26 09:21:34 PDT 2012

Thanks to both John and Weihai,

Yes it works now. I really appreciate it. Thanks for the extra information
regarding dvar_vector and dvectors!

Kind regards,
Tor Arne

On 5/26/12 02:30 , "John Sibert" <sibert at hawaii.edu> wrote:

>It seems that the vectors x and h are data and the output of the conv1(
>) funtion, does not depend on the model parameters. If that is the case
>they should be declared to be dvectors. A dvar_vector is a container
>class for a variable for which derivative information is to be
>accumulated. I'm not sure which "log" file you are looking at, but the
>error  "size of file cmpdiff.tmp = 0"  may have been caused by
>attempting to use a variable object (dvar_vector) before temporary
>memory for the derivative information has been allocated.
>Weihai is correct about the order of statements. If you follow the
>simple cpp practice of not declaring multiple variables on a single
>line, the compiler might have picket up the error. ie
>  dvector conv1(const dvector& x, const dvector& h)
>    {
>    dvector lowerlimit(1,2);
>    dvector upperlimit(1,2);
>    dvector y(1,n+m-1); // error since m and n are not declared yet.
>    int m=size_count(x);
>    int n=size_count(h);

More information about the Users mailing list