[ADMB Users] PI and sumsq()

Arni Magnusson arnima at hafro.is
Fri Mar 1 09:32:34 PST 2013


In older versions of ADMB, the constant M_PI was available for some, but 
not all compilers. In other words, ADMB models with M_PI would not compile 
on all machines.

As of ADMB 11.0, the constant PI is defined in ADMB for all compilers, its 
value taken from the GCC definition of M_PI (3.14159265358979323846). Some 
users will continue using M_PI, so that their models can be compiled with 
older versions of ADMB. Others will start using PI, so that their models 
are not dependent on a particular compiler.

The idea behind PI, besides portability, is to use the most intuitive 
expressions for common tasks in ADMB. Another similar move is introducing 
the new function sumsq() for the sum of squares in ADMB 11.0. This means 
that norm2() will be considered as an "internal" function, but sumsq() as 
a "user" function.

These and other new features in ADMB 11.0 are mentioned in the NEWS file 
(http://admb-project.org/svn/trunk/NEWS.txt) and will be documented in the 
user manual version 11.

Arni



On Fri, 1 Mar 2013, Jeff Laake wrote:

> Realized what the issue is. I was using admb11 and there is no gcc 64 
> bit version listed which is why I went to 32 bit. But you pointed me to 
> 10.1. I'll use it and change my references to PI to M_PI. If I do that 
> will my code need to be changed back to PI for admb11 or will M_PI 
> continue to work?
>
> --jeff
>



More information about the Users mailing list