-
Notifications
You must be signed in to change notification settings - Fork 763
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
Extra functionality of Tensor class #631
Conversation
inline | ||
Number contract (const Tensor<1,dim,Number> &src1, | ||
const Tensor<1,dim,Number> &src2) | ||
const Tensor<1,dim,OtherNumber> &src2) |
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.
The return type of this should now be typename ProductType<Number,OtherNumber>::type
. Same in the operator*
.
I don't recall the conversation about this. Where do you need the |
There was no conversation about the |
I think
as it shall not require a temporary object. |
This is for small objects with a handful of elements. The compiler will optimize all of this out -- let's not worry about these micro-optimizations unless we have evidence that they are necessary. So I would vote to just leave the existing code of the form
in place. There is a cost to adding member functions (as this discussion shows) and it doesn't seem worth it at this point. |
ok |
will check that it compiles... |
builds fine. |
Looks good. |
Extra functionality of Tensor class
in reference to #2033 |
the two commits are currently part of https://github.com/dealii/dealii/pull/621/commits
Wolfang wanted at least one of them to be in separate PR, thus I create it.