Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Przyklad
- */
- public class Przyklad {
- int N; //liczba krokow
- int n_max; //maksymalny rozmiar problemu
- int[] n; //tablica rozmiarow macierzy
- double[] T; //tablica czasow
- //Konstruktor
- public Przyklad(int NN, int nn_max) {
- N = NN;
- n_max = nn_max;
- n = new int[N];
- T = new double[N];
- }
- public void BadajZlozonosc() {
- int n_krok = (int) (n_max / N); //krok zmiany rozmiaru problemu
- long pomiar; //zmienna przechowujaca czas
- for(int i = 0; i < N; i++) {
- Uklad u1 = new Uklad((i + 1) * n_krok);
- u1.LosujUklad();
- Banachiewicz test3 = new Banachiewicz(u1);
- pomiar = System.currentTimeMillis();
- test3.Rozklad();
- test3.RozwiazTrojkatnyDolny();
- test3.RozwiazTrojkatnyGorny();
- pomiar = System.currentTimeMillis() - pomiar;
- n[i] = (i + 1) * n_krok;
- T[i] = pomiar/1000.0;
- System.out.format("%d \t %4.5f\n", n[i], T[i]);
- }
- Wykresik wykresik = new Wykresik(N, n, T);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement