int HUGE_VOL = 400000; void MainWindow::ergodicity() { process.clear(); QVector 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(); }