12345678910111213141516171819202122232425262728293031323334353637 |
- class Main {
- public static void main(String[] args) {
- if (args.length != 1) {
- System.out.println("Usage: java Main <n>");
- System.exit(1);
- }
-
- NPunkter17 points = new NPunkter17(Integer.parseInt(args[0]));
- int[] x = new int[points.n];
- int[] y = new int[points.n];
-
- System.out.println("Filling...");
- points.fyllArrayer(x, y);
- System.out.println("Done.");
-
- Oblig4 seq = new Sequential(x, y, points.n);
- Oblig4 par = new Parallel(x, y, points.n);
-
- Timer tseq = run(seq, null);
- run(par, tseq);
-
- seq.draw();
- par.draw();
- }
-
- static Timer run(Oblig4 o, Timer base) {
- Timer t = new Timer().start();
- o.solve();
- t.end();
- if (base == null)
- System.out.println(o.name+": "+t.prettyTime());
- else
- System.out.println(o.name+": "+t.prettySpeedup(base));
-
- return t;
- }
- }
|