Package sim.util.distribution
Class BreitWigner
java.lang.Object
sim.util.distribution.AbstractDistribution
sim.util.distribution.AbstractContinuousDistribution
sim.util.distribution.BreitWigner
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BreitWignerMeanSquare
BreitWigner (aka Lorentz) distribution; See the math definition.
A more general form of the Cauchy distribution.
Static methods operate on a default uniform random number generator; they are synchronized.
Instance methods operate on a user supplied uniform random number generator; they are unsynchronized.
Implementation: This is a port of RandBreitWigner used in CLHEP 1.4.0 (C++).
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected double
protected double
protected double
Fields inherited from class sim.util.distribution.AbstractDistribution
randomGenerator
-
Constructor Summary
ConstructorDescriptionBreitWigner
(double mean, double gamma, double cut, MersenneTwisterFast randomGenerator) Constructs a BreitWigner distribution. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns a random number from the distribution.double
nextDouble
(double mean, double gamma, double cut) Returns a random number from the distribution; bypasses the internal state.void
setState
(double mean, double gamma, double cut) Sets the mean, gamma and cut parameters.toString()
Returns a String representation of the receiver.Methods inherited from class sim.util.distribution.AbstractDistribution
apply, apply, getRandomGenerator, nextInt, setRandomGenerator
-
Field Details
-
mean
protected double mean -
gamma
protected double gamma -
cut
protected double cut
-
-
Constructor Details
-
BreitWigner
Constructs a BreitWigner distribution.- Parameters:
cut
- cut==Double.NEGATIVE_INFINITY indicates "don't cut".
-
-
Method Details
-
nextDouble
public double nextDouble()Returns a random number from the distribution.- Specified by:
nextDouble
in classAbstractDistribution
-
nextDouble
public double nextDouble(double mean, double gamma, double cut) Returns a random number from the distribution; bypasses the internal state.- Parameters:
cut
- cut==Double.NEGATIVE_INFINITY indicates "don't cut".
-
setState
public void setState(double mean, double gamma, double cut) Sets the mean, gamma and cut parameters.- Parameters:
cut
- cut==Double.NEGATIVE_INFINITY indicates "don't cut".
-
toString
Returns a String representation of the receiver.
-