You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/06/02 08:10:23 UTC

[GitHub] [incubator-doris] PragmaTwice opened a new pull request, #9939: [Enhancement] Refactor functions in int_exp by templates

PragmaTwice opened a new pull request, #9939:
URL: https://github.com/apache/incubator-doris/pull/9939

   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem Summary:
   
   The current implementation of functions in `int_exp.h` used some hand-written, hard-coded arrays, which made the code lengthy. 
   These functions can be rewritten using templates, and this implementation is more generalized and less error-prone.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: (No)
   2. Has unit tests been added: (?)
   3. Has document been added or modified: (No Need)
   4. Does it need to update dependencies: (No)
   5. Are there any changes that cannot be rolled back: (No)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] PragmaTwice commented on pull request #9939: [Enhancement] Refactor functions in int_exp by templates

Posted by GitBox <gi...@apache.org>.
PragmaTwice commented on PR #9939:
URL: https://github.com/apache/incubator-doris/pull/9939#issuecomment-1145883858

   Could you please review it again since I formatted the code? @BiteTheDDDDt 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] BiteTheDDDDt commented on a diff in pull request #9939: [Enhancement] Refactor functions in int_exp by templates

Posted by GitBox <gi...@apache.org>.
BiteTheDDDDt commented on code in PR #9939:
URL: https://github.com/apache/incubator-doris/pull/9939#discussion_r888885609


##########
be/src/vec/common/int_exp.h:
##########
@@ -22,6 +22,34 @@
 
 #include <cstdint>
 #include <limits>
+#include <utility>
+
+namespace exp_details {
+
+// compile-time exp(v, n) by linear recursion
+template <typename T, T v, std::size_t n>
+constexpr inline const T exp = v* exp<T, v, n - 1>;

Review Comment:
   Seems here have a bug of clang-format, maybe we can use `T(v) * exp<T, v, n - 1>` to work around.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] github-actions[bot] commented on pull request #9939: [Enhancement] Refactor functions in int_exp by templates

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #9939:
URL: https://github.com/apache/incubator-doris/pull/9939#issuecomment-1145963062

   PR approved by at least one committer and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] github-actions[bot] commented on pull request #9939: [Enhancement] Refactor functions in int_exp by templates

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #9939:
URL: https://github.com/apache/incubator-doris/pull/9939#issuecomment-1144684424

   PR approved by at least one committer and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] HappenLee merged pull request #9939: [Enhancement] Refactor functions in int_exp by templates

Posted by GitBox <gi...@apache.org>.
HappenLee merged PR #9939:
URL: https://github.com/apache/incubator-doris/pull/9939


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] PragmaTwice commented on a diff in pull request #9939: [Enhancement] Refactor functions in int_exp by templates

Posted by GitBox <gi...@apache.org>.
PragmaTwice commented on code in PR #9939:
URL: https://github.com/apache/incubator-doris/pull/9939#discussion_r888944806


##########
be/src/vec/common/int_exp.h:
##########
@@ -22,6 +22,34 @@
 
 #include <cstdint>
 #include <limits>
+#include <utility>
+
+namespace exp_details {
+
+// compile-time exp(v, n) by linear recursion
+template <typename T, T v, std::size_t n>
+constexpr inline const T exp = v* exp<T, v, n - 1>;

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] github-actions[bot] commented on pull request #9939: [Enhancement] Refactor functions in int_exp by templates

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #9939:
URL: https://github.com/apache/incubator-doris/pull/9939#issuecomment-1144684467

   PR approved by anyone and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org