forked from seub/Harmony
-
Notifications
You must be signed in to change notification settings - Fork 0
/
discreteheatflowiterator.h
42 lines (30 loc) · 1.24 KB
/
discreteheatflowiterator.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
#ifndef DISCRETEHEATFLOWITERATOR_H
#define DISCRETEHEATFLOWITERATOR_H
#include "tools.h"
template <typename Point, typename Map> class LiftedGraphFunction;
template <typename Point, typename Map> class DiscreteHeatFlowIterator
{
public:
DiscreteHeatFlowIterator(const LiftedGraphFunction<Point, Map> *initialFunction);
void iterate();
void iterate(uint nbIterations);
void getOutputFunction(LiftedGraphFunction<Point, Map> *outputFunction);
double updateSupDelta();
void reset();
Point getValue(uint index) const {return newValues.at(index);}
private:
void refreshNeighborsValuesKicked();
void updateValues();
void refreshOutput();
const uint nbBoundaryPoints;
const uint nbPoints;
const std::vector< std::vector<uint> > neighborsIndices;
const std::vector< std::vector<double> > neighborsWeights;
const std::vector< std::vector<Map> > boundaryPointsNeighborsPairingsValues;
std::vector<Point> initialValues, oldValues, newValues;
std::vector< std::vector<Point> > oldNeighborsValuesKicked, newNeighborsValuesKicked;
const std::unique_ptr<LiftedGraphFunction<Point, Map> > outputFunction;
double supDelta;
std::vector<double> errors;
};
#endif // DISCRETEHEATFLOWITERATOR_H