custom-permutation 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -42
- package/lib/CustomPermutation.d.ts +5 -5
- package/lib/CustomPermutation.js.map +1 -1
- package/lib/CustomPermutationGenerator.d.ts +24 -18
- package/lib/CustomPermutationGenerator.js +12 -18
- package/lib/CustomPermutationGenerator.js.map +1 -1
- package/lib/PermutationGeneratorForSet.d.ts +21 -19
- package/lib/PermutationGeneratorForSet.js +25 -21
- package/lib/PermutationGeneratorForSet.js.map +1 -1
- package/lib/demo.d.ts +1 -0
- package/lib/demo.js +12 -0
- package/lib/demo.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -11
- package/lib/index.js.map +1 -1
- package/package.json +19 -12
package/README.md
CHANGED
|
@@ -1,108 +1,121 @@
|
|
|
1
|
-
#
|
|
2
|
-
1.1.0
|
|
1
|
+
# Custom Permutation Generator
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
23.09.2024 - Edge cases are handled and the codespace is simplified.
|
|
6
|
-
25.09.2023 - unChoices did not reflect always, fixed now.
|
|
3
|
+
## Usage
|
|
7
4
|
|
|
8
|
-
|
|
5
|
+
### 1.1. `require`
|
|
9
6
|
|
|
10
|
-
## 1.1. `require`
|
|
11
7
|
```ts
|
|
12
|
-
const CustomPermutation = require('custom-permutation')
|
|
8
|
+
const CustomPermutation = require('custom-permutation');
|
|
13
9
|
```
|
|
14
|
-
|
|
10
|
+
|
|
11
|
+
### 1.2. `import`
|
|
15
12
|
|
|
16
13
|
```ts
|
|
17
|
-
import CustomPermutation from
|
|
14
|
+
import CustomPermutation from 'custom-permutation';
|
|
18
15
|
```
|
|
19
16
|
|
|
20
17
|
## 2. Constructor
|
|
18
|
+
|
|
21
19
|
```ts
|
|
22
|
-
CustomPermutation(
|
|
20
|
+
CustomPermutation(
|
|
21
|
+
elList:[],
|
|
22
|
+
choices:{ index: [] },
|
|
23
|
+
nonChoices:{ index: [] }
|
|
24
|
+
)
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
## 3. Usage
|
|
27
|
+
## 3. Usage explanied
|
|
26
28
|
|
|
27
29
|
_example:_
|
|
28
30
|
|
|
29
31
|
```ts
|
|
30
|
-
CustomPermutation([
|
|
32
|
+
CustomPermutation(['a', 'b', 'c'], { '1': ['a', 'b'] }, { '0': ['a'] });
|
|
31
33
|
```
|
|
32
34
|
|
|
33
35
|
Permutate 3 elements which are "a", "b" and "c" with below rules
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
**`choices` rule:**
|
|
38
|
+
|
|
36
39
|
```json
|
|
37
40
|
{ "1": ["a", "b"] }
|
|
38
41
|
```
|
|
39
42
|
|
|
40
|
-
|
|
43
|
+
> At `index=1` there can only be the element `"a"` or `"b"`
|
|
44
|
+
|
|
45
|
+
**`nonChoices` rule:**
|
|
41
46
|
|
|
42
|
-
__- nonChoices rule:__
|
|
43
47
|
```json
|
|
44
48
|
{ "0": ["a"] }
|
|
45
49
|
```
|
|
46
50
|
|
|
47
|
-
|
|
51
|
+
> At `index=0` there can NOT be the element `"a"`
|
|
48
52
|
|
|
49
53
|
_Note: given index are considered as 0 based: [index=0, index=1, etc.]_
|
|
50
54
|
|
|
55
|
+
| index | all options | after customization |
|
|
56
|
+
| :---: | :-----------------: | :-----------------: |
|
|
57
|
+
| 0 | `"a"`, `"b"`, `"c"` | `"b"`, `"c"` |
|
|
58
|
+
| 1 | `"a"`, `"b"`, `"c"` | `"a"`, `"b"` |
|
|
59
|
+
| 2 | `"a"`, `"b"`, `"c"` | `"a"`, `"b"`, `"c"` |
|
|
60
|
+
|
|
51
61
|
## 4. Result set explanation:
|
|
52
62
|
|
|
53
|
-
Let's
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
63
|
+
Let's check all permutations, and see which ones are and are not valid.
|
|
64
|
+
|
|
65
|
+
| Permutation | Is valid | Violates | Description |
|
|
66
|
+
| :---------------: | :------: | :--------: | :--------------------------------------------: |
|
|
67
|
+
| `["a", "b", "c"]` | No | nonChoices | _first elemen can't be `"a"`_ |
|
|
68
|
+
| `["a", "c", "b"]` | No | nonChoices | _first elemen can't be `"a"`_ |
|
|
69
|
+
| `["b", "a", "c"]` | Yes | - | - |
|
|
70
|
+
| `["b", "c", "a"]` | No | choices | _second element is asked to be `"a"` or `"b"`_ |
|
|
71
|
+
| `["c", "a", "b"]` | Yes | - | - |
|
|
72
|
+
| `["c", "b", "a"]` | Yes | - | - |
|
|
60
73
|
|
|
61
|
-
So there are just 3 results that
|
|
74
|
+
So there are just **3** results that chould be generated with these parameters.
|
|
62
75
|
|
|
63
76
|
## 5. Complete example
|
|
64
77
|
|
|
65
|
-
### 1. Create
|
|
78
|
+
### 5.1. Create object from `CustomPermutation` class
|
|
66
79
|
|
|
67
80
|
```ts
|
|
68
|
-
let customPerm = new CustomPermutation(
|
|
69
|
-
["a", "b", "c"],
|
|
70
|
-
{ "1": ["a", "b"] },
|
|
71
|
-
{ "0": ["a"] }
|
|
72
|
-
);
|
|
81
|
+
let customPerm = new CustomPermutation(['a', 'b', 'c'], { '1': ['a', 'b'] }, { '0': ['a'] });
|
|
73
82
|
```
|
|
74
83
|
|
|
75
|
-
### 2. Get next value
|
|
84
|
+
### 5.2. Get next value
|
|
76
85
|
|
|
77
|
-
#### 2.1.
|
|
86
|
+
#### 5.2.1. With `next`
|
|
78
87
|
|
|
79
88
|
```ts
|
|
80
89
|
let next = customPerm.next();
|
|
81
90
|
|
|
82
91
|
while (next) {
|
|
83
|
-
|
|
84
|
-
|
|
92
|
+
console.log(next);
|
|
93
|
+
next = customPerm.next();
|
|
85
94
|
}
|
|
86
95
|
```
|
|
87
96
|
|
|
88
|
-
#### 2.2.
|
|
97
|
+
#### 5.2.2. With `generator`
|
|
89
98
|
|
|
90
99
|
```ts
|
|
91
100
|
let generator = customPerm.generator();
|
|
92
101
|
let next = generator.next();
|
|
93
102
|
|
|
94
103
|
while (!next.done) {
|
|
95
|
-
|
|
96
|
-
|
|
104
|
+
console.log(next.value);
|
|
105
|
+
next = generator.next();
|
|
97
106
|
}
|
|
98
107
|
```
|
|
99
108
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
__Console__
|
|
109
|
+
**Output:**
|
|
103
110
|
|
|
104
111
|
```sh
|
|
105
112
|
["b", "a", "c"]
|
|
106
113
|
["c", "a", "b"]
|
|
107
114
|
["c", "b", "a"]
|
|
108
|
-
```
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Fixed bugs
|
|
118
|
+
|
|
119
|
+
11.06.2026 - Better typing implemented and more test coverage added.
|
|
120
|
+
23.09.2024 - Edge cases are handled and the codespace is simplified.
|
|
121
|
+
25.09.2023 - unChoices did not reflect always, fixed now.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CustomPermutationGenerator } from './CustomPermutationGenerator';
|
|
2
|
-
export default class CustomPermutation {
|
|
2
|
+
export default class CustomPermutation<T> {
|
|
3
3
|
private listToPermutate;
|
|
4
4
|
private choices;
|
|
5
5
|
private nonChoices;
|
|
6
6
|
private elementsOrderAbsolute?;
|
|
7
7
|
private passFn?;
|
|
8
|
-
customPermGen: CustomPermutationGenerator
|
|
9
|
-
constructor(listToPermutate:
|
|
10
|
-
next():
|
|
11
|
-
generator(): Generator<
|
|
8
|
+
customPermGen: CustomPermutationGenerator<T>;
|
|
9
|
+
constructor(listToPermutate: T[], choices: Record<number, T[]>, nonChoices: Record<number, T[]>, elementsOrderAbsolute?: number[] | undefined, passFn?: ((items: T[]) => boolean) | undefined);
|
|
10
|
+
next(): T[] | null;
|
|
11
|
+
generator(): Generator<T[], void, unknown>;
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomPermutation.js","sourceRoot":"","sources":["../src/CustomPermutation.ts"],"names":[],"mappings":";;AAAA,6EAA0E;AAE1E,MAAqB,iBAAiB;IAGpC,YACU,
|
|
1
|
+
{"version":3,"file":"CustomPermutation.js","sourceRoot":"","sources":["../src/CustomPermutation.ts"],"names":[],"mappings":";;AAAA,6EAA0E;AAE1E,MAAqB,iBAAiB;IAGpC,YACU,eAAoB,EACpB,OAA4B,EAC5B,UAA+B,EAC/B,qBAAgC,EAChC,MAAgC;QAJhC,oBAAe,GAAf,eAAe,CAAK;QACpB,YAAO,GAAP,OAAO,CAAqB;QAC5B,eAAU,GAAV,UAAU,CAAqB;QAC/B,0BAAqB,GAArB,qBAAqB,CAAW;QAChC,WAAM,GAAN,MAAM,CAA0B;QAExC,IAAI,CAAC,CAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,MAAM,CAAA,EAAE,CAAC;YACnC,qBAAqB,GAAG,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACvE,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,IAAI,uDAA0B,CACjD,IAAI,CAAC,eAAe,EACpB,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,qBAAqB,EAC1B,IAAI,CAAC,MAAM,CACZ,CAAC;IACJ,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IACnC,CAAC;IAED,CAAC,SAAS;QACR,IAAI,QAAQ,GAAG,IAAI,CAAC;QAEpB,OAAO,IAAI,EAAE,CAAC;YACZ,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;YACrC,IAAI,QAAQ,EAAE,CAAC;gBACb,MAAM,QAAQ,CAAC;YACjB,CAAC;iBAAM,CAAC;gBACN,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAvCD,oCAuCC"}
|
|
@@ -1,32 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
import { PermutationGeneratorForSet } from './PermutationGeneratorForSet';
|
|
2
|
+
export declare class CustomPermutationGenerator<T> {
|
|
2
3
|
private elementList;
|
|
3
4
|
private choicesByIndex;
|
|
4
5
|
private nonChoicesByIndex;
|
|
5
6
|
private elementsOrderAbsolute?;
|
|
6
7
|
private passFunction?;
|
|
7
|
-
set:
|
|
8
|
-
permutationGenOfSet:
|
|
8
|
+
set: T[];
|
|
9
|
+
permutationGenOfSet: PermutationGeneratorForSet;
|
|
9
10
|
nextIndexList: number[];
|
|
10
|
-
finalChoicesByIndexInSet: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
finalChoicesByIndexInSet: {
|
|
12
|
+
[key: string]: number[];
|
|
13
|
+
};
|
|
14
|
+
history: T[][];
|
|
15
|
+
historyHashes: string[];
|
|
16
|
+
current: T[];
|
|
14
17
|
cursor: number;
|
|
15
|
-
constructor(elementList:
|
|
18
|
+
constructor(elementList: T[], choicesByIndex: Record<number, T[]>, nonChoicesByIndex: Record<number, T[]>, elementsOrderAbsolute?: number[] | undefined, passFunction?: ((items: T[]) => boolean) | undefined);
|
|
16
19
|
removeNonChoicesIndexes(): void;
|
|
17
20
|
setChoicesIndexesInSet(): void;
|
|
18
|
-
getAllIndexesOfElementInList(el:
|
|
21
|
+
getAllIndexesOfElementInList(el: unknown, list: unknown[]): number[];
|
|
19
22
|
completeRestOfIndexes(): void;
|
|
20
|
-
extendIndexesOfSameElements(choicesByIndex:
|
|
21
|
-
prev():
|
|
22
|
-
next():
|
|
23
|
-
nextDistinct():
|
|
23
|
+
extendIndexesOfSameElements(choicesByIndex: Record<string | number, any[]>, indexesOfSameElements: Record<number, number[]>): void;
|
|
24
|
+
prev(): T[] | undefined;
|
|
25
|
+
next(): T[] | null;
|
|
26
|
+
nextDistinct(): {
|
|
27
|
+
value: T[] | undefined;
|
|
28
|
+
done: boolean;
|
|
29
|
+
};
|
|
24
30
|
saveCurrentToHistory(): void;
|
|
25
|
-
getHash(elList:
|
|
26
|
-
getElementListByInitialListIndexes(indexes:
|
|
31
|
+
getHash(elList: T[]): string;
|
|
32
|
+
getElementListByInitialListIndexes(indexes: number[]): T[];
|
|
27
33
|
reset(): void;
|
|
28
|
-
getSet():
|
|
34
|
+
getSet(): T[];
|
|
29
35
|
isEmpty(): boolean;
|
|
30
|
-
getCurrent():
|
|
31
|
-
last():
|
|
36
|
+
getCurrent(): T[] | null;
|
|
37
|
+
last(): T[];
|
|
32
38
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CustomPermutationGenerator = void 0;
|
|
4
4
|
const PermutationGeneratorForSet_1 = require("./PermutationGeneratorForSet");
|
|
5
5
|
class CustomPermutationGenerator {
|
|
6
|
-
constructor(elementList, choicesByIndex
|
|
6
|
+
constructor(elementList, choicesByIndex, nonChoicesByIndex, elementsOrderAbsolute, passFunction) {
|
|
7
7
|
this.elementList = elementList;
|
|
8
8
|
this.choicesByIndex = choicesByIndex;
|
|
9
9
|
this.nonChoicesByIndex = nonChoicesByIndex;
|
|
@@ -45,7 +45,7 @@ class CustomPermutationGenerator {
|
|
|
45
45
|
.map((x, i) => i);
|
|
46
46
|
Object.keys(this.nonChoicesByIndex).forEach((key) => {
|
|
47
47
|
let indexes = allIndexes.slice();
|
|
48
|
-
for (const el of this.nonChoicesByIndex[key]) {
|
|
48
|
+
for (const el of this.nonChoicesByIndex[+key]) {
|
|
49
49
|
const indexesToRemove = this.getAllIndexesOfElementInList(el, this.elementList);
|
|
50
50
|
indexes = indexes.filter((x) => indexesToRemove.indexOf(x) < 0);
|
|
51
51
|
}
|
|
@@ -54,11 +54,11 @@ class CustomPermutationGenerator {
|
|
|
54
54
|
}
|
|
55
55
|
setChoicesIndexesInSet() {
|
|
56
56
|
for (const key in this.choicesByIndex) {
|
|
57
|
-
if (!this.choicesByIndex[key]) {
|
|
57
|
+
if (!this.choicesByIndex[+key]) {
|
|
58
58
|
continue;
|
|
59
59
|
}
|
|
60
60
|
let indexesInList = [];
|
|
61
|
-
for (const el of this.choicesByIndex[key]) {
|
|
61
|
+
for (const el of this.choicesByIndex[+key]) {
|
|
62
62
|
indexesInList = indexesInList.concat(this.getAllIndexesOfElementInList(el, this.elementList));
|
|
63
63
|
}
|
|
64
64
|
this.finalChoicesByIndexInSet[key] = indexesInList;
|
|
@@ -105,17 +105,20 @@ class CustomPermutationGenerator {
|
|
|
105
105
|
// cursor-1 is current, cursor-2 is prev
|
|
106
106
|
return this.history[--this.cursor - 1];
|
|
107
107
|
}
|
|
108
|
+
return undefined;
|
|
108
109
|
}
|
|
109
110
|
next() {
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
var _a;
|
|
112
|
+
const nextDistinctPerm = this.nextDistinct();
|
|
113
|
+
return !nextDistinctPerm.done ? ((_a = nextDistinctPerm.value) !== null && _a !== void 0 ? _a : null) : null;
|
|
112
114
|
}
|
|
113
115
|
nextDistinct() {
|
|
116
|
+
var _a;
|
|
114
117
|
if (this.cursor < this.history.length) {
|
|
115
118
|
return { value: this.history[this.cursor++], done: false };
|
|
116
119
|
}
|
|
117
120
|
const nextPerm = this.permutationGenOfSet.next();
|
|
118
|
-
this.nextIndexList = nextPerm.value;
|
|
121
|
+
this.nextIndexList = (_a = nextPerm.value) !== null && _a !== void 0 ? _a : [];
|
|
119
122
|
let elList;
|
|
120
123
|
if (this.nextIndexList && this.nextIndexList.length > 0) {
|
|
121
124
|
elList = this.getElementListByInitialListIndexes(nextPerm.value);
|
|
@@ -139,13 +142,7 @@ class CustomPermutationGenerator {
|
|
|
139
142
|
this.cursor++;
|
|
140
143
|
}
|
|
141
144
|
getHash(elList) {
|
|
142
|
-
|
|
143
|
-
for (let i = 0; i < elList.length; i++) {
|
|
144
|
-
for (let j = 0; j < i + 1; j++) {
|
|
145
|
-
hash += String(elList[i]);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return hash;
|
|
145
|
+
return JSON.stringify(elList);
|
|
149
146
|
}
|
|
150
147
|
getElementListByInitialListIndexes(indexes) {
|
|
151
148
|
if (!indexes || !indexes.length) {
|
|
@@ -153,10 +150,7 @@ class CustomPermutationGenerator {
|
|
|
153
150
|
}
|
|
154
151
|
const elList = [];
|
|
155
152
|
indexes.forEach((index) => {
|
|
156
|
-
|
|
157
|
-
{
|
|
158
|
-
elList.push(this.elementList[index]);
|
|
159
|
-
}
|
|
153
|
+
elList.push(this.elementList[index]);
|
|
160
154
|
});
|
|
161
155
|
return elList;
|
|
162
156
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomPermutationGenerator.js","sourceRoot":"","sources":["../src/CustomPermutationGenerator.ts"],"names":[],"mappings":";;;AAAA,6EAA0E;AAE1E,MAAa,0BAA0B;IAUrC,YACU,
|
|
1
|
+
{"version":3,"file":"CustomPermutationGenerator.js","sourceRoot":"","sources":["../src/CustomPermutationGenerator.ts"],"names":[],"mappings":";;;AAAA,6EAA0E;AAE1E,MAAa,0BAA0B;IAUrC,YACU,WAAgB,EAChB,cAAmC,EACnC,iBAAsC,EACtC,qBAAgC,EAChC,YAAsC;QAJtC,gBAAW,GAAX,WAAW,CAAK;QAChB,mBAAc,GAAd,cAAc,CAAqB;QACnC,sBAAiB,GAAjB,iBAAiB,CAAqB;QACtC,0BAAqB,GAArB,qBAAqB,CAAW;QAChC,iBAAY,GAAZ,YAAY,CAA0B;QAZhD,kBAAa,GAAa,EAAE,CAAC;QAC7B,6BAAwB,GAAgC,EAAE,CAAC;QAC3D,YAAO,GAAU,EAAE,CAAC;QACpB,kBAAa,GAAa,EAAE,CAAC;QAC7B,YAAO,GAAQ,EAAE,CAAC;QAClB,WAAM,GAAG,CAAC,CAAC;QAST,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC;aACxC,IAAI,CAAC,CAAC,CAAC;aACP,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC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EAAE,CAAC;QAEvB,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACxB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAClB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;IACxB,CAAC;IAED,OAAO;QACL,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,UAAU;QACR,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,IAAI;QACF,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;CACF;AA3ND,gEA2NC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
type ChoiceEntry = {
|
|
2
|
+
index: number;
|
|
3
|
+
length: number;
|
|
4
|
+
};
|
|
1
5
|
export declare class PermutationGeneratorForSet {
|
|
2
6
|
private elementList;
|
|
3
7
|
private indexList;
|
|
@@ -5,31 +9,29 @@ export declare class PermutationGeneratorForSet {
|
|
|
5
9
|
private indexesOfSameElements?;
|
|
6
10
|
private actualOrderOfElements?;
|
|
7
11
|
private passFunction?;
|
|
8
|
-
choicesArraysInitial:
|
|
9
|
-
choicesArrays:
|
|
12
|
+
choicesArraysInitial: number[][];
|
|
13
|
+
choicesArrays: number[][];
|
|
10
14
|
size: number;
|
|
11
|
-
currentIndsOfChoices:
|
|
15
|
+
currentIndsOfChoices: number[];
|
|
12
16
|
currentElInd: number;
|
|
13
|
-
newPerm:
|
|
14
|
-
initialIndexList:
|
|
15
|
-
indexesAndChoicesCountsSortedByLength:
|
|
16
|
-
indexesAndChoicesCounts:
|
|
17
|
-
visitedDict:
|
|
18
|
-
constructor(elementList: any[], indexList:
|
|
19
|
-
isNewPermutationPassingFunction(currentEl:
|
|
17
|
+
newPerm: (number | null)[];
|
|
18
|
+
initialIndexList: number[];
|
|
19
|
+
indexesAndChoicesCountsSortedByLength: ChoiceEntry[];
|
|
20
|
+
indexesAndChoicesCounts: ChoiceEntry[];
|
|
21
|
+
visitedDict: Record<number, boolean>;
|
|
22
|
+
constructor(elementList: any[], indexList: number[], choicesByIndex?: Record<string, number[]> | undefined, indexesOfSameElements?: Record<number, number[]> | undefined, actualOrderOfElements?: number[] | undefined, passFunction?: ((items: any[]) => boolean) | undefined);
|
|
23
|
+
isNewPermutationPassingFunction(currentEl: number, elIndInPerm: number): boolean;
|
|
20
24
|
reorderListAndChoicesAccordingToChoicesCount(): void;
|
|
21
25
|
initChoicesArray(): void;
|
|
22
26
|
init(): void;
|
|
23
27
|
next(): {
|
|
24
28
|
done: boolean;
|
|
25
|
-
value?:
|
|
26
|
-
} | {
|
|
27
|
-
done: boolean;
|
|
28
|
-
value: any[];
|
|
29
|
+
value?: number[];
|
|
29
30
|
};
|
|
30
|
-
getNextPerm():
|
|
31
|
-
goBack(newPerm:
|
|
32
|
-
getAndSetPossibleNextElementForNewPerm(newPerm:
|
|
33
|
-
validateParameters(elementSet:
|
|
34
|
-
revertResultPermToInitialOrder(newPerm:
|
|
31
|
+
getNextPerm(): (number | null)[] | undefined;
|
|
32
|
+
goBack(newPerm: (number | null)[], choicesArrayWithIndexes: number[][], selectedIndexesForPerm: number[], elInd: number): boolean;
|
|
33
|
+
getAndSetPossibleNextElementForNewPerm(newPerm: (number | null)[], choices: number[], currentIndsInChoices: number[], elInd: number): number | undefined;
|
|
34
|
+
validateParameters(elementSet: number[], choicesByIndex?: object): boolean;
|
|
35
|
+
revertResultPermToInitialOrder(newPerm: (number | null)[]): (number | null)[];
|
|
35
36
|
}
|
|
37
|
+
export {};
|
|
@@ -9,13 +9,15 @@ class PermutationGeneratorForSet {
|
|
|
9
9
|
this.indexesOfSameElements = indexesOfSameElements;
|
|
10
10
|
this.actualOrderOfElements = actualOrderOfElements;
|
|
11
11
|
this.passFunction = passFunction;
|
|
12
|
-
this.choicesArraysInitial = [];
|
|
13
|
-
this.choicesArrays = [];
|
|
12
|
+
this.choicesArraysInitial = [];
|
|
13
|
+
this.choicesArrays = [];
|
|
14
14
|
this.size = 0;
|
|
15
|
-
this.currentIndsOfChoices = [];
|
|
16
|
-
this.currentElInd = 0;
|
|
15
|
+
this.currentIndsOfChoices = [];
|
|
16
|
+
this.currentElInd = 0;
|
|
17
17
|
this.newPerm = [];
|
|
18
|
-
this.initialIndexList = [];
|
|
18
|
+
this.initialIndexList = [];
|
|
19
|
+
this.indexesAndChoicesCountsSortedByLength = [];
|
|
20
|
+
this.indexesAndChoicesCounts = [];
|
|
19
21
|
this.visitedDict = {};
|
|
20
22
|
this.actualOrderOfElements =
|
|
21
23
|
this.actualOrderOfElements ||
|
|
@@ -45,7 +47,7 @@ class PermutationGeneratorForSet {
|
|
|
45
47
|
if (this.passFunction) {
|
|
46
48
|
const elArray = [];
|
|
47
49
|
actualOrderedNewPerm.forEach((elInd, i) => (elArray[i] = this.elementList[elInd]));
|
|
48
|
-
const passed = this.passFunction(elArray.filter((x) => x)); // Remove nulls, since some array elements are undefined when building
|
|
50
|
+
const passed = this.passFunction(elArray.filter((x) => x !== undefined && x !== null)); // Remove nulls, since some array elements are undefined when building
|
|
49
51
|
return passed;
|
|
50
52
|
}
|
|
51
53
|
return true;
|
|
@@ -67,12 +69,11 @@ class PermutationGeneratorForSet {
|
|
|
67
69
|
this.choicesArraysInitial = JSON.parse(JSON.stringify(this.choicesArrays));
|
|
68
70
|
}
|
|
69
71
|
initChoicesArray() {
|
|
72
|
+
var _a, _b;
|
|
70
73
|
this.choicesArrays = [];
|
|
71
74
|
this.choicesArraysInitial = [];
|
|
72
75
|
for (let i = 0; i < this.indexList.length; i++) {
|
|
73
|
-
this.choicesArrays.push(this.choicesByIndex[i]
|
|
74
|
-
? this.choicesByIndex[i].slice()
|
|
75
|
-
: this.indexList.slice());
|
|
76
|
+
this.choicesArrays.push(((_b = (_a = this.choicesByIndex) === null || _a === void 0 ? void 0 : _a[i]) === null || _b === void 0 ? void 0 : _b.length) ? this.choicesByIndex[i].slice() : this.indexList.slice());
|
|
76
77
|
this.choicesArraysInitial.push(this.choicesArrays[i].slice());
|
|
77
78
|
}
|
|
78
79
|
}
|
|
@@ -93,18 +94,16 @@ class PermutationGeneratorForSet {
|
|
|
93
94
|
}
|
|
94
95
|
next() {
|
|
95
96
|
let nextPerm = this.getNextPerm();
|
|
96
|
-
if (
|
|
97
|
-
while (nextPerm.filter((x) => x || x === 0).length < nextPerm.length) {
|
|
98
|
-
nextPerm = this.getNextPerm();
|
|
99
|
-
if (!nextPerm || nextPerm.length === 0) {
|
|
100
|
-
return { done: true };
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return { done: false, value: this.revertResultPermToInitialOrder(nextPerm) };
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
97
|
+
if (!nextPerm || nextPerm.length === 0) {
|
|
106
98
|
return { done: true };
|
|
107
99
|
}
|
|
100
|
+
while (nextPerm.filter((x) => x || x === 0).length < nextPerm.length) {
|
|
101
|
+
nextPerm = this.getNextPerm();
|
|
102
|
+
if (!nextPerm || nextPerm.length === 0) {
|
|
103
|
+
return { done: true };
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return { done: false, value: this.revertResultPermToInitialOrder(nextPerm) };
|
|
108
107
|
}
|
|
109
108
|
getNextPerm() {
|
|
110
109
|
for (let i = this.size - 1; i >= 0 && i < this.size; i++) {
|
|
@@ -123,7 +122,7 @@ class PermutationGeneratorForSet {
|
|
|
123
122
|
}
|
|
124
123
|
else {
|
|
125
124
|
this.newPerm[i] = el;
|
|
126
|
-
this.visitedDict[
|
|
125
|
+
this.visitedDict[el] = true;
|
|
127
126
|
}
|
|
128
127
|
}
|
|
129
128
|
return this.newPerm.slice();
|
|
@@ -154,6 +153,7 @@ class PermutationGeneratorForSet {
|
|
|
154
153
|
}
|
|
155
154
|
}
|
|
156
155
|
}
|
|
156
|
+
return false;
|
|
157
157
|
}
|
|
158
158
|
getAndSetPossibleNextElementForNewPerm(newPerm, choices, currentIndsInChoices, elInd) {
|
|
159
159
|
if (currentIndsInChoices[elInd] < 0) {
|
|
@@ -168,7 +168,11 @@ class PermutationGeneratorForSet {
|
|
|
168
168
|
}
|
|
169
169
|
newPerm[elInd] = choices[currentIndsInChoices[elInd]];
|
|
170
170
|
this.visitedDict[newPerm[elInd]] = true;
|
|
171
|
-
this.choicesArrays[elInd] = this.choicesArrays[elInd].filter((x) =>
|
|
171
|
+
this.choicesArrays[elInd] = this.choicesArrays[elInd].filter((x) => {
|
|
172
|
+
var _a;
|
|
173
|
+
return ((_a = this.indexesOfSameElements) === null || _a === void 0 ? void 0 : _a[newPerm[elInd]]) &&
|
|
174
|
+
this.indexesOfSameElements[newPerm[elInd]].indexOf(x) === -1;
|
|
175
|
+
});
|
|
172
176
|
return choices[currentIndsInChoices[elInd]];
|
|
173
177
|
}
|
|
174
178
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PermutationGeneratorForSet.js","sourceRoot":"","sources":["../src/PermutationGeneratorForSet.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"PermutationGeneratorForSet.js","sourceRoot":"","sources":["../src/PermutationGeneratorForSet.ts"],"names":[],"mappings":";;;AAEA,MAAa,0BAA0B;IAcr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CAAC,KAAK,CAAE,CAAC,GAAG,KAAK,CAAC;YAC1C,oBAAoB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;YACjC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;YACtB,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IAED,kBAAkB,CAAC,UAAoB,EAAE,cAAuB;QAC9D,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3C,OAAO,KAAK,CAAC;QACf,CAAC;QAED,KAAK,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;YACjC,IAAI,CAAC,cAAc,CAAC,GAAkC,CAAC,EAAE,CAAC;gBACxD,SAAS;YACX,CAAC;YAED,KAAK,MAAM,UAAU,IAAI,cAAc,CAAC,GAAkC,CAAa,EAAE,CAAC;gBACxF,IAAI,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;oBACvC,OAAO,KAAK,CAAC;gBACf,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,8BAA8B,CAAC,OAA0B;QACvD,MAAM,UAAU,GAAsB,EAAE,CAAC;QAEzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACxC,UAAU,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAC/E,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAnQD,gEAmQC"}
|
package/lib/demo.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/demo.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const CustomPermutation_1 = require("./CustomPermutation");
|
|
4
|
+
let customPerm = new CustomPermutation_1.default([], {}, {});
|
|
5
|
+
while (true) {
|
|
6
|
+
const next = customPerm.next();
|
|
7
|
+
if (!next) {
|
|
8
|
+
break;
|
|
9
|
+
}
|
|
10
|
+
console.log(next);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=demo.js.map
|
package/lib/demo.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo.js","sourceRoot":"","sources":["../src/demo.ts"],"names":[],"mappings":";;AAAA,2DAAoD;AAEpD,IAAI,UAAU,GAAG,IAAI,2BAAiB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AACnD,OAAO,IAAI,EAAE,CAAC;IACZ,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;IAE/B,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM;IACR,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { default } from './CustomPermutation';
|
package/lib/index.js
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
while (true) {
|
|
7
|
-
let next = customPerm.next();
|
|
8
|
-
if (!next) {
|
|
9
|
-
break;
|
|
10
|
-
}
|
|
11
|
-
count++;
|
|
12
|
-
}
|
|
13
|
-
module.exports = CustomPermutation_1.default;
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
var CustomPermutation_1 = require("./CustomPermutation");
|
|
5
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return CustomPermutation_1.default; } });
|
|
14
6
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAA8C;AAArC,4GAAA,OAAO,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "custom-permutation",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": ">=18.0.0"
|
|
6
|
+
},
|
|
4
7
|
"description": "Permutation generator with custom options.",
|
|
5
8
|
"main": "lib/index.js",
|
|
6
9
|
"types": "lib/index.d.ts",
|
|
@@ -8,12 +11,13 @@
|
|
|
8
11
|
"test": "jest --config jestconfig.json",
|
|
9
12
|
"build": "tsc",
|
|
10
13
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
11
|
-
"lint": "
|
|
14
|
+
"lint": "eslint src",
|
|
12
15
|
"prepare": "npm run build",
|
|
13
16
|
"prepublishOnly": "npm test && npm run preversion",
|
|
14
|
-
"preversion": "
|
|
17
|
+
"preversion": "npm run lint",
|
|
15
18
|
"version": "npm run format && git add -A src",
|
|
16
|
-
"postversion": "git push && git push --tags"
|
|
19
|
+
"postversion": "git push && git push --tags",
|
|
20
|
+
"demo": "ts-node src/demo.ts"
|
|
17
21
|
},
|
|
18
22
|
"repository": {
|
|
19
23
|
"type": "git",
|
|
@@ -29,19 +33,22 @@
|
|
|
29
33
|
"Permutation with Options"
|
|
30
34
|
],
|
|
31
35
|
"author": "@yilmazhasan",
|
|
32
|
-
"license": "
|
|
36
|
+
"license": "GPL-3.0",
|
|
33
37
|
"bugs": {
|
|
34
38
|
"url": "https://github.com/yilmazhasan/custom-permutation/issues"
|
|
35
39
|
},
|
|
36
40
|
"homepage": "https://github.com/yilmazhasan/custom-permutation#readme",
|
|
37
41
|
"devDependencies": {
|
|
38
|
-
"@types/jest": "^
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
+
"@types/jest": "^29.5.14",
|
|
43
|
+
"@types/node": "^25.9.3",
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "^8.61.0",
|
|
45
|
+
"@typescript-eslint/parser": "^8.61.0",
|
|
46
|
+
"eslint": "^10.4.1",
|
|
47
|
+
"eslint-config-prettier": "^10.1.8",
|
|
48
|
+
"jest": "^29.7.0",
|
|
49
|
+
"prettier": "^3.8.4",
|
|
50
|
+
"ts-jest": "^29.4.11",
|
|
42
51
|
"ts-node": "^10.9.2",
|
|
43
|
-
"
|
|
44
|
-
"tslint-config-prettier": "^1.18.0",
|
|
45
|
-
"typescript": "^4.3.5"
|
|
52
|
+
"typescript": "^5.9.3"
|
|
46
53
|
}
|
|
47
54
|
}
|