Sample.hpp 934 Bytes
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
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <string>


struct Sample {
    Level level;

    int number;

    bool coarse;

    Sample() {}

    Sample(Level level, int number, bool coarse) :
        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
    Sample 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 Sample &id) :
niklas.baumgarten's avatar
niklas.baumgarten committed
52
        id(id), U(Vector((*solMGraphs)[id.MGLevel()])) {
53
54
55
        Init();
    }

56
    void Init();
57
58
};

59
#endif //SAMPLE_HPP