Class MaxList

Object
MaxList
All Implemented Interfaces:
Computation<Pair<DRes<SInt>,​DRes<SInt>>,​ProtocolBuilderNumeric>

public class MaxList
extends Object
implements Computation<Pair<DRes<SInt>,​DRes<SInt>>,​ProtocolBuilderNumeric>
Given a list X = [x0, ..., xn-1] with n a power of 2, this method returns a pair [max(X), i : xi = max(X)]. In the case of ties, the highest index is chosen. The algorithm is in log n rounds each with a total of n-1 comparisons where n is the number of inputs.
  • Constructor Details

  • Method Details

    • withSFixed

      public static Computation<Pair<DRes<SFixed>,​DRes<SInt>>,​ProtocolBuilderNumeric> withSFixed​(List<DRes<SFixed>> input)
    • buildComputation

      public DRes<Pair<DRes<SInt>,​DRes<SInt>>> buildComputation​(ProtocolBuilderNumeric builder)
      Specified by:
      buildComputation in interface Computation<Pair<DRes<SInt>,​DRes<SInt>>,​ProtocolBuilderNumeric>