[ADMB Users] vectoizing pow for random effects
John Sibert
sibert at hawaii.edu
Mon Jul 11 23:21:15 PDT 2011
An interesting feature of doxygen.
The function prototype
dvar_vector pow(_CONST dvar_vector&,_CONST dvector& t1);
is declared in fvar.hpp, but the function is not actually defined in any
source module (that I could find with grep).
The doxygen pages for pow list a number of overloads of pow. Most
entries note the source file and line number where the function is
defined, but there is no mention of a source file for dvar_vector
pow(_CONST dvar_vector&,_CONST dvector& t1);
A useful feature if you know it is there.
John
On 07/11/2011 05:47 PM, Mollie Brooks wrote:
> Sorry, it turns out that function didn't exist. I wonder why it showed
> up in the doxygen at the link below.
> I solved the problem by writing
> dvar_vector pow(const dvector& x,const dvar_vector& a)
>
>
> On 11 Jul 2011, at 11:38 PM, Mollie Brooks wrote:
>
>> I thought that pow was already overloaded for dvar_vectors.
>> See
>> http://admb-project.org/documentation/api/fvar_8hpp.html#aad01213052d6d5ea585a60b19ef16fa0
>> This function is suspicious though because there's no documentation.
>>
>> I'm attaching a test file that sends a random effects vector to the
>> function Hill(). It produces the same errors.
>>
>> bash-3.2$ admb -r testHill_RE
>>
>> *** tpl2rem testHill_RE
>>
>> *** CXXFLAGS="" adcomp -r testHill_RE
>> g++ -c -O3 -Wno-deprecated -D__GNUDOS__ -Dlinux -DOPT_LIB
>> -DUSE_LAPLACE -fpermissive -I. -I/usr/local/admb/include testHill_RE.cpp
>>
>> *** LDFLAGS=" " adlink -r testHill_RE
>> g++ -L/usr/local/admb/lib testHill_RE.o -ldf1b2o -ladmod -ladt -lado
>> -ldf1b2o -ladmod -ladt -lado -o testHill_RE
>> Undefined symbols:
>> "pow(dvector const&, dvar_vector const&)", referenced from:
>> Hill(dvector const&, dvar_vector const&, dvar_vector const&,
>> dvar_vector const&)in testHill_RE.o
>> Hill(dvector const&, dvar_vector const&, dvar_vector const&,
>> dvar_vector const&)in testHill_RE.o
>> Hill(dvector const&, prevariable const&, dvar_vector const&,
>> dvar_vector const&)in testHill_RE.o
>> Hill(dvector const&, prevariable const&, dvar_vector const&,
>> dvar_vector const&)in testHill_RE.o
>> Hill(dvector const&, dvar_vector const&, prevariable const&,
>> dvar_vector const&)in testHill_RE.o
>> Hill(dvector const&, dvar_vector const&, prevariable const&,
>> dvar_vector const&)in testHill_RE.o
>> Hill(dvector const&, prevariable const&, prevariable const&,
>> dvar_vector const&)in testHill_RE.o
>> Hill(dvector const&, prevariable const&, prevariable const&,
>> dvar_vector const&)in testHill_RE.o
>> ld: symbol(s) not found
>> collect2: ld returned 1 exit status
>>
>> Error: could not create testHill_RE
>> <testHill_RE.tpl>
>>
>>
>>
>> On 11 Jul 2011, at 8:32 PM, Steve Martell wrote:
>>
>>> I did not try and compile your code, but it appears you have
>>> overloaded the pow function as a df1b2vector only by you are passing
>>> it dvar_vectors.
>>>
>>> S.
>>> On 2011-07-11, at 4:41 PM, Mollie Brooks wrote:
>>>
>>>> <pow_vectorized_RE.cpp><Hill.cpp>
>>>
>>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at admb-project.org <mailto:Users at admb-project.org>
>> http://lists.admb-project.org/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users
--
John Sibert
Emeritus Researcher, SOEST
University of Hawaii at Manoa
Visit the ADMB project http://admb-project.org/
More information about the Users
mailing list