Skip to content
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

Fix model_header include order when STAN_MODEL_FVAR_VAR is defined #3294

Merged
merged 4 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/stan/model/model_base.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef STAN_MODEL_MODEL_BASE_HPP
#define STAN_MODEL_MODEL_BASE_HPP

#include <stan/io/var_context.hpp>
#include <stan/math/rev/core.hpp>
#ifdef STAN_MODEL_FVAR_VAR
#include <stan/math/mix.hpp>
#endif
#include <stan/io/var_context.hpp>
#include <stan/math/rev/core.hpp>
#include <stan/model/prob_grad.hpp>
#include <stan/services/util/create_rng.hpp>
#include <ostream>
Expand Down
2 changes: 1 addition & 1 deletion src/stan/model/model_base_crtp.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef STAN_MODEL_MODEL_BASE_CRTP_HPP
#define STAN_MODEL_MODEL_BASE_CRTP_HPP

#include <stan/model/model_base.hpp>
#ifdef STAN_MODEL_FVAR_VAR
#include <stan/math/mix.hpp>
#endif
#include <stan/model/model_base.hpp>
#include <iostream>
#include <utility>
#include <vector>
Expand Down
4 changes: 2 additions & 2 deletions src/stan/model/model_header.hpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#ifndef STAN_MODEL_MODEL_HEADER_HPP
#define STAN_MODEL_MODEL_HEADER_HPP

#include <stan/model/model_base.hpp>
#include <stan/model/model_base_crtp.hpp>
#include <stan/math.hpp>

#include <stan/io/deserializer.hpp>
#include <stan/io/serializer.hpp>

#include <stan/model/rethrow_located.hpp>
#include <stan/model/model_base.hpp>
#include <stan/model/model_base_crtp.hpp>
#include <stan/model/prob_grad.hpp>
#include <stan/model/indexing.hpp>
#include <stan/services/util/create_rng.hpp>
Expand Down
9 changes: 9 additions & 0 deletions src/test/test-models/good/model/accumulate.stan
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
data {
int<lower=1> N;
}
parameters {
vector[N] y;
}
model {
target += y;
}
2 changes: 2 additions & 0 deletions src/test/unit/model/compile_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// test model which previously failed with -DSTAN_MODEL_FVAR_VAR
#include <test/test-models/good/model/accumulate.hpp>
Loading