Skip to content

Commit be7645c

Browse files
committed
fix: crash on sampling categorical parameter values
1 parent 4510de7 commit be7645c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/MetaFilters/iASamplingMethodImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class iAIntRandom: public iARandomGenerator
8383
m_max(max),
8484
m_isLog(isLog)
8585
{}
86-
//! return a random number between 0 and max-1, uniformly distributed
86+
//! return a random number between min and max, uniformly distributed
8787
QVariant next() override
8888
{
8989
double randMin = m_isLog ? std::log(m_min) : m_min;
@@ -102,7 +102,7 @@ class iACategoryRandom : public iARandomGenerator
102102
public:
103103
iACategoryRandom(QStringList const & options):
104104
m_options(options),
105-
m_intRandom(0, static_cast<int>(options.size()), false)
105+
m_intRandom(0, static_cast<int>(options.size()-1), false)
106106
{}
107107
QVariant next() override
108108
{

0 commit comments

Comments
 (0)