[ADMB Users] df1b2variable/prevariable operator

H. Skaug hskaug at gmail.com
Mon Jul 11 14:42:54 PDT 2011


Hi Mollie,

You are right, the RE manual is missing information
about how to add new functions. The rule
is: you need to write both the dvariable and df1b2variable
versions of "Michaelis_Menten1" even if
you only want to use the RE stuff.

I am not sure about the prevariable part: try to
df1b2variable Michaelis_Menten1(const double& x,  const df1b2variable&
a, const df1b2variable& b)

If you make this work it would be nice if you can
can add something to the RE docs, or send it
to me, based on your experience
in writing the Michaelis_Menten1 funciton.

Hans



On Mon, Jul 11, 2011 at 8:33 PM, Mollie Brooks <mbrooks at ufl.edu> wrote:
> Is this information documented anywhere? It's not in the RE manual.
>
> On 11 Jul 2011, at 2:16 PM, Weihai Liu wrote:
>
> As I know, df1b2variables for random effect model, any variable defined in
> parameter_section by default use df1b2variables.
> for non random effect, any variable in parameter_section refer to
> prevariable. So I don't think regular user will have a chance to use both of
> them at the same time in admb.
> I have not check the source code about df1b2variables class, not sure what
> is the relation between df1b2variables and prevariable. It is just my
> initial thought. I could be wrong.
> weihai
>
> On Mon, Jul 11, 2011 at 2:02 PM, Mollie Brooks <mbrooks at ufl.edu> wrote:
>>
>> I'm writing a library and overloading the function with all combinations
>> that I think a novice user might attempt to do.
>> What's wrong with mixing prevariables and df1b2variables? Isn't this what
>> happens in the procedure section anyway?
>> -Mollie
>>
>>
>> On 11 Jul 2011, at 1:59 PM, Weihai Liu wrote:
>>
>> can you change your b as df1b2variable, is there a reason you must define
>> b as prevariable? I would try not to  mix them.
>> weihai
>> On Mon, Jul 11, 2011 at 1:48 PM, Mollie Brooks <mbrooks at ufl.edu> wrote:
>>>
>>> There seems to be no operator defined for dividing a df1b2variable by a
>>> prevariable. Should I create a new df1b2variable and set it equal to the
>>> prevariable denominator?
>>>
>>> Will this operator eventially get defined? Should I add it as a feature
>>> request?
>>>
>>> thanks,
>>> Mollie
>>>
>>> Details...
>>> This is the function I'm trying to write:
>>>
>>> df1b2variable Michaelis_Menten1(const double& x,  const df1b2variable& a,
>>>  const prevariable& b)
>>> {
>>>    RETURN_ARRAYS_INCREMENT();
>>>        df1b2variable y;
>>>        y=a*x/(b+x);
>>>
>>>        RETURN_ARRAYS_DECREMENT();
>>>    return (y);
>>> }
>>>
>>> When I try to use it, I get the following error
>>>
>>>  In function 'df1b2variable Michaelis_Menten1(const double&, const
>>> df1b2variable&, const prevariable&)':
>>> ./Michaelis_Menten1.cpp:62: error: no match for 'operator/' in
>>> 'operator*(const df1b2variable&, double)(x) / operator+(((const
>>> prevariable&)((const prevariable*)b)), x)
>>>
>>> I believe the relevant candidates are:
>>>
>>> df1b2variable operator/(double, const df1b2variable&)
>>> df1b2variable operator/(const df1b2variable&, double)
>>> df1b2variable operator/(const df1b2variable&, const df1b2variable&)
>>> _______________________________________________
>>> Users mailing list
>>> Users at admb-project.org
>>> http://lists.admb-project.org/mailman/listinfo/users
>>
>>
>>
>> --
>> Weihai Liu
>> ~~~~~~~~~~~~~~~~~~~~~~~~
>> Quantitative Fisheries Center
>> Department of Fisheries & Wildlife
>> Michigan State University
>> 153 Giltner Hall
>> East Lansing, MI 48824
>> Phone: 517-355-0126
>> Email: liuweih at msu.edu
>> ~~~~~~~~~~~~~~~~~~~~~~
>>
>
>
>
> --
> Weihai Liu
> ~~~~~~~~~~~~~~~~~~~~~~~~
> Quantitative Fisheries Center
> Department of Fisheries & Wildlife
> Michigan State University
> 153 Giltner Hall
> East Lansing, MI 48824
> Phone: 517-355-0126
> Email: liuweih at msu.edu
> ~~~~~~~~~~~~~~~~~~~~~~
>
>
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users
>
>



More information about the Users mailing list