Sample.hpp 1.02 KB
Newer Older
1
2
#ifndef SAMPLE_HPP
#define SAMPLE_HPP
niklas.baumgarten's avatar
niklas.baumgarten committed
3

4
#include "Level.hpp"
niklas.baumgarten's avatar
niklas.baumgarten committed
5

niklas.baumgarten's avatar
niklas.baumgarten committed
6
#include "matrixgraph/CellMatrixGraph.hpp"
niklas.baumgarten's avatar
niklas.baumgarten committed
7
#include "Algebra.hpp"
8

9
10
11
#include <string>


12
struct SampleID {
13
14
15
16
17
18
    Level level;

    int number;

    bool coarse;

19
    SampleID() {}
20

21
    SampleID(Level level, int number, bool coarse) :
22
23
24
25
26
27
28
        level(level), number(number), coarse(coarse) {}

    int MGLevel() const;

    std::string Str() const;
};

niklas.baumgarten's avatar
niklas.baumgarten committed
29

30
struct SampleSolution {
31
32
    std::string name = "U";

33
    SampleID id;
34
35
36
37
38
39
40

    double Q;

    double Cost;

    Vector U;

niklas.baumgarten's avatar
niklas.baumgarten committed
41
42
43
44
45
    SampleSolution(MatrixGraph *solMGraph) :
        U(Vector((*solMGraph))) {
        Init();
    }

46
47
    SampleSolution(MatrixGraphs *solMGraphs, int mGlevel) :
        U(Vector((*solMGraphs)[mGlevel])) {
48
49
50
        Init();
    }

51
    SampleSolution(MatrixGraphs *solMGraphs, const SampleID &id) :
niklas.baumgarten's avatar
niklas.baumgarten committed
52
        id(id), U(Vector((*solMGraphs)[id.MGLevel()])) {
53
54
55
        Init();
    }

56
57
58
59
60
    SampleSolution(Vector U, const SampleID &id) :
        id(id), U(U) {
        Init();
    }

61
    void Init();
62
63
};

64
#endif //SAMPLE_HPP