Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/toolsforhomalg/doc/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 2.4.2025 mit Größe 12 kB image not shown  

Quelle  chap1.html   Sprache: HTML

 
 products/Sources/formale Sprachen/GAP/pkg/toolsforhomalg/doc/chap1.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" xml:lang="en">
<head>
<title>GAP (ToolsForHomalg) - Chapter 1: Caches</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript"></script>
<script type="text/javascript">overwriteStyle();</script>
</head>
<body class="chap1"  onload="jscontent()">


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chapInd.html">Ind</a>  </div>

<div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a>   <a href="chap0.html#contents">[Contents]</a>    <a href="chap0.html">[Previous Chapter]</a>    <a href="chap2.html">[Next Chapter]</a>   </div>

<p id="mathjaxlink" class="pcenter"><a href="chap1_mj.html">[MathJax on]</a></p>
<p><a id="X7A42AF337F0F3EAE" name="X7A42AF337F0F3EAE"></a></p>
<div class="ChapSects"><a href="chap1.html#X7A42AF337F0F3EAE">1 <span class="Heading">Caches</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap1.html#X824C0CC579E8DD7F">1.1 <span class="Heading">Object constructors</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X7E14EE657C553EDB">1.1-1 CachingObject</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X85F7EEE385E58EBB">1.1-2 CachingObject</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap1.html#X7F4F8C2380D95C03">1.2 <span class="Heading">Setters, getters</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X7FA41BDA822790B2">1.2-1 CacheValue</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X81D3DA3881F54824">1.2-2 SetCacheValue</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X828F425478CE6FF1">1.2-3 IsEqualForCache</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap1.html#X7CAF0DB27B3836F9">1.3 <span class="Heading">Managing functions</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X7E2443877886AEFD">1.3-1 SetCachingObjectCrisp</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X7E1E50AD7FE9BE4D">1.3-2 SetCachingObjectWeak</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X7B68A31E806C85A2">1.3-3 DeactivateCachingObject</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap1.html#X8791224B7C97F0CF">1.4 <span class="Heading">Install functions</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X7CC147407A5963AF">1.4-1 InstallMethodWithCache</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X867A71918020901E">1.4-2 InstallMethodWithCrispCache</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X7B148C2280708F41">1.4-3 InstallMethodWithCacheFromObject</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X8154383B83B3A992">1.4-4 FunctionWithCache</a></span>
</div></div>
</div>

<h3>1 <span class="Heading">Caches</span></h3>

<p><a id="X824C0CC579E8DD7F" name="X824C0CC579E8DD7F"></a></p>

<h4>1.1 <span class="Heading">Object constructors</span></h4>

<p>Caches are objects which store for a fixed number of keys a value, so they are a map Obj^k -> Obj, while the k is fixed. A cache ususally stores the result in a weak pointer list, which means that if the value which the cache should store is not referenced in the system anymore, it will not be remembered by the cache. However, caches can be set to store the value permanently (crisp), or not to store any new value at all (inaktive). In that case, already stored values are still in the cache and can be accessed once the cache is set active again.</p>

<p><a id="X7E14EE657C553EDB" name="X7E14EE657C553EDB"></a></p>

<h5>1.1-1 CachingObject</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CachingObject</code>( [<var class="Arg">k</var>][,] [<var class="Arg">is_crisp</var>] )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CachingObject</code>( <var class="Arg">arg</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CachingObject</code>( <var class="Arg">arg1</var>, <var class="Arg">arg2</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: a cache</p>

<p>If no argument is given, the function returns a weak cache with key length one, if an integer k is given, a weak cache with key length k, and if the bool is_crisp is true, a crisp cache with the corresponding length.</p>

<p><a id="X85F7EEE385E58EBB" name="X85F7EEE385E58EBB"></a></p>

<h5>1.1-2 CachingObject</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CachingObject</code>( <var class="Arg">object</var>, <var class="Arg">cache_name</var>, <var class="Arg">length</var>[, <var class="Arg">is_crisp</var>] )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CachingObject</code>( <var class="Arg">arg1</var>, <var class="Arg">arg2</var>, <var class="Arg">arg3</var>, <var class="Arg">arg4</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>This methods are not installed, they serve as an interface for InstallMethodWithCacheFromObject.</p>

<p><a id="X7F4F8C2380D95C03" name="X7F4F8C2380D95C03"></a></p>

<h4>1.2 <span class="Heading">Setters, getters</span></h4>

<p><a id="X7FA41BDA822790B2" name="X7FA41BDA822790B2"></a></p>

<h5>1.2-1 CacheValue</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CacheValue</code>( <var class="Arg">cache</var>, <var class="Arg">key</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: stored value</p>

<p>If there is a value stored in the cache for key, which can be a single key for caches with key length one or a list of keys depending on the key length of the cache, this method returns a list only contraining the value, otherwise an empty list.</p>

<p><a id="X81D3DA3881F54824" name="X81D3DA3881F54824"></a></p>

<h5>1.2-2 SetCacheValue</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ SetCacheValue</code>( <var class="Arg">cache</var>, <var class="Arg">key</var>, <var class="Arg">value</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Sets the value of key of the cache to value.</p>

<p><a id="X828F425478CE6FF1" name="X828F425478CE6FF1"></a></p>

<h5>1.2-3 IsEqualForCache</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsEqualForCache</code>( <var class="Arg">obj1</var>, <var class="Arg">obj2</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: true or false</p>

<p>This function is used to compare objects for the caches. The standard way is IsIdenticalObj, and lists are compared recursive with this function. It is possible and recommended to overload this function as needed.</p>

<p><a id="X7CAF0DB27B3836F9" name="X7CAF0DB27B3836F9"></a></p>

<h4>1.3 <span class="Heading">Managing functions</span></h4>

<p><a id="X7E2443877886AEFD" name="X7E2443877886AEFD"></a></p>

<h5>1.3-1 SetCachingObjectCrisp</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ SetCachingObjectCrisp</code>( <var class="Arg">cache</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: nothing</p>

<p>Sets the caching to crisp, weak, or deativates the cache completely.</p>

<p><a id="X7E1E50AD7FE9BE4D" name="X7E1E50AD7FE9BE4D"></a></p>

<h5>1.3-2 SetCachingObjectWeak</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ SetCachingObjectWeak</code>( <var class="Arg">arg</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><a id="X7B68A31E806C85A2" name="X7B68A31E806C85A2"></a></p>

<h5>1.3-3 DeactivateCachingObject</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DeactivateCachingObject</code>( <var class="Arg">arg</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><a id="X8791224B7C97F0CF" name="X8791224B7C97F0CF"></a></p>

<h4>1.4 <span class="Heading">Install functions</span></h4>

<p><a id="X7CC147407A5963AF" name="X7CC147407A5963AF"></a></p>

<h5>1.4-1 InstallMethodWithCache</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ InstallMethodWithCache</code>( <var class="Arg">Like</var>, <var class="Arg">InstallMethod</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Installs a method like InstallMethod, but additionally puts a cache layer around it so that the result is cached. It is possible to give the cache as the option Cache, to use the same cache for more than one method or store it somewhere to have access to the cache.</p>

<p><a id="X867A71918020901E" name="X867A71918020901E"></a></p>

<h5>1.4-2 InstallMethodWithCrispCache</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ InstallMethodWithCrispCache</code>( <var class="Arg">arg</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Like InstallMethodWithCache, but with a crisp cache.</p>

<p><a id="X7B148C2280708F41" name="X7B148C2280708F41"></a></p>

<h5>1.4-3 InstallMethodWithCacheFromObject</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ InstallMethodWithCacheFromObject</code>( <var class="Arg">Like</var>, <var class="Arg">InstallMethod</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>This works just like InstallMethodWithCache, but it extracts the cache via the CachingObject method from one of its arguments. The CachingObject must then be implemented for one of the arguments, and the option ArgumentNumber can specify which option to be used. As second argument for CachingObject a string is used, which can identify the cache. Standard is the name of the operation, for which the method is installed, but it can be specified using the CacheName option.</p>

<p><a id="X8154383B83B3A992" name="X8154383B83B3A992"></a></p>

<h5>1.4-4 FunctionWithCache</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FunctionWithCache</code>( <var class="Arg">func</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a function</p>

<p>Creates a cached function out of a given function <var class="Arg">func</var>. If the option Cache is a cache, this cache is used. If the option Cache is the string crisp, a crisp cache is used. All other values for this option lead to a single weak cache.</p>


<div class="chlinkprevnextbot"> <a href="chap0.html">[Top of Book]</a>   <a href="chap0.html#contents">[Contents]</a>    <a href="chap0.html">[Previous Chapter]</a>    <a href="chap2.html">[Next Chapter]</a>   </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chapInd.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>

98%


¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.