Logical comparisons

#define COMPARE(OP)
 Create logical comparison operator functions.
#define COMPARE_T(OP)
 Create logical comparison operator functions.
#define COMPARE(OP)
 Create logical comparison operator functions.
#define COMPARE_T(OP)
 Create logical comparison operator functions.

Detailed Description

Both the likelihood and probability classes are derived from the boost::operators classes. As a result, these logical comparison operators are the foundation for a complete set of comparison operators. Both classes support the equality comparable and totally ordered concepts.

Define Documentation

#define COMPARE OP   ) 
 

Value:

template <typename Ldomain, typename Lvalue, typename Lvalidator,         \
              typename Rdomain, typename Rvalue, typename Rvalidator>         \
    bool                                                                      \
    operator OP (const probability<Ldomain,Lvalue,Lvalidator>& lhs,           \
                 const probability<Rdomain,Rvalue,Rvalidator>& rhs)           \
    { return lhs.value_cast(log_domain()) OP rhs.value_cast(log_domain()); }
Create logical comparison operator functions.

This macro simplifies the creation of the necessary logical comparisons between two probability quantities as they are all essentially the same, differing only in the probability types being compared.

Operators include the full range of logical comparisons (==, !=, <, <=, >=, >).

#define COMPARE OP   ) 
 

Value:

template <typename Ldomain, typename Lvalue, typename Lvalidator,         \
              typename Rdomain, typename Rvalue, typename Rvalidator>         \
    bool                                                                      \
    operator OP (const likelihood<Ldomain,Lvalue,Lvalidator>& lhs,            \
                 const likelihood<Rdomain,Rvalue,Rvalidator>& rhs)            \
    { return lhs.value_cast(log_domain()) OP rhs.value_cast(log_domain()); }  \
    template <typename Ldomain, typename Lvalue, typename Lvalidator,         \
              typename Rdomain, typename Rvalue, typename Rvalidator>         \
    bool                                                                      \
    operator OP (const likelihood<Ldomain,Lvalue,Lvalidator>& lhs,            \
                 const probability<Rdomain,Rvalue,Rvalidator>& rhs)           \
    { return lhs.value_cast(log_domain()) OP rhs.value_cast(log_domain()); }  \
    template <typename Ldomain, typename Lvalue, typename Lvalidator,         \
              typename Rdomain, typename Rvalue, typename Rvalidator>         \
    bool                                                                      \
    operator OP (const probability<Ldomain,Lvalue,Lvalidator>& lhs,           \
                 const likelihood<Rdomain,Rvalue,Rvalidator>& rhs)            \
    { return lhs.value_cast(log_domain()) OP rhs.value_cast(log_domain()); }
Create logical comparison operator functions.

This macro simplifies the creation of the necessary logical comparisons between two likelihood quantities as they are all essentially the same, differing only in the likelihood types being compared.

Operators include the full range of logical comparisons (==, !=, <, <=, >=, >).

#define COMPARE_T OP   ) 
 

Value:

template <typename Domain,typename Value,typename Validator,typename T>   \
    bool                                                                      \
    operator OP (const probability<Domain,Value,Validator>& lhs, const T& rhs)\
    {                                                                         \
      function_requires< ConvertibleConcept<T,Value> >();                     \
      return lhs.value_cast(linear_domain()) OP rhs;                          \
    }                                                                         \
    template <typename Domain,typename Value,typename Validator,typename T>   \
    bool                                                                      \
    operator OP (const T& lhs, const probability<Domain,Value,Validator>& rhs)\
    {                                                                         \
      function_requires< ConvertibleConcept<T,Value> >();                     \
      return lhs OP rhs.value_cast(linear_domain());                          \
    }
Create logical comparison operator functions.

This macro simplifies the creation of the necessary logical comparisons between a probability quantity and another type as they are all essentially the same, differing only in the types being compared.

Operators include the full range of logical comparisons (==, !=, <, <=, >=, >).

#define COMPARE_T OP   ) 
 

Value:

template <typename Domain,typename Value,typename Validator,typename T>   \
    bool                                                                      \
    operator OP (const likelihood<Domain,Value,Validator>& lhs, const T& rhs) \
    {                                                                         \
      function_requires< ConvertibleConcept<T,Value> >();                     \
      return lhs.value_cast(linear_domain()) OP rhs;                          \
    }                                                                         \
    template <typename Domain,typename Value,typename Validator,typename T>   \
    bool                                                                      \
    operator OP (const T& lhs, const likelihood<Domain,Value,Validator>& rhs) \
    {                                                                         \
      function_requires< ConvertibleConcept<T,Value> >();                     \
      return lhs OP rhs.value_cast(linear_domain());                          \
    }
Create logical comparison operator functions.

This macro simplifies the creation of the necessary logical comparisons between a likelihood quantity and another type as they are all essentially the same, differing only in the types being compared.

Operators include the full range of logical comparisons (==, !=, <, <=, >=, >).


Generated on Thu Oct 18 11:10:28 2007 for Boost.Probability: C++ Probability and Likelihood Library by  doxygen 1.4.5