Skip to content

Commit

Permalink
Rename set and reset functions for labels
Browse files Browse the repository at this point in the history
  • Loading branch information
scheinerman committed Feb 7, 2025
1 parent aa10806 commit cea3e10
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Matroids"
uuid = "f99c5f09-8689-4482-a891-4b988ec2fc3d"
authors = ["Ed Scheinerman <[email protected]>"]
version = "0.0.4"
version = "0.0.5"

[deps]

Expand Down
2 changes: 1 addition & 1 deletion docs/build/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.11.3","generation_timestamp":"2025-02-07T10:39:47","documenter_version":"1.8.0"}}
{"documenter":{"julia_version":"1.11.3","generation_timestamp":"2025-02-07T13:39:36","documenter_version":"1.8.0"}}
2 changes: 1 addition & 1 deletion docs/build/design/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
end</code></pre><blockquote><p>It is important that your rank function satisfy the matroid rank axioms or the resulting <code>Matroid</code> will not be a matroid.</p></blockquote><p>Finally, define a function <code>MyMatroid(parameters)</code> that creates the matroid:</p><pre><code class="language-julia hljs">function MyMatroid(parameters)
# create the rank function r and the size of the ground set m from the parameters
return Matroid(m, r)
end</code></pre><p>As an example, look at <code>UniformRankFunction</code> and <code>UniformMatroid</code> in <code>src/RankFunctions.jl</code>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../labels/">« Labeling Elements</a><a class="docs-footer-nextpage" href="../math/">What is a Matroid? »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.0 on <span class="colophon-date" title="Friday 7 February 2025 10:39">Friday 7 February 2025</span>. Using Julia version 1.11.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
end</code></pre><p>As an example, look at <code>UniformRankFunction</code> and <code>UniformMatroid</code> in <code>src/RankFunctions.jl</code>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../labels/">« Labeling Elements</a><a class="docs-footer-nextpage" href="../math/">What is a Matroid? »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.0 on <span class="colophon-date" title="Friday 7 February 2025 13:39">Friday 7 February 2025</span>. Using Julia version 1.11.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion docs/build/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/build/labels/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{4, 4} matroid

julia&gt; get_label(M,1)
(1, 2)</code></pre><h2 id="Setting-Labels"><a class="docs-heading-anchor" href="#Setting-Labels">Setting Labels</a><a id="Setting-Labels-1"></a><a class="docs-heading-anchor-permalink" href="#Setting-Labels" title="Permalink"></a></h2><p>To assign a label to element <code>e</code> of matroid <code>M</code>, use <code>set_label(M, e, label)</code>.</p><p>The function <code>reset_labels</code> can be used in two ways:</p><ul><li><code>reset_labels(M)</code> sets the label of elemement <code>e</code> to be <code>e</code> for all <code>e</code>.</li><li><code>reset_labels(M, labs)</code> sets the label of element <code>e</code> to be <code>labs[e]</code> for all <code>e</code>. Here, <code>labs</code> is a <code>Dict</code>.</li></ul><h2 id="Finding-an-Element-with-a-Given-Label"><a class="docs-heading-anchor" href="#Finding-an-Element-with-a-Given-Label">Finding an Element with a Given Label</a><a id="Finding-an-Element-with-a-Given-Label-1"></a><a class="docs-heading-anchor-permalink" href="#Finding-an-Element-with-a-Given-Label" title="Permalink"></a></h2><p>The function <code>find_label(M, lab)</code> returns an element of <code>M</code> whose label is <code>lab</code>. If no such element exists, then <code>0</code> is returned. </p><p>Note that labels may be repeated; this function returns only one element (the lowest number element) with the requested label. </p><h2 id="Label-Preservation"><a class="docs-heading-anchor" href="#Label-Preservation">Label Preservation</a><a id="Label-Preservation-1"></a><a class="docs-heading-anchor-permalink" href="#Label-Preservation" title="Permalink"></a></h2><p>Matroid operations preserve labels. For example, suppose element <code>e</code> of matroid <code>M</code> has the label <code>lab</code>. When we construct the dual of <code>M</code> (which has the same ground set as <code>M</code>), the label assigned to <code>e</code> in the dual is also <code>lab</code>.</p><pre><code class="nohighlight hljs">julia&gt; A = [1 2 3; 4 5 6]
(1, 2)</code></pre><h2 id="Setting-Labels"><a class="docs-heading-anchor" href="#Setting-Labels">Setting Labels</a><a id="Setting-Labels-1"></a><a class="docs-heading-anchor-permalink" href="#Setting-Labels" title="Permalink"></a></h2><p>To assign a label to element <code>e</code> of matroid <code>M</code>, use <code>set_label!(M, e, label)</code>.</p><p>The function <code>reset_labels!</code> can be used in two ways:</p><ul><li><code>reset_labels!(M)</code> sets the label of elemement <code>e</code> to be <code>e</code> for all <code>e</code>.</li><li><code>reset_labels!(M, labs)</code> sets the label of element <code>e</code> to be <code>labs[e]</code> for all <code>e</code>. Here, <code>labs</code> is a <code>Dict</code>.</li></ul><h2 id="Finding-an-Element-with-a-Given-Label"><a class="docs-heading-anchor" href="#Finding-an-Element-with-a-Given-Label">Finding an Element with a Given Label</a><a id="Finding-an-Element-with-a-Given-Label-1"></a><a class="docs-heading-anchor-permalink" href="#Finding-an-Element-with-a-Given-Label" title="Permalink"></a></h2><p>The function <code>find_label(M, lab)</code> returns an element of <code>M</code> whose label is <code>lab</code>. If no such element exists, then <code>0</code> is returned. </p><p>Note that labels may be repeated; this function returns only one element (the lowest number element) with the requested label. </p><h2 id="Label-Preservation"><a class="docs-heading-anchor" href="#Label-Preservation">Label Preservation</a><a id="Label-Preservation-1"></a><a class="docs-heading-anchor-permalink" href="#Label-Preservation" title="Permalink"></a></h2><p>Matroid operations preserve labels. For example, suppose element <code>e</code> of matroid <code>M</code> has the label <code>lab</code>. When we construct the dual of <code>M</code> (which has the same ground set as <code>M</code>), the label assigned to <code>e</code> in the dual is also <code>lab</code>.</p><pre><code class="nohighlight hljs">julia&gt; A = [1 2 3; 4 5 6]
2×3 Matrix{Int64}:
1 2 3
4 5 6
Expand All @@ -36,4 +36,4 @@
julia&gt; get_label(MM,1)
2-element Vector{Int64}:
1
4</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Main Documentation</a><a class="docs-footer-nextpage" href="../design/">Module Design »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.0 on <span class="colophon-date" title="Friday 7 February 2025 10:39">Friday 7 February 2025</span>. Using Julia version 1.11.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
4</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Main Documentation</a><a class="docs-footer-nextpage" href="../design/">Module Design »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.0 on <span class="colophon-date" title="Friday 7 February 2025 13:39">Friday 7 February 2025</span>. Using Julia version 1.11.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit cea3e10

Please sign in to comment.