Dynare++: minor fix to check for oversized problem

The maximum value of a signed integer is 2³¹−1, so the inequality test must not
be strict.
last-period-simul
Sébastien Villemot 2022-01-21 14:54:41 +01:00
parent 4fdb15b437
commit 5a55e29561
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
/*
* Copyright © 2004 Ondra Kamenik
* Copyright © 2019 Dynare Team
* Copyright © 2019-2022 Dynare Team
*
* This file is part of Dynare.
*
@ -51,7 +51,7 @@ namespace TLStatic
init(int dim, int nvar)
{
// Check that tensor indices will not overflow (they are stored as signed int, hence on 31 bits)
if (std::log2(nvar)*dim > std::numeric_limits<int>::digits)
if (std::log2(nvar)*dim >= std::numeric_limits<int>::digits)
throw TLException(__FILE__, __LINE__, "Problem too large, you should decrease the approximation order");
std::lock_guard<std::mutex>{mut};

View File

@ -285,7 +285,7 @@ License: GFDL-NIV-1.3+
Files: dynare++/*
Copyright: 2004-2011 Ondra Kamenik
2019-2021 Dynare Team
2019-2022 Dynare Team
License: GPL-3+
Files: m4/ax_blas.m4 m4/ax_lapack.m4