@@ -5,13 +5,13 @@ function ModelKit.System(V::SemialgebraicSets.AbstractAlgebraicSet; kwargs...)
5
5
end
6
6
7
7
"""
8
- SemialgebraicSetsHCSolver(; excess_residual_tol = nothing, real_tol = 1e-6, compile = false, options...)
8
+ SemialgebraicSetsHCSolver(; excess_residual_tol = nothing, real_atol = 1e-6, real_rtol = 0.0 , compile = false, options...)
9
9
10
10
Construct a `SemialgebraicSets.AbstractAlgebraicSolver` to be used in `SemialgebraicSets`.
11
11
`options` are all valid options for [`solve`](@ref).
12
12
13
- Solutions with imaginary part of absolute value larger than `real_tol` are
14
- filtered out.
13
+ Solutions with imaginary part larger than the specified tolerances are
14
+ filtered out (see [`is_real`](@ref) for details) .
15
15
16
16
For overdetermined systems, `excess_residual_tol` can be set to a `Float64`
17
17
value. Excess solutions that have a residual smaller than `excess_residual_tol`
@@ -43,19 +43,32 @@ julia> collect(V)
43
43
"""
44
44
struct SemialgebraicSetsHCSolver <: SemialgebraicSets.AbstractAlgebraicSolver
45
45
excess_residual_tol:: Union{Nothing,Float64}
46
- real_tol:: Float64
46
+ real_atol:: Float64
47
+ real_rtol:: Float64
47
48
options:: Any
48
49
end
49
- SemialgebraicSetsHCSolver (;
50
+ function SemialgebraicSetsHCSolver (;
50
51
excess_residual_tol = nothing ,
51
- real_tol = 1e-6 ,
52
+ real_atol = 1e-6 ,
53
+ real_rtol = 0.0 ,
54
+ real_tol = nothing ,
52
55
compile = :none ,
53
56
options... ,
54
- ) = SemialgebraicSetsHCSolver (
55
- excess_residual_tol,
56
- real_tol,
57
- (compile = compile, options... ),
58
57
)
58
+ if real_tol != = nothing
59
+ Base. depwarn (
60
+ " The `real_tol` keyword argument is deprecated and will be removed in a future version. Use `real_atol` instead." ,
61
+ :SemialgebraicSetsHCSolver ,
62
+ )
63
+ real_atol = real_tol
64
+ end
65
+ SemialgebraicSetsHCSolver (
66
+ excess_residual_tol,
67
+ real_atol,
68
+ real_rtol,
69
+ (compile = compile, options... ),
70
+ )
71
+ end
59
72
60
73
function SemialgebraicSets. default_gröbner_basis_algorithm (
61
74
:: Any ,
@@ -77,7 +90,9 @@ function Base.show(io::IO, solver::SemialgebraicSetsHCSolver)
77
90
print (io, " excess_residual_tol = " , solver. excess_residual_tol)
78
91
print (io, " , " )
79
92
end
80
- print (io, " real_tol = " , solver. real_tol)
93
+ print (io, " real_atol = " , solver. real_atol)
94
+ print (io, " , " )
95
+ print (io, " real_rtol = " , solver. real_rtol)
81
96
print (io, " , " )
82
97
join (
83
98
io,
@@ -117,5 +132,5 @@ function SemialgebraicSets.solve(
117
132
hcsolver. excess_residual_tol,
118
133
)
119
134
# Only return real, non-singular solutions
120
- return real_solutions (results; real_tol = hcsolver. real_tol , only_nonsingular = true )
135
+ return real_solutions (results; real_atol = hcsolver. real_atol, real_rtol = hcsolver . real_rtol , only_nonsingular = true )
121
136
end
0 commit comments