Compounds<T> constructor

Compounds<T>(
  1. List<T> items
)

Implementation

Compounds(List<T> items)
    : _items = List<T>.from(items, growable: false),
      _length = (List<BigInt>.generate(
              items.length + 1, (r) => nPr(items.length, r))
          .fold<BigInt>(BigInt.zero, (a, b) => a + b)) {
  if (!itemsAreUnique(items)) throw Exception("Items are not unique.");
}