IR2Vec
Loading...
Searching...
No Matches
Triple.h
1#ifndef TRIPLE_H
2#define TRIPLE_H
3#include "Setting.h"
4
5struct Triple {
6
7 INT h, r, t;
8
9 static bool cmp_head(const Triple &a, const Triple &b) {
10 return (a.h < b.h) || (a.h == b.h && a.r < b.r) ||
11 (a.h == b.h && a.r == b.r && a.t < b.t);
12 }
13
14 static bool cmp_tail(const Triple &a, const Triple &b) {
15 return (a.t < b.t) || (a.t == b.t && a.r < b.r) ||
16 (a.t == b.t && a.r == b.r && a.h < b.h);
17 }
18
19 static bool cmp_rel(const Triple &a, const Triple &b) {
20 return (a.h < b.h) || (a.h == b.h && a.t < b.t) ||
21 (a.h == b.h && a.t == b.t && a.r < b.r);
22 }
23
24 static bool cmp_rel2(const Triple &a, const Triple &b) {
25 return (a.r < b.r) || (a.r == b.r && a.h < b.h) ||
26 (a.r == b.r && a.h == b.h && a.t < b.t);
27 }
28};
29
30#endif
Definition Triple.h:5