Version 1.3 - Minor fixes in Progress
This commit is contained in:
parent
292e1a2b9b
commit
2f644b760e
2
BM1D.cc
2
BM1D.cc
|
@ -1,4 +1,4 @@
|
||||||
/// BM1D program. Date: 2017-10-29 Creators: Balázs Demeter, Balázs Ujvári
|
/// BM1D program. Date: 2017-10-29 Creators: Balázs Demeter, Balázs Ujvári, Dávid Baranyai
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "Progress.hh"
|
#include "Progress.hh"
|
||||||
|
|
|
@ -6,6 +6,7 @@ Brownian movement in one dimension. Starter pack for data processing course from
|
||||||
|
|
||||||
* **Balázs Demeter** - *University of Debrecen* - [E-mail](mailto:balazsdemeter92@gmail.com)
|
* **Balázs Demeter** - *University of Debrecen* - [E-mail](mailto:balazsdemeter92@gmail.com)
|
||||||
* **Balázs Ujvári** - *University of Debrecen* - [E-mail](mailto:balazs.ujvari@science.unideb.hu)
|
* **Balázs Ujvári** - *University of Debrecen* - [E-mail](mailto:balazs.ujvari@science.unideb.hu)
|
||||||
|
* **Dávid Baranyai** - *University of Debrecen* - [E-mail](mailto:divaldo95@gmail.com)
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/// BM1D program. Date: 2017-10-29 Creators: Balázs Demeter, Balázs Ujvári
|
/// BM1D program. Date: 2017-10-29 Creators: Balázs Demeter, Balázs Ujvári, Dávid Baranyai
|
||||||
|
|
||||||
#ifndef Progress_h
|
#ifndef Progress_h
|
||||||
#define Progress_h 1
|
#define Progress_h 1
|
||||||
|
@ -24,10 +24,19 @@ class Progress {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Progress(Int_t n);
|
Progress(Int_t n);
|
||||||
|
Progress(Int_t n, Double_t p0_Set);
|
||||||
|
Progress(Int_t n, Double_t p0_Set, Double_t startposition);
|
||||||
~Progress();
|
~Progress();
|
||||||
|
|
||||||
void Count(char a);
|
void Count(char a);
|
||||||
|
|
||||||
|
Double_t GetP0();
|
||||||
|
Int_t GetSteps();
|
||||||
|
Double_t GetNext();
|
||||||
|
Double_t GetPrevious();
|
||||||
|
|
||||||
|
void SetP0(double p0_new);
|
||||||
|
|
||||||
std::vector<Double_t> GetX();
|
std::vector<Double_t> GetX();
|
||||||
std::vector<Double_t> GetY();
|
std::vector<Double_t> GetY();
|
||||||
|
|
||||||
|
@ -38,6 +47,10 @@ private:
|
||||||
std::vector<Double_t> x;
|
std::vector<Double_t> x;
|
||||||
std::vector<Double_t> y;
|
std::vector<Double_t> y;
|
||||||
|
|
||||||
|
Double_t p0;
|
||||||
|
Double_t preVstate;
|
||||||
|
Int_t steps;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,9 +1,21 @@
|
||||||
/// BM1D program. Date: 2017-10-29 Creators: Balázs Demeter, Balázs Ujvári
|
/// BM1D program. Date: 2017-10-29 Creators: Balázs Demeter, Balázs Ujvári, Dávid Baranyai
|
||||||
|
|
||||||
#include "Progress.hh"
|
#include "Progress.hh"
|
||||||
|
|
||||||
Progress::Progress(Int_t nP) :
|
Progress::Progress(Int_t nP) :
|
||||||
n (nP)
|
n (nP), p0(1), preVstate(0), steps(0)
|
||||||
|
{
|
||||||
|
random1 = new TRandom();
|
||||||
|
}
|
||||||
|
|
||||||
|
Progress::Progress(Int_t nP, Double_t p0_Set) :
|
||||||
|
n (nP), p0(p0_Set), preVstate(0), steps(0)
|
||||||
|
{
|
||||||
|
random1 = new TRandom();
|
||||||
|
}
|
||||||
|
|
||||||
|
Progress::Progress(Int_t nP, Double_t p0_Set, Double_t startposition) :
|
||||||
|
n (nP), p0(p0_Set), preVstate(startposition), steps(0)
|
||||||
{
|
{
|
||||||
random1 = new TRandom();
|
random1 = new TRandom();
|
||||||
}
|
}
|
||||||
|
@ -56,6 +68,33 @@ void Progress::Count(char a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Double_t Progress::GetNext()
|
||||||
|
{
|
||||||
|
preVstate+=fmod(random1->Uniform(),(2*p0)-p0);
|
||||||
|
steps++;
|
||||||
|
return preVstate;
|
||||||
|
}
|
||||||
|
|
||||||
|
Double_t Progress::GetPrevious()
|
||||||
|
{
|
||||||
|
return preVstate;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Progress::SetP0(Double_t p0_new)
|
||||||
|
{
|
||||||
|
p0=p0_new;
|
||||||
|
}
|
||||||
|
|
||||||
|
Double_t Progress::GetP0()
|
||||||
|
{
|
||||||
|
return p0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Int_t Progress::GetSteps()
|
||||||
|
{
|
||||||
|
return steps;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<Double_t> Progress::GetX()
|
std::vector<Double_t> Progress::GetX()
|
||||||
{
|
{
|
||||||
return x;
|
return x;
|
||||||
|
|
Loading…
Reference in New Issue