-
Notifications
You must be signed in to change notification settings - Fork 1
/
discreteflowiterator.h
94 lines (59 loc) · 2.49 KB
/
discreteflowiterator.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
82
83
84
85
86
87
88
89
90
91
92
93
94
#ifndef DISCRETEFLOWITERATOR_H
#define DISCRETEFLOWITERATOR_H
#include "tools.h"
#include "h2tangentvector.h"
template<typename Point, typename Map> class LiftedGraphFunction;
template<typename Point, typename Map>
class DiscreteFlowIterator
{
public:
DiscreteFlowIterator(const LiftedGraphFunction<Point, Map> *initialFunction);
void iterate(int flowChoice);
void iterate(int flowChoice, uint nbIterations);
void getOutputFunction(LiftedGraphFunction<Point, Map> *outputFunction);
double updateSupDelta();
void updateEnergy();
double getEnergy() const;
double getEnergyError();
void reset();
// double lineSearchTest();
// void undoIterate();
// void updateValuesEnergyGivenStep(const double & step);
Point getValue(uint index) const {return newValues.at(index);}
protected:
void refreshNeighborsValuesKicked();
void updateValuesCentroid();
void refreshOutput();
void updateValuesEnergyConstantStep();
void updateValuesEnergyOptimalStep();
void computeGradient();
std::vector<H2TangentVector> computeEnergyGradient(const std::vector<H2Point> &Y);
void lineSearch();
double computeEnergyHessian(const std::vector<H2TangentVector> &V);
std::vector<H2TangentVector> gradient;
double constantStep, optimalStep;
const uint nbBoundaryPoints;
const uint nbPoints;
const std::vector< std::vector<uint> > neighborsIndices;
const std::vector< std::vector<double> > neighborsWeightsCentroid,neighborsWeightsEnergy;
const std::vector< std::vector<Map> > boundaryPointsNeighborsPairingsValues;
std::vector<Point> initialValues, oldValues, newValues;
std::vector< std::vector<Point> > neighborsValuesKicked;
const std::unique_ptr<LiftedGraphFunction<Point, Map> > outputFunction;
double supDelta, oldEnergy, newEnergy, energyError;
std::vector<double> errors;
};
/*template <typename Point, typename Map> class LiftedGraphFunctionTriangulated; template <typename Map> class GroupRepresentation;
template <typename Point, typename Map> class DiscreteHeatFlowIteratorRecursiveDepth
{
public:
DiscreteHeatFlowIteratorRecursiveDepth(const GroupRepresentation<Map> &rhoDomain, const GroupRepresentation<Map> &rhoImage, uint depth);
bool run();
private:
GroupRepresentation<Map> rhoDomain, rhoImage;
uint depth;
double tol, subTol;
std::vector< LiftedGraphFunctionTriangulated<Point, Map> > domainFunctions, imageFunctions;
bool stop;
};*/
#endif // DISCRETEFLOWITERATOR_H