From 71f5ba2d22c6c45efef2ab003a584e974b70ae87 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Sat, 5 Jun 2010 11:50:57 +0200 Subject: [PATCH] Array_ops: new array access methods Signed-off-by: Thorsten Liebig --- tools/array_ops.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/array_ops.h b/tools/array_ops.h index c96cd6b..53921e7 100644 --- a/tools/array_ops.h +++ b/tools/array_ops.h @@ -41,6 +41,14 @@ void Delete2DArray(FDTD_FLOAT** array, const unsigned int* numLines); FDTD_FLOAT*** Create3DArray(const unsigned int* numLines); void Delete3DArray(FDTD_FLOAT*** array, const unsigned int* numLines); +inline FDTD_FLOAT& Access_N_3DArray(FDTD_FLOAT**** array, unsigned int n, unsigned int* pos) +{ + return array[n][pos[0]][pos[1]][pos[2]]; +} +inline FDTD_FLOAT& Access_N_3DArray(FDTD_FLOAT**** array, unsigned int n, unsigned int x, unsigned int y, unsigned int z ) +{ + return array[n][x][y][z]; +} FDTD_FLOAT**** Create_N_3DArray(const unsigned int* numLines); void Delete_N_3DArray(FDTD_FLOAT**** array, const unsigned int* numLines);