Chalkboard - v3.0.4
    Preparing search index...

    Function group

    • Defines an algebraic structure known as a group.

      Type Parameters

      • T

      Parameters

      • set: ChalkboardSet<T>

        The set of the group

      • operation: (a: T, b: T) => T

        The operation of the group

      • Optionalidentity: T

        The identity element of the group (optional if the set is Z, Q, R, C, A, S, M, or GL)

      • Optionalinverter: (a: T) => T

        The function to calculate the inverse of an element of the group (optional if the set is Z, Q, R, C, M, A, S, or GL)

      Returns ChalkboardStructure<T>

      const Z4 = Chalkboard.abal.group(Chalkboard.abal.Z(4), (a, b) => (a + b) % 4, 0, (a) => (4 - a) % 4);
      const valid = Chalkboard.abal.isGroup(Z4); // Returns true