Skip to content

Commit 5e69897

Browse files
authored
Merge pull request #3248 from stan-dev/tweak-positive-index-wording
Update wording of validate_positive_index
2 parents b916789 + 5397344 commit 5e69897

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

stan/math/prim/err/validate_positive_index.hpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,21 @@ namespace stan {
1010
namespace math {
1111

1212
/**
13-
* Check that simplex is at least size 1
13+
* Check that size is at least 1. Used for simplexes and
14+
* other constraints that do a (size - 1) operation.
1415
*
15-
* @param var_name Name of simplex variable
16+
* @param var_name Name of variable
1617
* @param expr Expression in which variable is declared
17-
* @param val Size of simplex
18-
* @throw std::invalid_argument if simplex size is less than 1
18+
* @param val Size to check
19+
* @throw std::invalid_argument if size is less than 1
1920
*/
2021
inline void validate_positive_index(const char* var_name, const char* expr,
2122
int val) {
2223
if (val < 1) {
2324
[&]() STAN_COLD_PATH {
2425
std::stringstream msg;
25-
msg << "Found dimension size less than one in simplex declaration"
26+
msg << "Found dimension size less than one in constrained type "
27+
"declaration (simplex, sum_to_zero_vector, etc.)"
2628
<< "; variable=" << var_name << "; dimension size expression=" << expr
2729
<< "; expression value=" << val;
2830
std::string msg_str(msg.str());

0 commit comments

Comments
 (0)