Drake
exponential_distribution< drake::symbolic::Expression > Class Template Reference

Detailed Description

template<>
class std::exponential_distribution< drake::symbolic::Expression >

Provides std::exponential_distribution, Exp(λ), for symbolic expressions.

When operator() is called, it returns a symbolic expression v / λ where v is a symbolic random variable associated with the standard exponential distribution (λ = 1).

See also
std::normal_distribution<drake::symbolic::Expression> for the internal representation of this implementation.

#include <drake/common/symbolic_expression.h>

Public Types

using RealType = drake::symbolic::Expression
 
using result_type = RealType
 

Public Member Functions

 exponential_distribution (RealType lambda)
 Constructs a new distribution object with lambda. More...
 
 exponential_distribution ()
 Constructs a new distribution object with lambda = 1.0. More...
 
void reset ()
 Resets the internal state of the distribution object. More...
 
result_type operator() ()
 Generates a symbolic expression representing a random value that is distributed according to the associated probability function. More...
 
template<class Generator >
result_type operator() (Generator &)
 Generates a symbolic expression representing a random value that is distributed according to the associated probability function. More...
 
RealType lambda () const
 Returns the lambda λ distribution parameter. More...
 
result_type min () const
 Returns the minimum potentially generated value. More...
 
result_type max () const
 Returns the maximum potentially generated value. More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 exponential_distribution (const exponential_distribution &)=default
 
exponential_distributionoperator= (const exponential_distribution &)=default
 
 exponential_distribution (exponential_distribution &&)=default
 
exponential_distributionoperator= (exponential_distribution &&)=default
 

Friends

bool operator== (const exponential_distribution< drake::symbolic::Expression > &lhs, const exponential_distribution< drake::symbolic::Expression > &rhs)
 

Member Typedef Documentation

◆ RealType

◆ result_type

Constructor & Destructor Documentation

◆ exponential_distribution() [1/4]

exponential_distribution ( RealType  lambda)
explicit

Constructs a new distribution object with lambda.

Exceptions
std::exceptionif lambda is a non-positive constant expression.

◆ exponential_distribution() [2/4]

exponential_distribution ( )

Constructs a new distribution object with lambda = 1.0.

◆ exponential_distribution() [3/4]

exponential_distribution ( const exponential_distribution< drake::symbolic::Expression > &  )
default

◆ exponential_distribution() [4/4]

exponential_distribution ( exponential_distribution< drake::symbolic::Expression > &&  )
default

Member Function Documentation

◆ lambda()

RealType lambda ( ) const

Returns the lambda λ distribution parameter.

◆ max()

result_type max ( ) const

Returns the maximum potentially generated value.

Note
that in libstdc++ exponential_distribution<>::max() returns DBL_MAX while the one in libc++ returns INFINITY. We follows libc++ and return INFINITY.

◆ min()

result_type min ( ) const

Returns the minimum potentially generated value.

◆ operator()() [1/2]

result_type operator() ( )

Generates a symbolic expression representing a random value that is distributed according to the associated probability function.

◆ operator()() [2/2]

result_type operator() ( Generator &  )

Generates a symbolic expression representing a random value that is distributed according to the associated probability function.

Note
We provide this method, which takes a random generator, for compatibility with the std::exponential_distribution::operator().

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ reset()

void reset ( )

Resets the internal state of the distribution object.

Friends And Related Function Documentation

◆ operator==

bool operator== ( const exponential_distribution< drake::symbolic::Expression > &  lhs,
const exponential_distribution< drake::symbolic::Expression > &  rhs 
)
friend

The documentation for this class was generated from the following file: