-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathPartitionTarget.h
63 lines (48 loc) · 1.65 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
// SPDX-FileCopyrightText: 2023 Technical University of Munich
//
// SPDX-License-Identifier: BSD-3-Clause
/**
* @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
*
* @author David Schneller <[email protected]>
*/
#ifndef PUML_PARTITION_TARGET_H
#define PUML_PARTITION_TARGET_H
#include <cstddef>
#ifdef USE_MPI
#endif // USE_MPI
#include <vector>
#include <cassert>
namespace PUML {
class PartitionTarget {
public:
PartitionTarget() = default;
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; }
[[nodiscard]] auto vertexWeights() const -> const std::vector<double>& { return m_vertexWeights; }
[[nodiscard]] auto vertexWeightsUniform() const -> bool { return m_vertexWeights.empty(); }
[[nodiscard]] auto imbalance() const -> double { return m_imbalance; }
[[nodiscard]] auto vertexCount() const -> std::size_t { return m_vertexCount; }
private:
std::vector<double> m_vertexWeights;
std::size_t m_vertexCount{};
double m_imbalance{};
};
} // namespace PUML
#endif