diff options
author | Anton Khirnov <anton@khirnov.net> | 2019-03-22 18:50:55 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2019-03-22 20:12:10 +0100 |
commit | c2ead14543d11a532a8ac564119a7a10160fdc41 (patch) | |
tree | c6c6da6d323f47896b85acc4cb75e01dc516c9a1 /ell_grid_solve.h | |
parent | aa0b903240d5c0ea5b0af8f5dc5aeb0845fd69b7 (diff) |
ell_grid_solve: switch to ndarray in its external API
Diffstat (limited to 'ell_grid_solve.h')
-rw-r--r-- | ell_grid_solve.h | 27 |
1 files changed, 6 insertions, 21 deletions
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; |