File: showcase.m2

package info (click to toggle)
macaulay2 1.21%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 133,096 kB
  • sloc: cpp: 110,377; ansic: 16,306; javascript: 4,193; makefile: 3,821; sh: 3,580; lisp: 764; yacc: 590; xml: 177; python: 140; perl: 114; lex: 65; awk: 3
file content (66 lines) | stat: -rw-r--r-- 2,885 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
debug needsPackage "NumericalAlgebraicGeometry"
NAGtrace 0
load (currentFileDirectory|"benchmarks.m2")

-- BENCHMARK SYSTEMS: ---------------------------------------------------------
systems = {
     -- random system in n variables of degree d 
     (n = 5; d = 4; setRandomSeed 0; -- #sols=1024, M2:1/4/5, B:20/18, P:20/18; (old... M2:4, H:11, B:51, P:63)
	  T = (randomSystem(n,d,CC))_*; (S,solsS) = totalDegreeStartSystem T; (T,S,solsS)), 
     (n = 5; d = 5; setRandomSeed 0; -- #sols=3125, M2:8/37/43, B:159/153, P:136/206; (old... M2:30, H:78, B:402, P:550)
	  T = (randomSystem(n,d,CC))_*; (S,solsS) = totalDegreeStartSystem T; (T,S,solsS)), 
     -- katsura
     (T = (katsuraBench 11)_*; -- #sols=1024, M2:2/3/3, B:12/13, P:14/52; (old... M2:4, H:7, B:15, P:37) 
	  (S,solsS) = totalDegreeStartSystem T; (T,S,solsS)), 
     (T = (katsuraBench 12)_*, -- #sols=2048, M2:5/7/8, B:43/46, P:37/182; (old... M2:11, H:19, B:37, P:102) -- PHCpack loses some sols in solveSystem
	  (S,solsS) = totalDegreeStartSystem T; (T,S,solsS)), 
     -- random generalized eigenvalue problem
     (setRandomSeed 0; randomGeneralizedEigenvalueProblem 35) -- #sols=35, M2:2/10/???, B:136/???, P:47: (old... M2:3, B:40, P:323) 
                                                               -- PHCpack thinks 4 solutions are singular
							       -- M2 goes to precision=100 (with multiprecision)  
     };

software = {
     M2engine,
     BERTINI,
     PHCPACK
     -- , HOM4PS2
     };

timeSystemSoftware = (system,soft) -> (     
    (T,S,solsS) = system;
    << "---------------------------------------------------------" << endl;
    << "---------- COMPUTING with " << soft << "-----------------" << endl; 
    << "---------------------------------------------------------" << endl;
    soft=>sortSolutions if soft===HOM4PS2 then elapsedTime solveSystem(T,Software=>soft)/point
    else (
	print "track";
	elapsedTime print tally (status \ track(S,T,solsS,gamma=>1+ii,Software=>soft)) ;
	if soft===M2engine then ( 
	    print "trackHomotopy";
	    elapsedTime print tally (status \ trackHomotopy(segmentHomotopy(polySystem S,polySystem T, gamma=>1+ii), solsS,EndZoneFactor=>0))
	    );
	print "solveSystem";
	s := elapsedTime solveSystem(T,Software=>soft);
	print tally (status \ s);
	s
	)
    )
 
end -----------------------------------------------------------------------------------
restart
load "NumericalAlgebraicGeometry/showcase.m2"
sols = new HashTable from apply(drop(systems,-1), system->( 
	(system,soft) => apply(software, soft->timeSystemSoftware(system,soft)) 
	))
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
system = first systems;
--...
system = last systems;
soft = M2engine
soft = BERTINI  
soft = PHCPACK

timeSystemSoftware(system,soft)