int HUGE_VOL 400000 void MainWindow ergodicity process clear QVector d

 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
int HUGE_VOL = 400000;
void MainWindow::ergodicity() {
process.clear();
QVector<double> tmp;
genProcess(tmp, HUGE_VOL);
// берем каждое NUM_SEL'ое значение из реализации процесса
int k = 0;
for (int i = 0; i < HUGE_VOL; ++i) {
if (i == HUGE_VOL/NUM_SEL*k) {
process.push_back(tmp[i]);
k++;
}
}
qSort(process);
double delta = getDelta(process, selectionT1, NUM_SEL);
double lambda = delta*sqrt(NUM_SEL*NUM_SEL/(NUM_SEL+NUM_SEL));
ui->ergoL->setText(QString("Lambda = %1").arg(lambda));
qDebug() << "Le = " << lambda;
for (int i = 0; i < NUM_SEL; ++i){
frv.push_back((double)(i+1)/NUM_SEL);
}
QPen penSel1;
penSel1.setWidth(2);
penSel1.setBrush(Qt::red);
penSel1.setCapStyle(Qt::RoundCap);
penSel1.setJoinStyle(Qt::RoundJoin);
QPen penSel2;
penSel2.setWidth(2);
penSel2.setBrush(Qt::blue);
penSel2.setCapStyle(Qt::RoundCap);
penSel2.setJoinStyle(Qt::RoundJoin);
ui->ergoPlot->addGraph();
ui->ergoPlot->graph(0)->setData(process, frv);
ui->ergoPlot->addGraph();
ui->ergoPlot->graph(1)->setData(selectionT1, frv);//(selection_proc, frv);
ui->ergoPlot->graph(0)->setPen(penSel1);
ui->ergoPlot->graph(1)->setPen(penSel2);
ui->ergoPlot->xAxis->setLabel("x1 , x2");
ui->ergoPlot->yAxis->setLabel("F1(x), F2(x)");
ui->ergoPlot->rescaleAxes();
ui->ergoPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
ui->ergoPlot->replot();
}