-
-
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
operator- for var<matrix> #2196
Conversation
…4.1 (tags/RELEASE_600/final)
@t4c1 can you take a look at beta proportion? I'm not sure if it's just some machines but in the add PR and this PR the beta proportion test has failed intermittently
|
I think you just need to merge recent develop. This was fixed by #2187 |
Ah word! Just merged to develop |
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
Could someone give this a look? Think it is good to go! |
Yeah I'll do it later |
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 good. I left a couple pedantic comments in the tests you can take or leave.
Do you mind looking at this first before we merge this: https://github.com/stan-dev/math/pull/2213/files#r530656277
I think that's related to whatever we do here (since that's operator+).
stan::test::expect_ad_matvar(tols, f, scalar_a, row_vector_rv1); | ||
stan::test::expect_ad_matvar(tols, f, row_vector_rv1, scalar_a); | ||
stan::test::expect_ad_matvar(tols, f, row_vector_rv1, vector_v1); | ||
stan::test::expect_ad_matvar(tols, f, vector_v1, row_vector_rv1); |
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.
These mixed type tests strike me as weird. I kinda want them gone cause they might be accidentally working now cause the linear sizes of the inputs are the same (and in reality I don't think we want to do the 1d vector ambiguity thing cause we don't do it at the language).
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.
I guess this is only checking that varmat behavior matches matvar, which is checking against prim, which is hopefully doing the right thing.
Edit: swapped varmat and matvar
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.
Yeah, I mean I think it's okay to do here in math. As long as their is not a signature for it the language won't access it.
stan::test::expect_ad_matvar(tols, f, scalar_a, matrix_m); | ||
stan::test::expect_ad_matvar(tols, f, matrix_m, scalar_a); | ||
stan::test::expect_ad_matvar(tols, f, matrix_m, vector_v); | ||
stan::test::expect_ad_matvar(tols, f, rowvector_rv, matrix_m); |
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.
These should definitely just be throwing errors. I guess it's good to have them so the error checks between mat<var>
and var<mat>
are consistent. Probably helpful to put them off to the side and say "errors".
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.
I put a space there to break them out
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
@SteveBronder this looks good. I'm gonna go ahead and merge. If it ends up there's a problem with |
@t4c1 your review is still here. Have a look and merge when you're happy with this. |
Summary
Adds
operator-
forvar<matrix>
typesTests
Adds the same tests for
operator+
forvar<matrix>
Side Effects
Nope!
Release notes
Adds
operator-
forvar<matrix>
typesChecklist
Math issue How to add static matrix? #1805
Copyright holder: Steve Bronder
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