-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbp.cpp
65 lines (52 loc) · 1.4 KB
/
bp.cpp
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
#include <iostream>
#include <fstream>
#include "stars.h"
using namespace std;
PDistr::PDistr () {
ain = 0.3;
bin = 0.15;
}
void PDistr::Set (ifstream * in) {
*in>>ain;
*in>>bin;
}
void PDistr::Set (double avalue, double bvalue) {
ain=avalue;
bin=bvalue;
}
void PDistr::print_param (ostream * out) {
*out<<"//----------------------------------------------------------//"<<endl;
*out<<"// Начальное распределение P и B читается из входных файлов //"<<endl;
*out<<"// P="<<a()<<", dP="<<b()<<endl;
*out<<"//----------------------------------------------------------//"<<endl;
}
double PDistr::a () {
return ain;
}
double PDistr::b () {
return bin;
}
BDistr::BDistr () {
ain = 12.65;
bin = 0.55;
}
void BDistr::Set (ifstream * in) {
*in>>ain;
*in>>bin;
}
void BDistr::Set (double avalue, double bvalue) {
ain=avalue;
bin=bvalue;
}
void BDistr::print_param (ostream * out) {
*out<<"//----------------------------------------------------------//"<<endl;
*out<<"// Начальное распределение P и B читается из входных файлов //"<<endl;
*out<<"// B="<<a()<<", dB="<<b()<<endl;
*out<<"//----------------------------------------------------------//"<<endl;
}
double BDistr::a () {
return ain;
}
double BDistr::b () {
return bin;
}