University stuff.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031
  1. class Main {
  2. public static void main(String[] args) {
  3. if (args.length != 1) {
  4. System.out.println("Usage: java Main <n>");
  5. System.exit(1);
  6. }
  7. NPunkter17 points = new NPunkter17(Integer.parseInt(args[0]));
  8. Oblig4 seq = new Sequential(points);
  9. Oblig4 par = new Parallel(points);
  10. Timer tseq = run(seq, null);
  11. run(par, tseq);
  12. }
  13. static Timer run(Oblig4 o, Timer base) {
  14. System.out.println(o.name+": filling...");
  15. o.fill();
  16. System.out.println("Done.");
  17. Timer t = new Timer().start();
  18. o.solve();
  19. t.end();
  20. if (base == null)
  21. System.out.println(o.name+": "+t.prettyTime());
  22. else
  23. System.out.println(o.name+": "+t.prettySpeedup(base));
  24. return t;
  25. }
  26. }