From b43749a2df21345cd7f16477a90a3d6097c4ee75 Mon Sep 17 00:00:00 2001 From: Bharat Medasani Date: Wed, 31 Jul 2024 08:54:09 -0400 Subject: [PATCH] Bug fix in regular grid interpolant --- src/simsoptpp/regular_grid_interpolant_3d.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/simsoptpp/regular_grid_interpolant_3d.h b/src/simsoptpp/regular_grid_interpolant_3d.h index e07349177..50d31638e 100644 --- a/src/simsoptpp/regular_grid_interpolant_3d.h +++ b/src/simsoptpp/regular_grid_interpolant_3d.h @@ -171,11 +171,11 @@ class RegularGridInterpolant3D { pkzs = Vec(degree+1, 0.); // build a regular mesh on [xmin, xmax] x [ymin, ymax] x [zmin, zmax] - Vec xmesh(nx+1, 0); + xmesh.reserve(nx+1); hx = linspace(xmin, xmax, nx+1, x_endpoint, xmesh); - Vec ymesh(ny+1, 0); + ymesh.reserve(ny+1); hy = linspace(ymin, ymax, ny+1, y_endpoint, ymesh); - Vec zmesh(nz+1, 0); + zmesh.reserve(nz+1); hz = linspace(zmin, zmax, nz+1, z_endpoint, zmesh); int nmesh = (nx+1)*(ny+1)*(nz+1);