aGrUM 3.1.1
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 85 of file Miic.h.

Member Function Documentation

◆ operator()()

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

Definition at line 103 of file Miic.cpp.

104 {
105 double p1xz = std::get< 2 >(e1);
106 double p1yz = std::get< 3 >(e1);
107 double p2xz = std::get< 2 >(e2);
108 double p2yz = std::get< 3 >(e2);
109 double I1 = std::get< 1 >(e1);
110 double I2 = std::get< 1 >(e2);
111 if ((I1 < 0 && I2 < 0) || (I1 >= 0 && I2 >= 0)) {
112 if (std::max(p1xz, p1yz) == std::max(p2xz, p2yz)) {
113 return std::abs(I1) > std::abs(I2);
114 } else {
115 return std::max(p1xz, p1yz) > std::max(p2xz, p2yz);
116 }
117 } else {
118 return I1 < I2;
119 }
120 }

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