From 743fa0b98adf3591a0d0f2b8e2af90034d8fd993 Mon Sep 17 00:00:00 2001 From: Jay Hesselberth Date: Mon, 20 Jan 2025 10:59:37 -0700 Subject: [PATCH] Fix ASAN error --- src/random.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/random.cpp b/src/random.cpp index 1fb42369..0f19ed94 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -24,7 +24,7 @@ writable::data_frame random_impl(data_frame genome, int length, int n, int seed auto generator = ENGINE(seed) ; // calculate weights for chrom distribution - double mass = std::accumulate(sizes.begin(), sizes.end(), 0); ; + double mass = std::accumulate(sizes.begin(), sizes.end(), 0.0); ; std::vector weights(nchrom) ; for (int i = 0; i < nchrom; ++i) {