Skip to content

Commit

Permalink
increase max size for std::vector
Browse files Browse the repository at this point in the history
  • Loading branch information
Zilong-Li committed Jul 16, 2024
1 parent 846071f commit f939d1c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ inline void chunk_beagle_genotype_likelihoods(const std::unique_ptr<BigAss> & ge
genome->pos.push_back(markers);
markers.clear();
// transpose glchunk into genome->gl then clear it
MyFloat1D gl(genome->nsamples * im * 3);
MyFloat1D gl((size_t)genome->nsamples * im * 3);
for(i = 0; i < genome->nsamples; i++)
{
for(j = 0; j < im; j++)
Expand Down Expand Up @@ -422,7 +422,7 @@ inline void chunk_beagle_genotype_likelihoods(const std::unique_ptr<BigAss> & ge
genome->nchunks++;
genome->chrs.push_back(chr0);
// transpose glchunk into genome->gl then clear it
MyFloat1D gl(genome->nsamples * im * 3);
MyFloat1D gl((size_t)genome->nsamples * im * 3);
for(i = 0; i < genome->nsamples; i++)
{
for(j = 0; j < im; j++)
Expand Down
2 changes: 1 addition & 1 deletion tests/test-admixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ TEST_CASE("phaseless naive vs dump dataset 1", "[test-phaseless]")
for(int i = 0; i < genome->nsamples; i++) llike2 += admixer2.runNativeWithBigAss(i, genome);
admixer2.updateIteration();
cerr << std::setprecision(6) << "llike2: " << llike2 << "\tllike1: " << llike1 << "\n";
REQUIRE(abs(llike1 - llike2) < 1e-10);
REQUIRE(abs(llike1 - llike2) < 1e-6);
}
REQUIRE(((admixer1.Q - admixer2.Q).abs() < 1e-6).all());
}

0 comments on commit f939d1c

Please sign in to comment.