Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

563477 views
1
<?xml version="1.0" encoding="UTF-8"?>
2
3
<!-- This is an automatically generated file. -->
4
<Chapter Label="Chapter_Caches">
5
<Heading>Caches</Heading>
6
7
<Section Label="Chapter_Caches_Section_Object_constructors">
8
<Heading>Object constructors</Heading>
9
10
Caches are objects which store for a fixed number of keys
11
a value, so they are a map Obj^k -> Obj, while the k is
12
fixed. A cache ususally stores the result in a weak pointer
13
list, which means that if the value which the cache should store
14
is not referenced in the system anymore, it will not be remembered
15
by the cache. However, caches can be set to store the value permanently (crisp),
16
or not to store any new value at all (inaktive). In that case, already stored values
17
are still in the cache and can be accessed once the cache is set active again.
18
<ManSection Label="AutoDoc_generated_group1">
19
<Oper Arg="[k],[is_crisp]" Name="CachingObject" />
20
<Oper Arg="arg" Name="CachingObject" Label="for IsObject"/>
21
<Oper Arg="arg1,arg2" Name="CachingObject" Label="for IsObject, IsObject"/>
22
<Returns>a cache
23
</Returns>
24
<Description>
25
If no argument is given, the function returns a weak cache with key length one,
26
if an integer k is given, a weak cache with key length k, and if the bool is_crisp
27
is true, a crisp cache with the corresponding length.
28
<P/>
29
</Description>
30
</ManSection>
31
32
33
<P/>
34
<ManSection Label="AutoDoc_generated_group2">
35
<Oper Arg="object, cache_name, length, [is_crisp]" Name="CachingObject" Label="for IsObject, IsObject, IsInt"/>
36
<Oper Arg="arg1,arg2,arg3,arg4" Name="CachingObject" Label="for IsObject, IsObject, IsInt, IsBool"/>
37
<Description>
38
This methods are not installed, they serve as an interface
39
for InstallMethodWithCacheFromObject.
40
<P/>
41
</Description>
42
</ManSection>
43
44
45
<P/>
46
</Section>
47
48
49
<Section Label="Chapter_Caches_Section_Setters_getters">
50
<Heading>Setters, getters</Heading>
51
52
<ManSection>
53
<Oper Arg="cache, key" Name="CacheValue" Label="for IsCachingObject, IsObject"/>
54
<Returns>stored value
55
</Returns>
56
<Description>
57
If there is a value stored in the cache for key, which can be a single key for
58
caches with key length one or a list of keys depending on the key length of the cache,
59
this method returns a list only contraining the value, otherwise an empty list.
60
</Description>
61
</ManSection>
62
63
64
<ManSection>
65
<Oper Arg="cache, key, value" Name="SetCacheValue" Label="for IsCachingObject, IsObject, IsObject"/>
66
<Description>
67
Sets the value of key of the cache to value.
68
</Description>
69
</ManSection>
70
71
72
<ManSection>
73
<Oper Arg="obj1, obj2" Name="IsEqualForCache" Label="for IsObject, IsObject"/>
74
<Returns>true or false
75
</Returns>
76
<Description>
77
This function is used to compare objects for the caches.
78
The standard way is IsIdenticalObj, and lists are compared recursive
79
with this function. It is possible and recommended to overload this function as needed.
80
</Description>
81
</ManSection>
82
83
84
</Section>
85
86
87
<Section Label="Chapter_Caches_Section_Managing_functions">
88
<Heading>Managing functions</Heading>
89
90
<ManSection>
91
<Func Arg="cache" Name="SetCachingObjectCrisp" />
92
<Returns>nothing
93
</Returns>
94
<Description>
95
Sets the caching to crisp, weak, or deativates the cache completely.
96
</Description>
97
</ManSection>
98
99
100
<P/>
101
<ManSection>
102
<Func Arg="arg" Name="SetCachingObjectWeak" />
103
<Description>
104
<P/>
105
</Description>
106
</ManSection>
107
108
109
<P/>
110
<ManSection>
111
<Func Arg="arg" Name="DeactivateCachingObject" />
112
<Description>
113
<P/>
114
</Description>
115
</ManSection>
116
117
118
</Section>
119
120
121
<Section Label="Chapter_Caches_Section_Install_functions">
122
<Heading>Install functions</Heading>
123
124
<ManSection>
125
<Func Arg="Like InstallMethod" Name="InstallMethodWithCache" />
126
<Description>
127
Installs a method like InstallMethod, but additionally puts a cache layer around it
128
so that the result is cached. It is possible to give the cache as the option Cache,
129
to use the same cache for more than one method or store it somewhere to have access to
130
the cache.
131
</Description>
132
</ManSection>
133
134
135
<ManSection>
136
<Func Arg="arg" Name="InstallMethodWithCrispCache" />
137
<Description>
138
Like InstallMethodWithCache, but with a crisp cache.
139
</Description>
140
</ManSection>
141
142
143
<ManSection>
144
<Func Arg="Like InstallMethod" Name="InstallMethodWithCacheFromObject" />
145
<Description>
146
This works just like InstallMethodWithCache, but it extracts
147
the cache via the CachingObject method from one of its arguments.
148
The CachingObject must then be implemented for one of the arguments,
149
and the option ArgumentNumber can specify which option to be used.
150
As second argument for CachingObject a string is used, which can identify
151
the cache. Standard is the name of the operation, for which the method is
152
installed, but it can be specified using the CacheName option.
153
</Description>
154
</ManSection>
155
156
157
<ManSection>
158
<Func Arg="func" Name="FunctionWithCache" />
159
<Returns>a function
160
</Returns>
161
<Description>
162
Creates a cached function out of a given function <A>func</A>.
163
If the option Cache is a cache, this cache is used. If the option
164
Cache is the string crisp, a crisp cache is used. All other values for this option
165
lead to a single weak cache.
166
</Description>
167
</ManSection>
168
169
170
</Section>
171
172
173
</Chapter>
174
175
176