dmat.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <link rel='stylesheet' type='text/css' href='../style.css' >
  5. <title>libigl file formats | .dmat</title>
  6. </head>
  7. <body class=article_outer>
  8. <div class=article_inner>
  9. <a href=..><img src=../libigl-logo.jpg alt="igl logo" class=center></a>
  10. <h1>.dmat - dense matrices</h1>
  11. <hr>
  12. <p>
  13. A .dmat file contains a dense matrix in column major order. It can contain
  14. ASCII or binary data. Note that it is uncompressed so binary only reduces the
  15. file size by 50%. But writing and reading binary is usualy faster. In MATLAB,
  16. binary is almost 100x faster.
  17. </p>
  18. <h2>ASCII</h2>
  19. <p>
  20. The first line is a header containing:
  21. </p>
  22. <pre><code>[#cols] [#rows]</code></pre>
  23. <p>
  24. Then the coefficients are printed in column-major order separated by spaces.
  25. </p>
  26. <h2>Binary</h2>
  27. <p>
  28. Binary files will also contain the ascii header, but it should read:
  29. </p>
  30. <pre><code>0 0</code></pre>
  31. <p>
  32. Then there should be another header containing the size of the binary part:
  33. </p>
  34. <pre><code>[#cols] [#rows]</code></pre>
  35. <p>
  36. Then coefficents are written in column-major order in Little-endian 8-byte
  37. double precision IEEE floating point format.
  38. </p>
  39. <p><strong>Note:</strong> Line endings must be <code>'\n'</code> aka char(10) aka line feeds.</p>
  40. <p>See also: <a href=.>file formats</a></p>
  41. </div>
  42. </body>
  43. </html>