-
-
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
Added var<mat>
implementations of columns_dot_product
and rows_dot_product
#2199
Added var<mat>
implementations of columns_dot_product
and rows_dot_product
#2199
Conversation
…ot_product` (Issue #2101)
…4.1 (tags/RELEASE_600/final)
@SteveBronder this passed unit tests. I think the failure is part of: #2200, so ready to review |
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.
Two suggestions but looks good!
if (is_var_matrix<Mat1>::value) { | ||
arena_v1.adj().noalias() += value_of(arena_v2) * res.adj().asDiagonal(); | ||
} else { | ||
arena_v1.adj() += value_of(arena_v2) * res.adj().asDiagonal(); | ||
} | ||
if (is_var_matrix<Mat2>::value) { | ||
arena_v2.adj().noalias() += value_of(arena_v1) * res.adj().asDiagonal(); | ||
} else { | ||
arena_v2.adj() += value_of(arena_v1) * res.adj().asDiagonal(); | ||
} |
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.
Since they are all var types at this point you can use .val()
directly
if (is_var_matrix<Mat2>::value) { | ||
arena_v2.adj().noalias() += arena_v1 * res.adj().asDiagonal(); | ||
} else { | ||
arena_v2.adj() += arena_v1 * res.adj().asDiagonal(); | ||
} |
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 the more I stare at this the more I think it would be better to have an update_adjoint()
function so we don't have these ifs everywhere
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.
Sure I saw the @t4c1 thumbs up on the other pull too. I'm happy with update_adjoint
. Let's do that in a separate pull to keep the scope limited here
Switched the |
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
Summary
Added
var<mat>
versions ofcolumns_dot_product
androws_dot_product
Release notes
Added
var<mat>
versions ofcolumns_dot_product
androws_dot_product
Checklist
Math issue Make functions with custom autodiff
var<mat>
friendly #2101Copyright holder: Columbia University
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