votes
    Preparing search index...

    Function matrixFromBallots

    • Pairwise matrix: array[i][j] is the weight of ballots ranking candidate i above candidate j, rounded to the 1e-6 tie tolerance so that fractional weights tie as they should (0.4 + 0.2 floats above 0.6).

      Type Parameters

      • C extends string

      Parameters

      • ballots: readonly Ballot<C>[]
      • _candidates: readonly C[]
      • unrankedLast: boolean = true

        whether a ballot ranks the candidates it leaves out below the others (default true). Pass false to count only what it ranks.

      Returns Matrix<C>