[ADMB Users] "xxglobal.tmp" error with tpl2rem

dave fournier otter at otter-rsch.com
Tue Aug 4 13:35:39 PDT 2009


>This line is causing problems in your other model (mccoypred3.tpl);

>prob = 1/(1/(elem_prod(cvec,elem_prod(pow(size/d,g),exp(-size/d))))
>+h*initial);

>specifically, it does not like "pow(size/d,g)" because there does not
>appear to be a function that takes the arguments:
>'bolker2.cpp:123: error: no matching function for call to
>‘pow(data_vector&, df1b2_init_number&)’

>You might want to re-write this function in log-space to get it to
>work properly.

It is difficult to diagnose these missing function problems if you are
not familiar with the package. A lot of the admb functions were not
extended (yet?) to the RE package. anyway what is missing is the function

  df1b2vector pow(const df1b2vector& v,const df1b2variable & x)

Probably the most elegant work around is to define your own
and put it in the GLOBALS_SECTION to make it available.

stick this at the bottom of the tpl file.


GLOBALS_SECTION

  #include <admodel.h>
  #include <df1b2fun.h>
  #include <adrndeff.h>

  df1b2vector pow(const df1b2vector& v,const df1b2variable & x)
  {
    int mmin=v.indexmin();
    int mmax=v.indexmax();
    df1b2vector tmp(mmin,mmax);
    for (int i=mmin;i<=mmax;i++)
    {
      tmp(i)=pow(v(i),x);
    }
    return tmp;
  }

Also in the version of the program I saw you are missing a ";"
in the line above.

-- 
David A. Fournier
P.O. Box 2040,
Sidney, B.C. V8l 3S3
Canada
Phone/FAX 250-655-3364
http://otter-rsch.com



More information about the Users mailing list