Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- int agents = 10;
- Approximation app;
- Generator gen;
- std::chrono::duration<double> start,
- stop,
- roznica_czasow,
- srednia;
- std::vector<double> wektorCzasowy(7);
- std::vector<double> wektorAgentow(7);
- //---------------------------testowanie-----------------------------------//
- /**
- // Obliczanie czasu generowania macierzy
- calculateTimeOfGenerating(agents);
- */
- // Obliczanie czasu obliczania macierzy dla różnych typów: Gauss, Gauss z optymalizacją i Gauss Seidel
- // s -> indexy kolejnych wyników
- for (int s = 0; s < 7; s++)
- {
- for (int j = 0; j < 3; j++)
- {
- SparseCalculateTimeOfExecutingCalculation(agents, wektorAgentow, wektorCzasowy, s);
- }
- agents += 5;
- }
- for (int p = 0; p < wektorCzasowy.size(); p ++)
- {
- std::cout << setprecision(12) << wektorCzasowy[p] << std::endl;
- }
- // Błędy aproksymacji dla podanych danych
- std::vector<double> c = app.run(wektorAgentow, wektorCzasowy, 1);
- double wynik = 0;
- for(int i=0; i<c.size(); i++)
- {
- wynik += c[i] * pow(100000, i);
- }
- for(int i = 0; i < c.size(); i++)
- {
- // Współczynniki
- cout << c[i] << " ";
- }
- std::cout<<"Ilosc godzin: " << wynik/3600.0<<std::endl;
- double wynikAprox = ApproximationError(wektorAgentow, wektorCzasowy, c);
- std::cout << wynikAprox << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement