admb-project / admb

AD Model Builder
http://admb-project.org
Other
64 stars 19 forks source link

Creating a vector with both bounds as init_ints causes ambiguous function error #18

Closed cgrandin closed 9 years ago

cgrandin commented 9 years ago

To reproduce this error, open simple.tpl and add these lines to the DATA_SECTION:

init_int sage init_int nage vector age(sage,nage)

This worked fine in previous versions but now gives an ambiguity error in dvector.h. There are two allocate functions which match. They are:

void allocate(int ncl, int ncu); void allocate(const ad_integer &, const index_type &);

Both those definitions were there in the previous versions and have been since inception so something else has changed in the ADMB source to cause this. The error appeared when I used the current source, pulled and compiled on Nov 4, 2015.

johnoel commented 9 years ago

Thanks Chris for finding this error.

The Error started with commit https://github.com/admb-project/admb/commit/c14c6870cf43e2c1bd0868c66d5fd46d04614d3a

Resolved in https://github.com/admb-project/admb/commit/99e8baa1ba85a81f804820338b94fb32e8a696f0

cgrandin commented 9 years ago

Thanks Johnoel, there is still an issue though with 3d arrays. Try adding this into simple.tpl, DATA_SECTION:

init_int nAgears init_ivector n_A_nobs(1,nAgears) init_ivector n_A_sage(1,nAgears); init_ivector n_A_nage(1,nAgears); 3darray d3_A_obs(1,nAgears,1,n_A_nobs,n_A_sage,n_A_nage);

johnoel commented 9 years ago

Try again Chris https://github.com/admb-project/admb/commit/907215a87ab79ee679a27b003b27aedb98b4f6e8

cgrandin commented 9 years ago

It is working again, thanks Johnoel!