hp/docs/fpm-ford/index.html
2023-06-09 19:14:39 -04:00

247 lines
No EOL
21 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="RPN calculator in modern Fortran">
<meta name="author" content="sgeard" >
<link rel="icon" href="./favicon.png">
<title> hp </title>
<link href="./css/bootstrap.min.css" rel="stylesheet">
<link href="./css/pygments.css" rel="stylesheet">
<link href="./css/font-awesome.min.css" rel="stylesheet">
<link href="./css/local.css" rel="stylesheet">
<link href="./tipuesearch/tipuesearch.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script src="./js/jquery-2.1.3.min.js"></script>
<script src="./js/svg-pan-zoom.min.js"></script>
</head>
<body>
<!-- Fixed navbar -->
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="./index.html">hp </a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="dropdown hidden-xs visible-sm visible-md hidden-lg">
<a href="#" class="dropdown-toggle"
data-toggle="dropdown" role="button"
aria-haspopup="true"
aria-expanded="false">Contents <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="./lists/files.html">Source Files</a></li>
<li><a href="./lists/modules.html">Modules</a></li>
<li><a href="./lists/procedures.html">Procedures</a></li>
<li><a href="./lists/absint.html">Abstract Interfaces</a></li>
<li><a href="./lists/types.html">Derived Types</a></li>
<li><a href="./lists/programs.html">Programs</a></li>
</ul>
</li>
<li class="visible-xs hidden-sm visible-lg"><a href="./lists/files.html">Source Files</a></li>
<li class="visible-xs hidden-sm visible-lg"><a href="./lists/modules.html">Modules</a></li>
<li class="visible-xs hidden-sm visible-lg"><a href="./lists/procedures.html">Procedures</a></li>
<li class="visible-xs hidden-sm visible-lg"><a href="./lists/absint.html">Abstract Interfaces</a></li>
<li class="visible-xs hidden-sm visible-lg"><a href="./lists/types.html">Derived Types</a></li>
<li class="visible-xs hidden-sm visible-lg"><a href="./lists/programs.html">Programs</a></li>
</ul>
<form action="./search.html" class="navbar-form navbar-right" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search" name="q" id="tipue_search_input" autocomplete="off" required>
</div>
<!--
<button type="submit" class="btn btn-default">Submit</button>
-->
</form>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container">
<!-- Main component for a primary marketing message or call to action -->
<div class="jumbotron">
<p>RPN calculator in modern Fortran</p>
<p> Find us on&hellip;</p>
<p>
<a class="btn btn-lg btn-primary" href="https://github.com/sgeard/hp" role="button">GitHub</a>
</p>
</div>
<div class="row" id='text'>
<div class="col-md-8">
<h1>hp</h1>
<h1>favicon: docs/images/favicon.ico</h1>
<p>print_creation_date: true
extra_mods: iso_fortran_env:https://gcc.gnu.org/onlinedocs/gfortran/ISO_005fFORTRAN_005fENV.html
tomlf:https://toml-f.github.io/toml-f
creation_date: %Y-%m-%d %H:%M %z
md_extensions: markdown.extensions.toc
markdown.extensions.smarty</p>
<hr>
<h1>hp</h1>
<h2>Command-line calculator</h2>
<p>This is an <em>rpn</em> calclulator with a maximum stack size of 5. It has full support for real and complex numbers
and will calculate summary statistics for a set of reals of real pairs. Spaces are important since they are used
to distinguish tokens.</p>
<h2>Building</h2>
<p>The source code is written in <em>Fortran</em>. The only compilers I've found that will build it are <em>ifort</em> and <em>ifx</em> from Intel's
OneApi suite. Makefiles are provides for GNU make (Linux) and nmake (Windows).</p>
<div class="codehilite"><pre><span></span><code><span class="n">hp</span><span class="w"> </span><span class="o">-</span><span class="n">h</span><span class="w"></span>
<span class="n">Command</span><span class="w"> </span><span class="n">Calculator</span><span class="w"></span>
<span class="o">==================</span><span class="w"></span>
<span class="n">Introduction</span><span class="w"></span>
<span class="o">------------</span><span class="w"></span>
<span class="n">This</span><span class="w"> </span><span class="n">is</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">command</span><span class="o">-</span><span class="n">line</span><span class="w"> </span><span class="n">calculator</span><span class="p">.</span><span class="w"> </span><span class="n">It</span><span class="w"> </span><span class="n">supports</span><span class="w"> </span><span class="n">both</span><span class="w"> </span><span class="kt">real</span><span class="w"> </span><span class="kr">and</span><span class="w"> </span><span class="n">complex</span><span class="w"> </span><span class="n">modes</span><span class="p">,</span><span class="w"> </span><span class="kr">as</span><span class="w"> </span><span class="n">well</span><span class="w"></span>
<span class="kr">as</span><span class="w"> </span><span class="n">degrees</span><span class="o">/</span><span class="n">radians</span><span class="w"> </span><span class="n">selection</span><span class="w"> </span><span class="kr">and</span><span class="w"> </span><span class="n">precision</span><span class="w"> </span><span class="n">control</span><span class="p">.</span><span class="w"> </span><span class="n">It</span><span class="w"> </span><span class="n">can</span><span class="w"> </span><span class="n">be</span><span class="w"> </span><span class="n">run</span><span class="w"> </span><span class="n">interactively</span><span class="w"> </span><span class="kr">or</span><span class="w"> </span><span class="kr">as</span><span class="w"> </span><span class="n">an</span><span class="w"></span>
<span class="n">expression</span><span class="w"> </span><span class="n">parser</span><span class="p">.</span><span class="w"> </span><span class="n">This</span><span class="w"> </span><span class="n">help</span><span class="w"> </span><span class="n">is</span><span class="w"> </span><span class="n">deliberately</span><span class="w"> </span><span class="n">terse</span><span class="w"> </span><span class="n">to</span><span class="w"> </span><span class="n">encourage</span><span class="w"> </span><span class="n">exploration</span><span class="p">.</span><span class="w"></span>
<span class="o">-------------------------------------------------------------------------------</span><span class="w"></span>
<span class="n">Operators</span><span class="o">:</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="o">^</span><span class="w"> </span><span class="o">^/</span><span class="n">x</span><span class="w"> </span><span class="o">^</span><span class="n">x</span><span class="w"> </span><span class="o">^</span><span class="mi">2</span><span class="w"> </span><span class="o">^/</span><span class="mi">2</span><span class="w"> </span><span class="o">^</span><span class="mi">3</span><span class="w"> </span><span class="o">^/</span><span class="mi">3</span><span class="w"> </span><span class="o">^*</span><span class="mi">2</span><span class="w"> </span><span class="o">^*</span><span class="mi">10</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="o">!</span><span class="w"> </span><span class="o">%</span><span class="w"></span>
<span class="n">Constants</span><span class="o">:</span><span class="w"> </span><span class="n">pi</span><span class="w"> </span><span class="n">e</span><span class="w"> </span><span class="n">g</span><span class="w"> </span><span class="n">G</span><span class="w"> </span><span class="n">c</span><span class="w"> </span><span class="n">two_pi</span><span class="w"> </span><span class="n">pi_over_2</span><span class="w"></span>
<span class="n">Functions</span><span class="o">:</span><span class="w"> </span><span class="nf">sin</span><span class="w"> </span><span class="nf">cos</span><span class="w"> </span><span class="nf">tan</span><span class="w"> </span><span class="nf">asin</span><span class="w"> </span><span class="nf">acos</span><span class="w"> </span><span class="nf">atan</span><span class="w"> </span><span class="nf">sinh</span><span class="w"> </span><span class="nf">cosh</span><span class="w"> </span><span class="nf">tanh</span><span class="w"> </span><span class="n">log2</span><span class="w"> </span><span class="nf">log</span><span class="w"> </span><span class="n">lg</span><span class="w"> </span><span class="n">len</span><span class="w"> </span><span class="n">sq</span><span class="w"> </span><span class="nf">sqrt</span><span class="w"> </span><span class="n">cb</span><span class="w"> </span><span class="n">cbrt</span><span class="w"></span>
<span class="w"> </span><span class="n">alog2</span><span class="w"> </span><span class="n">alog</span><span class="w"> </span><span class="n">alog10</span><span class="w"> </span><span class="n">gamma</span><span class="w"> </span><span class="n">ncr</span><span class="w"> </span><span class="n">npr</span><span class="w"> </span><span class="n">rem</span><span class="w"> </span><span class="n">int</span><span class="w"> </span><span class="n">nint</span><span class="w"></span>
<span class="w"> </span><span class="n">Controls</span><span class="o">:</span><span class="w"> </span><span class="n">fix</span><span class="p">[</span><span class="mi">0</span><span class="o">-</span><span class="mi">9</span><span class="p">]</span><span class="w"> </span><span class="n">clx</span><span class="w"> </span><span class="n">cl</span><span class="w"> </span><span class="n">cla</span><span class="w"> </span>
<span class="w"> </span><span class="n">Modes</span><span class="o">:</span><span class="w"> </span><span class="kt">real</span><span class="w"> </span><span class="n">complex</span><span class="w"> </span><span class="n">verbose</span><span class="w"> </span><span class="n">terse</span><span class="w"> </span><span class="n">degrees</span><span class="w"> </span><span class="n">radians</span><span class="w"></span>
<span class="w"> </span><span class="n">Memories</span><span class="o">:</span><span class="w"> </span><span class="n">n</span><span class="o">=</span><span class="mf">0.</span><span class="p">.</span><span class="mf">.9</span><span class="w"> </span><span class="n">st</span><span class="o">&lt;</span><span class="n">n</span><span class="o">&gt;</span><span class="w"> </span><span class="n">sw</span><span class="o">&lt;</span><span class="n">n</span><span class="o">&gt;</span><span class="w"> </span><span class="n">rc</span><span class="o">&lt;</span><span class="n">n</span><span class="o">&gt;</span><span class="w"> </span><span class="n">cl</span><span class="o">&lt;</span><span class="n">n</span><span class="o">&gt;</span><span class="w"> </span><span class="n">m</span><span class="o">&lt;</span><span class="n">n</span><span class="o">&gt;+</span><span class="w"> </span><span class="n">m</span><span class="o">&lt;</span><span class="n">n</span><span class="o">&gt;-</span><span class="w"> </span><span class="n">m</span><span class="o">&lt;</span><span class="n">n</span><span class="o">&gt;*</span><span class="w"> </span><span class="n">m</span><span class="o">&lt;</span><span class="n">n</span><span class="o">&gt;/</span><span class="w"> </span><span class="n">msh</span><span class="w"></span>
<span class="w"> </span><span class="n">Complex</span><span class="o">:</span><span class="w"> </span><span class="n">ri</span><span class="w"> </span><span class="n">_</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="n">to_pol</span><span class="w"> </span><span class="n">to_cart</span><span class="w"></span>
<span class="w"> </span><span class="n">Actions</span><span class="o">:</span><span class="w"> </span><span class="mi">1</span><span class="o">/</span><span class="w"> </span><span class="o">--</span><span class="w"> </span><span class="n">R</span><span class="w"> </span><span class="n">r</span><span class="w"> </span><span class="o">?</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">split</span><span class="w"> </span><span class="n">drop</span><span class="w"></span>
<span class="w"> </span><span class="n">Stats</span><span class="o">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">x1</span><span class="w"> </span><span class="n">x2</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">x1</span><span class="p">,</span><span class="n">y1</span><span class="w"> </span><span class="n">x2</span><span class="p">,</span><span class="n">y2</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w"> </span><span class="n">n</span><span class="w"> </span><span class="n">ux</span><span class="w"> </span><span class="n">sx</span><span class="w"> </span><span class="n">mx</span><span class="w"> </span><span class="n">lqx</span><span class="w"> </span><span class="n">uqx</span><span class="w"> </span><span class="n">uy</span><span class="w"> </span><span class="n">sy</span><span class="w"> </span><span class="n">my</span><span class="w"> </span><span class="n">lqy</span><span class="w"> </span><span class="n">uqy</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">b</span><span class="w"> </span><span class="n">cov</span><span class="w"> </span><span class="n">corr</span><span class="w"></span>
<span class="w"> </span><span class="n">Quits</span><span class="o">:</span><span class="w"> </span><span class="n">q</span><span class="w"></span>
<span class="o">-------------------------------------------------------------------------------</span><span class="w"></span>
<span class="n">Examples</span><span class="w"></span>
<span class="o">--------</span><span class="w"></span>
<span class="w"> </span><span class="n">hp</span><span class="w"> </span><span class="s">&quot;fix2 18 2 - 8 2 / * =&quot;</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="mf">64.00</span><span class="w"></span>
<span class="w"> </span><span class="n">hp</span><span class="w"> </span><span class="s">&quot;2 -- complex sqrt =&quot;</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="p">(</span><span class="mf">0.00000</span><span class="p">,</span><span class="o">-</span><span class="mf">1.414214</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">hp</span><span class="w"> </span><span class="o">-</span><span class="n">c</span><span class="w"> </span><span class="s">&quot;radians (1,pi_over_2)p ^ * degrees =&quot;</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="p">(</span><span class="mf">1.000000</span><span class="p">,</span><span class="mf">180.000000</span><span class="p">)</span><span class="w"> </span><span class="n">p</span><span class="w"></span>
</code></pre></div>
</div>
<div class="col-md-4">
<div class="well">
<h2>Developer Info</h2>
<h4>sgeard</h4>
<div class="text-center"><div class="btn-group" role="group">
<a class="btn btn-lg btn-primary" href="https://github.com/sgeard/hp"><i class="fa fa-github fa-lg"></i></a>
</div></div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-3">
<h3>Source Files</h3>
<ul> <li><a href='./sourcefile/amap.f90.html'>amap.f90</a></li>
<li><a href='./sourcefile/linked_list.f90.html'>linked_list.f90</a></li>
<li><a href='./sourcefile/main.f90.html'>main.f90</a></li>
<li><a href='./sourcefile/rpn_stack.f90.html'>rpn_stack.f90</a></li>
<li><a href='./sourcefile/rpn_stack_sm.f90.html'>rpn_stack_sm.f90</a></li>
<li><a href='./sourcefile/test_amap.f90.html'>test_amap.f90</a></li>
</ul>
</div>
<div class="col-xs-6 col-sm-3">
<h3>Modules</h3>
<ul> <li><a href='./module/amap.html'>amap</a></li>
<li><a href='./module/linked_list.html'>linked_list</a></li>
<li><a href='./module/rpn_stack.html'>rpn_stack</a></li>
</ul>
</div>
<div class="col-xs-6 col-sm-3">
<h3>Procedures</h3>
<ul> <li><a href='./interface/acosine_fr.html'>acosine_fr</a></li>
<li><a href='./interface/add_fr.html'>add_fr</a></li>
<li><a href='./interface/add_rpns.html'>add_rpns</a></li>
<li><a href='./interface/ahcosine_fr.html'>ahcosine_fr</a></li>
<li><a href='./interface/ahsine_fr.html'>ahsine_fr</a></li>
<li><a href='./interface/ahtangent_fr.html'>ahtangent_fr</a></li>
<li><a href='./proc/append.html'>append</a></li>
<li><a href='./proc/apply_command.html'>apply_command</a></li>
<li><a href='./interface/asine_fr.html'>asine_fr</a></li>
<li><a href='./interface/atangent2_fr.html'>atangent2_fr</a></li>
</ul>
</div>
<div class="col-xs-6 col-sm-3">
<h3>Derived Types</h3>
<ul> <li><a href='./type/amap_t.html'>amap_t</a></li>
<li><a href='./type/key_t.html'>key_t</a></li>
<li><a href='./type/llist.html'>llist</a></li>
<li><a href='./type/llist_node.html'>llist_node</a></li>
<li><a href='./type/pair_t.html'>pair_t</a></li>
<li><a href='./type/rpn_t.html'>rpn_t</a></li>
<li><a href='./type/stack_t.html'>stack_t</a></li>
<li><a href='./type/value_t.html'>value_t</a></li>
</ul>
</div>
</div>
<hr>
</div> <!-- /container -->
<footer>
<div class="container">
<div class="row">
<div class="col-xs-6 col-md-6"><p>hp was developed by sgeard<br>&copy; 2023
</p>
</div>
<div class="col-xs-6 col-md-6">
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
</p>
</div>
</div>
<br>
</div> <!-- /container -->
</footer>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<!--
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
-->
<script src="./js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="./js/ie10-viewport-bug-workaround.js"></script>
<!-- MathJax JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: { extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: { autoNumber: 'AMS' } },
jax: ['input/TeX','input/MathML','output/HTML-CSS'],
extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']
});
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="./tipuesearch/tipuesearch_content.js"></script>
<script src="./tipuesearch/tipuesearch_set.js"></script>
<script src="./tipuesearch/tipuesearch.js"></script>
</body>
</html>