Hmm. I'm not sure which OS your are using, but in my world double
round(double) requires only one argument, not two as in your report
section example. It is part of the standard C/C++ math library and is
not an ADMB function.
The " error: cannot convert 'param_init_bounded_number' to 'double' for
argument '1' to 'double round(double)' " can probably be eliminated by
report << "FPSFpD=" << round(value(FPSFpD)) << endl;
The value function returns the double part of the variable, and there is
only one argument to round.
On 05/23/2013 11:10 AM, Rice, Cliff G (DFW) wrote:
> Mssrs. Sibert and Grandin,
>
> I am simply trying to round a parameter value for display in the report section, e.g.,
> Given:
> PARAMETER_SECTION
> init_bounded_number FPSFpD(0.2,0.7)
> .
> .
> .
> REPORT_SECTION
> report<<"FPSFpD="<<round(FPSFpD, 2)<<<<endl;
>
> Produces the error:
> error: cannot convert 'param_init_bounded_number' to 'double' for argument '1' to 'double round(double)'
>
> This is true whether or not I have the include <contrib.h> statement in the TPL.
>
> I discovered you can use round() to round a 'plain' number, but apparently not a bounded number.
> So, I looked for other people's approaches and found the qfclib.h library.
> When I couldn't get the example to work, I quoted it in my question, not my own program, because the example was available for everyone to see. However, the example uses the round function on a nested function - I guess to show how versatile it is, but I'm not interested in what those nested functions.
>
> Thanks,
> Cliff
>
> P.S. I have been trying for the last week to get a message to the Group Owner to make me a member so I can respond directly, but without success (Google keep giving an error). So, I am sending this directly to you as well as cc'ing the group.
>
>
> -----Original Message-----
> From: John Sibert [mailto:
sib...@hawaii.edu]
> Sent: Thursday, May 16, 2013 6:08 PM
> To: Rice, Cliff G (DFW)
> Cc:
us...@admb-project.org
> Subject: Re: [ADMB Users] Invoking library qfclib.h
>