Loading src/testing/test_zinvert.cpp +8 −18 Original line number Diff line number Diff line Loading @@ -39,30 +39,21 @@ int main() { int result = (int)SUCCESS; printf("INFO: matrix inversion test.\n"); printf("INFO: sizeof(np_int) = %ld\n", sizeof(np_int)); #ifdef USE_MAGMA magma_init(); printf("INFO: sizeof(magma_int_t) = %ld\n", sizeof(magma_int_t)); #endif const np_int n = 3; const np_int n = 2; const np_int nn = n * n; const double tolerance = 1.0e-6; dcomplex **test_matrix; dcomplex *vec_matrix = new dcomplex[n]; dcomplex *vec_inv_matrix = new dcomplex[n]; dcomplex *vec_matrix = new dcomplex[nn]; dcomplex *vec_inv_matrix = new dcomplex[nn]; for (int ivi = 0; ivi < nn; ivi++) vec_matrix[ivi] = 1.0 + ivi + I * (1.0 + ivi); test_matrix[0] = vec_matrix; test_matrix[1] = vec_matrix + 2; vec_inv_matrix[0] = 3.0 + I * 3.0; vec_inv_matrix[1] = 1.0 / 3.0 + I * 0.0; vec_inv_matrix[2] = 2.0 / 3.0 + I * 0.0; vec_inv_matrix[3] = 6.0 + I * 6.0; vec_inv_matrix[4] = 2.0 + I * 2.0; vec_inv_matrix[5] = 0.5 + I * 0.0; vec_inv_matrix[6] = 9.0 + I * 9.0; vec_inv_matrix[7] = 4.0 + I * 4.0; vec_inv_matrix[8] = 0.0 + I * 0.0; test_matrix = &vec_matrix; vec_inv_matrix[0] = -1.0 + I * 1.0; vec_inv_matrix[1] = 0.5 - I * 0.5; vec_inv_matrix[2] = 0.75 - I * 0.75; vec_inv_matrix[3] = -0.25 + I * 0.25; #ifdef USE_MAGMA if (sizeof(np_int) != sizeof(magma_int_t)) { printf("ERROR: sizeof(np_int) = %ld; sizeof(magma_int_t) = %ld\n", Loading @@ -81,7 +72,6 @@ int main() { } delete[] vec_inv_matrix; delete[] vec_matrix; delete[] test_matrix; #ifdef USE_MAGMA magma_finalize(); #endif Loading Loading
src/testing/test_zinvert.cpp +8 −18 Original line number Diff line number Diff line Loading @@ -39,30 +39,21 @@ int main() { int result = (int)SUCCESS; printf("INFO: matrix inversion test.\n"); printf("INFO: sizeof(np_int) = %ld\n", sizeof(np_int)); #ifdef USE_MAGMA magma_init(); printf("INFO: sizeof(magma_int_t) = %ld\n", sizeof(magma_int_t)); #endif const np_int n = 3; const np_int n = 2; const np_int nn = n * n; const double tolerance = 1.0e-6; dcomplex **test_matrix; dcomplex *vec_matrix = new dcomplex[n]; dcomplex *vec_inv_matrix = new dcomplex[n]; dcomplex *vec_matrix = new dcomplex[nn]; dcomplex *vec_inv_matrix = new dcomplex[nn]; for (int ivi = 0; ivi < nn; ivi++) vec_matrix[ivi] = 1.0 + ivi + I * (1.0 + ivi); test_matrix[0] = vec_matrix; test_matrix[1] = vec_matrix + 2; vec_inv_matrix[0] = 3.0 + I * 3.0; vec_inv_matrix[1] = 1.0 / 3.0 + I * 0.0; vec_inv_matrix[2] = 2.0 / 3.0 + I * 0.0; vec_inv_matrix[3] = 6.0 + I * 6.0; vec_inv_matrix[4] = 2.0 + I * 2.0; vec_inv_matrix[5] = 0.5 + I * 0.0; vec_inv_matrix[6] = 9.0 + I * 9.0; vec_inv_matrix[7] = 4.0 + I * 4.0; vec_inv_matrix[8] = 0.0 + I * 0.0; test_matrix = &vec_matrix; vec_inv_matrix[0] = -1.0 + I * 1.0; vec_inv_matrix[1] = 0.5 - I * 0.5; vec_inv_matrix[2] = 0.75 - I * 0.75; vec_inv_matrix[3] = -0.25 + I * 0.25; #ifdef USE_MAGMA if (sizeof(np_int) != sizeof(magma_int_t)) { printf("ERROR: sizeof(np_int) = %ld; sizeof(magma_int_t) = %ld\n", Loading @@ -81,7 +72,6 @@ int main() { } delete[] vec_inv_matrix; delete[] vec_matrix; delete[] test_matrix; #ifdef USE_MAGMA magma_finalize(); #endif Loading