ultra-mega-enumerator
Version:
Ultra Mega Enumerator is a lightweight library designed to enumerate various combinatorial objects.
56 lines (55 loc) • 1.77 kB
TypeScript
import { BitSet } from './objects/';
import { PCS12 } from './objects/';
declare class Utils {
static calcIntervalVector(input: number[]): number[];
static calcIntervalVectorFromBitSet(input: BitSet): number[];
/**
* Rotates a sequence n positions to the right. If n is negative, rotates -n positions to the left.
*
* @param arr The array to be rotated.
* @param n The number of positions to rotate. Positive for right, negative for left.
* @return A new rotated array.
*/
static rotate(arr: number[], n: number): number[];
/**
* Rotates sequence 1 position to the right.
*
* @param arr The array to be rotated.
* @return A new array rotated to the right.
*/
static rotateRight(arr: number[]): number[];
/**
* Rotates sequence 1 position to the left.
*
* @param arr The array to be rotated.
* @return A new array rotated to the left.
*/
static rotateLeft(arr: number[]): number[];
}
declare class Ordering {
private comparator;
constructor(comparator: (a: any, b: any) => number);
static natural(): Ordering;
nullsFirst(): Ordering;
getComparator(): (a: any, b: any) => number;
}
declare class CustomComparisonChain<T> {
private comparisons;
private a;
private b;
static start<T>(): CustomComparisonChain<T>;
setValues(a: T, b: T): this;
compare(comparator: (x: T, y: T) => number): this;
result(): number;
}
declare class SubsetOf {
private pCS12;
constructor(pCS12: PCS12);
apply(input: PCS12): boolean;
}
declare class SupersetOf {
private pCS12;
constructor(pCS12: PCS12);
apply(input: PCS12): boolean;
}
export { Utils, CustomComparisonChain, Ordering, SubsetOf, SupersetOf };