Commit b1fe4c71 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

worked on empirical measures

parent e2b5587d
......@@ -3,12 +3,18 @@
#include <math.h>
void Sums::Update(double fineCost, double diffQ, double fineQ) {
Cost += fineCost;
Q1 += fineQ;
Q2 += fineQ * fineQ;
Q3 += fineQ * fineQ * fineQ;
Q4 += fineQ * fineQ * fineQ * fineQ;
void SampleCounter::Update() {
M += dM;
dM = 0;
}
void Sums::Update(SampleSolution &fineSolution, SampleSolution &coarseSolution) {
double diffQ = fineSolution.Q - coarseSolution.Q; // Todo
Cost += fineSolution.Cost;
Q1 += fineSolution.Q;
Q2 += fineSolution.Q * fineSolution.Q;
Q3 += fineSolution.Q * fineSolution.Q * fineSolution.Q;
Q4 += fineSolution.Q * fineSolution.Q * fineSolution.Q * fineSolution.Q;
Y1 += diffQ;
Y2 += diffQ * diffQ;
Y3 += diffQ * diffQ * diffQ;
......
#ifndef EMPIRICMEASURES_HPP
#define EMPIRICMEASURES_HPP
#include "utility/SampleID.hpp"
struct SampleCounter {
int M = 0;
int dM = 0;
void Update() {
M += dM;
dM = 0;
}
void Update();
};
struct Sums {
double Cost = 0.0;
double Q1 = 0.0;
double Q2 = 0.0;
......@@ -32,7 +29,13 @@ struct Sums {
double Y4 = 0.0;
void Update(double fineCost, double diffQ, double fineQ);
double Cost = 0.0;
// Vector U; Todo; Also be careful with instabilities of difference
//
// Vector V;
void Update(SampleSolution &fineSolution, SampleSolution &coarseSolution);
};
struct Averages {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment