{"action":"created","issue":{"url":"https://api.github.com/repos/sxs-collaboration/spectre/issues/572","repository_url":"https://api.github.com/repos/sxs-collaboration/spectre","labels_url":"https://api.github.com/repos/sxs-collaboration/spectre/issues/572/labels{/name}","comments_url":"https://api.github.com/repos/sxs-collaboration/spectre/issues/572/comments","events_url":"https://api.github.com/repos/sxs-collaboration/spectre/issues/572/events","html_url":"https://github.com/sxs-collaboration/spectre/pull/572","id":302030190,"number":572,"title":"Add Tensor/EagerMath/DotProduct.hpp","user":{"login":"geoffrey4444","id":867015,"avatar_url":"https://avatars1.githubusercontent.com/u/867015?v=4","gravatar_id":"","url":"https://api.github.com/users/geoffrey4444","html_url":"https://github.com/geoffrey4444","followers_url":"https://api.github.com/users/geoffrey4444/followers","following_url":"https://api.github.com/users/geoffrey4444/following{/other_user}","gists_url":"https://api.github.com/users/geoffrey4444/gists{/gist_id}","starred_url":"https://api.github.com/users/geoffrey4444/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoffrey4444/subscriptions","organizations_url":"https://api.github.com/users/geoffrey4444/orgs","repos_url":"https://api.github.com/users/geoffrey4444/repos","events_url":"https://api.github.com/users/geoffrey4444/events{/privacy}","received_events_url":"https://api.github.com/users/geoffrey4444/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-03-03T20:36:58Z","updated_at":"2018-03-05T16:13:48Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/sxs-collaboration/spectre/pulls/572","html_url":"https://github.com/sxs-collaboration/spectre/pull/572","diff_url":"https://github.com/sxs-collaboration/spectre/pull/572.diff","patch_url":"https://github.com/sxs-collaboration/spectre/pull/572.patch"},"body":"## Proposed changes\r\n\r\nAdd EagerMath/DotProduct.hpp, which is similar to EagerMath/Magnitude.hpp except computes the dot product of two tensors instead of the magnitude of one tensor. dot_product() accepts either two arguments (for the Euclidean dot product) or three arguments (for the dot product with respect to a metric), following magnitude().\r\n\r\nThe test parallels the test for magnitude(), but instead of taking the magnitude of tensor, it dot products tensor_a and tensor_b.\r\n\r\n### Types of changes:\r\n\r\n- [ ] Bugfix\r\n- [x] New feature\r\n\r\n### Component:\r\n\r\n- [x] Code\r\n- [ ] Documentation\r\n- [ ] Build system\r\n- [ ] Continuous integration\r\n\r\n### Code review checklist\r\n\r\n- Follows [code review guidelines](https://sxs-collaboration.github.io/spectre/code_review_guide.html)\r\n- Code has documentation and unit tests\r\n- Private member variables have a trailing underscore\r\n- Do not use [Hungarian notation](https://en.wikipedia.org/wiki/Hungarian_notation), e.g. `double* pd_blah` is bad\r\n- Header order:\r\n  1. hpp corresponding to cpp (only in cpp files)\r\n  2. Blank line (only in cpp files)\r\n  3. STL and externals (in alphabetical order)\r\n  4. Blank line\r\n  5. SpECTRE includes (in alphabetical order)\r\n- File lists in CMake are alphabetical\r\n- Correct `noexcept` specification for functions (if unsure, mark `noexcept`)\r\n- Mark objects `const` whenever possible\r\n- Almost always `auto`, except with expression templates, i.e. `DataVector`\r\n- All commits for performance changes provide quantitative evidence and the tests used to obtain said evidence.\r\n- Make sure error messages are helpful, e.g. \"The number of grid points in the matrix 'F' is not the same as the number of grid points in the determinant.\"\r\n- Prefix commits addressing PR requests with `fixup`. These commits are flagged\r\n  by Travis so we do not accidentally merge them.\r\n- Include what you use, prefer forward declarations in hpp files.\r\n- Explicitly make numbers floating point, e.g. `2.` or `2.0` over `2`\r\n- Use `Tensor`'s non-member get if the indices are constant expressions, e.g.\r\n  `get<1>(tensor)`\r\n\r\n### Further comments\r\n\r\n<!--\r\nIf this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/sxs-collaboration/spectre/issues/comments/370471654","html_url":"https://github.com/sxs-collaboration/spectre/pull/572#issuecomment-370471654","issue_url":"https://api.github.com/repos/sxs-collaboration/spectre/issues/572","id":370471654,"user":{"login":"geoffrey4444","id":867015,"avatar_url":"https://avatars1.githubusercontent.com/u/867015?v=4","gravatar_id":"","url":"https://api.github.com/users/geoffrey4444","html_url":"https://github.com/geoffrey4444","followers_url":"https://api.github.com/users/geoffrey4444/followers","following_url":"https://api.github.com/users/geoffrey4444/following{/other_user}","gists_url":"https://api.github.com/users/geoffrey4444/gists{/gist_id}","starred_url":"https://api.github.com/users/geoffrey4444/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoffrey4444/subscriptions","organizations_url":"https://api.github.com/users/geoffrey4444/orgs","repos_url":"https://api.github.com/users/geoffrey4444/repos","events_url":"https://api.github.com/users/geoffrey4444/events{/privacy}","received_events_url":"https://api.github.com/users/geoffrey4444/received_events","type":"User","site_admin":false},"created_at":"2018-03-05T16:13:48Z","updated_at":"2018-03-05T16:13:48Z","author_association":"CONTRIBUTOR","body":"Thanks for clarifying, @nilsdeppe. I appreciate the pointer.\r\n\r\nWhen I was checking my code, I thought noexcept was not necessary in this case, based on the example of magnitude.*pp. I'll add it to the function that doesn't contain the asserts."}}
{"actor":{"display_login":"geoffrey4444"}}