From 72330844cc87b846d0b4c76ae9e0f6415cdf709e Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Tue, 18 May 2010 14:10:11 +0200 Subject: [PATCH] critical fix in engine field access methods --- FDTD/engine.h | 8 ++++---- FDTD/engine_multithread.h | 8 ++++---- FDTD/engine_sse.h | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/FDTD/engine.h b/FDTD/engine.h index 2723e9c..b0f52ac 100644 --- a/FDTD/engine.h +++ b/FDTD/engine.h @@ -43,10 +43,10 @@ public: virtual unsigned int GetNumberOfTimesteps() {return numTS;}; //this access functions muss be overloaded by any new engine using a different storage model - inline virtual FDTD_FLOAT& GetVolt( unsigned int n, unsigned int x, unsigned int y, unsigned int z ) const { return volt[n][x][y][z]; } - inline virtual FDTD_FLOAT& GetVolt( unsigned int n, unsigned int pos[] ) { return volt[n][pos[0]][pos[1]][pos[2]]; } - inline virtual FDTD_FLOAT& GetCurr( unsigned int n, unsigned int x, unsigned int y, unsigned int z ) const { return curr[n][x][y][z]; } - inline virtual FDTD_FLOAT& GetCurr( unsigned int n, unsigned int pos[] ) { return curr[n][pos[0]][pos[1]][pos[2]]; } + inline virtual FDTD_FLOAT& GetVolt( unsigned int n, unsigned int x, unsigned int y, unsigned int z ) { return volt[n][x][y][z]; } + inline virtual FDTD_FLOAT& GetVolt( unsigned int n, unsigned int pos[3] ) { return volt[n][pos[0]][pos[1]][pos[2]]; } + inline virtual FDTD_FLOAT& GetCurr( unsigned int n, unsigned int x, unsigned int y, unsigned int z ) { return curr[n][x][y][z]; } + inline virtual FDTD_FLOAT& GetCurr( unsigned int n, unsigned int pos[3] ) { return curr[n][pos[0]][pos[1]][pos[2]]; } virtual void UpdateVoltages(unsigned int startX, unsigned int numX); virtual void ApplyVoltageExcite(); diff --git a/FDTD/engine_multithread.h b/FDTD/engine_multithread.h index add52fd..bd5afcb 100644 --- a/FDTD/engine_multithread.h +++ b/FDTD/engine_multithread.h @@ -83,10 +83,10 @@ public: virtual ~Engine_Multithread(); //this access functions muss be overloaded by any new engine using a different storage model - inline virtual FDTD_FLOAT& GetVolt( unsigned int n, unsigned int x, unsigned int y, unsigned int z ) const { return m_RunEngine->GetVolt(n,x,y,z); } - inline virtual FDTD_FLOAT& GetVolt( unsigned int n, unsigned int pos[3] ) const { return m_RunEngine->GetVolt(n,pos); } - inline virtual FDTD_FLOAT& GetCurr( unsigned int n, unsigned int x, unsigned int y, unsigned int z ) const { return m_RunEngine->GetCurr(n,x,y,z); } - inline virtual FDTD_FLOAT& GetCurr( unsigned int n, unsigned int pos[3] ) const { return m_RunEngine->GetCurr(n,pos);} + inline virtual FDTD_FLOAT& GetVolt( unsigned int n, unsigned int x, unsigned int y, unsigned int z ) { return m_RunEngine->GetVolt(n,x,y,z); } + inline virtual FDTD_FLOAT& GetVolt( unsigned int n, unsigned int pos[3] ) { return m_RunEngine->GetVolt(n,pos); } + inline virtual FDTD_FLOAT& GetCurr( unsigned int n, unsigned int x, unsigned int y, unsigned int z ) { return m_RunEngine->GetCurr(n,x,y,z); } + inline virtual FDTD_FLOAT& GetCurr( unsigned int n, unsigned int pos[3] ) { return m_RunEngine->GetCurr(n,pos);} virtual void setNumThreads( unsigned int numThreads ); virtual void Init(); diff --git a/FDTD/engine_sse.h b/FDTD/engine_sse.h index 5c0ed8d..00cd324 100644 --- a/FDTD/engine_sse.h +++ b/FDTD/engine_sse.h @@ -33,10 +33,10 @@ public: virtual unsigned int GetNumberOfTimesteps() {return numTS;}; //this access functions muss be overloaded by any new engine using a different storage model - inline virtual FDTD_FLOAT& GetVolt( unsigned int n, unsigned int x, unsigned int y, unsigned int z ) const { return f4_volt[n][x][y][z%numVectors].f[z/numVectors]; } - inline virtual FDTD_FLOAT& GetVolt( unsigned int n, unsigned int pos[3] ) const { return f4_volt[n][pos[0]][pos[1]][pos[2]%numVectors].f[pos[2]/numVectors]; } - inline virtual FDTD_FLOAT& GetCurr( unsigned int n, unsigned int x, unsigned int y, unsigned int z ) const { return f4_curr[n][x][y][z%numVectors].f[z/numVectors]; } - inline virtual FDTD_FLOAT& GetCurr( unsigned int n, unsigned int pos[3] ) const { return f4_curr[n][pos[0]][pos[1]][pos[2]%numVectors].f[pos[2]/numVectors]; } + inline virtual FDTD_FLOAT& GetVolt( unsigned int n, unsigned int x, unsigned int y, unsigned int z ) { return f4_volt[n][x][y][z%numVectors].f[z/numVectors]; } + inline virtual FDTD_FLOAT& GetVolt( unsigned int n, unsigned int pos[3] ) { return f4_volt[n][pos[0]][pos[1]][pos[2]%numVectors].f[pos[2]/numVectors]; } + inline virtual FDTD_FLOAT& GetCurr( unsigned int n, unsigned int x, unsigned int y, unsigned int z ) { return f4_curr[n][x][y][z%numVectors].f[z/numVectors]; } + inline virtual FDTD_FLOAT& GetCurr( unsigned int n, unsigned int pos[3] ) { return f4_curr[n][pos[0]][pos[1]][pos[2]%numVectors].f[pos[2]/numVectors]; } protected: Engine_sse(const Operator_sse* op);