Direct Graphical Models  v.1.7.0
Graph3.h
1 // (triplet) Graph class interface;
2 // Written by Sergey G. Kosov in 2014 for Project X
3 #pragma once
4 
5 #include "GraphPairwise.h"
6 
7 namespace DirectGraphicalModels
8 {
9  // =============================== Triplet Structure ==============================
14  struct Triplet {
15  size_t node1;
16  size_t node2;
17  size_t node3;
18 
19  Triplet(void) {}
20 
21  Triplet(size_t n1, size_t n2, size_t n3) : node1(n1), node2(n2), node3(n3) {}
22  };
23  using vec_triplet_t = std::vector<Triplet>;
24 
25  // ================================ Graph3 Class ================================
31  class CGraph3 : public CGraphPairwise
32  {
33  public:
38  DllExport CGraph3(byte nStates) : CGraphPairwise(nStates) {}
39  DllExport virtual ~CGraph3(void) {}
40 
41 
42 
49  DllExport void addTriplet(dword Node1, dword Node2, dword Node3);
57  DllExport void addTriplet(dword Node1, dword Node2, dword Node3, const Mat &pot);
65  DllExport void setTriplet(dword Node1, dword Node2, dword Node3, const Mat &pot);
66  };
67 }
virtual ~CGraph3(void)
Definition: Graph3.h:39
size_t node2
Second node in edge.
Definition: Graph3.h:16
size_t node3
Third node in edge.
Definition: Graph3.h:17
void addTriplet(dword Node1, dword Node2, dword Node3)
Adds an additional directed edge.
Definition: Graph3.cpp:5
CGraph3(byte nStates)
Constructor.
Definition: Graph3.h:38
Triple graph class.
Definition: Graph3.h:31
std::vector< Triplet > vec_triplet_t
Definition: Graph3.h:23
size_t node1
First node in edge.
Definition: Graph3.h:15
Triplet structure
Definition: Graph3.h:14
void setTriplet(dword Node1, dword Node2, dword Node3, const Mat &pot)
Sets or changes the potentional of directed edge.
Definition: Graph3.cpp:13
Triplet(size_t n1, size_t n2, size_t n3)
Definition: Graph3.h:21