Class SampleBernoulliDistribution
java.lang.Object
dk.alexandra.fresco.stat.sampling.SampleBernoulliDistribution
- All Implemented Interfaces:
dk.alexandra.fresco.framework.builder.Computation<dk.alexandra.fresco.framework.value.SInt,dk.alexandra.fresco.framework.builder.numeric.ProtocolBuilderNumeric>
public class SampleBernoulliDistribution extends Object implements dk.alexandra.fresco.framework.builder.Computation<dk.alexandra.fresco.framework.value.SInt,dk.alexandra.fresco.framework.builder.numeric.ProtocolBuilderNumeric>
Sample a number from a Bernoulli distribution which is 0 with probability p and 1 with
probability 1-p.
-
Constructor Summary
Constructors Constructor Description SampleBernoulliDistribution(double p)SampleBernoulliDistribution(dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> p) -
Method Summary
Modifier and Type Method Description dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>buildComputation(dk.alexandra.fresco.framework.builder.numeric.ProtocolBuilderNumeric root)
-
Constructor Details
-
SampleBernoulliDistribution
public SampleBernoulliDistribution(double p) -
SampleBernoulliDistribution
public SampleBernoulliDistribution(dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> p)
-
-
Method Details
-
buildComputation
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt> buildComputation(dk.alexandra.fresco.framework.builder.numeric.ProtocolBuilderNumeric root)- Specified by:
buildComputationin interfacedk.alexandra.fresco.framework.builder.Computation<dk.alexandra.fresco.framework.value.SInt,dk.alexandra.fresco.framework.builder.numeric.ProtocolBuilderNumeric>
-