From c2ead14543d11a532a8ac564119a7a10160fdc41 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 22 Mar 2019 18:50:55 +0100 Subject: ell_grid_solve: switch to ndarray in its external API --- ell_grid_solve.h | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'ell_grid_solve.h') diff --git a/ell_grid_solve.h b/ell_grid_solve.h index 5455c13..d56616b 100644 --- a/ell_grid_solve.h +++ b/ell_grid_solve.h @@ -43,6 +43,7 @@ #include "log.h" #include "mg2d_boundary.h" #include "mg2d_constants.h" +#include "ndarray.h" enum EGSType { /** @@ -156,11 +157,7 @@ typedef struct EGSContext { * initial guess. * Afterwards updated in mg2di_egs_step(). */ - double *u; - /** - * Distance between neighbouring gridpoints along coord1. - */ - ptrdiff_t u_stride; + NDArray *u; /** * Values of the right-hand side. @@ -168,24 +165,16 @@ typedef struct EGSContext { * Allocated by the solver in mg2di_egs_alloc(), owned by the solver. * Must be filled by the caller before mg2di_egs_init(). */ - double *rhs; - /** - * Distance between neighbouring gridpoints along coord1. - */ - ptrdiff_t rhs_stride; + NDArray *rhs; /** - * Values of the right-hand side. + * Values of the residual. * * Allocated by the solver in mg2di_egs_alloc(), owned by the solver. * Read-only for the caller. Initialized after mg2di_egs_init(), * afterwards updated in mg2di_egs_step(). */ - double *residual; - /** - * Distance between neighbouring gridpoints along coord1. - */ - ptrdiff_t residual_stride; + NDArray *residual; /** * Maximum of the absolute value of residual. @@ -198,11 +187,7 @@ typedef struct EGSContext { * Allocated by the solver in mg2di_egs_alloc(), owned by the solver. * Must be filled by the caller before mg2di_egs_init(). */ - double *diff_coeffs[MG2D_DIFF_COEFF_NB]; - /** - * Distance between neighbouring gridpoints along coord1. - */ - ptrdiff_t diff_coeffs_stride; + NDArray *diff_coeffs[MG2D_DIFF_COEFF_NB]; /* timings */ int64_t time_boundaries; -- cgit v1.2.3