File: PHCpack.test.m2

package info (click to toggle)
macaulay2 1.24.11%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 171,648 kB
  • sloc: cpp: 107,850; ansic: 16,307; javascript: 4,188; makefile: 3,947; lisp: 682; yacc: 604; sh: 476; xml: 177; perl: 114; lex: 65; python: 33
file content (31 lines) | stat: -rw-r--r-- 793 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
-- this file is created to test PHCpack interface 

setDefault(Software=>PHCPACK)

R = CC[x,y];
S = {x^2-1,y^2-1};
T = {x^2+y^2-1, x*y};
solsS = {{1,-1},{1,1},{-1,1},{-1,-1}};
solsT = {{1,0},{0,1},{-1,0},{0,-1}};

-- solveSystem
sols = solveSystem(T)/coordinates
assert(areEqual(sortSolutions solsT, sortSolutions sols))

-- track
sols = track(S,T,solsS/(s->point{s}))/coordinates
assert(areEqual(sortSolutions solsT, sortSolutions sols))

-- refine 
R = CC[x,y];
T = {x^2+y^2-1, x*y};
sols = { {1.00000001,0.00000001}, { -0.0000001,1.0000002} };
rsols = refine(T, sols/(s->point{s}), Bits=>1000)
assert areEqual((sortSolutions rsols)/coordinates, {{0,1},{1,0}})
end

restart
errorDepth = 2
needsPackage "NumericalAlgebraicGeometry"
load "NumericalAlgebraicGeometry/PHCpack/PHCpack.test.m2"