Skip to content
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

[Core] Refactor Dot function in math_utils.h to support template types #13150

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

loumalouomega
Copy link
Member

📝 Description

This change enhances the flexibility of the Dot function by making it compatible with various vector types beyond the default Vector type.

After #13106

Commit Summary:

  • Modified the Dot function in the MathUtils class within kratos/utilities/math_utils.h to accept template parameters for the input vectors, allowing the function to handle different vector types (TVector1 and TVector2).
  • Updated function signature to use templated vector types instead of the specific Vector type.

🆕 Changelog

@loumalouomega loumalouomega added Kratos Core FastPR This Pr is simple and / or has been already tested and the revision should be fast Refactor When code is moved or rewrote keeping the same behavior labels Feb 19, 2025
@loumalouomega loumalouomega requested a review from a team as a code owner February 19, 2025 15:10
@loumalouomega loumalouomega marked this pull request as draft February 19, 2025 15:18
@loumalouomega loumalouomega marked this pull request as ready for review February 20, 2025 09:20
)
{
double temp = 0.0;
TDataType temp {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a 0...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For fundamental types (like int or double), the variable is initialized to zero. For class types, the default constructor is called. A priori this will limited to float and double.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FastPR This Pr is simple and / or has been already tested and the revision should be fast Kratos Core Refactor When code is moved or rewrote keeping the same behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants