diff --git a/Include/Core/cpu_complex.h b/Include/Core/cpu_complex.h index dcbc08780..a3e4f4262 100644 --- a/Include/Core/cpu_complex.h +++ b/Include/Core/cpu_complex.h @@ -18,6 +18,5 @@ typedef double complex hr_complex; typedef float complex hr_complex_flt; -typedef int complex hr_complex_int; #endif diff --git a/Include/Core/gpu_complex.hpp b/Include/Core/gpu_complex.hpp index 85a90cc48..a342f8e00 100644 --- a/Include/Core/gpu_complex.hpp +++ b/Include/Core/gpu_complex.hpp @@ -162,14 +162,13 @@ auto visible inline __attribute__((always_inline)) operator/(const hr_complex_t< (x.im * c.re - x.re * c.im) / (c.re * c.re + c.im * c.im)); } -typedef struct hr_complex_t hr_complex_int; typedef struct hr_complex_t hr_complex; typedef struct hr_complex_t hr_complex_flt; #ifndef HIP -#define I (hr_complex_int(0, 1)) +#define I (hr_complex_flt(0.0f, 1.0f)) #else -constexpr hr_complex I = hr_complex_int(0, 1); +constexpr hr_complex I = hr_complex_flt(0.0f, 1.0f); #endif #define creal(a) ((a).re) #define cimag(a) ((a).im) diff --git a/Include/Inverters/test_complex.h b/Include/Inverters/test_complex.h index af3844e7c..4e8b21673 100644 --- a/Include/Inverters/test_complex.h +++ b/Include/Inverters/test_complex.h @@ -32,10 +32,6 @@ int test_overload_prod_hr_complex(); int test_overload_div_hr_complex(); int test_negate(); int test_cast_double(); -int test_overload_plus_rhs_integer(); -int test_overload_plus_lhs_integer(); -int test_overload_div_rhs_integer(); -int test_overload_div_lhs_integer(); int test_I_add(); int test_I_prod(); diff --git a/LibHR/Inverters/test_complex.cu b/LibHR/Inverters/test_complex.cu index bf00eb142..2a06bf03b 100644 --- a/LibHR/Inverters/test_complex.cu +++ b/LibHR/Inverters/test_complex.cu @@ -200,74 +200,6 @@ int test_cast_double() { return result; } -int test_overload_plus_rhs_integer() { - lprintf("TEST", 0, __func__); - int result = 0; - hr_complex c = hr_complex(1.1, 2.2); - hr_complex a; - hr_complex_int b = hr_complex_int(3, 4); - a = c + b; - - result += check_diff_norm(4.1 - a.re, EPSILON_TEST); - result += check_diff_norm(6.2 - a.im, EPSILON_TEST); - result += check_diff_norm(1.1 - c.re, EPSILON_TEST); - result += check_diff_norm(2.2 - c.im, EPSILON_TEST); - result += check_diff_norm(3 - b.re, EPSILON_TEST); - result += check_diff_norm(4 - b.im, EPSILON_TEST); - return result; -} - -int test_overload_plus_lhs_integer() { - lprintf("TEST", 0, __func__); - int result = 0; - hr_complex c = hr_complex(1.1, 2.2); - hr_complex a; - hr_complex_int b = hr_complex_int(3, 4); - a = b + c; - - result += check_diff_norm(4.1 - a.re, EPSILON_TEST); - result += check_diff_norm(6.2 - a.im, EPSILON_TEST); - result += check_diff_norm(1.1 - c.re, EPSILON_TEST); - result += check_diff_norm(2.2 - c.im, EPSILON_TEST); - result += check_diff_norm(3 - b.re, EPSILON_TEST); - result += check_diff_norm(4 - b.im, EPSILON_TEST); - return result; -} - -int test_overload_div_rhs_integer() { - lprintf("TEST", 0, __func__); - int result = 0; - hr_complex c = hr_complex(1.1, 2.2); - hr_complex_int b = hr_complex_int(3, 4); - hr_complex a; - a = c / b; - - result += check_diff_norm(0.484 - a.re, EPSILON_TEST); - result += check_diff_norm(0.088 - a.im, EPSILON_TEST); - result += check_diff_norm(1.1 - c.re, EPSILON_TEST); - result += check_diff_norm(2.2 - c.im, EPSILON_TEST); - result += check_diff_norm(3 - b.re, EPSILON_TEST); - result += check_diff_norm(4 - b.im, EPSILON_TEST); - return result; -} - -int test_overload_div_lhs_integer() { - lprintf("TEST", 0, __func__); - int result = 0; - hr_complex c = hr_complex(1.1, 2.2); - hr_complex_int b = hr_complex_int(3, 4); - hr_complex a; - a = b / c; - - result += check_diff_norm(2.0 - a.re, EPSILON_TEST); - result += check_diff_norm(-4.0 / 11.0 - a.im, EPSILON_TEST); - result += check_diff_norm(1.1 - c.re, EPSILON_TEST); - result += check_diff_norm(2.2 - c.im, EPSILON_TEST); - result += check_diff_norm(3 - b.re, EPSILON_TEST); - result += check_diff_norm(4 - b.im, EPSILON_TEST); - return result; -} - int test_I_add() { lprintf("TEST", 0, __func__); int result = 0; @@ -407,30 +339,14 @@ template void random_number(hr_complex_t &c) { result += __fname__##_tmpl(EPSILON_FLT_TEST); \ lprintf("TEST", 0, "Check hr_complex_flt -- int\n"); \ result += __fname__##_tmpl(EPSILON_FLT_TEST); \ - lprintf("TEST", 0, "Check hr_complex_int -- double\n"); \ - result += __fname__##_tmpl(EPSILON_TEST); \ - lprintf("TEST", 0, "Check hr_complex_int -- float\n"); \ - result += __fname__##_tmpl(EPSILON_TEST); \ - lprintf("TEST", 0, "Check hr_complex_int -- int\n"); \ - result += __fname__##_tmpl(EPSILON_TEST); \ lprintf("TEST", 0, "Check hr_complex -- hr_complex\n"); \ result += __fname__##_tmpl(EPSILON_TEST); \ lprintf("TEST", 0, "Check hr_complex -- hr_complex_flt\n"); \ result += __fname__##_tmpl(EPSILON_FLT_TEST); \ - lprintf("TEST", 0, "Check hr_complex -- hr_complex_int\n"); \ - result += __fname__##_tmpl(EPSILON_TEST); \ lprintf("TEST", 0, "Check hr_complex_flt -- hr_complex\n"); \ result += __fname__##_tmpl(EPSILON_FLT_TEST); \ lprintf("TEST", 0, "Check hr_complex_flt -- hr_complex_flt\n"); \ result += __fname__##_tmpl(EPSILON_FLT_TEST); \ - lprintf("TEST", 0, "Check hr_complex_flt -- hr_complex_int\n"); \ - result += __fname__##_tmpl(EPSILON_FLT_TEST); \ - lprintf("TEST", 0, "Check hr_complex_int -- hr_complex\n"); \ - result += __fname__##_tmpl(EPSILON_TEST); \ - lprintf("TEST", 0, "Check hr_complex_int -- hr_complex_flt\n"); \ - result += __fname__##_tmpl(EPSILON_FLT_TEST); \ - lprintf("TEST", 0, "Check hr_complex_int -- hr_complex_int\n"); \ - result += __fname__##_tmpl(0.0); \ return result; \ } diff --git a/TestProgram/ComplexNumbers/check_complex.c b/TestProgram/ComplexNumbers/check_complex.c index 308220730..21f327b61 100644 --- a/TestProgram/ComplexNumbers/check_complex.c +++ b/TestProgram/ComplexNumbers/check_complex.c @@ -26,10 +26,6 @@ int main(int argc, char *argv[]) { return_value += test_overload_div_hr_complex(); return_value += test_negate(); return_value += test_cast_double(); - return_value += test_overload_plus_rhs_integer(); - return_value += test_overload_plus_lhs_integer(); - return_value += test_overload_div_rhs_integer(); - return_value += test_overload_div_lhs_integer(); return_value += test_I_add(); return_value += test_I_prod();