-
-
Notifications
You must be signed in to change notification settings - Fork 195
Add missing scalar prim signatures #2612
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
103cc03
a4ddd66
3411c67
e6d68e8
4075c09
af70d36
872803c
969d378
64fa890
02bee11
d7af743
dd142c3
228a05f
43c3a99
5769a7b
50e54f7
e60adb1
b3f9ff3
dc23f52
8f730bb
2301ba1
0f4383d
465a551
4a10aee
00397e9
79d0351
d9795d2
ed76fdd
e13933d
0925494
382be99
aac0a55
199da11
27b3748
943ccd3
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef STAN_MATH_PRIM_FUN_ATAN2_HPP | ||
#define STAN_MATH_PRIM_FUN_ATAN2_HPP | ||
|
||
#include <stan/math/prim/core.hpp> | ||
#include <stan/math/prim/meta.hpp> | ||
#include <cmath> | ||
|
||
namespace stan { | ||
namespace math { | ||
|
||
/** | ||
* Computes the arc tangent of y/x using the signs of | ||
* arguments to determine the correct quadrant. | ||
* | ||
* @tparam T1 type of first argument (must be arithmetic) | ||
* @tparam T2 type of second argument (must be arithmetic) | ||
* @param y first argument | ||
* @param x second argument | ||
* @return arctangent of `y / x` | ||
*/ | ||
template <typename T1, typename T2, require_all_arithmetic_t<T1, T2>* = nullptr> | ||
double atan2(T1 y, T2 x) { | ||
return std::atan2(y, x); | ||
} | ||
|
||
} // namespace math | ||
} // namespace stan | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,21 @@ | |
namespace stan { | ||
namespace math { | ||
|
||
/** | ||
* Returns the minimum coefficient of the two specified | ||
* scalar arguments. | ||
* | ||
* @tparam T1 type of first argument (must be arithmetic) | ||
* @tparam T2 type of second argument (must be arithmetic) | ||
* @param x first argument | ||
* @param y second argument | ||
* @return minimum value of the two arguments | ||
*/ | ||
template <typename T1, typename T2, require_all_arithmetic_t<T1, T2>* = nullptr> | ||
return_type_t<T1, T2> min(T1 x, T2 y) { | ||
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. Will this return an integer if 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.
Yes, it will. That is tested here: https://github.com/stan-dev/math/blob/develop/test/unit/math/mix/meta/return_type_test.cpp#L17 |
||
return std::min(x, y); | ||
} | ||
|
||
/** | ||
* Returns the minimum coefficient in the specified | ||
* matrix, vector, row vector or std vector. | ||
|
Uh oh!
There was an error while loading. Please reload this page.