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

#include <Miic.h>

Public Member Functions

bool operator() (const std::tuple< std::tuple< NodeId, NodeId, NodeId > *, double, double, double > &e1, const std::tuple< std::tuple< NodeId, NodeId, NodeId > *, double, double, double > &e2) const
 

Detailed Description

Definition at line 77 of file Miic.h.

Member Function Documentation

◆ operator()()

bool gum::learning::GreaterTupleOnLast::operator() ( const std::tuple< std::tuple< NodeId, NodeId, NodeId > *, double, double, double > &  e1,
const std::tuple< std::tuple< NodeId, NodeId, NodeId > *, double, double, double > &  e2 
) const

Definition at line 91 of file Miic.cpp.

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

97  {
98  double p1xz = std::get< 2 >(e1);
99  double p1yz = std::get< 3 >(e1);
100  double p2xz = std::get< 2 >(e2);
101  double p2yz = std::get< 3 >(e2);
102  double I1 = std::get< 1 >(e1);
103  double I2 = std::get< 1 >(e2);
104  // First, we look at the sign of information.
105  // Then, the probility values
106  // and finally the abs value of information.
107  if ((I1 < 0 && I2 < 0) || (I1 >= 0 && I2 >= 0)) {
108  if (std::max(p1xz, p1yz) == std::max(p2xz, p2yz)) {
109  return std::abs(I1) > std::abs(I2);
110  } else {
111  return std::max(p1xz, p1yz) > std::max(p2xz, p2yz);
112  }
113  } else {
114  return I1 < I2;
115  }
116  }
Potential< GUM_SCALAR > abs(const Potential< GUM_SCALAR > &arg)
Definition: potential.h:617
+ Here is the call graph for this function:

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