-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweighedClique.h
99 lines (72 loc) · 2.07 KB
/
weighedClique.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#ifndef CLIQUE2_H
#define CLIQUE2_H
#include <list>
#include <algorithm>
#include <vector>
#include <iostream>
#include <cfloat>
class clique
{
protected:
std::vector<size_t> nodes;
public:
friend std::ostream& operator <<(std::ostream &os,const clique &obj);
clique();
const size_t size() const;
const size_t at(const size_t i) const;
//virtual void addNodes(const std::vector<size_t> & unsorted_nodes);
virtual void copyClique(const clique & old_clique);
/*
clique( clique & old_clique) {
copyClique(old_clique);
}
clique( const clique & old_clique) {
copyClique(old_clique);
}
*/
void replaceNodes( const std::vector<size_t> & unsorted_nodes );
void printClique() const;
clique(const std::vector<size_t> & unsorted_nodes);
bool operator== ( const clique & clique2 ) const;
bool operator!= ( const clique & clique2 ) const;
bool operator< ( const clique & clique2) const;
~clique()
{
// nodes.clear();
}
};
#endif
#ifndef W_CLIQUE_H
#define W_CLIQUE_H
// #include <math.h>
#include "../lcelib/Nets.H"
//#include "clique2.H"
//#ifndef NET_TYPE
//#define NET_TYPE
typedef SymmNet<float> NetType;
//#endif
class weighedClique: public clique
{
private:
float weight;
void getLinks(const NetType & net);
public:
weighedClique();
float (weighedClique::*weightFunc)(const NetType &) const; // define function pointer
weighedClique( const std::vector<size_t> & unsorted_nodes, const NetType & net, size_t funcType = 0 );
void addNodes(const std::vector<size_t> & unsorted_nodes, const NetType & net);
void copyClique(const weighedClique & old_clique);
void replaceNodes( const std::vector<size_t> & unsorted_nodes, const NetType & net );
float getWeight() const
{
return weight;
}
//wanha
float minWeight(const NetType & net) const;
//wanha
float maxWeight(const NetType & net) const;
//wanha
float intensity(const NetType & net) const;
void printWeightedClique(std::ostream & file) const;
};
#endif