123456789101112131415161718192021222324252627282930313233 |
- 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]));
- Oblig4 seq = new Sequential(points);
- Oblig4 par = new Parallel(points);
-
- Timer tseq = run(seq, null);
- run(par, tseq);
-
- seq.draw();
- }
-
- static Timer run(Oblig4 o, Timer base) {
- System.out.println(o.name+": filling...");
- o.fill();
- System.out.println("Done.");
-
- 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;
- }
- }
|