-
Notifications
You must be signed in to change notification settings - Fork 4
/
PartitionTarget.h
81 lines (64 loc) · 1.76 KB
/
PartitionTarget.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
/**
* @file
* This file is part of PUML
*
* For conditions of distribution and use, please see the copyright
* notice in the file 'COPYING' at the root directory of this package
* and the copyright notice at https://github.com/TUM-I5/PUMGen
*
* @copyright 2023 Technische Universitaet Muenchen
* @author David Schneller <[email protected]>
*/
#ifndef PUML_PARTITION_TARGET_H
#define PUML_PARTITION_TARGET_H
#ifdef USE_MPI
#include <mpi.h>
#endif // USE_MPI
#include <vector>
#include <cassert>
#include "Topology.h"
#include "PUML.h"
#include "utils/logger.h"
namespace PUML
{
class PartitionTarget {
public:
PartitionTarget() {}
void setVertexWeightsUniform(std::size_t vertexCount) {
m_vertexCount = vertexCount;
m_vertexWeights.clear();
}
void setVertexWeights(const std::vector<double>& vertexWeights) {
m_vertexWeights = vertexWeights;
m_vertexCount = vertexWeights.size();
}
void setVertexWeights(std::size_t vertexCount, double* vertexWeights) {
m_vertexCount = vertexCount;
m_vertexWeights = std::vector<double>(vertexWeights, vertexWeights + vertexCount);
}
void setImbalance(double imbalance) {
m_imbalance = imbalance;
}
const std::vector<double>& vertexWeights() const {
return m_vertexWeights;
}
bool vertexWeightsUniform() const {
return m_vertexWeights.empty();
}
bool edgeWeightsUniform() const {
// TODO: implement non-uniform
return true;
}
double imbalance() const {
return m_imbalance;
}
std::size_t vertexCount() const {
return m_vertexCount;
}
private:
std::vector<double> m_vertexWeights;
std::size_t m_vertexCount;
double m_imbalance;
};
}
#endif