Add coefs_size to UBspline_3d_x.

git-svn-id: https://subversion.assembla.com/svn/qmcdev/trunk@5728 e5b18d87-469d-4833-9cc0-8cdfa06e9491
This commit is contained in:
Jeongnim Kim 2013-02-21 00:37:54 +00:00
parent 34484a768f
commit ff660a1faa
2 changed files with 10 additions and 6 deletions

View File

@ -492,12 +492,11 @@ create_UBspline_3d_s (Ugrid x_grid, Ugrid y_grid, Ugrid z_grid,
spline->x_stride = Ny*Nz;
spline->y_stride = Nz;
size_t Nxyz=(size_t)Nx*(size_t)Ny*(size_t)Nz;
spline->coefs_size=(size_t)Nx*(size_t)Ny*(size_t)Nz;
#ifndef HAVE_SSE2
spline->coefs = malloc (sizeof(float)*Nxyz);
spline->coefs = malloc (sizeof(float)*spline->coefs_size);
#else
posix_memalign ((void**)&spline->coefs, 16, (sizeof(float)*Nxyz));
posix_memalign ((void**)&spline->coefs, 16, (sizeof(float)*spline->coefs_size));
#endif
// First, solve in the X-direction
@ -1372,10 +1371,12 @@ create_UBspline_3d_d (Ugrid x_grid, Ugrid y_grid, Ugrid z_grid,
spline->x_stride = Ny*Nz;
spline->y_stride = Nz;
spline->coefs_size=(size_t)Nx*(size_t)Ny*(size_t)Nz;
#ifndef HAVE_SSE2
spline->coefs = malloc (sizeof(double)*Nx*Ny*Nz);
spline->coefs = malloc (sizeof(double)*spline->coefs_size);
#else
posix_memalign ((void**)&spline->coefs, 16, (sizeof(double)*Nx*Ny*Nz));
posix_memalign ((void**)&spline->coefs, 16, (sizeof(double)*spline->coefs_size));
#endif
if(data != NULL) // only data is provided

View File

@ -20,6 +20,7 @@
#ifndef BSPLINE_STRUCTS_STD_H
#define BSPLINE_STRUCTS_STD_H
#include <stdlib.h>
///////////////////////////
// Single precision real //
@ -51,6 +52,7 @@ typedef struct
int x_stride, y_stride;
Ugrid x_grid, y_grid, z_grid;
BCtype_s xBC, yBC, zBC;
size_t coefs_size;
} UBspline_3d_s;
@ -84,6 +86,7 @@ typedef struct
int x_stride, y_stride;
Ugrid x_grid, y_grid, z_grid;
BCtype_d xBC, yBC, zBC;
size_t coefs_size;
} UBspline_3d_d;