-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
Cleanup mdivide_* and tests #1715
Conversation
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
I have two more PRs I'm preparing that depend on this. @rok-cesnovar Would you mind review this? |
Sure. I can do this in a few hours when I will be at my computer. |
@@ -13,7 +13,7 @@ namespace stan { | |||
namespace math { | |||
|
|||
template <typename T, int R1, int C1, int R2, int C2> | |||
inline Eigen::Matrix<fvar<T>, R1, C1> mdivide_left_tri_low( | |||
inline Eigen::Matrix<fvar<T>, R1, C2> mdivide_left_tri_low( |
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.
Nice catch!
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.
Looks great! Much nicer to read. Thanks for adding the zero size tests.
b)); | ||
|
||
return Eigen::Matrix<return_type_t<T1, T2>, R1, C1>(A).lu().solve( | ||
Eigen::Matrix<return_type_t<T1, T2>, R2, C2>(b)); |
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.
Much nicer!
Thank you! |
Summary
This cleans up the
mdivide
functions, mainly to usereturn_type_t
instead ofpromote_common
. There are a couple of unused header removed and a correction to the return type declared for the fwd version ofmdivide_left_tri_low
. Fixes #1714.Tests
Reworked and expanded so that the left and right versions contain the same tests. Some boundary condition tests will be completed in #1689.
Side Effects
None.
Checklist
Math issue remove uses of promote_common from mdivide_* functions and improve tests #1714
Copyright holder: Marco Colombo
The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
the basic tests are passing
./runTests.py test/unit
)make test-headers
)make test-math-dependencies
)make doxygen
)make cpplint
)the code is written in idiomatic C++ and changes are documented in the doxygen
the new changes are tested