OasisLMF / ktools

In-memory simulation kernel for loss modelling.
BSD 3-Clause "New" or "Revised" License
29 stars 18 forks source link

Fix resizing of sample loss vector in aalcalc when sample size is 1 #311

Closed hchagani-oasislmf closed 2 years ago

hchagani-oasislmf commented 2 years ago

Fix resizing of sample loss vector in aalcalc when sample size is 1

Following the introduction of the Average Loss Convergence Table (ALCT) in ktools v3.9.0 (see PR https://github.com/OasisLMF/ktools/pull/301 for more details) a bug was introduced where the sample loss vector in aalcalc would not be resized when sample size is 1 and the ALCT output was not requested on the command line. Under these circumstances, an attempt to write beyond the scope of the vector would be made, which would throw a segmentation fault. The logic behind resizing the sample loss vector has been changed, thus fixing this issue.