# Class BetaDistribution
Wrapper for beta distribution which is not part of the stl random module.

Defined in | <seqan/random.h>
Signature | `class BetaDistribution<TRealType>;`

## Template Parameters

`TRealType` | A floating-point type. Aliased as member type result_type. By default, this is double.

## Member Function Overview

- `explicit BetaDistribution(a, b), explicit BetaDistribution(param)`
  Constructor for the beta distribution.

## Interface Function Overview

- `TRealType alpha();`
  Returns the alpha parameter associated with the beta distribution.
- `TRealType beta();`
  Returns the beta parameter associated with the beta distribution.
- `TRealType max();`
  Maximum value.
- `TRealType min();`
  Minimum value.
- `TRealType operator(rng); TRealType operator(rng, param);`
  Generate random number.
- `stream operator<<(stream, beta);`
  Writes to output stream.
- `stream operator>>(stream, beta);`
  Reads from input stream.
- `TParamType param() const;`
  Returns the parameters of this distribution.
- `void setParam(param);`
  Sets the given parameters to this distribution.

## Detailed Description

This distribution produces random numbers that are distributed according to the beta distribution.

## Member Functions Detail

### `explicit BetaDistribution(a, b) explicit BetaDistribution(param)`

Constructor for the beta distribution.

#### Parameters

`a` | Tha alpha value of the beta distribution. Defaults to 2.0.
`b` | Tha beta value of the beta distribution. Defaults to 2.0.
`param` | Tha param type of the beta distribution.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

## Interface Functions Detail

### `TRealType alpha();`

Returns the alpha parameter associated with the beta distribution.

#### Returns

`TRealType` | Returns the alpha parameter.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

### `TRealType beta();`

Returns the beta parameter associated with the beta distribution.

#### Returns

`TRealType` | Returns the beta parameter.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

### `TRealType max();`

Maximum value.

#### Returns

`TRealType` | Returns the least upper bound of the range of values potentially returned by member operator().

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

### `TRealType min();`

Minimum value.

#### Returns

`TRealType` | Returns the greatest lower bound of the range of values potentially returned by member operator(), which for `BetaDistribution` is always zero.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

### `TRealType operator(rng); TRealType operator(rng, param);`

Generate random number.

#### Parameters

`rng` | The random number generator engine.
`param` | The parameter to used for the distribution.

#### Returns

`TRealType` | The generated random number.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

### `stream operator<<(stream, beta);`

Writes to output stream.

#### Parameters

`stream` | The stream to write to.
`beta` | An instance of the beta distribution.

#### Returns

`stream` | The updated stream to write too.

Writes a textual representation of the distribution parameters and any other internal data kept by the object, in such a way that if this same text is inserted using `operator>>` into an object of the same type, the same sequence of random numbers would be generated by equivalent invocations of `operator()`.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

#### See Also

- BetaDistribution#operator>>

### `stream operator>>(stream, beta);`

Reads from input stream.

#### Parameters

`stream` | The stream to read from.
`beta` | An instance of the beta distribution to read from input.

#### Returns

`stream` | The updated stream to write too.

Restores the distribution parameters and any other internal data into distr from the textual representation provided by is.

`beta` will generate the same sequence of random numbers as if equivalent invocations of `operator()` were performed on the object of the same type from which the provided text was obtained.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

#### See Also

- BetaDistribution#operator>>

### `TParamType param() const;`

Returns the parameters of this distribution.

#### Returns

`TParamType` | The parameter of this distribution. Of type `typename BetaDistribution\<TRealType\>::param_type` .

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

#### See Also

- setParam

### `void setParam(param);`

Sets the given parameters to this distribution.

#### Parameters

`param` | The parameters to be set to this distribution.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

#### See Also

- param

#### Dox Sources

    /*!
     * @class BetaDistribution
     *
     * @headerfile <seqan/random.h>
     *
     * @brief Wrapper for beta distribution which is not part of the stl random
     *        module.
     *
     * @signature class BetaDistribution<TRealType>;
     *
     * @tparam TRealType A floating-point type. Aliased as member type result_type.
     *                   By default, this is double.
     *
     * This distribution produces random numbers that are distributed according to
     * the beta distribution.
     *
     * @fn BetaDistribution::BetaDistribution
     *
     * @brief Constructor for the beta distribution.
     *
     * @signature explicit BetaDistribution(a, b)
     * @signature explicit BetaDistribution(param)
     *
     * @param[in] a Tha alpha value of the beta distribution. Defaults to 2.0.
     * @param[in] b Tha beta value of the beta distribution. Defaults to 2.0.
     * @param[in] param Tha param type of the beta distribution.
     *
     *
     *
     * @fn BetaDistribution#param
     *
     * @brief Returns the parameters of this distribution.
     *
     * @signature TParamType param() const;
     *
     * @return TParamType The parameter of this distribution. Of type <tt> typename
     *                    BetaDistribution\<TRealType\>::param_type </tt>.
     *
     * @see BetaDistribution#setParam
     *
     * @fn BetaDistribution#setParam
     *
     * @brief Sets the given parameters to this distribution.
     *
     * @signature void setParam(param);
     *
     * @param[in] param The parameters to be set to this distribution.
     *
     * @see BetaDistribution#param
     *
     * @fn BetaDistribution#operator()
     *
     * @brief Generate random number.
     *
     * @signature TRealType operator(rng); TRealType operator(rng, param);
     *
     * @param[in,out] rng The random number generator engine.
     * @param[in] param The parameter to used for the distribution.
     *
     * @return TRealType The generated random number.
     *
     * @fn BetaDistribution#min
     *
     * @brief Minimum value.
     *
     * @signature TRealType min();
     *
     * @return TRealType Returns the greatest lower bound of the range of values
     *                   potentially returned by member operator(), which for
     *                   <tt>BetaDistribution</tt> is always zero.
     *
     * @fn BetaDistribution#max
     *
     * @brief Maximum value.
     *
     * @signature TRealType max();
     *
     * @return TRealType Returns the least upper bound of the range of values
     *                   potentially returned by member operator().
     *
     * @fn BetaDistribution#alpha
     *
     * @brief Returns the alpha parameter associated with the beta distribution.
     *
     * @signature TRealType alpha();
     *
     * @return TRealType Returns the alpha parameter.
     *
     * @fn BetaDistribution#beta
     *
     * @brief Returns the beta parameter associated with the beta distribution.
     *
     * @signature TRealType beta();
     *
     * @return TRealType Returns the beta parameter.
     *
     * @fn BetaDistribution#operator<<
     *
     * @brief Writes to output stream.
     *
     * @signature stream operator<<(stream, beta);
     *
     * @param[in,out] stream The stream to write to.
     * @param[in] beta An instance of the beta distribution.
     *
     * @return stream The updated stream to write too.
     *
     * Writes a textual representation of the distribution parameters and any other
     * internal data kept by the object, in such a way that if this same text is
     * inserted using <tt>operator>></tt> into an object of the same type, the same
     * sequence of random numbers would be generated by equivalent invocations of
     * <tt>operator()</tt>.
     *
     * @see BetaDistribution#operator>>
     *
     * @fn BetaDistribution#operator>>
     *
     * @brief Reads from input stream.
     *
     * @signature stream operator>>(stream, beta);
     *
     * @param[in,out] stream The stream to read from.
     * @param[in,out] beta An instance of the beta distribution to read from input.
     *
     * @return stream The updated stream to write too.
     *
     * Restores the distribution parameters and any other internal data into distr
     * from the textual representation provided by is.
     *
     * <tt>beta</tt> will generate the same sequence of random numbers as if
     * equivalent invocations of <tt>operator()</tt> were performed on the object of
     * the same type from which the provided text was obtained.
     *
     * @see BetaDistribution#operator>>
     */