Index: src/analyzer.cpp
===================================================================
--- src/analyzer.cpp	(revision 9e5a04de7e452653cd51c0bbb3ed1427808806fb)
+++ src/analyzer.cpp	(revision f3dc4cada1aab42f4ac415cb0adb90ad5db6eed7)
@@ -29,5 +29,5 @@
   ForceMatrix Shielding;
   ForceMatrix ShieldingPAS;
-  MatrixContainer Time;
+  EnergyMatrix Time;
   EnergyMatrix EnergyFragments;
   EnergyMatrix HcorrectionFragments;
@@ -51,4 +51,5 @@
   bool Hcorrected = true;
   double norm;
+  int counter;
   
   cout << "ANOVA Analyzer" << endl;
@@ -82,11 +83,11 @@
   
   // ------------- Parse through all Fragment subdirs --------
-  if (!Energy.ParseMatrix(argv[1], dir, EnergySuffix,0,0)) return 1;
-  Hcorrected = Hcorrection.ParseMatrix(argv[1], "", HCORRECTIONSUFFIX,0,0);
-  if (!Force.ParseMatrix(argv[1], dir, ForcesSuffix,0,0)) return 1;
-  if (!Time.ParseMatrix(argv[1], dir, TimeSuffix, 10,1)) return 1;
+  if (!Energy.ParseFragmentMatrix(argv[1], dir, EnergySuffix,0,0)) return 1;
+  Hcorrected = Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX,0,0);
+  if (!Force.ParseFragmentMatrix(argv[1], dir, ForcesSuffix,0,0)) return 1;
+  if (!Time.ParseFragmentMatrix(argv[1], dir, TimeSuffix, 10,1)) return 1;
   if (periode != NULL) { // also look for PAS values
-    if (!Shielding.ParseMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
-    if (!ShieldingPAS.ParseMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
+    if (!Shielding.ParseFragmentMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
+    if (!ShieldingPAS.ParseFragmentMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
   }
 
@@ -111,10 +112,10 @@
   
   // ---------- Parse fragment files created by 'joiner' into an array -------------
-  if (!EnergyFragments.ParseMatrix(argv[1], dir, EnergyFragmentSuffix,0,0)) return 1;
-  if (Hcorrected) HcorrectionFragments.ParseMatrix(argv[1], dir, HcorrectionFragmentSuffix,0,0);
-  if (!ForceFragments.ParseMatrix(argv[1], dir, ForceFragmentSuffix,0,0)) return 1;
+  if (!EnergyFragments.ParseFragmentMatrix(argv[1], dir, EnergyFragmentSuffix,0,0)) return 1;
+  if (Hcorrected) HcorrectionFragments.ParseFragmentMatrix(argv[1], dir, HcorrectionFragmentSuffix,0,0);
+  if (!ForceFragments.ParseFragmentMatrix(argv[1], dir, ForceFragmentSuffix,0,0)) return 1;
   if (periode != NULL) { // also look for PAS values
-    if (!ShieldingFragments.ParseMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
-    if (!ShieldingPASFragments.ParseMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
+    if (!ShieldingFragments.ParseFragmentMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
+    if (!ShieldingPASFragments.ParseFragmentMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
   }
 
@@ -160,18 +161,14 @@
   
   output << endl << "Total Times" << endl << "===============" << endl << Time.Header << endl;
-  Time.SetLastMatrix(0., 0);
-  for (int BondOrder=KeySet.Order;BondOrder--;)
-    for(int i=KeySet.FragmentsPerOrder[BondOrder];i--;)
-      for(int j=Time.RowCounter[Time.MatrixCounter];j--;)
-        for(int k=Time.ColumnCounter;k--;) {
-          Time.Matrix[ Time.MatrixCounter ][j][k] += Time.Matrix[ KeySet.OrderSet[BondOrder][i] ][j][k];
-        }
   for(int j=0;j<Time.RowCounter[Time.MatrixCounter];j++) {
-    for(int k=0;k<Time.ColumnCounter;k++)
+    for(int k=0;k<Time.ColumnCounter;k++) {
       output << scientific << Time.Matrix[ Time.MatrixCounter ][j][k] << "\t";
+    }
     output << endl;
   }
   output << endl;
   output.close();
+  for(int k=0;k<Time.ColumnCounter;k++)
+    Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter] ][k] = Time.Matrix[ Time.MatrixCounter ][Time.RowCounter[Time.MatrixCounter]-1][k];
 
   // +++++++++++++++ ANALYZING ++++++++++++++++++++++++++++++
@@ -182,7 +179,14 @@
 
   // +++++++++++++++++++++++++++++++++++++++ Plotting Simtime vs Bond Order
+  // +++++++++++++++++++++++++++++++++++++++ Plotting Delta Simtime vs Bond Order
   if (!OpenOutputFile(output, argv[3], "SimTime-Order.dat" )) return false;
-  Time.SetLastMatrix(0., 0);
+  if (!OpenOutputFile(output2, argv[3], "DeltaSimTime-Order.dat" )) return false;
+  for(int j=Time.RowCounter[Time.MatrixCounter];j--;)
+    for(int k=Time.ColumnCounter;k--;) {
+      Time.Matrix[ Time.MatrixCounter ][j][k] = 0.;
+    }
+  counter = 0;
   output << "#Order\tFrag.No.\t" << Time.Header << endl;
+  output2 << "#Order\tFrag.No.\t" << Time.Header << endl;
   for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) {
     for(int i=KeySet.FragmentsPerOrder[BondOrder];i--;)
@@ -191,10 +195,20 @@
           Time.Matrix[ Time.MatrixCounter ][j][k] += Time.Matrix[ KeySet.OrderSet[BondOrder][i] ][j][k];
         }
-    output << BondOrder+1 << "\t" << KeySet.FragmentsPerOrder[BondOrder];
-    for(int k=0;k<Time.ColumnCounter;k++)
-      output << "\t" << scientific << Time.Matrix[ Time.MatrixCounter ][1][k];
-    output << endl;
+    counter += KeySet.FragmentsPerOrder[BondOrder];
+    output << BondOrder+1 << "\t" << counter;
+    output2 << BondOrder+1 << "\t" << counter;
+    for(int k=0;k<Time.ColumnCounter;k++) {
+      output << "\t" << scientific << Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter]-1 ][k];
+      if (fabs(Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter] ][k]) > MYEPSILON)
+        output2 << "\t" << scientific << Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter]-1 ][k] / Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter] ][k];
+      else
+        output2 << "\t" << scientific << Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter]-1 ][k];
+    }
+    output << endl;
+    output2 << endl;
   }
   output.close();
+  output2.close();
+
 
   // +++++++++++++++++++++++++++++++++++++++ Plotting deviation in energy to full QM
