Optimized [].
authorJayant DeSouza <jdesouza@uiuc.edu>
Mon, 21 Jun 2004 06:41:02 +0000 (06:41 +0000)
committerJayant DeSouza <jdesouza@uiuc.edu>
Mon, 21 Jun 2004 06:41:02 +0000 (06:41 +0000)
src/langs/jade/JArray.h

index 519189af9bd43c3abc46298198d4be098846c8c3..f80b071f013ecfa2cbac49320c866581ca073202 100644 (file)
@@ -216,6 +216,9 @@ public:
 
        // 1D
        inline T& getElement(int i) {
+               return data[i];
+       }
+       inline T& getElementSlow(int i) {
                uint idx[] = { i };
                return getElement(idx);
        }
@@ -243,6 +246,9 @@ public:
 
        // 3D
        inline T& getElement(int i, int j, int k) {
+               return data[i*dimSize[0]+j*dimSize[1]+k];
+       }
+       inline T& getElementSlow(int i, int j, int k) {
                uint idx[] = { i, j, k };
                return getElement(idx);
        }