:78 Function create_function() is deprecated [8192]

Now initializing error variable to zero

Ramses van Zon [2016-01-06 19:48:08]
Now initializing error variable to zero
Filename
Makefile
diffuse.cc
diff --git a/Makefile b/Makefile
index b426fcd..114bbd8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,2 +1,4 @@
 diffuse: diffuse.cc
 	g++ -O3 -Wall -g diffuse.cc -o diffuse
+clean:
+	rm diffuse
\ No newline at end of file
diff --git a/diffuse.cc b/diffuse.cc
index d83a1a0..2777af1 100644
--- a/diffuse.cc
+++ b/diffuse.cc
@@ -46,7 +46,7 @@ int main( int argc, char *argv[] )
     float ***rho;
     float time;
     float dt, dx;
-    float error;
+    float error = 0.0;
     float rhoint;
     int theory, before, active;

@@ -160,10 +160,10 @@ int main( int argc, char *argv[] )
             error = 0;
             for( int i = 1; i <= numPoints; i++ ) {
                 for( int j = 1; j <= numPoints; j++ ) {
-                    error += pow( rho[theory][i][j]-rho[active][i][j] , 2 );
+                   error += pow( rho[theory][i][j]-rho[active][i][j] , 2 );
                 }
             }
-            //            error = sqrt(error);
+            error = sqrt(error);

             // Write out data for graphics
             theoryFile.write( (char*)(rho[theory][0]),
ViewGit