diff --git a/doc/404.html b/doc/404.html new file mode 100644 index 0000000..c4edf26 --- /dev/null +++ b/doc/404.html @@ -0,0 +1,87 @@ + + + + + + + + 404 – Combination v0.0.1 + + + + + +
+ + + +
+
+ + +

Page not found

+ +

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 +API Reference page to find what +you were looking for.

+ + +
+
+
+ + + + diff --git a/doc/Combination.html b/doc/Combination.html new file mode 100644 index 0000000..688513a --- /dev/null +++ b/doc/Combination.html @@ -0,0 +1,230 @@ + + + + + + + + Combination – Combination v0.0.1 + + + + + +
+ + + +
+
+ + +

+ Combination v0.0.1 + Combination + + + + + + +

+ + +
+

Provide a set of algorithms to generate combinations and permutations.

+

For non-distinct elements in the source collection, simply pipe the result through Enum.uniq/1 to remove duplicates.

+ +
+ + + +
+

+ + + + Summary +

+ + + +
+

+ Functions +

+
+ + +

Generate k1..k2 combinations of based on given collection, where k2 > k1

+
+ +
+
+ + +

Generate all permutation of the collection, filtered by filter function

+
+ +
+ +
+ + + + + + +
+ + + + + +
+

+ + + + Functions +

+
+
+ + + + combine(collection, k) + + + + + +
+ +
+

Specs

+
+ +
combine(Enum.t, Range.t) :: [list]
+ +
combine(Enum.t, non_neg_integer) :: [list]
+ +
+
+ +
+

Generate k1..k2 combinations of based on given collection, where k2 > k1.

+

Examples

+
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]]
+ +
+
+
+
+ + + + permutate(collection, filter \\ fn _p -> true end) + + + + + +
+ +
+

Specs

+
+ +
permutate(Enum.t, (list -> as_boolean(term))) :: [list]
+ +
+
+ +
+

Generate all permutation of the collection, filtered by filter function.

+

The filter function filters the generated permutation before it is added +to the result list. It returns true by default, thus allowing all permutations.

+

Example

+
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]]
+ +
+
+ +
+ + + + + + +
+
+
+ + + + diff --git a/doc/api-reference.html b/doc/api-reference.html new file mode 100644 index 0000000..cb12a5a --- /dev/null +++ b/doc/api-reference.html @@ -0,0 +1,111 @@ + + + + + + + + API Reference – Combination v0.0.1 + + + + + +
+ + + +
+
+ +

+ Combination v0.0.1 + API Reference +

+ + + + +
+

Modules

+
+
+ + +

Provide a set of algorithms to generate combinations and permutations

+
+ +
+ +
+
+ + + + + + +
+
+
+ + + + diff --git a/doc/changelog.html b/doc/changelog.html new file mode 100644 index 0000000..671ed12 --- /dev/null +++ b/doc/changelog.html @@ -0,0 +1,86 @@ + + + + + + + + CHANGELOG – Combination v0.0.1 + + + + + +
+ + + +
+
+ + +

Changelog

+

Version 0.0.1 (2016-01-15)

    +
  • First Version +
  • +
+ + +
+
+
+ + + + diff --git a/doc/dist/app-6d2e071366.js b/doc/dist/app-6d2e071366.js new file mode 100644 index 0000000..a5cf0a4 --- /dev/null +++ b/doc/dist/app-6d2e071366.js @@ -0,0 +1,6 @@ +!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))switch(typeof e[t]){case"function":break;case"object":e[t]=function(t){var n=t.slice(1),r=e[t[0]];return function(e,t,i){r.apply(this,[e,t,i].concat(n))}}(e[t]);break;default:e[t]=e[e[t]]}return e}([function(e,t,n){"use strict";var r=n(1)["default"],i=n(2),a=r(i),o=n(3),s=r(o),l=n(4),c=n(95),u=n(96);window.$=a["default"],a["default"](function(){s["default"].configure({tabReplace:" ",languages:[]}),u.initialize(),c.initialize(),l.initialize(),s["default"].initHighlighting()})},function(e,t){"use strict";t["default"]=function(e){return e&&e.__esModule?e:{"default":e}},t.__esModule=!0},function(e,t,n){var r,i;!function(t,n){"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(n,a){function o(e){var t="length"in e&&e.length,n=re.type(e);return"function"===n||re.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function s(e,t,n){if(re.isFunction(t))return re.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return re.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(fe.test(t))return re.filter(t,e,n);t=re.filter(t,e)}return re.grep(e,function(e){return V.call(t,e)>=0!==n})}function l(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function c(e){var t=ye[e]={};return re.each(e.match(ve)||[],function(e,n){t[n]=!0}),t}function u(){te.removeEventListener("DOMContentLoaded",u,!1),n.removeEventListener("load",u,!1),re.ready()}function f(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=re.expando+f.uid++}function d(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ke,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:Ee.test(n)?re.parseJSON(n):n}catch(i){}we.set(e,t,n)}else n=void 0;return n}function p(){return!0}function h(){return!1}function g(){try{return te.activeElement}catch(e){}}function m(e,t){return re.nodeName(e,"table")&&re.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function v(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function y(e){var t=Be.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function b(e,t){for(var n=0,r=e.length;r>n;n++)_e.set(e[n],"globalEval",!t||_e.get(t[n],"globalEval"))}function x(e,t){var n,r,i,a,o,s,l,c;if(1===t.nodeType){if(_e.hasData(e)&&(a=_e.access(e),o=_e.set(t,a),c=a.events)){delete o.handle,o.events={};for(i in c)for(n=0,r=c[i].length;r>n;n++)re.event.add(t,i,c[i][n])}we.hasData(e)&&(s=we.access(e),l=re.extend({},s),we.set(t,l))}}function _(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&re.nodeName(e,t)?re.merge([e],n):n}function w(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Se.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function E(e,t){var r,i=re(t.createElement(e)).appendTo(t.body),a=n.getDefaultComputedStyle&&(r=n.getDefaultComputedStyle(i[0]))?r.display:re.css(i[0],"display");return i.detach(),a}function k(e){var t=te,n=We[e];return n||(n=E(e,t),"none"!==n&&n||(ze=(ze||re("