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"
|