aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
gum::learning::GreaterTupleOnLast Class Reference

#include <Miic.h>

Public Member Functions

bool operator() (const ProbabilisticRanking &e1, const ProbabilisticRanking &e2) const
 

Detailed Description

Definition at line 75 of file Miic.h.

Member Function Documentation

◆ operator()()

bool gum::learning::GreaterTupleOnLast::operator() ( const ProbabilisticRanking e1,
const ProbabilisticRanking e2 
) const

Definition at line 83 of file Miic.cpp.

References gum::learning::genericBNLearner::Database::Database().

84  {
85  double p1xz = std::get< 2 >(e1);
86  double p1yz = std::get< 3 >(e1);
87  double p2xz = std::get< 2 >(e2);
88  double p2yz = std::get< 3 >(e2);
89  double I1 = std::get< 1 >(e1);
90  double I2 = std::get< 1 >(e2);
91  // First, we look at the sign of information.
92  // Then, the probability values
93  // and finally the abs value of information.
94  if ((I1 < 0 && I2 < 0) || (I1 >= 0 && I2 >= 0)) {
95  if (std::max(p1xz, p1yz) == std::max(p2xz, p2yz)) {
96  return std::abs(I1) > std::abs(I2);
97  } else {
98  return std::max(p1xz, p1yz) > std::max(p2xz, p2yz);
99  }
100  } else {
101  return I1 < I2;
102  }
103  }
Potential< GUM_SCALAR > abs(const Potential< GUM_SCALAR > &arg)
Definition: potential.h:595
+ Here is the call graph for this function:

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