Version 1.3.1 - Release Candidate
This commit is contained in:
parent
a58845fe85
commit
4adbdad44b
6
BM1D.cc
6
BM1D.cc
|
@ -23,7 +23,7 @@ void OpenRootFile()
|
|||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
Int_t n = 1000;
|
||||
Int_t n = 1000, p0 = 1, start = 0;
|
||||
|
||||
TApplication App("tapp", &argc, argv);
|
||||
TCanvas* Canv = new TCanvas("c10","Live display",800,400);
|
||||
|
@ -35,8 +35,8 @@ int main(int argc, char* argv[])
|
|||
else
|
||||
{
|
||||
|
||||
Progress* Pr1 = new Progress(n);
|
||||
Progress* Pr2 = new Progress(n);
|
||||
Progress* Pr1 = new Progress(n,p0,start);
|
||||
Progress* Pr2 = new Progress(n,p0,start);
|
||||
|
||||
Pr1->Count('u');
|
||||
Pr2->Count('g');
|
||||
|
|
|
@ -8,7 +8,7 @@ Brownian movement in one dimension. Starter pack for data processing course from
|
|||
* **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
|
||||
|
||||
* Linux (Tested on Ubuntu 16.04 LTS)
|
||||
* CERN ROOT (Tested on v6.10/08)
|
||||
|
@ -51,6 +51,8 @@ If there's command line argument, then program opens the created root file. Name
|
|||
|
||||
## Updates
|
||||
|
||||
* 2017/10/29 - 'v1.3.1' - Release Candidate
|
||||
|
||||
* 2017/10/29 - 'v1.3' - Minor fixes in Progress
|
||||
|
||||
* 2017/10/29 - 'v1.2' - Creation of reloaded version and it's repository
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
|
||||
Double_t GetP0();
|
||||
Int_t GetSteps();
|
||||
Double_t GetNext();
|
||||
Double_t GetNext(char a);
|
||||
Double_t GetPrevious();
|
||||
|
||||
void SetP0(double p0_new);
|
||||
|
|
|
@ -31,46 +31,32 @@ void Progress::Count(char a)
|
|||
{
|
||||
if(i==0)
|
||||
{
|
||||
x.push_back(0.0);
|
||||
x.push_back(p0);
|
||||
y.push_back(0.0);
|
||||
}
|
||||
|
||||
y.push_back((Double_t)i);
|
||||
|
||||
switch(a)
|
||||
{
|
||||
x.push_back(GetNext(a));
|
||||
y.push_back(steps);
|
||||
}
|
||||
}
|
||||
|
||||
Double_t Progress::GetNext(char a)
|
||||
{
|
||||
switch(a){
|
||||
case 'u':
|
||||
if(random1->Uniform()>=0.5)
|
||||
{
|
||||
x.push_back(x[i-1]-0.1);
|
||||
}
|
||||
else
|
||||
{
|
||||
x.push_back(x[i-1]+0.1);
|
||||
}
|
||||
preVstate+=random1->Uniform(-p0,p0);
|
||||
break;
|
||||
|
||||
case 'g':
|
||||
if(random1->Gaus()>=0.5)
|
||||
{
|
||||
x.push_back(x[i-1]-0.1);
|
||||
}
|
||||
else
|
||||
{
|
||||
x.push_back(x[i-1]+0.1);
|
||||
}
|
||||
preVstate+=random1->Gaus(-p0,p0);
|
||||
break;
|
||||
|
||||
default:
|
||||
std::cout<<"Invalid argument!"<<std::endl;
|
||||
preVstate+=0.0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Double_t Progress::GetNext()
|
||||
{
|
||||
preVstate+=fmod(random1->Uniform(),(2*p0)-p0);
|
||||
|
||||
steps++;
|
||||
return preVstate;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue