[ADMB Users] Implementing a convolution in the GLOBAL_SECTION

John Sibert sibert at hawaii.edu
Sat May 26 13:11:20 PDT 2012


Glad you were able to get it working.

Regarding the message in the .log file (ie simple.log), it can be safely 
ignored. It seems to contain the same information under all conditions.

John Sibert
Emeritus Researcher, SOEST
University of Hawaii at Manoa

Visit the ADMB project http://admb-project.org/


On 05/26/2012 06:21 AM, Øigård Tor Arne wrote:
> 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);
>>
>> Cheers,
>> John
>>
>




More information about the Users mailing list