Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 14f9d1392cdb31b82b42df8a6fcda1e4 > files > 43

ocaml-res-devel-3.2.0-1mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="next" href="Res.BitDefStrat.html">
<link rel="Up" href="Res.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Strat" rel="Chapter" href="Strat.html">
<link title="Pres_intf" rel="Chapter" href="Pres_intf.html">
<link title="Nopres_intf" rel="Chapter" href="Nopres_intf.html">
<link title="Weak_intf" rel="Chapter" href="Weak_intf.html">
<link title="Res" rel="Chapter" href="Res.html"><title>Res.DefStrat</title>
</head>
<body>
<div class="navbar">&nbsp;<a href="Res.html">Up</a>
&nbsp;<a href="Res.BitDefStrat.html">Next</a>
</div>
<center><h1>Module <a href="type_Res.DefStrat.html">Res.DefStrat</a></h1></center>
<br>
<pre><span class="keyword">module</span> DefStrat: <code class="type"><a href="Strat.T.html">Strat.T</a></code><code class="type">  with type t = float * float * int</code></pre>Default strategy for resizable datastructures
<p>
<code class="code">type t</code> is a triple <code class="code">waste, shrink_trig, min_size</code>, where
    <code class="code">waste</code> (default: 1.5) indicates by how much the array should
    be grown in excess when reallocation is triggered, <code class="code">shrink_trig</code>
    (default: 0.5) at which percentage of excess elements it should be
    shrinked and <code class="code">min_size</code> (default: 16 elements) is the minimum size
    of the resizable array.<br>
<hr width="100%">
<pre><span class="keyword">type</span> <a name="TYPEt"></a><code class="type"></code>t </pre>
<div class="info">
The abstract type of strategies.<br>
</div>

<pre><span class="keyword">val</span> <a name="VALdefault"></a>default : <code class="type"><a href="Strat.T.html#TYPEt">t</a></code></pre><div class="info">
Default strategy of this strategy implementation.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALgrow"></a>grow : <code class="type"><a href="Strat.T.html#TYPEt">t</a> -> int -> int</code></pre><div class="info">
<code class="code">grow strat new_len</code><br>
<b>Returns</b> the new real length of some contiguous
      datastructure using strategy <code class="code">strat</code> given new virtual length
      <code class="code">new_len</code>.  The user should then use this new real length to resize
      the datastructure.
<p>

      Be careful, the new (real) length <b>must</b> be larger than the new
      virtual length, otherwise your program will crash!<br>
</div>
<pre><span class="keyword">val</span> <a name="VALshrink"></a>shrink : <code class="type"><a href="Strat.T.html#TYPEt">t</a> -> real_len:int -> new_len:int -> int</code></pre><div class="info">
<code class="code">shrink strat ~real_len ~new_len</code><br>
<b>Returns</b> the new real length
      of a resizable datastructure given its current real length
      <code class="code">real_len</code> and its required new virtual length <code class="code">new_len</code>
      wrt. strategy <code class="code">strat</code>.  The user should then use this new real
      length to resize the datastructure.  If <code class="code">-1</code> is returned, it is
      not necessary to resize.
<p>

      Be careful, the new (real) length <b>must</b> be larger than the new
      (virtual) length, otherwise your program may crash!<br>
</div>
</body></html>