mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-12-22 20:33:36 +01:00
2447 lines
118 KiB
HTML
2447 lines
118 KiB
HTML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
|
<head>
|
|
<!-- 2023-06-16 Fri 18:16 -->
|
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>Common</title>
|
|
<meta name="generator" content="Org mode" />
|
|
<meta name="author" content="Anthony Scemama" />
|
|
<style type="text/css">
|
|
<!--/*--><![CDATA[/*><!--*/
|
|
.title { text-align: center;
|
|
margin-bottom: .2em; }
|
|
.subtitle { text-align: center;
|
|
font-size: medium;
|
|
font-weight: bold;
|
|
margin-top:0; }
|
|
.todo { font-family: monospace; color: red; }
|
|
.done { font-family: monospace; color: green; }
|
|
.priority { font-family: monospace; color: orange; }
|
|
.tag { background-color: #eee; font-family: monospace;
|
|
padding: 2px; font-size: 80%; font-weight: normal; }
|
|
.timestamp { color: #bebebe; }
|
|
.timestamp-kwd { color: #5f9ea0; }
|
|
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
|
|
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
|
|
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
|
|
.underline { text-decoration: underline; }
|
|
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
|
|
p.verse { margin-left: 3%; }
|
|
pre {
|
|
border: 1px solid #ccc;
|
|
box-shadow: 3px 3px 3px #eee;
|
|
padding: 8pt;
|
|
font-family: monospace;
|
|
overflow: auto;
|
|
margin: 1.2em;
|
|
}
|
|
pre.src {
|
|
position: relative;
|
|
overflow: auto;
|
|
padding-top: 1.2em;
|
|
}
|
|
pre.src:before {
|
|
display: none;
|
|
position: absolute;
|
|
background-color: white;
|
|
top: -10px;
|
|
right: 10px;
|
|
padding: 3px;
|
|
border: 1px solid black;
|
|
}
|
|
pre.src:hover:before { display: inline;}
|
|
/* Languages per Org manual */
|
|
pre.src-asymptote:before { content: 'Asymptote'; }
|
|
pre.src-awk:before { content: 'Awk'; }
|
|
pre.src-C:before { content: 'C'; }
|
|
/* pre.src-C++ doesn't work in CSS */
|
|
pre.src-clojure:before { content: 'Clojure'; }
|
|
pre.src-css:before { content: 'CSS'; }
|
|
pre.src-D:before { content: 'D'; }
|
|
pre.src-ditaa:before { content: 'ditaa'; }
|
|
pre.src-dot:before { content: 'Graphviz'; }
|
|
pre.src-calc:before { content: 'Emacs Calc'; }
|
|
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
|
|
pre.src-fortran:before { content: 'Fortran'; }
|
|
pre.src-gnuplot:before { content: 'gnuplot'; }
|
|
pre.src-haskell:before { content: 'Haskell'; }
|
|
pre.src-hledger:before { content: 'hledger'; }
|
|
pre.src-java:before { content: 'Java'; }
|
|
pre.src-js:before { content: 'Javascript'; }
|
|
pre.src-latex:before { content: 'LaTeX'; }
|
|
pre.src-ledger:before { content: 'Ledger'; }
|
|
pre.src-lisp:before { content: 'Lisp'; }
|
|
pre.src-lilypond:before { content: 'Lilypond'; }
|
|
pre.src-lua:before { content: 'Lua'; }
|
|
pre.src-matlab:before { content: 'MATLAB'; }
|
|
pre.src-mscgen:before { content: 'Mscgen'; }
|
|
pre.src-ocaml:before { content: 'Objective Caml'; }
|
|
pre.src-octave:before { content: 'Octave'; }
|
|
pre.src-org:before { content: 'Org mode'; }
|
|
pre.src-oz:before { content: 'OZ'; }
|
|
pre.src-plantuml:before { content: 'Plantuml'; }
|
|
pre.src-processing:before { content: 'Processing.js'; }
|
|
pre.src-python:before { content: 'Python'; }
|
|
pre.src-R:before { content: 'R'; }
|
|
pre.src-ruby:before { content: 'Ruby'; }
|
|
pre.src-sass:before { content: 'Sass'; }
|
|
pre.src-scheme:before { content: 'Scheme'; }
|
|
pre.src-screen:before { content: 'Gnu Screen'; }
|
|
pre.src-sed:before { content: 'Sed'; }
|
|
pre.src-sh:before { content: 'shell'; }
|
|
pre.src-sql:before { content: 'SQL'; }
|
|
pre.src-sqlite:before { content: 'SQLite'; }
|
|
/* additional languages in org.el's org-babel-load-languages alist */
|
|
pre.src-forth:before { content: 'Forth'; }
|
|
pre.src-io:before { content: 'IO'; }
|
|
pre.src-J:before { content: 'J'; }
|
|
pre.src-makefile:before { content: 'Makefile'; }
|
|
pre.src-maxima:before { content: 'Maxima'; }
|
|
pre.src-perl:before { content: 'Perl'; }
|
|
pre.src-picolisp:before { content: 'Pico Lisp'; }
|
|
pre.src-scala:before { content: 'Scala'; }
|
|
pre.src-shell:before { content: 'Shell Script'; }
|
|
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
|
|
/* additional language identifiers per "defun org-babel-execute"
|
|
in ob-*.el */
|
|
pre.src-cpp:before { content: 'C++'; }
|
|
pre.src-abc:before { content: 'ABC'; }
|
|
pre.src-coq:before { content: 'Coq'; }
|
|
pre.src-groovy:before { content: 'Groovy'; }
|
|
/* additional language identifiers from org-babel-shell-names in
|
|
ob-shell.el: ob-shell is the only babel language using a lambda to put
|
|
the execution function name together. */
|
|
pre.src-bash:before { content: 'bash'; }
|
|
pre.src-csh:before { content: 'csh'; }
|
|
pre.src-ash:before { content: 'ash'; }
|
|
pre.src-dash:before { content: 'dash'; }
|
|
pre.src-ksh:before { content: 'ksh'; }
|
|
pre.src-mksh:before { content: 'mksh'; }
|
|
pre.src-posh:before { content: 'posh'; }
|
|
/* Additional Emacs modes also supported by the LaTeX listings package */
|
|
pre.src-ada:before { content: 'Ada'; }
|
|
pre.src-asm:before { content: 'Assembler'; }
|
|
pre.src-caml:before { content: 'Caml'; }
|
|
pre.src-delphi:before { content: 'Delphi'; }
|
|
pre.src-html:before { content: 'HTML'; }
|
|
pre.src-idl:before { content: 'IDL'; }
|
|
pre.src-mercury:before { content: 'Mercury'; }
|
|
pre.src-metapost:before { content: 'MetaPost'; }
|
|
pre.src-modula-2:before { content: 'Modula-2'; }
|
|
pre.src-pascal:before { content: 'Pascal'; }
|
|
pre.src-ps:before { content: 'PostScript'; }
|
|
pre.src-prolog:before { content: 'Prolog'; }
|
|
pre.src-simula:before { content: 'Simula'; }
|
|
pre.src-tcl:before { content: 'tcl'; }
|
|
pre.src-tex:before { content: 'TeX'; }
|
|
pre.src-plain-tex:before { content: 'Plain TeX'; }
|
|
pre.src-verilog:before { content: 'Verilog'; }
|
|
pre.src-vhdl:before { content: 'VHDL'; }
|
|
pre.src-xml:before { content: 'XML'; }
|
|
pre.src-nxml:before { content: 'XML'; }
|
|
/* add a generic configuration mode; LaTeX export needs an additional
|
|
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
|
|
pre.src-conf:before { content: 'Configuration File'; }
|
|
|
|
table { border-collapse:collapse; }
|
|
caption.t-above { caption-side: top; }
|
|
caption.t-bottom { caption-side: bottom; }
|
|
td, th { vertical-align:top; }
|
|
th.org-right { text-align: center; }
|
|
th.org-left { text-align: center; }
|
|
th.org-center { text-align: center; }
|
|
td.org-right { text-align: right; }
|
|
td.org-left { text-align: left; }
|
|
td.org-center { text-align: center; }
|
|
dt { font-weight: bold; }
|
|
.footpara { display: inline; }
|
|
.footdef { margin-bottom: 1em; }
|
|
.figure { padding: 1em; }
|
|
.figure p { text-align: center; }
|
|
.equation-container {
|
|
display: table;
|
|
text-align: center;
|
|
width: 100%;
|
|
}
|
|
.equation {
|
|
vertical-align: middle;
|
|
}
|
|
.equation-label {
|
|
display: table-cell;
|
|
text-align: right;
|
|
vertical-align: middle;
|
|
}
|
|
.inlinetask {
|
|
padding: 10px;
|
|
border: 2px solid gray;
|
|
margin: 10px;
|
|
background: #ffffcc;
|
|
}
|
|
#org-div-home-and-up
|
|
{ text-align: right; font-size: 70%; white-space: nowrap; }
|
|
textarea { overflow-x: auto; }
|
|
.linenr { font-size: smaller }
|
|
.code-highlighted { background-color: #ffff00; }
|
|
.org-info-js_info-navigation { border-style: none; }
|
|
#org-info-js_console-label
|
|
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
|
|
.org-info-js_search-highlight
|
|
{ background-color: #ffff00; color: #000000; font-weight: bold; }
|
|
.org-svg { width: 90%; }
|
|
/*]]>*/-->
|
|
</style>
|
|
<link rel="stylesheet" title="Standard" href="qcaml.css" type="text/css" />
|
|
|
|
<script type="text/javascript" src="org-info.js">
|
|
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
|
|
// @license-end
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
|
|
<!--/*--><![CDATA[/*><!--*/
|
|
org_html_manager.set("TOC_DEPTH", "4");
|
|
org_html_manager.set("LINK_HOME", "index.html");
|
|
org_html_manager.set("LINK_UP", "");
|
|
org_html_manager.set("LOCAL_TOC", "1");
|
|
org_html_manager.set("VIEW_BUTTONS", "0");
|
|
org_html_manager.set("MOUSE_HINT", "underline");
|
|
org_html_manager.set("FIXED_TOC", "0");
|
|
org_html_manager.set("TOC", "1");
|
|
org_html_manager.set("VIEW", "info");
|
|
org_html_manager.setup(); // activate after the parameters are set
|
|
/*]]>*///-->
|
|
// @license-end
|
|
</script>
|
|
<script type="text/javascript">
|
|
// @license magnet:?xt=urn:btih:e95b018ef3580986a04669f1b5879592219e2a7a&dn=public-domain.txt Public Domain
|
|
<!--/*--><![CDATA[/*><!--*/
|
|
function CodeHighlightOn(elem, id)
|
|
{
|
|
var target = document.getElementById(id);
|
|
if(null != target) {
|
|
elem.classList.add("code-highlighted");
|
|
target.classList.add("code-highlighted");
|
|
}
|
|
}
|
|
function CodeHighlightOff(elem, id)
|
|
{
|
|
var target = document.getElementById(id);
|
|
if(null != target) {
|
|
elem.classList.remove("code-highlighted");
|
|
target.classList.remove("code-highlighted");
|
|
}
|
|
}
|
|
/*]]>*///-->
|
|
// @license-end
|
|
</script>
|
|
<script type="text/x-mathjax-config">
|
|
MathJax.Hub.Config({
|
|
displayAlign: "center",
|
|
displayIndent: "0em",
|
|
|
|
"HTML-CSS": { scale: 100,
|
|
linebreaks: { automatic: "false" },
|
|
webFont: "TeX"
|
|
},
|
|
SVG: {scale: 100,
|
|
linebreaks: { automatic: "false" },
|
|
font: "TeX"},
|
|
NativeMML: {scale: 100},
|
|
TeX: { equationNumbers: {autoNumber: "AMS"},
|
|
MultLineWidth: "85%",
|
|
TagSide: "right",
|
|
TagIndent: ".8em"
|
|
}
|
|
});
|
|
</script>
|
|
<script type="text/javascript"
|
|
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"></script>
|
|
</head>
|
|
<body>
|
|
<div id="org-div-home-and-up">
|
|
<a accesskey="h" href=""> UP </a>
|
|
|
|
|
<a accesskey="H" href="index.html"> HOME </a>
|
|
</div><div id="content">
|
|
<h1 class="title">Common</h1>
|
|
<div id="table-of-contents">
|
|
<h2>Table of Contents</h2>
|
|
<div id="text-table-of-contents">
|
|
<ul>
|
|
<li><a href="#orgbaa871d">1. Summary</a></li>
|
|
<li><a href="#orgc03fb7d">2. Angular Momentum</a>
|
|
<ul>
|
|
<li><a href="#org3aada86">2.1. Type</a></li>
|
|
<li><a href="#org9faa30e">2.2. Conversions</a></li>
|
|
<li><a href="#orgd1f859e">2.3. Shell functions</a></li>
|
|
<li><a href="#org3818aba">2.4. Arithmetic</a></li>
|
|
<li><a href="#orgbc8b645">2.5. Printers</a></li>
|
|
<li><a href="#orgae4e76b">2.6. <span class="todo TODO">TODO</span> Tests</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org93e5071">3. Bit string</a>
|
|
<ul>
|
|
<li><a href="#org5261976">3.1. Type</a></li>
|
|
<li><a href="#orga81cd0e">3.2. General implementation</a></li>
|
|
<li><a href="#orgf3c8526">3.3. Printers</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgd287715">4. Charge</a>
|
|
<ul>
|
|
<li><a href="#org3d74d76">4.1. Type</a></li>
|
|
<li><a href="#org4a610dd">4.2. Conversions</a></li>
|
|
<li><a href="#org10f0eaf">4.3. Simple operations</a></li>
|
|
<li><a href="#org548aa1e">4.4. Printers</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org1e4f46d">5. Command line</a>
|
|
<ul>
|
|
<li><a href="#org91bf246">5.1. Types</a></li>
|
|
<li><a href="#org4a8bb18">5.2. Mutable attributes</a></li>
|
|
<li><a href="#org7bcad19">5.3. Query functions</a></li>
|
|
<li><a href="#orge586d5f">5.4. Specification</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgdda944d">6. Constants</a>
|
|
<ul>
|
|
<li><a href="#org1575550">6.1. Thresholds</a></li>
|
|
<li><a href="#org39e6692">6.2. Mathematical constants</a></li>
|
|
<li><a href="#org9b05bfc">6.3. Physical constants</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgfa084fa">7. Coordinate</a>
|
|
<ul>
|
|
<li><a href="#org1328e4a">7.1. Type</a></li>
|
|
<li><a href="#org05c7c0d">7.2. Creation</a></li>
|
|
<li><a href="#org7805487">7.3. Conversion</a></li>
|
|
<li><a href="#org668fdd5">7.4. Vector operations</a></li>
|
|
<li><a href="#orgb031ec9">7.5. Printers</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgcc37d80">8. Non-negative float</a>
|
|
<ul>
|
|
<li><a href="#org74a5447">8.1. Type</a></li>
|
|
<li><a href="#org1b5c393">8.2. Conversions</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org2d2264c">9. Powers</a>
|
|
<ul>
|
|
<li><a href="#org533e8b4">9.1. Type</a></li>
|
|
<li><a href="#org3550c5a">9.2. Conversions</a></li>
|
|
<li><a href="#org8d03623">9.3. Operations</a></li>
|
|
<li><a href="#orgbb858cc">9.4. Printers</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgc57240d">10. QCaml</a></li>
|
|
<li><a href="#org2ac7025">11. Range</a>
|
|
<ul>
|
|
<li><a href="#orgaf6e78d">11.1. Type</a></li>
|
|
<li><a href="#org1f49487">11.2. Conversion</a></li>
|
|
<li><a href="#orgd31ee18">11.3. Printers</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgd8140f4">12. Spin</a>
|
|
<ul>
|
|
<li><a href="#org23a98c0">12.1. Type</a></li>
|
|
<li><a href="#orgde32229">12.2. Functions</a></li>
|
|
<li><a href="#org4e9d601">12.3. Printers</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgced12fd">13. Util</a>
|
|
<ul>
|
|
<li><a href="#orgde83450">13.1. External C functions</a>
|
|
<ul>
|
|
<li><a href="#org10b8785">13.1.1. Erf</a></li>
|
|
<li><a href="#org6f44057">13.1.2. Erfc</a></li>
|
|
<li><a href="#orge13e18d">13.1.3. Gamma</a></li>
|
|
<li><a href="#org42bf14b">13.1.4. Popcnt</a></li>
|
|
<li><a href="#org0295d1c">13.1.5. Trailz</a></li>
|
|
<li><a href="#org3f78b9e">13.1.6. Leadz</a></li>
|
|
<li><a href="#org1877a0a">13.1.7. Test</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org1458827">13.2. General functions</a></li>
|
|
<li><a href="#org837ff7d">13.3. Functions related to the Boys function</a></li>
|
|
<li><a href="#org48d5e1c">13.4. List functions</a></li>
|
|
<li><a href="#org8d9afa8">13.5. Array functions</a></li>
|
|
<li><a href="#orga8ba7e5">13.6. Seq functions</a></li>
|
|
<li><a href="#org4a8ceee">13.7. Printers</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org59e8f21">14. Zkey</a>
|
|
<ul>
|
|
<li><a href="#orgab5e9c6">14.1. Types</a></li>
|
|
<li><a href="#org73cf8df">14.2. Conversions</a></li>
|
|
<li><a href="#org1dd6a39">14.3. Functions for hash tables</a></li>
|
|
<li><a href="#orge7a2dcb">14.4. Printers</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orge568969">15. Zmap</a>
|
|
<ul>
|
|
<li><a href="#orgc343c38">15.1. Type</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgbaa871d" class="outline-2">
|
|
<h2 id="orgbaa871d"><span class="section-number-2">1</span> Summary</h2>
|
|
</div>
|
|
|
|
<div id="outline-container-orgc03fb7d" class="outline-2">
|
|
<h2 id="orgc03fb7d"><span class="section-number-2">2</span> Angular Momentum</h2>
|
|
<div class="outline-text-2" id="text-2">
|
|
<p>
|
|
Azimuthal quantum number, repsesented as \( s,p,d,\dots \) .
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org3aada86" class="outline-3">
|
|
<h3 id="org3aada86"><span class="section-number-3">2.1</span> Type</h3>
|
|
<div class="outline-text-3" id="text-2-1">
|
|
<p>
|
|
<a id="orgde35f5a"><code>Angular_momentum.t</code></a>
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml" id="org6615989"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span> <span class="org-tuareg-font-lock-operator">=</span>
|
|
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">S</span> <span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">P</span> <span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">D</span> <span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">F</span> <span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">G</span> <span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">H</span> <span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">I</span> <span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">J</span> <span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">K</span> <span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">L</span> <span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">M</span> <span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">N</span> <span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">O</span>
|
|
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">Int</span> <span class="org-keyword">of</span> int
|
|
|
|
<span class="org-keyword">exception</span> <span class="org-tuareg-font-lock-constructor">Angular_momentum_error</span> <span class="org-keyword">of</span> string
|
|
|
|
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">kind</span> <span class="org-tuareg-font-lock-operator">=</span>
|
|
<span class="org-tuareg-font-lock-constructor">Singlet</span> <span class="org-keyword">of</span> t
|
|
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">Doublet</span> <span class="org-keyword">of</span> <span class="org-tuareg-font-lock-operator">(</span>t <span class="org-tuareg-font-lock-operator">*</span> t<span class="org-tuareg-font-lock-operator">)</span>
|
|
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">Triplet</span> <span class="org-keyword">of</span> <span class="org-tuareg-font-lock-operator">(</span>t <span class="org-tuareg-font-lock-operator">*</span> t <span class="org-tuareg-font-lock-operator">*</span> t<span class="org-tuareg-font-lock-operator">)</span>
|
|
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">Quartet</span> <span class="org-keyword">of</span> <span class="org-tuareg-font-lock-operator">(</span>t <span class="org-tuareg-font-lock-operator">*</span> t <span class="org-tuareg-font-lock-operator">*</span> t <span class="org-tuareg-font-lock-operator">*</span> t<span class="org-tuareg-font-lock-operator">)</span>
|
|
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
An exception is raised when the <a href="#orgde35f5a"><code>Angular_momentum.t</code></a> element can't
|
|
be created.
|
|
</p>
|
|
|
|
<p>
|
|
The <code>kind</code> is used to build shells, shell doublets, triplets or
|
|
quartets, use in the two-electron operators.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org9faa30e" class="outline-3">
|
|
<h3 id="org9faa30e"><span class="section-number-3">2.2</span> Conversions</h3>
|
|
<div class="outline-text-3" id="text-2-2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_char</span> <span class="org-tuareg-font-lock-operator">:</span> char <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_char</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> char
|
|
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_int</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> int
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_int</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">-></span> t
|
|
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_string</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> string
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>of_char</code></td>
|
|
<td class="org-left">Returns an <a href="#orgde35f5a"><code>Angular_momentum.t</code></a> when a shell is given as a character (case insensitive)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>to_char</code></td>
|
|
<td class="org-left">Converts the angular momentum into a char</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>of_int</code></td>
|
|
<td class="org-left">Returns a shell given an \(l\) value.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>to_int</code></td>
|
|
<td class="org-left">Returns the \(l_{max}\) value of the shell</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>to_string</code></td>
|
|
<td class="org-left">Converts the angular momentum into a string</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>
|
|
Example:
|
|
</p>
|
|
<pre class="example" id="org459861d">
|
|
Angular_momentum.of_char 'p';;
|
|
- : Angular_momentum.t = P
|
|
|
|
Angular_momentum.(to_char P);;
|
|
- : char = 'P'
|
|
|
|
Angular_momentum.of_int 2;;
|
|
- : Angular_momentum.t = D
|
|
|
|
Angular_momentum.(to_int D);;
|
|
- : int = 2
|
|
|
|
Angular_momentum.(to_string D);;
|
|
- : string = "D"
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd1f859e" class="outline-3">
|
|
<h3 id="orgd1f859e"><span class="section-number-3">2.3</span> Shell functions</h3>
|
|
<div class="outline-text-3" id="text-2-3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">n_functions</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> int
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">zkey_array</span> <span class="org-tuareg-font-lock-operator">:</span> kind <span class="org-tuareg-font-lock-operator">-></span> <span class="org-tuareg-font-lock-module">Zkey.</span>t array
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>n_functions</code></td>
|
|
<td class="org-left">Returns the number of cartesian functions in a shell.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>zkey_array</code></td>
|
|
<td class="org-left">Array of <a href="#orgd6ab9db"><code>Zkey.t</code></a>, where each element is a a key associated with the the powers of \(x,y,z\).</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>
|
|
Example:
|
|
</p>
|
|
<pre class="example" id="org2a19b80">
|
|
Angular_momentum.(n_functions D) ;;
|
|
- : int = 6
|
|
|
|
Angular_momentum.( zkey_array (Doublet (P,S)) );;
|
|
- : Zkey.t array =
|
|
[|< 01125899906842624 | 1, 0, 0, 0, 0, 0 >;
|
|
< 01099511627776 | 0, 1, 0, 0, 0, 0 >;
|
|
< 01073741824 | 0, 0, 1, 0, 0, 0 >|]
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org3818aba" class="outline-3">
|
|
<h3 id="org3818aba"><span class="section-number-3">2.4</span> Arithmetic</h3>
|
|
<div class="outline-text-3" id="text-2-4">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-tuareg-font-lock-operator">(</span> <span class="org-tuareg-font-lock-operator">+</span> <span class="org-tuareg-font-lock-operator">)</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-tuareg-font-lock-operator">(</span> <span class="org-tuareg-font-lock-operator">-</span> <span class="org-tuareg-font-lock-operator">)</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Example:
|
|
</p>
|
|
<pre class="example" id="orgebcfe35">
|
|
Angular_momentum.(D + P);;
|
|
- : Angular_momentum.t = F
|
|
|
|
Angular_momentum.(F - P);;
|
|
- : Angular_momentum.t = D
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgbc8b645" class="outline-3">
|
|
<h3 id="orgbc8b645"><span class="section-number-3">2.5</span> Printers</h3>
|
|
<div class="outline-text-3" id="text-2-5">
|
|
<p>
|
|
Printers can print as a string (default) or as an integer.
|
|
</p>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp_string</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp_int</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgae4e76b" class="outline-3">
|
|
<h3 id="orgae4e76b"><span class="section-number-3">2.6</span> <span class="todo TODO">TODO</span> Tests</h3>
|
|
</div>
|
|
</div>
|
|
<div id="outline-container-org93e5071" class="outline-2">
|
|
<h2 id="org93e5071"><span class="section-number-2">3</span> Bit string</h2>
|
|
<div class="outline-text-2" id="text-3">
|
|
<p>
|
|
We define here a data type to handle bit strings efficiently. When
|
|
the bit string contains less than 64 bits, it is stored internally
|
|
in a 63-bit integer and uses bitwise instructions. When more than
|
|
63 bits are required, the <code>zarith</code> library is used to consider the
|
|
bit string as a multi-precision integer.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div id="outline-container-org5261976" class="outline-3">
|
|
<h3 id="org5261976"><span class="section-number-3">3.1</span> Type</h3>
|
|
<div class="outline-text-3" id="text-3-1">
|
|
<p>
|
|
<a id="orgc083ed5"><code>Bitstring.t</code></a>
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orga81cd0e" class="outline-3">
|
|
<h3 id="orga81cd0e"><span class="section-number-3">3.2</span> General implementation</h3>
|
|
<div class="outline-text-3" id="text-3-2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_int</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_z</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Z.</span>t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">zero</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">-></span> t
|
|
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">is_zero</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> bool
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">numbits</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> int
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">testbit</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> int <span class="org-tuareg-font-lock-operator">-></span> bool
|
|
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">neg</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">shift_left</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> int <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">shift_right</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> int <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">shift_left_one</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">-></span> int <span class="org-tuareg-font-lock-operator">-></span> t
|
|
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">logor</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">logxor</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">logand</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">lognot</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">plus_one</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">minus_one</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">hamdist</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> int
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">trailing_zeros</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> int
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">popcount</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> int
|
|
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_list</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-label">?accu</span><span class="org-tuareg-font-lock-operator">:(</span>int list<span class="org-tuareg-font-lock-operator">)</span> <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> int list
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">permutations</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">-></span> int <span class="org-tuareg-font-lock-operator">-></span> t list
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>of_int</code></td>
|
|
<td class="org-left">Creates a bit string from an <code>int</code></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>of_z</code></td>
|
|
<td class="org-left">Creates a bit string from an <code>Z.t</code> multi-precision integer</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>zero</code></td>
|
|
<td class="org-left"><code>zero n</code> creates a zero bit string with <code>n</code> bits</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>is_zero</code></td>
|
|
<td class="org-left">True if all the bits of the bit string are zero.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>numbits</code></td>
|
|
<td class="org-left">Returns the number of bits used to represent the bit string</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>testbit</code></td>
|
|
<td class="org-left"><code>testbit t n</code> is true if the <code>n</code>-th bit of the bit string <code>t</code> is set to <code>1</code></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>neg</code></td>
|
|
<td class="org-left">Returns the negative of the integer interpretation of the bit string</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>shift_left</code></td>
|
|
<td class="org-left"><code>shift_left t n</code> returns a new bit strings with all the bits shifted <code>n</code> positions to the left</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>shift_right</code></td>
|
|
<td class="org-left"><code>shift_right t n</code> returns a new bit strings with all the bits shifted <code>n</code> positions to the right</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>shift_left_one</code></td>
|
|
<td class="org-left"><code>shift_left_one size n</code> returns a new bit strings with the <code>n</code>-th bit set to one. It is equivalent as shifting <code>1</code> by <code>n</code> bits to the left, <code>size</code> is the total number of bits of the bit string</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>logor</code></td>
|
|
<td class="org-left">Bitwise logical or</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>logxor</code></td>
|
|
<td class="org-left">Bitwise logical exclusive or</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>logand</code></td>
|
|
<td class="org-left">Bitwise logical and</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>lognot</code></td>
|
|
<td class="org-left">Bitwise logical negation</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>plus_one</code></td>
|
|
<td class="org-left">Takes the integer representation of the bit string and adds one</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>minus_one</code></td>
|
|
<td class="org-left">Takes the integer representation of the bit string and removes one</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>hamdist</code></td>
|
|
<td class="org-left">Returns the Hamming distance, i.e. the number of bits differing between two bit strings</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>trailing_zeros</code></td>
|
|
<td class="org-left">Returns the number of trailing zeros in the bit string</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>permutations</code></td>
|
|
<td class="org-left"><code>permutations m n</code> generates the list of all possible <code>n</code>-bit strings with <code>m</code> bits set to <code>1</code>. Algorithm adapted from <a href="https://graphics.stanford.edu/~seander/bithacks.html#NextBitPermutation">Bit twiddling hacks</a></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>popcount</code></td>
|
|
<td class="org-left">Returns the number of bits set to one in the bit string</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>to_list</code></td>
|
|
<td class="org-left">Converts a bit string into a list of integers indicating the positions where the bits are set to <code>1</code>. The first value for the position is not <code>0</code> but <code>1</code></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>
|
|
Example:
|
|
</p>
|
|
<pre class="example" id="org0abba25">
|
|
Bitstring.of_int 15;;
|
|
- : Bitstring.t =
|
|
++++------------------------------------------------------------
|
|
</pre>
|
|
|
|
<p>
|
|
Example:
|
|
</p>
|
|
<pre class="example" id="org5d5613b">
|
|
Bitstring.(shift_left (of_int 15) 2);;
|
|
- : Bitstring.t =
|
|
--++++----------------------------------------------------------
|
|
|
|
Bitstring.(shift_right (of_int 15) 2);;
|
|
- : Bitstring.t =
|
|
++--------------------------------------------------------------
|
|
|
|
Bitstring.shift_left_one 32 4;;
|
|
- : Bitstring.t =
|
|
----+-----------------------------------------------------------
|
|
|
|
Bitstring.(testbit (of_int 15) 3);;
|
|
- : bool = true
|
|
|
|
Bitstring.(testbit (of_int 15) 4);;
|
|
- : bool = false
|
|
</pre>
|
|
|
|
<p>
|
|
Example:
|
|
</p>
|
|
<pre class="example" id="org0553868">
|
|
Bitstring.(logor (of_int 15) (of_int 73));;
|
|
- : Bitstring.t =
|
|
++++--+---------------------------------------------------------
|
|
|
|
Bitstring.(logand (of_int 15) (of_int 10));;
|
|
- : Bitstring.t =
|
|
-+-+------------------------------------------------------------
|
|
|
|
Bitstring.(logxor (of_int 15) (of_int 73));;
|
|
- : Bitstring.t =
|
|
-++---+---------------------------------------------------------
|
|
</pre>
|
|
|
|
|
|
<p>
|
|
Example:
|
|
</p>
|
|
<pre class="example" id="org80f89fa">
|
|
Bitstring.(plus_one (of_int 15));;
|
|
- : Bitstring.t =
|
|
----+-----------------------------------------------------------
|
|
|
|
Bitstring.(minus_one (of_int 15));;
|
|
- : Bitstring.t =
|
|
-+++------------------------------------------------------------
|
|
</pre>
|
|
|
|
|
|
<p>
|
|
Example:
|
|
</p>
|
|
<pre class="example" id="org57f5df5">
|
|
Bitstring.(trailing_zeros (of_int 12));;
|
|
- : int = 2
|
|
|
|
Bitstring.(hamdist (of_int 15) (of_int 73));;
|
|
- : int = 3
|
|
|
|
Bitstring.(popcount (of_int 15));;
|
|
- : int = 4
|
|
</pre>
|
|
|
|
<p>
|
|
Example:
|
|
</p>
|
|
<pre class="example" id="org2a39c1e">
|
|
Bitstring.(to_list (of_int 45));;
|
|
- : int list = [1; 3; 4; 6]
|
|
</pre>
|
|
|
|
<p>
|
|
Example:
|
|
</p>
|
|
<pre class="example" id="org3e73601">
|
|
Bitstring.permutations 2 4;;
|
|
- : Bitstring.t list =
|
|
[++--------------------------------------------------------------;
|
|
+-+-------------------------------------------------------------;
|
|
-++-------------------------------------------------------------;
|
|
+--+------------------------------------------------------------;
|
|
-+-+------------------------------------------------------------;
|
|
--++------------------------------------------------------------]
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf3c8526" class="outline-3">
|
|
<h3 id="orgf3c8526"><span class="section-number-3">3.3</span> Printers</h3>
|
|
<div class="outline-text-3" id="text-3-3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd287715" class="outline-2">
|
|
<h2 id="orgd287715"><span class="section-number-2">4</span> Charge</h2>
|
|
<div class="outline-text-2" id="text-4">
|
|
</div>
|
|
|
|
<div id="outline-container-org3d74d76" class="outline-3">
|
|
<h3 id="org3d74d76"><span class="section-number-3">4.1</span> Type</h3>
|
|
<div class="outline-text-3" id="text-4-1">
|
|
<p>
|
|
<a id="org1d2c325"><code>Charge.t</code></a>
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
This type should be used for all charges in the program (electrons, nuclei,…).
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org4a610dd" class="outline-3">
|
|
<h3 id="org4a610dd"><span class="section-number-3">4.2</span> Conversions</h3>
|
|
<div class="outline-text-3" id="text-4-2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_float</span> <span class="org-tuareg-font-lock-operator">:</span> float <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_float</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> float
|
|
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_int</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_int</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> int
|
|
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_string</span><span class="org-tuareg-font-lock-operator">:</span> string <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_string</span><span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> string
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org10f0eaf" class="outline-3">
|
|
<h3 id="org10f0eaf"><span class="section-number-3">4.3</span> Simple operations</h3>
|
|
<div class="outline-text-3" id="text-4-3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-tuareg-font-lock-operator">(</span> <span class="org-tuareg-font-lock-operator">+</span> <span class="org-tuareg-font-lock-operator">)</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-tuareg-font-lock-operator">(</span> <span class="org-tuareg-font-lock-operator">-</span> <span class="org-tuareg-font-lock-operator">)</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-tuareg-font-lock-operator">(</span> <span class="org-tuareg-font-lock-operator">*</span> <span class="org-tuareg-font-lock-operator">)</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> float <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-tuareg-font-lock-operator">(</span> <span class="org-tuareg-font-lock-operator">/</span> <span class="org-tuareg-font-lock-operator">)</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> float <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">is_null</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> bool
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org548aa1e" class="outline-3">
|
|
<h3 id="org548aa1e"><span class="section-number-3">4.4</span> Printers</h3>
|
|
<div class="outline-text-3" id="text-4-4">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org1e4f46d" class="outline-2">
|
|
<h2 id="org1e4f46d"><span class="section-number-2">5</span> Command line</h2>
|
|
<div class="outline-text-2" id="text-5">
|
|
<p>
|
|
This module is a wrapper around the <code>Getopt</code> library and helps to
|
|
define command-line arguments.
|
|
</p>
|
|
|
|
<p>
|
|
Here is an example of how to use this module.
|
|
First, define the specification:
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">let</span> <span class="org-tuareg-font-lock-governing">open </span><span class="org-tuareg-font-lock-module">Command_line</span> <span class="org-tuareg-font-lock-governing">in</span>
|
|
<span class="org-tuareg-font-lock-governing">begin</span>
|
|
set_header_doc <span class="org-tuareg-font-lock-operator">(</span><span class="org-tuareg-font-lock-module">Sys.</span>argv.<span class="org-tuareg-font-lock-operator">(</span>0<span class="org-tuareg-font-lock-operator">)</span> <span class="org-tuareg-font-lock-operator">^</span> <span class="org-string">" - One-line description"</span><span class="org-tuareg-font-lock-operator">);</span>
|
|
set_description_doc <span class="org-string">"Long description of the command."</span><span class="org-tuareg-font-lock-operator">;</span>
|
|
set_specs
|
|
<span class="org-tuareg-font-lock-operator">[</span> <span class="org-tuareg-font-lock-operator">{</span> short<span class="org-tuareg-font-lock-operator">=</span><span class="org-string">'c'</span><span class="org-tuareg-font-lock-operator">;</span> long<span class="org-tuareg-font-lock-operator">=</span><span class="org-string">"check"</span><span class="org-tuareg-font-lock-operator">;</span> opt<span class="org-tuareg-font-lock-operator">=</span><span class="org-tuareg-font-lock-constructor">Optional</span><span class="org-tuareg-font-lock-operator">;</span>
|
|
doc<span class="org-tuareg-font-lock-operator">=</span><span class="org-string">"Checks the input data"</span><span class="org-tuareg-font-lock-operator">;</span>
|
|
arg<span class="org-tuareg-font-lock-operator">=</span><span class="org-tuareg-font-lock-constructor">Without_arg</span><span class="org-tuareg-font-lock-operator">;</span> <span class="org-tuareg-font-lock-operator">};</span>
|
|
|
|
<span class="org-tuareg-font-lock-operator">{</span> short<span class="org-tuareg-font-lock-operator">=</span><span class="org-string">'b'</span> <span class="org-tuareg-font-lock-operator">;</span> long<span class="org-tuareg-font-lock-operator">=</span><span class="org-string">"basis"</span> <span class="org-tuareg-font-lock-operator">;</span> opt<span class="org-tuareg-font-lock-operator">=</span><span class="org-tuareg-font-lock-constructor">Mandatory</span><span class="org-tuareg-font-lock-operator">;</span>
|
|
arg<span class="org-tuareg-font-lock-operator">=</span><span class="org-tuareg-font-lock-constructor">With_arg</span> <span class="org-string">"<string>"</span><span class="org-tuareg-font-lock-operator">;</span>
|
|
doc<span class="org-tuareg-font-lock-operator">=</span><span class="org-string">"Name of the file containing the basis set"</span><span class="org-tuareg-font-lock-operator">;</span> <span class="org-tuareg-font-lock-operator">}</span> <span class="org-tuareg-font-lock-operator">;</span>
|
|
|
|
<span class="org-tuareg-font-lock-operator">{</span> short<span class="org-tuareg-font-lock-operator">=</span><span class="org-string">'m'</span> <span class="org-tuareg-font-lock-operator">;</span> long<span class="org-tuareg-font-lock-operator">=</span><span class="org-string">"multiplicity"</span> <span class="org-tuareg-font-lock-operator">;</span> opt<span class="org-tuareg-font-lock-operator">=</span><span class="org-tuareg-font-lock-constructor">Optional</span><span class="org-tuareg-font-lock-operator">;</span>
|
|
arg<span class="org-tuareg-font-lock-operator">=</span><span class="org-tuareg-font-lock-constructor">With_arg</span> <span class="org-string">"<int>"</span><span class="org-tuareg-font-lock-operator">;</span>
|
|
doc<span class="org-tuareg-font-lock-operator">=</span><span class="org-string">"Spin multiplicity (2S+1). Default is singlet"</span><span class="org-tuareg-font-lock-operator">;</span> <span class="org-tuareg-font-lock-operator">}</span> <span class="org-tuareg-font-lock-operator">;</span>
|
|
<span class="org-tuareg-font-lock-operator">]</span>
|
|
<span class="org-tuareg-font-lock-governing">end</span><span class="org-tuareg-font-lock-operator">;</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Then, define what to do with the arguments:
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">let</span> <span class="org-variable-name">c</span> <span class="org-tuareg-font-lock-operator">=</span>
|
|
<span class="org-tuareg-font-lock-module">Command_line.</span>get_bool <span class="org-string">"check"</span>
|
|
<span class="org-tuareg-font-lock-governing">in</span>
|
|
|
|
<span class="org-tuareg-font-lock-governing">let</span> <span class="org-variable-name">basis</span> <span class="org-tuareg-font-lock-operator">=</span>
|
|
<span class="org-keyword">match</span> <span class="org-tuareg-font-lock-module">Command_line.</span>get <span class="org-string">"basis"</span> <span class="org-keyword">with</span>
|
|
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">Some</span> x <span class="org-tuareg-font-lock-operator">-></span> x
|
|
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">None</span> <span class="org-tuareg-font-lock-operator">-></span> <span class="org-keyword">assert</span> <span class="org-constant">false</span>
|
|
<span class="org-tuareg-font-lock-governing">in</span>
|
|
|
|
<span class="org-tuareg-font-lock-governing">let</span> <span class="org-variable-name">multiplicity</span> <span class="org-tuareg-font-lock-operator">=</span>
|
|
<span class="org-keyword">match</span> <span class="org-tuareg-font-lock-module">Command_line.</span>get <span class="org-string">"multiplicity"</span> <span class="org-keyword">with</span>
|
|
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">None</span> <span class="org-tuareg-font-lock-operator">-></span> 1
|
|
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">Some</span> n <span class="org-tuareg-font-lock-operator">-></span> int_of_string n
|
|
<span class="org-tuareg-font-lock-governing">in</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org91bf246" class="outline-3">
|
|
<h3 id="org91bf246"><span class="section-number-3">5.1</span> Types</h3>
|
|
<div class="outline-text-3" id="text-5-1">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml" id="org5286330"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">short_opt</span> <span class="org-tuareg-font-lock-operator">=</span> char
|
|
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">long_opt</span> <span class="org-tuareg-font-lock-operator">=</span> string
|
|
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">optional</span> <span class="org-tuareg-font-lock-operator">=</span> <span class="org-tuareg-font-lock-constructor">Mandatory</span> <span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">Optional</span>
|
|
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">documentation</span> <span class="org-tuareg-font-lock-operator">=</span> string
|
|
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">argument</span> <span class="org-tuareg-font-lock-operator">=</span> <span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">With_arg</span> <span class="org-keyword">of</span> string
|
|
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">Without_arg</span>
|
|
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">With_opt_arg</span> <span class="org-keyword">of</span> string
|
|
|
|
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">description</span> <span class="org-tuareg-font-lock-operator">=</span> <span class="org-tuareg-font-lock-operator">{</span>
|
|
short<span class="org-tuareg-font-lock-operator">:</span> short_opt <span class="org-tuareg-font-lock-operator">;</span>
|
|
long <span class="org-tuareg-font-lock-operator">:</span> long_opt <span class="org-tuareg-font-lock-operator">;</span>
|
|
opt <span class="org-tuareg-font-lock-operator">:</span> optional <span class="org-tuareg-font-lock-operator">;</span>
|
|
doc <span class="org-tuareg-font-lock-operator">:</span> documentation <span class="org-tuareg-font-lock-operator">;</span>
|
|
arg <span class="org-tuareg-font-lock-operator">:</span> argument <span class="org-tuareg-font-lock-operator">;</span>
|
|
<span class="org-tuareg-font-lock-operator">}</span>
|
|
|
|
</pre>
|
|
</div>
|
|
|
|
<ul class="org-ul">
|
|
<li><a id="org5387b20">Short option</a>: in the command line, a dash with a single character
|
|
(ex: <code>ls -l</code>)</li>
|
|
<li><a id="org0274b24">Long option</a>: in the command line, two dashes with a word
|
|
(ex: <code>ls --directory</code>)</li>
|
|
<li>Command-line options can be <code>Mandatory</code> or <code>Optional</code></li>
|
|
<li>Documentation of the option is used in the help function</li>
|
|
<li>Some options require an argument (<code>ls --ignore="*.ml"</code> ), some
|
|
don't (<code>ls -l</code>) and for some arguments the argument is optional
|
|
(<code>git --log[=<n>]</code>)</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org4a8bb18" class="outline-3">
|
|
<h3 id="org4a8bb18"><span class="section-number-3">5.2</span> Mutable attributes</h3>
|
|
<div class="outline-text-3" id="text-5-2">
|
|
<p>
|
|
All the options are stored in the hash table <code>dict</code> where the key
|
|
is the <a href="#org0274b24">long option</a> and the value is a value of type <code>description</code>.
|
|
</p>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">set_header_doc</span> <span class="org-tuareg-font-lock-operator">:</span> string <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">set_description_doc</span> <span class="org-tuareg-font-lock-operator">:</span> string <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">set_footer_doc</span> <span class="org-tuareg-font-lock-operator">:</span> string <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Functions to set the header, footer and main description of the
|
|
documentation provided by the <code>help</code> function:
|
|
</p>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">anonymous</span> <span class="org-tuareg-font-lock-operator">:</span> long_opt <span class="org-tuareg-font-lock-operator">-></span> optional <span class="org-tuareg-font-lock-operator">-></span> documentation <span class="org-tuareg-font-lock-operator">-></span> description
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Function to create an anonymous argument.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7bcad19" class="outline-3">
|
|
<h3 id="org7bcad19"><span class="section-number-3">5.3</span> Query functions</h3>
|
|
<div class="outline-text-3" id="text-5-3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">get</span> <span class="org-tuareg-font-lock-operator">:</span> long_opt <span class="org-tuareg-font-lock-operator">-></span> string option
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">get_bool</span> <span class="org-tuareg-font-lock-operator">:</span> long_opt <span class="org-tuareg-font-lock-operator">-></span> bool
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">anon_args</span> <span class="org-tuareg-font-lock-operator">:</span> unit <span class="org-tuareg-font-lock-operator">-></span> string list
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>get</code></td>
|
|
<td class="org-left">Returns the argument associated with a <a href="#org0274b24">long option</a></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>get_bool</code></td>
|
|
<td class="org-left">True if the <code>Optional</code> argument is present in the command-line</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>anon_args</code></td>
|
|
<td class="org-left">Returns the list of anonymous arguments</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="outline-container-orge586d5f" class="outline-3">
|
|
<h3 id="orge586d5f"><span class="section-number-3">5.4</span> Specification</h3>
|
|
<div class="outline-text-3" id="text-5-4">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">set_specs</span> <span class="org-tuareg-font-lock-operator">:</span> description list <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Sets the specifications of the current program from a list of
|
|
<code>descrption</code> variables.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgdda944d" class="outline-2">
|
|
<h2 id="orgdda944d"><span class="section-number-2">6</span> Constants</h2>
|
|
<div class="outline-text-2" id="text-6">
|
|
<p>
|
|
All constants used in the program.
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org1575550" class="outline-3">
|
|
<h3 id="org1575550"><span class="section-number-3">6.1</span> Thresholds</h3>
|
|
<div class="outline-text-3" id="text-6-1">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">epsilon</span> <span class="org-tuareg-font-lock-operator">:</span> float
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">integrals_cutoff</span> <span class="org-tuareg-font-lock-operator">:</span> float
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>epsilon</code></td>
|
|
<td class="org-left">Value below which a float is considered null. Default is ε = 2.10<sup>-15</sup></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>integrals_cutoff</code></td>
|
|
<td class="org-left">Cutoff value for integrals. Default is ε</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org39e6692" class="outline-3">
|
|
<h3 id="org39e6692"><span class="section-number-3">6.2</span> Mathematical constants</h3>
|
|
<div class="outline-text-3" id="text-6-2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pi</span> <span class="org-tuareg-font-lock-operator">:</span> float
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">two_pi</span> <span class="org-tuareg-font-lock-operator">:</span> float
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">sq_pi</span> <span class="org-tuareg-font-lock-operator">:</span> float
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">sq_pi_over_two</span> <span class="org-tuareg-font-lock-operator">:</span> float
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pi_inv</span> <span class="org-tuareg-font-lock-operator">:</span> float
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">two_over_sq_pi</span> <span class="org-tuareg-font-lock-operator">:</span> float
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>pi</code></td>
|
|
<td class="org-left">\(\pi = 3.141~592~653~589~793~12\)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>two_pi</code></td>
|
|
<td class="org-left">\(2 \pi\)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>sq_pi</code></td>
|
|
<td class="org-left">\(\sqrt{\pi}\)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>sq_pi_over_two</code></td>
|
|
<td class="org-left">\(\sqrt{\pi} / 2\)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>pi_inv</code></td>
|
|
<td class="org-left">\(1 / \pi\)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>two_over_sq_pi</code></td>
|
|
<td class="org-left">\(2 / \sqrt{\pi}\)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org9b05bfc" class="outline-3">
|
|
<h3 id="org9b05bfc"><span class="section-number-3">6.3</span> Physical constants</h3>
|
|
<div class="outline-text-3" id="text-6-3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">a0</span> <span class="org-tuareg-font-lock-operator">:</span> float
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">a0_inv</span> <span class="org-tuareg-font-lock-operator">:</span> float
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">ha_to_ev</span> <span class="org-tuareg-font-lock-operator">:</span> float
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">ev_to_ha</span> <span class="org-tuareg-font-lock-operator">:</span> float
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>a0</code></td>
|
|
<td class="org-left">Bohr's radius : \(a_0 = 0.529~177~210~67(23)\) angstrom</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>a0_inv</code></td>
|
|
<td class="org-left">\(1 / a_0\)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>ha_to_ev</code></td>
|
|
<td class="org-left">Hartree to eV conversion factor : \(27.211~386~02(17)\)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>ev_to_ha</code></td>
|
|
<td class="org-left">eV to Hartree conversion factor : 1 / <code>ha_to_ev</code></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgfa084fa" class="outline-2">
|
|
<h2 id="orgfa084fa"><span class="section-number-2">7</span> Coordinate</h2>
|
|
<div class="outline-text-2" id="text-7">
|
|
<p>
|
|
Coordinates in 3D space.
|
|
</p>
|
|
|
|
<p>
|
|
All operations on points are done in atomic units. Therefore,
|
|
all coordinates are given in bohr and manipulated with this
|
|
module.
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org1328e4a" class="outline-3">
|
|
<h3 id="org1328e4a"><span class="section-number-3">7.1</span> Type</h3>
|
|
<div class="outline-text-3" id="text-7-1">
|
|
<p>
|
|
<a id="orga1c0a76"><code>Coordinate.t</code></a>
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml" id="org7ac3d46"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">bohr</span>
|
|
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">angstrom</span>
|
|
|
|
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">xyz</span> <span class="org-tuareg-font-lock-operator">=</span> <span class="org-tuareg-font-lock-operator">{</span>
|
|
x <span class="org-tuareg-font-lock-operator">:</span> float <span class="org-tuareg-font-lock-operator">;</span>
|
|
y <span class="org-tuareg-font-lock-operator">:</span> float <span class="org-tuareg-font-lock-operator">;</span>
|
|
z <span class="org-tuareg-font-lock-operator">:</span> float <span class="org-tuareg-font-lock-operator">;</span>
|
|
<span class="org-tuareg-font-lock-operator">}</span>
|
|
|
|
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">'a point</span> <span class="org-tuareg-font-lock-operator">=</span> xyz
|
|
|
|
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span> <span class="org-tuareg-font-lock-operator">=</span> bohr point
|
|
|
|
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">axis</span> <span class="org-tuareg-font-lock-operator">=</span> <span class="org-tuareg-font-lock-constructor">X</span> <span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">Y</span> <span class="org-tuareg-font-lock-operator">|</span> Z
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org05c7c0d" class="outline-3">
|
|
<h3 id="org05c7c0d"><span class="section-number-3">7.2</span> Creation</h3>
|
|
<div class="outline-text-3" id="text-7-2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">make</span> <span class="org-tuareg-font-lock-operator">:</span> 'a point <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">make_angstrom</span> <span class="org-tuareg-font-lock-operator">:</span> 'a point <span class="org-tuareg-font-lock-operator">-></span> angstrom point
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">zero</span> <span class="org-tuareg-font-lock-operator">:</span> bohr point
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>make</code></td>
|
|
<td class="org-left">Creates a point in atomic units</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>make_angstrom</code></td>
|
|
<td class="org-left">Creates a point in angstrom</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>zero</code></td>
|
|
<td class="org-left">\((0., 0., 0.)\)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7805487" class="outline-3">
|
|
<h3 id="org7805487"><span class="section-number-3">7.3</span> Conversion</h3>
|
|
<div class="outline-text-3" id="text-7-3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">bohr_to_angstrom</span> <span class="org-tuareg-font-lock-operator">:</span> bohr point <span class="org-tuareg-font-lock-operator">-></span> angstrom point
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">angstrom_to_bohr</span> <span class="org-tuareg-font-lock-operator">:</span> angstrom point <span class="org-tuareg-font-lock-operator">-></span> bohr point
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>bohr_to_angstrom</code></td>
|
|
<td class="org-left">Converts a point in bohr to angstrom</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>angstrom_to_bohr</code></td>
|
|
<td class="org-left">Converts a point in angstrom to bohr</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org668fdd5" class="outline-3">
|
|
<h3 id="org668fdd5"><span class="section-number-3">7.4</span> Vector operations</h3>
|
|
<div class="outline-text-3" id="text-7-4">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">neg</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">get</span> <span class="org-tuareg-font-lock-operator">:</span> axis <span class="org-tuareg-font-lock-operator">-></span> bohr point <span class="org-tuareg-font-lock-operator">-></span> float
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">dot</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> float
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">norm</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> float
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-tuareg-font-lock-operator">(</span> <span class="org-tuareg-font-lock-operator">|</span>. <span class="org-tuareg-font-lock-operator">)</span> <span class="org-tuareg-font-lock-operator">:</span> float <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-tuareg-font-lock-operator">(</span> <span class="org-tuareg-font-lock-operator">|+</span> <span class="org-tuareg-font-lock-operator">)</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-tuareg-font-lock-operator">(</span> <span class="org-tuareg-font-lock-operator">|-</span> <span class="org-tuareg-font-lock-operator">)</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>neg</code></td>
|
|
<td class="org-left">Negative of a point</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>get</code></td>
|
|
<td class="org-left">Extracts the projection of the coordinate on an axis</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>dot</code></td>
|
|
<td class="org-left">Dot product</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>norm</code></td>
|
|
<td class="org-left">\(\ell{^2}\) norm of the vector</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left">$| .$</td>
|
|
<td class="org-left">Scales the vector by a constant</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left">\(\vert +\)</td>
|
|
<td class="org-left">Adds two vectors</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left">\(\vert -\)</td>
|
|
<td class="org-left">Subtracts two vectors</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>
|
|
Example:
|
|
</p>
|
|
<pre class="example" id="orgf37cfd1">
|
|
Coordinate.neg { x=1. ; y=2. ; z=3. } ;;
|
|
- : Coordinate.t = -1.0000 -2.0000 -3.0000
|
|
|
|
Coordinate.(get Y { x=1. ; y=2. ; z=3. }) ;;
|
|
- : float = 2.
|
|
|
|
Coordinate.(
|
|
2. |. { x=1. ; y=2. ; z=3. }
|
|
) ;;
|
|
- : Coordinate.t = 2.0000 4.0000 6.0000
|
|
|
|
Coordinate.(
|
|
{ x=1. ; y=2. ; z=3. } |+ { x=2. ; y=3. ; z=1. }
|
|
);;
|
|
- : Coordinate.t = 3.0000 5.0000 4.0000
|
|
|
|
Coordinate.(
|
|
{ x=1. ; y=2. ; z=3. } |- { x=2. ; y=3. ; z=1. }
|
|
);;
|
|
- : Coordinate.t = -1.0000 -1.0000 2.0000
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="outline-container-orgb031ec9" class="outline-3">
|
|
<h3 id="orgb031ec9"><span class="section-number-3">7.5</span> Printers</h3>
|
|
<div class="outline-text-3" id="text-7-5">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp_bohr</span><span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp_angstrom</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Coordinates can be printed in bohr or angstrom.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgcc37d80" class="outline-2">
|
|
<h2 id="orgcc37d80"><span class="section-number-2">8</span> Non-negative float</h2>
|
|
<div class="outline-text-2" id="text-8">
|
|
</div>
|
|
|
|
<div id="outline-container-org74a5447" class="outline-3">
|
|
<h3 id="org74a5447"><span class="section-number-3">8.1</span> Type</h3>
|
|
<div class="outline-text-3" id="text-8-1">
|
|
<p>
|
|
<<a id="orgc8f438d"></a>
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span> <span class="org-tuareg-font-lock-operator">=</span> <span class="org-keyword">private</span> float
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org1b5c393" class="outline-3">
|
|
<h3 id="org1b5c393"><span class="section-number-3">8.2</span> Conversions</h3>
|
|
<div class="outline-text-3" id="text-8-2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_float</span> <span class="org-tuareg-font-lock-operator">:</span> float <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">unsafe_of_float</span> <span class="org-tuareg-font-lock-operator">:</span> float <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_float</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> float
|
|
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_string</span> <span class="org-tuareg-font-lock-operator">:</span> string <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_string</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> string
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
The <code>of_float</code> function checks that the float is non-negative.
|
|
The unsafe variant doesn't do this check.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org2d2264c" class="outline-2">
|
|
<h2 id="org2d2264c"><span class="section-number-2">9</span> Powers</h2>
|
|
<div class="outline-text-2" id="text-9">
|
|
<p>
|
|
Contains powers of \(x\), \(y\) and \(z\) describing the polynomials in atomic basis sets.
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org533e8b4" class="outline-3">
|
|
<h3 id="org533e8b4"><span class="section-number-3">9.1</span> Type</h3>
|
|
<div class="outline-text-3" id="text-9-1">
|
|
<p>
|
|
<a id="org6b9eac3"><code>Powers.t</code></a>
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span> <span class="org-tuareg-font-lock-operator">=</span> <span class="org-keyword">private</span> <span class="org-tuareg-font-lock-operator">{</span>
|
|
x <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">;</span>
|
|
y <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">;</span>
|
|
z <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">;</span>
|
|
tot <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">;</span>
|
|
<span class="org-tuareg-font-lock-operator">}</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
<code>tot</code> always contains <code>x+y+z</code>.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org3550c5a" class="outline-3">
|
|
<h3 id="org3550c5a"><span class="section-number-3">9.2</span> Conversions</h3>
|
|
<div class="outline-text-3" id="text-9-2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_int_tuple</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">*</span> int <span class="org-tuareg-font-lock-operator">*</span> int <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_int_tuple</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> int <span class="org-tuareg-font-lock-operator">*</span> int <span class="org-tuareg-font-lock-operator">*</span> int
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Example:
|
|
</p>
|
|
<pre class="example" id="org500b6f5">
|
|
Powers.of_int_tuple (2,3,1);;
|
|
- : Powers.t = x^2 + y^3 + z^1
|
|
|
|
Powers.(to_int_tuple (of_int_tuple (2,3,1)));;
|
|
- : int * int * int = (2, 3, 1)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org8d03623" class="outline-3">
|
|
<h3 id="org8d03623"><span class="section-number-3">9.3</span> Operations</h3>
|
|
<div class="outline-text-3" id="text-9-3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">get</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Coordinate.</span>axis <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> int
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">incr</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Coordinate.</span>axis <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">decr</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Coordinate.</span>axis <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>get</code></td>
|
|
<td class="org-left">Returns the value of the power for \(x\), \(y\) or \(z\)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>incr</code></td>
|
|
<td class="org-left">Returns a new <a href="#org6b9eac3"><code>Powers.t</code></a> with the power on the given axis incremented</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>decr</code></td>
|
|
<td class="org-left">Returns a new <a href="#org6b9eac3"><code>Powers.t</code></a> with the power on the given axis decremented. As opposed to <code>of_int_tuple</code>, the values may become negative</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>
|
|
Example:
|
|
</p>
|
|
<pre class="example" id="org4e20301">
|
|
Powers.get Coordinate.Y (Powers.of_int_tuple (2,3,1));;
|
|
- : int = 3
|
|
|
|
Powers.incr Coordinate.Y (Powers.of_int_tuple (2,3,1));;
|
|
- : Powers.t = x^2 + y^4 + z^1
|
|
|
|
Powers.decr Coordinate.Y (Powers.of_int_tuple (2,3,1));;
|
|
- : Powers.t = x^2 + y^2 + z^1
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="outline-container-orgbb858cc" class="outline-3">
|
|
<h3 id="orgbb858cc"><span class="section-number-3">9.4</span> Printers</h3>
|
|
<div class="outline-text-3" id="text-9-4">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgc57240d" class="outline-2">
|
|
<h2 id="orgc57240d"><span class="section-number-2">10</span> QCaml</h2>
|
|
<div class="outline-text-2" id="text-10">
|
|
<p>
|
|
QCaml-specific parameters
|
|
</p>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">root</span> <span class="org-tuareg-font-lock-operator">:</span> string
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">name</span> <span class="org-tuareg-font-lock-operator">:</span> string
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">num_domains</span> <span class="org-tuareg-font-lock-operator">:</span> int
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>root</code></td>
|
|
<td class="org-left">Path to the QCaml source directory</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>name</code></td>
|
|
<td class="org-left"><code>"QCaml"</code></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>num_domains</code></td>
|
|
<td class="org-left">Number of threads in parallel computations</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org2ac7025" class="outline-2">
|
|
<h2 id="org2ac7025"><span class="section-number-2">11</span> Range</h2>
|
|
<div class="outline-text-2" id="text-11">
|
|
<p>
|
|
A range is a sorted list of integers in an interval.
|
|
</p>
|
|
|
|
<ul class="org-ul">
|
|
<li><code>"[a-b]"</code> : range between a and b (included)</li>
|
|
<li><code>"[a]"</code> : the list with only one integer a</li>
|
|
<li><code>"a"</code> : equivalent to "[a]"</li>
|
|
<li><code>"[36-53,72-107,126-131]"</code> represents the list of integers
|
|
[ 37 ; 37 ; 38 ; … ; 52 ; 53 ; 72 ; 73 ; … ; 106 ; 107 ; 126 ; 127 ; … ; 130 ; 131 ].</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div id="outline-container-orgaf6e78d" class="outline-3">
|
|
<h3 id="orgaf6e78d"><span class="section-number-3">11.1</span> Type</h3>
|
|
<div class="outline-text-3" id="text-11-1">
|
|
<p>
|
|
<a id="orgc2942bf"><code>Range.t</code></a>
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org1f49487" class="outline-3">
|
|
<h3 id="org1f49487"><span class="section-number-3">11.2</span> Conversion</h3>
|
|
<div class="outline-text-3" id="text-11-2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_string</span> <span class="org-tuareg-font-lock-operator">:</span> string <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_string</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> string
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_int_list</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> int list
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd31ee18" class="outline-3">
|
|
<h3 id="orgd31ee18"><span class="section-number-3">11.3</span> Printers</h3>
|
|
<div class="outline-text-3" id="text-11-3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd8140f4" class="outline-2">
|
|
<h2 id="orgd8140f4"><span class="section-number-2">12</span> Spin</h2>
|
|
<div class="outline-text-2" id="text-12">
|
|
<p>
|
|
Electron spin
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org23a98c0" class="outline-3">
|
|
<h3 id="org23a98c0"><span class="section-number-3">12.1</span> Type</h3>
|
|
<div class="outline-text-3" id="text-12-1">
|
|
<p>
|
|
<a id="org4b71156"><code>Spin.t</code></a>
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span> <span class="org-tuareg-font-lock-operator">=</span> <span class="org-tuareg-font-lock-constructor">Alfa</span> <span class="org-tuareg-font-lock-operator">|</span> Beta
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Note :
|
|
<code>Alfa</code> if written with an 'f' instead of 'ph' because it has the same number of
|
|
letters as <code>Beta</code>, so the alignment of the code is nicer.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgde32229" class="outline-3">
|
|
<h3 id="orgde32229"><span class="section-number-3">12.2</span> Functions</h3>
|
|
<div class="outline-text-3" id="text-12-2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">other</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Returns the opposite spin
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org4e9d601" class="outline-3">
|
|
<h3 id="org4e9d601"><span class="section-number-3">12.3</span> Printers</h3>
|
|
<div class="outline-text-3" id="text-12-3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgced12fd" class="outline-2">
|
|
<h2 id="orgced12fd"><span class="section-number-2">13</span> Util</h2>
|
|
<div class="outline-text-2" id="text-13">
|
|
<p>
|
|
Utility functions.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div id="outline-container-orgde83450" class="outline-3">
|
|
<h3 id="orgde83450"><span class="section-number-3">13.1</span> External C functions</h3>
|
|
<div class="outline-text-3" id="text-13-1">
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>erf_float</code></td>
|
|
<td class="org-left">Error function <code>erf</code> from <code>libm</code></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>erfc_float</code></td>
|
|
<td class="org-left">Complementary error function <code>erfc</code> from <code>libm</code></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>gamma_float</code></td>
|
|
<td class="org-left">Gamma function <code>gamma</code> from <code>libm</code></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>popcnt</code></td>
|
|
<td class="org-left"><code>popcnt</code> instruction</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>trailz</code></td>
|
|
<td class="org-left"><code>ctz</code> instruction</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>leadz</code></td>
|
|
<td class="org-left"><code>bsf</code> instruction</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div id="outline-container-org10b8785" class="outline-4">
|
|
<h4 id="org10b8785"><span class="section-number-4">13.1.1</span> Erf</h4>
|
|
<div class="outline-text-4" id="text-13-1-1">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">external</span> <span class="org-function-name">erf_float</span> <span class="org-tuareg-font-lock-operator">:</span> float <span class="org-tuareg-font-lock-operator">-></span> float
|
|
<span class="org-tuareg-font-lock-operator">=</span> <span class="org-string">"erf_float_bytecode"</span> <span class="org-string">"erf_float"</span> <span class="org-tuareg-font-lock-attribute">[@@unboxed]</span> <span class="org-tuareg-font-lock-attribute">[@@noalloc]</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org6f44057" class="outline-4">
|
|
<h4 id="org6f44057"><span class="section-number-4">13.1.2</span> Erfc</h4>
|
|
<div class="outline-text-4" id="text-13-1-2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">external</span> <span class="org-function-name">erfc_float</span> <span class="org-tuareg-font-lock-operator">:</span> float <span class="org-tuareg-font-lock-operator">-></span> float
|
|
<span class="org-tuareg-font-lock-operator">=</span> <span class="org-string">"erfc_float_bytecode"</span> <span class="org-string">"erfc_float"</span> <span class="org-tuareg-font-lock-attribute">[@@unboxed]</span> <span class="org-tuareg-font-lock-attribute">[@@noalloc]</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge13e18d" class="outline-4">
|
|
<h4 id="orge13e18d"><span class="section-number-4">13.1.3</span> Gamma</h4>
|
|
<div class="outline-text-4" id="text-13-1-3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">external</span> <span class="org-function-name">gamma_float</span> <span class="org-tuareg-font-lock-operator">:</span> float <span class="org-tuareg-font-lock-operator">-></span> float
|
|
<span class="org-tuareg-font-lock-operator">=</span> <span class="org-string">"gamma_float_bytecode"</span> <span class="org-string">"gamma_float"</span> <span class="org-tuareg-font-lock-attribute">[@@unboxed]</span> <span class="org-tuareg-font-lock-attribute">[@@noalloc]</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org42bf14b" class="outline-4">
|
|
<h4 id="org42bf14b"><span class="section-number-4">13.1.4</span> Popcnt</h4>
|
|
<div class="outline-text-4" id="text-13-1-4">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">popcnt</span> <span class="org-tuareg-font-lock-operator">:</span> int64 <span class="org-tuareg-font-lock-operator">-></span> int
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org0295d1c" class="outline-4">
|
|
<h4 id="org0295d1c"><span class="section-number-4">13.1.5</span> Trailz</h4>
|
|
<div class="outline-text-4" id="text-13-1-5">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">trailz</span> <span class="org-tuareg-font-lock-operator">:</span> int64 <span class="org-tuareg-font-lock-operator">-></span> int
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org3f78b9e" class="outline-4">
|
|
<h4 id="org3f78b9e"><span class="section-number-4">13.1.6</span> Leadz</h4>
|
|
<div class="outline-text-4" id="text-13-1-6">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">leadz</span> <span class="org-tuareg-font-lock-operator">:</span> int64 <span class="org-tuareg-font-lock-operator">-></span> int
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org1877a0a" class="outline-4">
|
|
<h4 id="org1877a0a"><span class="section-number-4">13.1.7</span> Test</h4>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org1458827" class="outline-3">
|
|
<h3 id="org1458827"><span class="section-number-3">13.2</span> General functions</h3>
|
|
<div class="outline-text-3" id="text-13-2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">fact</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">-></span> float
|
|
<span class="org-comment-delimiter">(* </span><span class="org-comment">@raise Invalid_argument for negative arguments or arguments >100. </span><span class="org-comment-delimiter">*)</span>
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">binom</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">-></span> int <span class="org-tuareg-font-lock-operator">-></span> int
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">binom_float</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">-></span> int <span class="org-tuareg-font-lock-operator">-></span> float
|
|
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">chop</span> <span class="org-tuareg-font-lock-operator">:</span> float <span class="org-tuareg-font-lock-operator">-></span> <span class="org-tuareg-font-lock-operator">(</span>unit <span class="org-tuareg-font-lock-operator">-></span> float<span class="org-tuareg-font-lock-operator">)</span> <span class="org-tuareg-font-lock-operator">-></span> float
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pow</span> <span class="org-tuareg-font-lock-operator">:</span> float <span class="org-tuareg-font-lock-operator">-></span> int <span class="org-tuareg-font-lock-operator">-></span> float
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">float_of_int_fast</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">-></span> float
|
|
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_some</span> <span class="org-tuareg-font-lock-operator">:</span> 'a option <span class="org-tuareg-font-lock-operator">-></span> 'a
|
|
|
|
<span class="org-keyword">exception</span> <span class="org-tuareg-font-lock-constructor">Not_implemented</span> <span class="org-keyword">of</span> string
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">not_implemented</span> <span class="org-tuareg-font-lock-operator">:</span> string <span class="org-tuareg-font-lock-operator">-></span> 'a
|
|
<span class="org-comment-delimiter">(* </span><span class="org-comment">@raise Not_implemented. </span><span class="org-comment-delimiter">*)</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>fact</code></td>
|
|
<td class="org-left">Factorial function.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>binom</code></td>
|
|
<td class="org-left">Binomial coefficient. <code>binom n k</code> = \(C_n^k\)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>binom_float</code></td>
|
|
<td class="org-left">float variant of <code>binom</code></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>pow</code></td>
|
|
<td class="org-left">Fast implementation of the power function for small integer powers</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>chop</code></td>
|
|
<td class="org-left">In <code>chop a f</code>, evaluate <code>f</code> only if the absolute value of <code>a</code> is larger than <code>Constants.epsilon</code>, and return <code>a *. f ()</code>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>float_of_int_fast</code></td>
|
|
<td class="org-left">Faster implementation of float<sub>of</sub><sub>int</sub> for small positive ints</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>not_implemented</code></td>
|
|
<td class="org-left">Fails if some functionality is not implemented</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>of_some</code></td>
|
|
<td class="org-left">Extracts the value of an option</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org837ff7d" class="outline-3">
|
|
<h3 id="org837ff7d"><span class="section-number-3">13.3</span> Functions related to the Boys function</h3>
|
|
<div class="outline-text-3" id="text-13-3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">incomplete_gamma</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-label">alpha</span><span class="org-tuareg-font-lock-operator">:</span>float <span class="org-tuareg-font-lock-operator">-></span> float <span class="org-tuareg-font-lock-operator">-></span> float
|
|
<span class="org-comment-delimiter">(* </span><span class="org-comment">@raise Failure when the calculation doesn't converge. </span><span class="org-comment-delimiter">*)</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
The lower <a href="https://en.wikipedia.org/wiki/Incomplete_gamma_function">Incomplete Gamma function</a> is implemented :
|
|
\[
|
|
\gamma(\alpha,x) = \int_0^x e^{-t} t^{\alpha-1} dt
|
|
\]
|
|
</p>
|
|
|
|
<p>
|
|
p: \(\frac{1}{\Gamma(\alpha)} \int_0^x e^{-t} t^{\alpha-1} dt\)
|
|
</p>
|
|
|
|
<p>
|
|
q: \(\frac{1}{\Gamma(\alpha)} \int_x^\infty e^{-t} t^{\alpha-1} dt\)
|
|
</p>
|
|
|
|
<p>
|
|
Reference : Haruhiko Okumura: C-gengo niyoru saishin algorithm jiten
|
|
(New Algorithm handbook in C language) (Gijyutsu hyouron sha,
|
|
Tokyo, 1991) p.227 [in Japanese]
|
|
</p>
|
|
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">boys_function</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-label">maxm</span><span class="org-tuareg-font-lock-operator">:</span>int <span class="org-tuareg-font-lock-operator">-></span> float <span class="org-tuareg-font-lock-operator">-></span> float array
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
The <a href="https://link.springer.com/article/10.1007/s10910-005-9023-3">Generalized Boys function</a> is implemented,
|
|
<code>maxm</code> is the maximum total angular momentum.
|
|
</p>
|
|
|
|
<p>
|
|
\[
|
|
F_m(x) = \frac{\gamma(m+1/2,x)}{2x^{m+1/2}}
|
|
\]
|
|
where \(\gamma\) is the incomplete gamma function.
|
|
</p>
|
|
|
|
<ul class="org-ul">
|
|
<li>\(F_0(0.) = 1\)</li>
|
|
<li>\(F_0(t) = \frac{\sqrt{\pi}}{2\sqrt{t}} \text{erf} ( \sqrt{t} )\)</li>
|
|
<li>\(F_m(0.) = \frac{1}{2m+1}\)</li>
|
|
<li>\(F_m(t) = \frac{\gamma{m+1/2,t}}{2t^{m+1/2}}\)</li>
|
|
<li>\(F_m(t) = \frac{ 2t\, F_{m+1}(t) + e^{-t} }{2m+1}\)</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org48d5e1c" class="outline-3">
|
|
<h3 id="org48d5e1c"><span class="section-number-3">13.4</span> List functions</h3>
|
|
<div class="outline-text-3" id="text-13-4">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">list_some</span> <span class="org-tuareg-font-lock-operator">:</span> 'a option list <span class="org-tuareg-font-lock-operator">-></span> 'a list
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">list_range</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">-></span> int <span class="org-tuareg-font-lock-operator">-></span> int list
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">list_pack</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">-></span> 'a list <span class="org-tuareg-font-lock-operator">-></span> 'a list list
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>list_some</code></td>
|
|
<td class="org-left">Filters out all <code>None</code> elements of the list, and returns the elements without the <code>Some</code></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>list_range</code></td>
|
|
<td class="org-left">Creates a list of consecutive integers</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>list_pack</code></td>
|
|
<td class="org-left"><code>list_pack n l</code> Creates a list of <code>n</code>-elements lists</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org8d9afa8" class="outline-3">
|
|
<h3 id="org8d9afa8"><span class="section-number-3">13.5</span> Array functions</h3>
|
|
<div class="outline-text-3" id="text-13-5">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">array_range</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">-></span> int <span class="org-tuareg-font-lock-operator">-></span> int array
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">array_sum</span> <span class="org-tuareg-font-lock-operator">:</span> float array <span class="org-tuareg-font-lock-operator">-></span> float
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">array_product</span> <span class="org-tuareg-font-lock-operator">:</span> float array <span class="org-tuareg-font-lock-operator">-></span> float
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>array_range</code></td>
|
|
<td class="org-left">Creates an array of consecutive integers</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>array_sum</code></td>
|
|
<td class="org-left">Returns the sum of all the elements of the array</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>array_product</code></td>
|
|
<td class="org-left">Returns the product of all the elements of the array</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orga8ba7e5" class="outline-3">
|
|
<h3 id="orga8ba7e5"><span class="section-number-3">13.6</span> Seq functions</h3>
|
|
<div class="outline-text-3" id="text-13-6">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">seq_range</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">-></span> int <span class="org-tuareg-font-lock-operator">-></span> int <span class="org-tuareg-font-lock-module">Seq.</span>t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">seq_to_list</span> <span class="org-tuareg-font-lock-operator">:</span> 'a <span class="org-tuareg-font-lock-module">Seq.</span>t <span class="org-tuareg-font-lock-operator">-></span> 'a list
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">seq_fold</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-operator">(</span>'a <span class="org-tuareg-font-lock-operator">-></span> 'b <span class="org-tuareg-font-lock-operator">-></span> 'a<span class="org-tuareg-font-lock-operator">)</span> <span class="org-tuareg-font-lock-operator">-></span> 'a <span class="org-tuareg-font-lock-operator">-></span> 'b <span class="org-tuareg-font-lock-module">Seq.</span>t <span class="org-tuareg-font-lock-operator">-></span> 'a
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>seq_range</code></td>
|
|
<td class="org-left">Creates a sequence returning consecutive integers</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>seq_to_list</code></td>
|
|
<td class="org-left">Read a sequence and put items in a list</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>seq_fold</code></td>
|
|
<td class="org-left">Apply a fold to the elements of the sequence</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org4a8ceee" class="outline-3">
|
|
<h3 id="org4a8ceee"><span class="section-number-3">13.7</span> Printers</h3>
|
|
<div class="outline-text-3" id="text-13-7">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp_float_array_size</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> float array <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp_float_array</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> float array <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp_float_2darray_size</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> float array array <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp_float_2darray</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> float array array <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp_bitstring</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">-></span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> <span class="org-tuareg-font-lock-module">Z.</span>t <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>pp_float_array</code></td>
|
|
<td class="org-left">Printer for float arrays</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>pp_float_array_size</code></td>
|
|
<td class="org-left">Printer for float arrays with size</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>pp_float_2darray</code></td>
|
|
<td class="org-left">Printer for matrices</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>pp_float_2darray_size</code></td>
|
|
<td class="org-left">Printer for matrices with size</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>pp_bitstring</code></td>
|
|
<td class="org-left">Printer for bit strings (used by <code>Bitstring</code> module)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>
|
|
Example:
|
|
</p>
|
|
<pre class="example" id="orgd14cd00">
|
|
pp_float_array_size:
|
|
[ 6: 1.000000 1.732051 1.732051 1.000000 1.732051 1.000000 ]
|
|
|
|
pp_float_array:
|
|
[ 1.000000 1.732051 1.732051 1.000000 1.732051 1.000000 ]
|
|
|
|
pp_float_2darray_size
|
|
[
|
|
2:[ 6: 1.000000 1.732051 1.732051 1.000000 1.732051 1.000000 ]
|
|
[ 4: 1.000000 2.000000 3.000000 4.000000 ] ]
|
|
|
|
pp_float_2darray:
|
|
[ [ 1.000000 1.732051 1.732051 1.000000 1.732051 1.000000 ]
|
|
[ 1.000000 2.000000 3.000000 4.000000 ] ]
|
|
|
|
pp_bitstring 14:
|
|
+++++------+--
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org59e8f21" class="outline-2">
|
|
<h2 id="org59e8f21"><span class="section-number-2">14</span> Zkey</h2>
|
|
<div class="outline-text-2" id="text-14">
|
|
<p>
|
|
Encodes the powers of x, y, z in a compact form, suitable for being
|
|
used as keys in a hash table.
|
|
</p>
|
|
|
|
<p>
|
|
Internally, the <a href="#orgd6ab9db"><code>Zkey.t</code></a> is made of two integers, <code>left</code> and <code>right</code>.
|
|
The small integers x, y and z are stored compactly in this 126-bits
|
|
space:
|
|
</p>
|
|
|
|
<p>
|
|
Example:
|
|
</p>
|
|
<pre class="example" id="orgc77d93b">
|
|
Left Right
|
|
3 [--------------------------------------------------------------] [------------------|---------------|---------------|---------------]
|
|
x y z
|
|
|
|
6 [--------------------------------------------------------------] [---|----------|----------|----------|----------|----------|---------]
|
|
x1 y1 z1 x2 y2 z2
|
|
|
|
9 [---------------------------------|----------|----------|---------] [---|----------|----------|----------|----------|----------|---------]
|
|
x1 y1 z1 x2 y2 z2 x3 y3 z3
|
|
|
|
12 [---|----------|----------|----------|----------|----------|---------] [---|----------|----------|----------|----------|----------|---------]
|
|
x1 y1 z1 x2 y2 z2 x3 y3 z3 x4 y4 z4
|
|
</pre>
|
|
|
|
<p>
|
|
The values of x,y,z should be positive and should not exceed 32767 for
|
|
<code>kind=3</code>. For all other kinds kinds the values should not exceed 1023.
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-orgab5e9c6" class="outline-3">
|
|
<h3 id="orgab5e9c6"><span class="section-number-3">14.1</span> Types</h3>
|
|
<div class="outline-text-3" id="text-14-1">
|
|
<p>
|
|
<a id="orgd6ab9db"><code>Zkey.t</code></a>
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span>
|
|
|
|
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">kind</span> <span class="org-tuareg-font-lock-operator">=</span>
|
|
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">Three</span> <span class="org-keyword">of</span> <span class="org-tuareg-font-lock-module">Powers.</span>t
|
|
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">Four</span> <span class="org-keyword">of</span> <span class="org-tuareg-font-lock-operator">(</span>int <span class="org-tuareg-font-lock-operator">*</span> int <span class="org-tuareg-font-lock-operator">*</span> int <span class="org-tuareg-font-lock-operator">*</span> int<span class="org-tuareg-font-lock-operator">)</span>
|
|
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">Six</span> <span class="org-keyword">of</span> <span class="org-tuareg-font-lock-operator">(</span><span class="org-tuareg-font-lock-module">Powers.</span>t <span class="org-tuareg-font-lock-operator">*</span> <span class="org-tuareg-font-lock-module">Powers.</span>t<span class="org-tuareg-font-lock-operator">)</span>
|
|
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">Nine</span> <span class="org-keyword">of</span> <span class="org-tuareg-font-lock-operator">(</span><span class="org-tuareg-font-lock-module">Powers.</span>t <span class="org-tuareg-font-lock-operator">*</span> <span class="org-tuareg-font-lock-module">Powers.</span>t <span class="org-tuareg-font-lock-operator">*</span> <span class="org-tuareg-font-lock-module">Powers.</span>t<span class="org-tuareg-font-lock-operator">)</span>
|
|
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">Twelve</span> <span class="org-keyword">of</span> <span class="org-tuareg-font-lock-operator">(</span><span class="org-tuareg-font-lock-module">Powers.</span>t <span class="org-tuareg-font-lock-operator">*</span> <span class="org-tuareg-font-lock-module">Powers.</span>t <span class="org-tuareg-font-lock-operator">*</span> <span class="org-tuareg-font-lock-module">Powers.</span>t <span class="org-tuareg-font-lock-operator">*</span> <span class="org-tuareg-font-lock-module">Powers.</span>t<span class="org-tuareg-font-lock-operator">)</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org73cf8df" class="outline-3">
|
|
<h3 id="org73cf8df"><span class="section-number-3">14.2</span> Conversions</h3>
|
|
<div class="outline-text-3" id="text-14-2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_powers_three</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Powers.</span>t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_powers_six</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Powers.</span>t <span class="org-tuareg-font-lock-operator">-></span> <span class="org-tuareg-font-lock-module">Powers.</span>t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_powers_nine</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Powers.</span>t <span class="org-tuareg-font-lock-operator">-></span> <span class="org-tuareg-font-lock-module">Powers.</span>t <span class="org-tuareg-font-lock-operator">-></span> <span class="org-tuareg-font-lock-module">Powers.</span>t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_powers_twelve</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Powers.</span>t <span class="org-tuareg-font-lock-operator">-></span> <span class="org-tuareg-font-lock-module">Powers.</span>t <span class="org-tuareg-font-lock-operator">-></span> <span class="org-tuareg-font-lock-module">Powers.</span>t <span class="org-tuareg-font-lock-operator">-></span> <span class="org-tuareg-font-lock-module">Powers.</span>t <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_powers</span> <span class="org-tuareg-font-lock-operator">:</span> kind <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_int_array</span> <span class="org-tuareg-font-lock-operator">:</span> int array <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_int_four</span> <span class="org-tuareg-font-lock-operator">:</span> int <span class="org-tuareg-font-lock-operator">-></span> int <span class="org-tuareg-font-lock-operator">-></span> int <span class="org-tuareg-font-lock-operator">-></span> int <span class="org-tuareg-font-lock-operator">-></span> t
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_int_array</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> int array
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_powers</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> kind
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_string</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> string
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>of_powers_three</code></td>
|
|
<td class="org-left">Create from a <a href="#org6b9eac3"><code>Powers.t</code></a></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>of_powers_six</code></td>
|
|
<td class="org-left">Create from two <a href="#org6b9eac3"><code>Powers.t</code></a></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>of_powers_nine</code></td>
|
|
<td class="org-left">Create from three <a href="#org6b9eac3"><code>Powers.t</code></a></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>of_powers_twelve</code></td>
|
|
<td class="org-left">Create from four <a href="#org6b9eac3"><code>Powers.t</code></a></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>of_powers</code></td>
|
|
<td class="org-left">Create using the <code>kind</code> type</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>of_int_array</code></td>
|
|
<td class="org-left">Convert from an <code>int</code> array</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>of_int_four</code></td>
|
|
<td class="org-left">Create from four <code>ints</code></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>to_int_array</code></td>
|
|
<td class="org-left">Convert to an <code>int</code> array</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>to_powers</code></td>
|
|
<td class="org-left">Convert to an <a href="#org6b9eac3"><code>Powers.t</code></a> array</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>to_string</code></td>
|
|
<td class="org-left">Pretty printing</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org1dd6a39" class="outline-3">
|
|
<h3 id="org1dd6a39"><span class="section-number-3">14.3</span> Functions for hash tables</h3>
|
|
<div class="outline-text-3" id="text-14-3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">hash</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> int
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">equal</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> bool
|
|
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">compare</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> int
|
|
</pre>
|
|
</div>
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left"><code>hash</code></td>
|
|
<td class="org-left">Associates a nonnegative integer to any Zkey</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>equal</code></td>
|
|
<td class="org-left">The equal function. True if two Zkeys are equal</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="org-left"><code>compare</code></td>
|
|
<td class="org-left">Comparison function, used for sorting</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge7a2dcb" class="outline-3">
|
|
<h3 id="orge7a2dcb"><span class="section-number-3">14.4</span> Printers</h3>
|
|
<div class="outline-text-3" id="text-14-4">
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-></span> t <span class="org-tuareg-font-lock-operator">-></span> unit
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge568969" class="outline-2">
|
|
<h2 id="orge568969"><span class="section-number-2">15</span> Zmap</h2>
|
|
<div class="outline-text-2" id="text-15">
|
|
<p>
|
|
A hash table where the keys are <code>Zkey</code>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-orgc343c38" class="outline-3">
|
|
<h3 id="orgc343c38"><span class="section-number-3">15.1</span> Type</h3>
|
|
<div class="outline-text-3" id="text-15-1">
|
|
<p>
|
|
<a id="org08a9aa7"><code>Zmap.t</code></a>
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">include</span> <span class="org-tuareg-font-lock-governing">module type of</span> <span class="org-tuareg-font-lock-module">Hashtbl.Make</span><span class="org-tuareg-font-lock-operator">(</span><span class="org-tuareg-font-lock-constructor">Zkey</span><span class="org-tuareg-font-lock-operator">)</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="postamble" class="status">
|
|
<p class="author">Author: Anthony Scemama</p>
|
|
<p class="date">Created: 2023-06-16 Fri 18:16</p>
|
|
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
|
|
</div>
|
|
</body>
|
|
</html>
|