ajout tests
[valse.git] / src / test / TEST R / checkOutput.R
diff --git a/src/test/TEST R/checkOutput.R b/src/test/TEST R/checkOutput.R
new file mode 100644 (file)
index 0000000..1faddaa
--- /dev/null
@@ -0,0 +1,10 @@
+checkOutput = function(varName, matrix, refMatrix, tol){
+  print('Checking %s\n',varName);
+  maxError = max(max(max(max(abs(matrix - refMatrix)))));
+  if(maxError >= tol){
+    print('Inaccuracy: max(abs(error)) = %g >= %g\n',maxError,tol)
+  }
+  else{
+    print('OK\n')
+  }
+}
\ No newline at end of file