-
-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move size_zero() calls after other consistency checks (L-Z) #1761
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,11 +42,10 @@ inline typename VectorBuilder<true, int, T_alpha>::type bernoulli_logit_glm_rng( | |
using boost::bernoulli_distribution; | ||
using boost::variate_generator; | ||
|
||
static const char *function = "bernoulli_logit_glm_rng"; | ||
|
||
const size_t N = x.row(0).size(); | ||
const size_t M = x.col(0).size(); | ||
|
||
static const char *function = "bernoulli_logit_glm_rng"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [optional] There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well I moved them closer to the consistency checks, which is the only place where they are used. The thing is that in this and the other glm functions, there are some constants to be computed before they can be used in the consistency checks... |
||
check_finite(function, "Matrix of independent variables", x); | ||
check_finite(function, "Weight vector", beta); | ||
check_finite(function, "Intercept", alpha); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[comment]
Not a request for this PR, but this should all be rewritten for arbitrary sizes using parameter packs. It'd also greatly simplify the docs.