You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
3.7 KiB

  1. // This file is part of Eigen, a lightweight C++ template library
  2. // for linear algebra.
  3. //
  4. // Copyright (C) 2012 Désiré Nuentsa-Wakam <desire.nuentsa_wakam@inria.fr>
  5. //
  6. // This Source Code Form is subject to the terms of the Mozilla
  7. // Public License v. 2.0. If a copy of the MPL was not distributed
  8. // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
  9. #ifndef SPBENCHSTYLE_H
  10. #define SPBENCHSTYLE_H
  11. void printBenchStyle(std::ofstream& out)
  12. {
  13. out << "<xsl:stylesheet id='stylesheet' version='1.0' \
  14. xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >\n \
  15. <xsl:template match='xsl:stylesheet' />\n \
  16. <xsl:template match='/'> <!-- Root of the document -->\n \
  17. <html>\n \
  18. <head> \n \
  19. <style type='text/css'> \n \
  20. td { white-space: nowrap;}\n \
  21. </style>\n \
  22. </head>\n \
  23. <body>";
  24. out<<"<table border='1' width='100%' height='100%'>\n \
  25. <TR> <!-- Write the table header -->\n \
  26. <TH>Matrix</TH> <TH>N</TH> <TH> NNZ</TH> <TH> Sym</TH> <TH> SPD</TH> <TH> </TH>\n \
  27. <xsl:for-each select='BENCH/AVAILSOLVER/SOLVER'>\n \
  28. <xsl:sort select='@ID' data-type='number'/>\n \
  29. <TH>\n \
  30. <xsl:value-of select='TYPE' />\n \
  31. <xsl:text></xsl:text>\n \
  32. <xsl:value-of select='PACKAGE' />\n \
  33. <xsl:text></xsl:text>\n \
  34. </TH>\n \
  35. </xsl:for-each>\n \
  36. </TR>";
  37. out<<" <xsl:for-each select='BENCH/LINEARSYSTEM'>\n \
  38. <TR> <!-- print statistics for one linear system-->\n \
  39. <TH rowspan='4'> <xsl:value-of select='MATRIX/NAME' /> </TH>\n \
  40. <TD rowspan='4'> <xsl:value-of select='MATRIX/SIZE' /> </TD>\n \
  41. <TD rowspan='4'> <xsl:value-of select='MATRIX/ENTRIES' /> </TD>\n \
  42. <TD rowspan='4'> <xsl:value-of select='MATRIX/SYMMETRY' /> </TD>\n \
  43. <TD rowspan='4'> <xsl:value-of select='MATRIX/POSDEF' /> </TD>\n \
  44. <TH> Compute Time </TH>\n \
  45. <xsl:for-each select='SOLVER_STAT'>\n \
  46. <xsl:sort select='@ID' data-type='number'/>\n \
  47. <TD> <xsl:value-of select='TIME/COMPUTE' /> </TD>\n \
  48. </xsl:for-each>\n \
  49. </TR>";
  50. out<<" <TR>\n \
  51. <TH> Solve Time </TH>\n \
  52. <xsl:for-each select='SOLVER_STAT'>\n \
  53. <xsl:sort select='@ID' data-type='number'/>\n \
  54. <TD> <xsl:value-of select='TIME/SOLVE' /> </TD>\n \
  55. </xsl:for-each>\n \
  56. </TR>\n \
  57. <TR>\n \
  58. <TH> Total Time </TH>\n \
  59. <xsl:for-each select='SOLVER_STAT'>\n \
  60. <xsl:sort select='@ID' data-type='number'/>\n \
  61. <xsl:choose>\n \
  62. <xsl:when test='@ID=../BEST_SOLVER/@ID'>\n \
  63. <TD style='background-color:red'> <xsl:value-of select='TIME/TOTAL' /> </TD>\n \
  64. </xsl:when>\n \
  65. <xsl:otherwise>\n \
  66. <TD> <xsl:value-of select='TIME/TOTAL' /></TD>\n \
  67. </xsl:otherwise>\n \
  68. </xsl:choose>\n \
  69. </xsl:for-each>\n \
  70. </TR>";
  71. out<<" <TR>\n \
  72. <TH> Error </TH>\n \
  73. <xsl:for-each select='SOLVER_STAT'>\n \
  74. <xsl:sort select='@ID' data-type='number'/>\n \
  75. <TD> <xsl:value-of select='ERROR' />\n \
  76. <xsl:if test='ITER'>\n \
  77. <xsl:text>(</xsl:text>\n \
  78. <xsl:value-of select='ITER' />\n \
  79. <xsl:text>)</xsl:text>\n \
  80. </xsl:if> </TD>\n \
  81. </xsl:for-each>\n \
  82. </TR>\n \
  83. </xsl:for-each>\n \
  84. </table>\n \
  85. </body>\n \
  86. </html>\n \
  87. </xsl:template>\n \
  88. </xsl:stylesheet>\n\n";
  89. }
  90. #endif