Closed BenWilliams-NOAA closed 1 year ago
Thats a C++ index, so if there are 30 ages, the vector is indexed from 0:29
if you use a look up of 30
for a vector of size 30
you will get undefined behaviour. Most likely a crash
Guess I had assumed the index was based on ages.size() but sounds like the init_n is based on max age?On Oct 2, 2023, at 12:10 PM, Craig Marsh (aka Cyril) @.***> wrote: Thats a C++ index, so if there are 30 ages, the vector is indexed from 0:29 if you use a look up of 30 for a vector of size 30 you will get undefined behaviour. Most likely a crash
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
durrr - been looking at to much admb code
https://github.com/Craig44/SpatialSablefishAssessment/blob/821112099391c2dc26c8f79972bb51c3e86c9e5c/src/TMB/CurrentAssessment.hpp#L562
I may be confused (likely) but wouldn't the plus group be
n_ages
, notn_ages -1
?