463 lines
No EOL
20 KiB
HTML
463 lines
No EOL
20 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>set_amap_t – 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">
|
|
<div class="row">
|
|
<h1>set_amap_t
|
|
<small>Subroutine</small>
|
|
|
|
</h1>
|
|
<div class="row" id="info-bar">
|
|
<div class="col-lg-12">
|
|
<div class="well well-sm">
|
|
<ul class="list-inline" style="margin-bottom:0px;display:inline">
|
|
|
|
<li id="statements"><i class="fa fa-list-ol"></i>
|
|
<a data-toggle="tooltip"
|
|
data-placement="bottom" data-html="true"
|
|
title=" 0.2% of total for procedures.">26 statements</a>
|
|
</li>
|
|
|
|
<li id="source-file">
|
|
<i class="fa fa-code"></i>
|
|
<a href="../src/amap.f90"> Source File</a>
|
|
</li>
|
|
</ul>
|
|
<ol class="breadcrumb in-well text-right">
|
|
<li><a href='../sourcefile/amap.f90.html'>amap.f90</a></li>
|
|
<li><a href='../module/amap.html'>amap</a></li>
|
|
<li class="active">set_amap_t</li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
$(function () {
|
|
$('[data-toggle="tooltip"]').tooltip()
|
|
})
|
|
</script>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-3 hidden-xs hidden-sm visible-md visible-lg">
|
|
<div id="sidebar">
|
|
<h3>Contents</h3>
|
|
|
|
<div class="panel panel-primary">
|
|
<div class="panel-heading text-left">
|
|
<h3 class="panel-title">
|
|
<a data-toggle="collapse" href="#vars-0">Variables</a>
|
|
</h3>
|
|
</div>
|
|
<div id="vars-0" class="panel-collapse collapse">
|
|
<div class="list-group">
|
|
<a class="list-group-item" href="../proc/set_amap_t.html#variable-idx~4">idx</a>
|
|
<a class="list-group-item" href="../proc/set_amap_t.html#variable-k~7">k</a>
|
|
<a class="list-group-item" href="../proc/set_amap_t.html#variable-tmp_pairs">tmp_pairs</a>
|
|
<a class="list-group-item" href="../proc/set_amap_t.html#variable-v~3">v</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="panel panel-primary">
|
|
<div class="panel-heading text-left"><h3 class="panel-title">Source Code</h3></div>
|
|
<div class="list-group">
|
|
<a class="list-group-item" href="../proc/set_amap_t.html#src">set_amap_t</a>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-9" id='text'>
|
|
<h2>public subroutine set_amap_t(this, kv, vv)
|
|
</h2>
|
|
|
|
|
|
|
|
<h3>Arguments</h3>
|
|
<table class="table table-striped varlist">
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Intent</th><th>Optional</th> <th>Attributes</th>
|
|
<th></th>
|
|
<th>Name</th>
|
|
<th></th>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<span class="anchor" id="variable-this~16"></span>
|
|
class(<a href='../type/amap_t.html'>amap_t</a>),
|
|
</td>
|
|
<td>intent(inout)</td>
|
|
<td></td> <td>
|
|
|
|
</td>
|
|
<td>::</td>
|
|
<td><strong>this</strong></td>
|
|
<td>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="anchor" id="variable-kv~4"></span>
|
|
character(len=*),
|
|
</td>
|
|
<td>intent(in)</td>
|
|
<td></td> <td>
|
|
|
|
</td>
|
|
<td>::</td>
|
|
<td><strong>kv</strong></td>
|
|
<td>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="anchor" id="variable-vv"></span>
|
|
real(kind=8),
|
|
</td>
|
|
<td>intent(in)</td>
|
|
<td></td> <td>
|
|
|
|
</td>
|
|
<td>::</td>
|
|
<td><strong>vv</strong></td>
|
|
<td>
|
|
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
<section class="visible-xs visible-sm hidden-md">
|
|
<h3>Contents</h3>
|
|
|
|
<div class="panel panel-primary">
|
|
<div class="panel-heading text-left">
|
|
<h3 class="panel-title">
|
|
<a data-toggle="collapse" href="#vars-1">Variables</a>
|
|
</h3>
|
|
</div>
|
|
<div id="vars-1" class="panel-collapse collapse">
|
|
<div class="list-group">
|
|
<a class="list-group-item" href="../proc/set_amap_t.html#variable-idx~4">idx</a>
|
|
<a class="list-group-item" href="../proc/set_amap_t.html#variable-k~7">k</a>
|
|
<a class="list-group-item" href="../proc/set_amap_t.html#variable-tmp_pairs">tmp_pairs</a>
|
|
<a class="list-group-item" href="../proc/set_amap_t.html#variable-v~3">v</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="panel panel-primary">
|
|
<div class="panel-heading text-left"><h3 class="panel-title">Source Code</h3></div>
|
|
<div class="list-group">
|
|
<a class="list-group-item" href="../proc/set_amap_t.html#src">set_amap_t</a>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</section>
|
|
<br class="visible-xs visible-sm hidden-md">
|
|
|
|
|
|
<section>
|
|
<h2>Variables</h2>
|
|
<table class="table table-striped varlist">
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Visibility</th> <th>Attributes</th>
|
|
<th></th>
|
|
<th>Name</th>
|
|
<th></th><th>Initial</th> <th></th>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<span class="anchor" id="variable-idx~4"></span>
|
|
integer,
|
|
</td>
|
|
<td>public</td>
|
|
<td>
|
|
|
|
</td>
|
|
<td>::</td>
|
|
<td><strong>idx</strong></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="anchor" id="variable-k~7"></span>
|
|
type(<a href='../type/key_t.html'>key_t</a>),
|
|
</td>
|
|
<td>public</td>
|
|
<td>
|
|
|
|
</td>
|
|
<td>::</td>
|
|
<td><strong>k</strong></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="anchor" id="variable-tmp_pairs"></span>
|
|
type(<a href='../type/pair_t.html'>pair_t</a>),
|
|
</td>
|
|
<td>public,</td>
|
|
<td>
|
|
allocatable
|
|
</td>
|
|
<td>::</td>
|
|
<td><strong>tmp_pairs</strong>(:)</td>
|
|
<td></td>
|
|
<td></td>
|
|
<td>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="anchor" id="variable-v~3"></span>
|
|
type(<a href='../type/value_t.html'>value_t</a>),
|
|
</td>
|
|
<td>public</td>
|
|
<td>
|
|
|
|
</td>
|
|
<td>::</td>
|
|
<td><strong>v</strong></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td>
|
|
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
</section>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<section>
|
|
<h2><span class="anchor" id="src"></span>Source Code</h2>
|
|
<div class="highlight"><pre><span></span><span class="w"> </span><span class="k">subroutine </span><span class="n">set_amap_t</span><span class="p">(</span><span class="n">this</span><span class="p">,</span><span class="n">kv</span><span class="p">,</span><span class="n">vv</span><span class="p">)</span><span class="w"></span>
|
|
<span class="w"> </span><span class="k">class</span><span class="p">(</span><span class="n">amap_t</span><span class="p">),</span><span class="w"> </span><span class="k">intent</span><span class="p">(</span><span class="n">inout</span><span class="p">)</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">this</span><span class="w"></span>
|
|
<span class="w"> </span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">),</span><span class="w"> </span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">kv</span><span class="w"></span>
|
|
<span class="w"> </span><span class="kt">real</span><span class="p">(</span><span class="mi">8</span><span class="p">),</span><span class="w"> </span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">vv</span><span class="w"></span>
|
|
<span class="w"> </span><span class="k">type</span><span class="p">(</span><span class="n">pair_t</span><span class="p">),</span><span class="w"> </span><span class="k">allocatable</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">tmp_pairs</span><span class="p">(:)</span><span class="w"></span>
|
|
<span class="w"> </span><span class="k">type</span><span class="p">(</span><span class="n">key_t</span><span class="p">)</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">k</span><span class="w"></span>
|
|
<span class="w"> </span><span class="k">type</span><span class="p">(</span><span class="n">value_t</span><span class="p">)</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">v</span><span class="w"></span>
|
|
<span class="w"> </span><span class="kt">integer</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">idx</span><span class="w"></span>
|
|
<span class="w"> </span>
|
|
<span class="w"> </span><span class="n">k</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">kv</span><span class="w"></span>
|
|
<span class="w"> </span><span class="n">v</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">vv</span><span class="w"></span>
|
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(.</span><span class="nb">not</span><span class="p">.</span><span class="w"> </span><span class="nb">allocated</span><span class="p">(</span><span class="n">this</span><span class="p">%</span><span class="n">pairs</span><span class="p">))</span><span class="w"> </span><span class="k">then</span>
|
|
<span class="k"> allocate</span><span class="p">(</span><span class="n">this</span><span class="p">%</span><span class="n">pairs</span><span class="p">(</span><span class="n">this</span><span class="p">%</span><span class="n">extent</span><span class="p">))</span><span class="w"></span>
|
|
<span class="w"> </span><span class="k">end if </span>
|
|
<span class="k"> </span>
|
|
<span class="k"> </span><span class="n">idx</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">this</span><span class="p">%</span><span class="n">find</span><span class="p">(</span><span class="n">k</span><span class="p">)</span><span class="w"></span>
|
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">idx</span><span class="w"> </span><span class="o">></span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
|
|
<span class="k"> </span><span class="n">this</span><span class="p">%</span><span class="n">pairs</span><span class="p">(</span><span class="n">idx</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">pair_t</span><span class="p">(</span><span class="n">k</span><span class="p">,</span><span class="n">v</span><span class="p">)</span><span class="w"></span>
|
|
<span class="w"> </span><span class="k">return</span>
|
|
<span class="k"> end if</span>
|
|
<span class="k"> </span>
|
|
<span class="k"> if</span><span class="w"> </span><span class="p">(</span><span class="n">this</span><span class="p">%</span><span class="n">high_water</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">size</span><span class="p">(</span><span class="n">this</span><span class="p">%</span><span class="n">pairs</span><span class="p">))</span><span class="w"> </span><span class="k">then</span>
|
|
<span class="k"> allocate</span><span class="p">(</span><span class="n">tmp_pairs</span><span class="p">(</span><span class="n">size</span><span class="p">(</span><span class="n">this</span><span class="p">%</span><span class="n">pairs</span><span class="p">)</span><span class="o">+</span><span class="n">this</span><span class="p">%</span><span class="n">extent</span><span class="p">))</span><span class="w"></span>
|
|
<span class="w"> </span><span class="n">tmp_pairs</span><span class="p">(</span><span class="mi">1</span><span class="p">:</span><span class="n">this</span><span class="p">%</span><span class="n">high_water</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">this</span><span class="p">%</span><span class="n">pairs</span><span class="w"></span>
|
|
<span class="w"> </span><span class="k">call </span><span class="nb">move_alloc</span><span class="p">(</span><span class="n">tmp_pairs</span><span class="p">,</span><span class="w"> </span><span class="n">this</span><span class="p">%</span><span class="n">pairs</span><span class="p">)</span><span class="w"></span>
|
|
<span class="w"> </span><span class="k">end if</span>
|
|
<span class="k"> </span><span class="n">this</span><span class="p">%</span><span class="n">high_water</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">this</span><span class="p">%</span><span class="n">high_water</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">1</span><span class="w"></span>
|
|
<span class="w"> </span><span class="n">this</span><span class="p">%</span><span class="n">pairs</span><span class="p">(</span><span class="n">this</span><span class="p">%</span><span class="n">high_water</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">pair_t</span><span class="p">(</span><span class="n">k</span><span class="p">,</span><span class="n">v</span><span class="p">)</span><span class="w"></span>
|
|
<span class="w"> </span>
|
|
<span class="w"> </span><span class="k">end subroutine </span><span class="n">set_amap_t</span><span class="w"></span>
|
|
</pre></div>
|
|
|
|
</section>
|
|
<br>
|
|
|
|
</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>© 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> |