-
-
Notifications
You must be signed in to change notification settings - Fork 195
Let prim functions return expressions #2190
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
Changes from all commits
cfb04b8
db03168
c1df65d
7eded17
0f85ba4
c92d5f7
26d745e
c08b000
4b830fc
3d13a2a
20eb3cd
14388eb
eb7a24f
1765307
46016f4
55bf3b2
873458c
a27e08e
a0091a2
c3dbb27
fa88821
0b15e7b
435a2b0
b2dbc29
c7ab13d
f84d6b2
b4d6208
62490e1
b316e1e
ccb1ad0
2dbe8eb
4575f35
4524299
257b6fd
a0523cc
bd33bbe
8dfd5b0
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 |
---|---|---|
|
@@ -2,11 +2,19 @@ | |
#define STAN_MATH_MIX_HPP | ||
|
||
#include <stan/math/mix/meta.hpp> | ||
|
||
#include <stan/math/prim.hpp> | ||
#include <stan/math/fwd.hpp> | ||
#include <stan/math/rev.hpp> | ||
#include <stan/math/mix/fun.hpp> | ||
#include <stan/math/mix/functor.hpp> | ||
|
||
#include <stan/math/rev/core.hpp> | ||
#include <stan/math/rev/meta.hpp> | ||
#include <stan/math/rev/fun.hpp> | ||
#include <stan/math/rev/functor.hpp> | ||
|
||
#include <stan/math/fwd/core.hpp> | ||
#include <stan/math/fwd/meta.hpp> | ||
#include <stan/math/fwd/fun.hpp> | ||
#include <stan/math/fwd/functor.hpp> | ||
|
||
#include <stan/math/prim.hpp> | ||
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. Ahh, there must be more to the story. Do tell! 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. Same for rev. 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. And why the individual files? 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. 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. rev.hpp for example also includes prim, which we dont want included before fwd. 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. 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. Oh and I see the conversation back here: #2190 (comment) 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.
Thqat can not really be an issue. If mix needs fwd or rev it is simply included. Same if fwd or rev needs prim. 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. I don't remember what exactly was an issue, but it was something, that gcc allows even if it is not standard, while clang is more strict. I know I was reading this: https://clang.llvm.org/compatibility.html#dep_lookup 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. Yeah I think this change is right. If everything is template overloads, then we can define things after they are used. Like in this: https://godbolt.org/z/hbT54n (you'll see both If you add an overload of myfunc, it will only get called if the overload is already available when the compiler hits int myfunc(const char *) {
std::cout << "hey" << std::endl;
return 5;
} Since we're depending on overloading and templates in Stan math, we gotta make sure and include the overloads for the |
||
|
||
#endif |
Uh oh!
There was an error while loading. Please reload this page.