diff --git a/inc/hgl/math/Math.h b/inc/hgl/math/Math.h index 6637bfb..30fb8b4 100644 --- a/inc/hgl/math/Math.h +++ b/inc/hgl/math/Math.h @@ -1,6 +1,7 @@ #ifndef HGL_ALGORITHM_MATH_INCLUDE #define HGL_ALGORITHM_MATH_INCLUDE +#include #include #include // Game Math and Geometry Library #include diff --git a/inc/hgl/math/PrimaryMathematics.h b/inc/hgl/math/PrimaryMathematics.h new file mode 100644 index 0000000..c85ea01 --- /dev/null +++ b/inc/hgl/math/PrimaryMathematics.h @@ -0,0 +1,39 @@ +#ifndef HGL_Primary_Mathematics_INCLUDE +#define HGL_Primary_Mathematics_INCLUDE +namespace hgl +{ + /** + * ÇóÒ»ÅúÊýµÄºÏ + */ + template + const T sum(const T *data,const int count) + { + T result=0; + + for(int i=0;i + const R sum(const T *data,const int count) + { + R result=0; + + for(int i=0;i