diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bef207..b649d57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ add_executable( src/core/cpu/sse.cpp src/core/cpu/naive.cpp src/core/cpu/avx2.cpp + src/core/bmath/complex.cpp sse.cpp ) diff --git a/main.cpp b/main.cpp index 0c650f2..9f69a8d 100644 --- a/main.cpp +++ b/main.cpp @@ -1,29 +1,14 @@ #include #include "src/core/blist.hpp" -#include "src/core/bmath/bmath.h" #include "src/core/cpu/avx2.hpp" #include #include -using namespace Core::bmath; using namespace Core::Cpu; int main(int argc, char **argv) { - BMath bm1 = BMath(); - BMath bm2; - u_int64_t c1 = bm1.sum(1,2); - - char* input[1024]; - std::string str=std::string(); - - for(int i=0; i<1024*1024*50; i++){ - BMath* bm2=new BMath(); - c1=c1+bm2->sum(c1,i); - delete bm2; - } - blist list = blist(); std::cout << "List size: " << list.getSize() < -#include - -namespace Core { - namespace bmath { - class BMath { - public: - BMath(){ - //std::cout << "Constructor BMath called" << std::endl; - } - u_int64_t sum(u_int64_t a,u_int64_t b){ - return a+b; - } - - - - ~BMath(){ - //std::cout<< "Destructor BMath called" << std::endl; - } - - }; - }; -} -#endif \ No newline at end of file diff --git a/src/core/bmath/complex.cpp b/src/core/bmath/complex.cpp new file mode 100644 index 0000000..59ac869 --- /dev/null +++ b/src/core/bmath/complex.cpp @@ -0,0 +1,6 @@ +#include "complex.hpp" + +Core::Bmath::Complex::Complex(Long real,Long imaginary){ + this->real=real; + this->imaginary=imaginary; +}; \ No newline at end of file diff --git a/src/core/bmath/complex.hpp b/src/core/bmath/complex.hpp new file mode 100644 index 0000000..26faf61 --- /dev/null +++ b/src/core/bmath/complex.hpp @@ -0,0 +1,21 @@ +#ifndef CORE_BMATH_COMPLEX +#define CORE_BMATH_COMPLEX + +#include "../cpu/types.hpp" + +namespace Core{ + namespace Bmath{ + class Complex{ + private: + Long real; + Long imaginary; + + public: + Complex(Long real,Long imaginary); + Complex& operator+=(const Complex& rightOp); + friend Complex operator+(Complex leftOp,const Complex &rightOp); + }; + }; +}; + +#endif \ No newline at end of file