-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
6,023 additions
and
1,408 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,9 +64,42 @@ | |
"search-label": "Search" | ||
} | ||
}</script> | ||
<script> | ||
MathJax = { | ||
loader: { | ||
load: ['[tex]/boldsymbol'] | ||
}, | ||
tex: { | ||
tags: "all", | ||
inlineMath: [['$','$'], ['\\(','\\)']], | ||
displayMath: [['$$','$$'], ['\\[','\\]']], | ||
processEscapes: true, | ||
processEnvironments: true, | ||
packages: { | ||
'[+]': ['boldsymbol'] | ||
} | ||
} | ||
}; | ||
</script> | ||
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js" type="text/javascript"></script> | ||
<link href="https://cdn.jsdelivr.net/npm/pseudocode@latest/build/pseudocode.min.css" rel="stylesheet"> | ||
|
||
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js" type="text/javascript"></script> | ||
<script>window.backupDefine = window.define; window.define = undefined;</script><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js"></script> | ||
<script>document.addEventListener("DOMContentLoaded", function () { | ||
var mathElements = document.getElementsByClassName("math"); | ||
var macros = []; | ||
for (var i = 0; i < mathElements.length; i++) { | ||
var texText = mathElements[i].firstChild; | ||
if (mathElements[i].tagName == "SPAN") { | ||
katex.render(texText.data, mathElements[i], { | ||
displayMode: mathElements[i].classList.contains('display'), | ||
throwOnError: false, | ||
macros: macros, | ||
fleqn: false | ||
}); | ||
}}}); | ||
</script> | ||
<script>window.define = window.backupDefine; window.backupDefine = undefined;</script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css"> | ||
|
||
<link rel="stylesheet" href="styles.css"> | ||
</head> | ||
|
@@ -136,18 +169,58 @@ | |
<span class="menu-text">Installation</span></a> | ||
</div> | ||
</li> | ||
<li class="sidebar-item"> | ||
<li class="sidebar-item sidebar-item-section"> | ||
<div class="sidebar-item-container"> | ||
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="true"> | ||
<span class="menu-text">Integration Guide</span></a> | ||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="true" aria-label="Toggle section"> | ||
<i class="bi bi-chevron-right ms-2"></i> | ||
</a> | ||
</div> | ||
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 show"> | ||
<li class="sidebar-item"> | ||
<div class="sidebar-item-container"> | ||
<a href="./cpp_integration.qmd" class="sidebar-item-text sidebar-link"> | ||
<span class="menu-text">Usage with C++</span></a> | ||
<a href="./integration/python_integration.html" class="sidebar-item-text sidebar-link"> | ||
<span class="menu-text">Usage from Python</span></a> | ||
</div> | ||
</li> | ||
<li class="sidebar-item"> | ||
<li class="sidebar-item"> | ||
<div class="sidebar-item-container"> | ||
<a href="./integration/cpp_integration.html" class="sidebar-item-text sidebar-link"> | ||
<span class="menu-text">Usage from C++</span></a> | ||
</div> | ||
</li> | ||
<li class="sidebar-item"> | ||
<div class="sidebar-item-container"> | ||
<a href="./integration/pybind11_integration.html" class="sidebar-item-text sidebar-link"> | ||
<span class="menu-text">Integrating with pybind11</span></a> | ||
</div> | ||
</li> | ||
</ul> | ||
</li> | ||
<li class="sidebar-item sidebar-item-section"> | ||
<div class="sidebar-item-container"> | ||
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" aria-expanded="true"> | ||
<span class="menu-text">User Guide</span></a> | ||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" aria-expanded="true" aria-label="Toggle section"> | ||
<i class="bi bi-chevron-right ms-2"></i> | ||
</a> | ||
</div> | ||
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 show"> | ||
<li class="sidebar-item"> | ||
<div class="sidebar-item-container"> | ||
<a href="./pybind11_integration.qmd" class="sidebar-item-text sidebar-link"> | ||
<span class="menu-text">Usage with pybind11</span></a> | ||
<a href="./guide/lanczos.html" class="sidebar-item-text sidebar-link"> | ||
<span class="menu-text">The Lanczos method</span></a> | ||
</div> | ||
</li> | ||
<li class="sidebar-item"> | ||
<div class="sidebar-item-container"> | ||
<a href="./guide/slq_guide.html" class="sidebar-item-text sidebar-link"> | ||
<span class="menu-text">The SLQ method</span></a> | ||
</div> | ||
</li> | ||
</ul> | ||
</li> | ||
<li class="sidebar-item"> | ||
<div class="sidebar-item-container"> | ||
<a href="./imate_compare.html" class="sidebar-item-text sidebar-link active"> | ||
|
@@ -158,30 +231,75 @@ | |
<div class="sidebar-item-container"> | ||
<a href="./reference/index.html" class="sidebar-item-text sidebar-link"> | ||
<span class="menu-text">API Reference</span></a> | ||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="true" aria-label="Toggle section"> | ||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-3" aria-expanded="true" aria-label="Toggle section"> | ||
<i class="bi bi-chevron-right ms-2"></i> | ||
</a> | ||
</div> | ||
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 show"> | ||
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 show"> | ||
<li class="sidebar-item sidebar-item-section"> | ||
<div class="sidebar-item-container"> | ||
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" aria-expanded="true"> | ||
<span class="menu-text">Diagonalize</span></a> | ||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" aria-expanded="true" aria-label="Toggle section"> | ||
<i class="bi bi-chevron-right ms-2"></i> | ||
</a> | ||
</div> | ||
<ul id="quarto-sidebar-section-4" class="collapse list-unstyled sidebar-section depth2 show"> | ||
<li class="sidebar-item"> | ||
<div class="sidebar-item-container"> | ||
<a href="./reference/random.normal.html" class="sidebar-item-text sidebar-link"> | ||
<span class="menu-text">random.normal</span></a> | ||
<a href="./reference/diagonalize.lanczos.html" class="sidebar-item-text sidebar-link"> | ||
<span class="menu-text">Lanczos</span></a> | ||
</div> | ||
</li> | ||
</ul> | ||
</li> | ||
<li class="sidebar-item sidebar-item-section"> | ||
<div class="sidebar-item-container"> | ||
<a href="./reference/trace.html" class="sidebar-item-text sidebar-link"> | ||
<span class="menu-text">Trace</span></a> | ||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-5" aria-expanded="true" aria-label="Toggle section"> | ||
<i class="bi bi-chevron-right ms-2"></i> | ||
</a> | ||
</div> | ||
<ul id="quarto-sidebar-section-5" class="collapse list-unstyled sidebar-section depth2 show"> | ||
<li class="sidebar-item"> | ||
<div class="sidebar-item-container"> | ||
<a href="./reference/primate.trace.sl_trace.html" class="sidebar-item-text sidebar-link"> | ||
<span class="menu-text">SL Trace</span></a> | ||
</div> | ||
</li> | ||
<li class="sidebar-item"> | ||
<div class="sidebar-item-container"> | ||
<a href="./reference/primate.trace.sl_gauss.html" class="sidebar-item-text sidebar-link"> | ||
<span class="menu-text">SL Gauss</span></a> | ||
</div> | ||
</li> | ||
</ul> | ||
</li> | ||
<li class="sidebar-item sidebar-item-section"> | ||
<div class="sidebar-item-container"> | ||
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-6" aria-expanded="true"> | ||
<span class="menu-text">Random</span></a> | ||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-6" aria-expanded="true" aria-label="Toggle section"> | ||
<i class="bi bi-chevron-right ms-2"></i> | ||
</a> | ||
</div> | ||
<ul id="quarto-sidebar-section-6" class="collapse list-unstyled sidebar-section depth2 show"> | ||
<li class="sidebar-item"> | ||
<div class="sidebar-item-container"> | ||
<a href="./reference/random.rademacher.html" class="sidebar-item-text sidebar-link"> | ||
<span class="menu-text">random.rademacher</span></a> | ||
<span class="menu-text">Rademacher</span></a> | ||
</div> | ||
</li> | ||
<li class="sidebar-item"> | ||
<div class="sidebar-item-container"> | ||
<a href="./reference/trace.slq.html" class="sidebar-item-text sidebar-link"> | ||
<span class="menu-text">trace.slq</span></a> | ||
<a href="./reference/random.normal.html" class="sidebar-item-text sidebar-link"> | ||
<span class="menu-text">Normal</span></a> | ||
</div> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</div> | ||
|
@@ -212,7 +330,7 @@ <h1 class="title">Comparison to <code>imate</code></h1> | |
|
||
</header> | ||
|
||
<p>Much of <code>primate</code>’s computational code was ported from the (excellent) <a href="https://github.com/ameli/imate"><code>imate</code> package</a>, prompting questions about their differences. In general, <code>primate</code> was developed with slightly different goals in mind than <code>imate</code>, most of which have to do with integrability and the choice of FFI / build system.</p> | ||
<p><code>primate</code>’s namesake (and some of the original code<a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a>) was inspired from the (excellent) <a href="https://github.com/ameli/imate"><code>imate</code> package</a>, prompting questions about their differences. In general, <code>primate</code> was developed with slightly different goals in mind than <code>imate</code>, most of which have to do with things like integrability, genericity, and choice of FFI / build system.</p> | ||
<p>Notable differences between the two packages include:</p> | ||
<table class="table"> | ||
<thead> | ||
|
@@ -224,48 +342,43 @@ <h1 class="title">Comparison to <code>imate</code></h1> | |
</thead> | ||
<tbody> | ||
<tr class="odd"> | ||
<td>Trace methods</td> | ||
<td>SLQ only</td> | ||
<td>Multiple</td> | ||
</tr> | ||
<tr class="even"> | ||
<td>Parallel support</td> | ||
<td>CPU only</td> | ||
<td>CPU & GPU</td> | ||
</tr> | ||
<tr class="odd"> | ||
<tr class="even"> | ||
<td>Function support</td> | ||
<td>Arbitrary</td> | ||
<td>Package supported<a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a></td> | ||
<td>Package supported<a href="#fn2" class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a></td> | ||
</tr> | ||
<tr class="even"> | ||
<tr class="odd"> | ||
<td>Operator support</td> | ||
<td>Arbitrary</td> | ||
<td>Matrix-derived</td> | ||
</tr> | ||
<tr class="odd"> | ||
<tr class="even"> | ||
<td>Linking strategy</td> | ||
<td>Header only</td> | ||
<td>Shared libraries</td> | ||
</tr> | ||
<tr class="even"> | ||
<tr class="odd"> | ||
<td>C++ version</td> | ||
<td><span class="math inline">\(\geq\)</span> C++20</td> | ||
<td><span class="math inline">\geq</span> C++20</td> | ||
<td>Any</td> | ||
</tr> | ||
<tr class="odd"> | ||
<tr class="even"> | ||
<td>FFI</td> | ||
<td>Pybind11</td> | ||
<td>Cython</td> | ||
</tr> | ||
<tr class="even"> | ||
<tr class="odd"> | ||
<td>Build tool</td> | ||
<td>Meson</td> | ||
<td>CMake</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<p>One of the primary motivations for developing <code>primate</code> was to streamline access to SLQ method from <em>user</em> (i.e. dependent) packages, as well as to extend native support for types adhering to SciPys <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.LinearOperator.html"><code>LinearOperator</code></a> abstract interface. If this fits your use case, consider giving <code>primate</code> a try!</p> | ||
<p>One motivation for developing <code>primate</code> was to modularize and streamline access to various parts of the SLQ method, which is achieved through the use of things like <a href="https://en.cppreference.com/w/cpp/language/function_template">function templates</a>, <a href="https://en.wikipedia.org/wiki/Type_erasure">type erasure</a>, and <a href="https://en.wikipedia.org/wiki/Header-only">header-only</a> definitions. These modifications not only simplify access to the SLQ method from <em>user</em> (i.e. dependent) packages, but they enable native support for arbitrary types adhering to SciPys <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.LinearOperator.html"><code>LinearOperator</code></a> abstract interface. For more details on this, see the integration guide.</p> | ||
<!-- - `imate` might be convenient for Python users that use Cython, whereas `primate` is convenient for C++ users that use pybind11 --> | ||
<!-- - `imate` supports multiple trace estimation approaches, e.g. decompositional methods. `primate` only supports the SLQ method. | ||
- `imate` supports both CPU parallelism and GPU parallelism. `primate` only supports CPU parallelism. | ||
|
@@ -282,7 +395,8 @@ <h1 class="title">Comparison to <code>imate</code></h1> | |
<div id="quarto-appendix" class="default"><aside id="footnotes" class="footnotes footnotes-end-of-document" role="doc-endnotes"><h2 class="anchored quarto-appendix-heading">Footnotes</h2> | ||
|
||
<ol> | ||
<li id="fn1"><p>See <a href="https://ameli.github.io/imate/api.html#functions">imates documentation</a> for the list of supported functions.<a href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></p></li> | ||
<li id="fn1"><p>Before v0.2, much of <code>primate</code>’s code was essentially ported and refactored from <code>imate</code>. The code for v0.2+ has been re-written using <a href="https://eigen.tuxfamily.org/index.php?title=Main_Page">Eigen</a> the library.<a href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></p></li> | ||
<li id="fn2"><p>See <a href="https://ameli.github.io/imate/api.html#functions">imates documentation</a> for the list of supported functions.<a href="#fnref2" class="footnote-back" role="doc-backlink">↩︎</a></p></li> | ||
</ol> | ||
</aside></div></main> <!-- /main --> | ||
<script id="quarto-html-after-body" type="application/javascript"> | ||
|
@@ -774,6 +888,30 @@ <h1 class="title">Comparison to <code>imate</code></h1> | |
}); | ||
</script> | ||
</div> <!-- /content --> | ||
<script src="https://cdn.jsdelivr.net/npm/pseudocode@latest/build/pseudocode.min.js" type="text/javascript"></script> | ||
<script type="text/javascript"> | ||
(function(d) { | ||
d.querySelectorAll(".pseudocode-container").forEach(function(el) { | ||
let pseudocodeOptions = { | ||
indentSize: el.dataset.indentSize || "1.2em", | ||
commentDelimiter: el.dataset.commentDelimiter || "//", | ||
lineNumber: el.dataset.lineNumber === "true" ? true : false, | ||
lineNumberPunc: el.dataset.lineNumberPunc || ":", | ||
noEnd: el.dataset.noEnd === "true" ? true : false, | ||
titlePrefix: el.dataset.algTitle || "Algorithm" | ||
}; | ||
pseudocode.renderElement(el.querySelector(".pseudocode"), pseudocodeOptions); | ||
}); | ||
})(document); | ||
(function(d) { | ||
d.querySelectorAll(".pseudocode-container").forEach(function(el) { | ||
titleSpan = el.querySelector(".ps-root > .ps-algorithm > .ps-line > .ps-keyword") | ||
titlePrefix = el.dataset.algTitle; | ||
titleIndex = el.dataset.chapterLevel ? el.dataset.chapterLevel + "." + el.dataset.pseudocodeIndex : el.dataset.pseudocodeIndex; | ||
titleSpan.innerHTML = titlePrefix + " " + titleIndex + " "; | ||
}); | ||
})(document); | ||
</script> | ||
|
||
|
||
|
||
|
Oops, something went wrong.