-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
756 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="x-ua-compatible" content="ie=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="generator" content="ExDoc v0.11.3"> | ||
<title>404 – Combination v0.0.1</title> | ||
<link rel="stylesheet" href="dist/app-ddd9717ad9.css" /> | ||
<script src="dist/sidebar_items.js"></script> | ||
</head> | ||
<body data-type="extras"> | ||
|
||
<div class="main"> | ||
<button class="sidebar-toggle"> | ||
<i class="icon-menu"></i> | ||
</button> | ||
<section class="sidebar"> | ||
<button class="sidebar-toggle"> | ||
<i class="icon-menu"></i> | ||
</button> | ||
|
||
|
||
<a href="Combination.html" class="sidebar-projectLink"> | ||
<div class="sidebar-projectDetails"> | ||
<h1 class="sidebar-projectName"> | ||
Combination | ||
</h1> | ||
<h2 class="sidebar-projectVersion"> | ||
v0.0.1 | ||
</h2> | ||
</div> | ||
|
||
</a> | ||
|
||
<div class="sidebar-search"> | ||
<i class="icon-search"></i> | ||
<input type="text" class="sidebar-searchInput" placeholder="search" autocomplete="off" /> | ||
</div> | ||
|
||
<ul class="sidebar-listNav"> | ||
<li><a id="extras-list" href="#full-list">Pages</a></li> | ||
|
||
|
||
<li><a id="modules-list" href="#full-list">Modules</a></li> | ||
|
||
|
||
|
||
|
||
|
||
</ul> | ||
|
||
<ul id="full-list" class="sidebar-fullList"></ul> | ||
<div class="sidebar-noResults"></div> | ||
</section> | ||
|
||
<section class="content"> | ||
<div id="content" class="content-inner"> | ||
|
||
|
||
<h2>Page not found</h2> | ||
|
||
<p>Sorry, but the page you were trying to get to, does not exist. You | ||
may want to try searching this site using the sidebar or using our | ||
<a href="api-reference.html" title="API Reference">API Reference</a> page to find what | ||
you were looking for.</p> | ||
|
||
<footer class="footer"> | ||
<p> | ||
<span class="line"> | ||
Built using | ||
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" rel="help" target="_blank">ExDoc</a> (v0.11.3), | ||
</span> | ||
<span class="line"> | ||
designed by | ||
<a href="https://twitter.com/dignifiedquire" target="_blank" title="@dignifiedquire">Friedel Ziegelmayer</a>. | ||
</span> | ||
</p> | ||
<button class="night-mode-toggle" /> | ||
</footer> | ||
</div> | ||
</section> | ||
</div> | ||
<script src="dist/app-6d2e071366.js"></script> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,230 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="x-ua-compatible" content="ie=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="generator" content="ExDoc v0.11.3"> | ||
<title>Combination – Combination v0.0.1</title> | ||
<link rel="stylesheet" href="dist/app-ddd9717ad9.css" /> | ||
<script src="dist/sidebar_items.js"></script> | ||
</head> | ||
<body data-type="modules"> | ||
|
||
<div class="main"> | ||
<button class="sidebar-toggle"> | ||
<i class="icon-menu"></i> | ||
</button> | ||
<section class="sidebar"> | ||
<button class="sidebar-toggle"> | ||
<i class="icon-menu"></i> | ||
</button> | ||
|
||
|
||
<a href="Combination.html" class="sidebar-projectLink"> | ||
<div class="sidebar-projectDetails"> | ||
<h1 class="sidebar-projectName"> | ||
Combination | ||
</h1> | ||
<h2 class="sidebar-projectVersion"> | ||
v0.0.1 | ||
</h2> | ||
</div> | ||
|
||
</a> | ||
|
||
<div class="sidebar-search"> | ||
<i class="icon-search"></i> | ||
<input type="text" class="sidebar-searchInput" placeholder="search" autocomplete="off" /> | ||
</div> | ||
|
||
<ul class="sidebar-listNav"> | ||
<li><a id="extras-list" href="#full-list">Pages</a></li> | ||
|
||
|
||
<li><a id="modules-list" href="#full-list">Modules</a></li> | ||
|
||
|
||
|
||
|
||
|
||
</ul> | ||
|
||
<ul id="full-list" class="sidebar-fullList"></ul> | ||
<div class="sidebar-noResults"></div> | ||
</section> | ||
|
||
<section class="content"> | ||
<div id="content" class="content-inner"> | ||
|
||
|
||
<h1> | ||
<small class="visible-xs">Combination v0.0.1</small> | ||
Combination | ||
|
||
|
||
<a href="https://github.com/seantanly/elixir-minmaxlist/blob/v0.0.1/lib/combination.ex#L1" title="View Source" class="view-source" rel="help"> | ||
<i class="icon-code"></i> | ||
</a> | ||
|
||
</h1> | ||
|
||
|
||
<section id="moduledoc" class="docstring"> | ||
<p>Provide a set of algorithms to generate combinations and permutations.</p> | ||
<p>For non-distinct elements in the source collection, simply pipe the result through <code class="inline">Enum.uniq/1</code> to remove duplicates.</p> | ||
|
||
</section> | ||
|
||
|
||
|
||
<section id="summary" class="details-list"> | ||
<h1 class="section-heading"> | ||
<a class="hover-link" href="#summary"> | ||
<i class="icon-link"></i> | ||
</a> | ||
Summary | ||
</h1> | ||
|
||
|
||
|
||
<div class="summary-functions summary"> | ||
<h2> | ||
<a href="#functions">Functions</a> | ||
</h2> | ||
<div class="summary-row"> | ||
<div class="summary-signature"> | ||
<a href="#combine/2">combine(collection, k)</a> | ||
</div> | ||
|
||
<div class="summary-synopsis"><p>Generate k1..k2 combinations of based on given collection, where k2 > k1</p> | ||
</div> | ||
|
||
</div> | ||
<div class="summary-row"> | ||
<div class="summary-signature"> | ||
<a href="#permutate/2">permutate(collection, filter \\ fn _p -> true end)</a> | ||
</div> | ||
|
||
<div class="summary-synopsis"><p>Generate all permutation of the collection, filtered by <code class="inline">filter</code> function</p> | ||
</div> | ||
|
||
</div> | ||
|
||
</div> | ||
|
||
|
||
|
||
|
||
|
||
|
||
</section> | ||
|
||
|
||
|
||
|
||
|
||
<section id="functions" class="details-list"> | ||
<h1 class="section-heading"> | ||
<a class="hover-link" href="#functions"> | ||
<i class="icon-link"></i> | ||
</a> | ||
Functions | ||
</h1> | ||
<div class="detail" id="combine/2"> | ||
<div class="detail-header"> | ||
<a href="#combine/2" class="detail-link" title="Link to this function"> | ||
<i class="icon-link"></i> | ||
</a> | ||
<span class="signature">combine(collection, k)</span> | ||
|
||
<a href="https://github.com/seantanly/elixir-minmaxlist/blob/v0.0.1/lib/combination.ex#L18" class="view-source" rel="help" title="View Source"> | ||
<i class="icon-code"></i> | ||
</a> | ||
|
||
</div> | ||
|
||
<div class="specs"> | ||
<h4 class="specs-title">Specs</h4> | ||
<div class="specs-list"> | ||
|
||
<pre><code class="elixir">combine(<a href="http://elixir-lang.org/docs/stable/elixir/Enum.html#t:t/0">Enum.t</a>, <a href="http://elixir-lang.org/docs/stable/elixir/Range.html#t:t/0">Range.t</a>) :: [list]</code></pre> | ||
|
||
<pre><code class="elixir">combine(<a href="http://elixir-lang.org/docs/stable/elixir/Enum.html#t:t/0">Enum.t</a>, non_neg_integer) :: [list]</code></pre> | ||
|
||
</div> | ||
</div> | ||
|
||
<section class="docstring"> | ||
<p>Generate k1..k2 combinations of based on given collection, where k2 > k1.</p> | ||
<h2>Examples</h2> | ||
<pre><code class="iex elixir">iex> 1..3 |> Combination.combine(1..2) | ||
[[1], [2], [3], [3, 2], [3, 1], [2, 1]] | ||
|
||
iex> 1..3 |> Combination.combine(2..3) | ||
[[3, 2], [3, 1], [2, 1], [3, 2, 1]]</code></pre> | ||
|
||
</section> | ||
</div> | ||
<div class="detail" id="permutate/2"> | ||
<div class="detail-header"> | ||
<a href="#permutate/2" class="detail-link" title="Link to this function"> | ||
<i class="icon-link"></i> | ||
</a> | ||
<span class="signature">permutate(collection, filter \\ fn _p -> true end)</span> | ||
|
||
<a href="https://github.com/seantanly/elixir-minmaxlist/blob/v0.0.1/lib/combination.ex#L83" class="view-source" rel="help" title="View Source"> | ||
<i class="icon-code"></i> | ||
</a> | ||
|
||
</div> | ||
|
||
<div class="specs"> | ||
<h4 class="specs-title">Specs</h4> | ||
<div class="specs-list"> | ||
|
||
<pre><code class="elixir">permutate(<a href="http://elixir-lang.org/docs/stable/elixir/Enum.html#t:t/0">Enum.t</a>, (list -> as_boolean(term))) :: [list]</code></pre> | ||
|
||
</div> | ||
</div> | ||
|
||
<section class="docstring"> | ||
<p>Generate all permutation of the collection, filtered by <code class="inline">filter</code> function.</p> | ||
<p>The <code class="inline">filter</code> function filters the generated permutation before it is added | ||
to the result list. It returns true by default, thus allowing all permutations.</p> | ||
<h2>Example</h2> | ||
<pre><code class="iex elixir">iex> 1..3 |> Combination.permutate | ||
[[1, 2, 3], [2, 1, 3], [3, 1, 2], [1, 3, 2], [2, 3, 1], [3, 2, 1]] | ||
|
||
iex> 1..3 |> Combination.permutate(fn p -> Enum.at(p, 0) == 1 end) | ||
[[1, 2, 3], [1, 3, 2]]</code></pre> | ||
|
||
</section> | ||
</div> | ||
|
||
</section> | ||
|
||
|
||
|
||
|
||
|
||
<footer class="footer"> | ||
<p> | ||
<span class="line"> | ||
Built using | ||
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" rel="help" target="_blank">ExDoc</a> (v0.11.3), | ||
</span> | ||
<span class="line"> | ||
designed by | ||
<a href="https://twitter.com/dignifiedquire" target="_blank" title="@dignifiedquire">Friedel Ziegelmayer</a>. | ||
</span> | ||
</p> | ||
<button class="night-mode-toggle" /> | ||
</footer> | ||
</div> | ||
</section> | ||
</div> | ||
<script src="dist/app-6d2e071366.js"></script> | ||
</body> | ||
</html> | ||
|
Oops, something went wrong.