@@ -4,6 +4,7 @@ export NumericalIrreducibleDecomposition,
4
4
regeneration,
5
5
witness_sets,
6
6
decompose,
7
+ ncomponents,
7
8
n_components,
8
9
seed
9
10
@@ -104,6 +105,7 @@ function update_progress!(progress::WitnessSetsProgress, W::Union{WitnessPoints,
104
105
showvalues = showvalues (progress),
105
106
)
106
107
end
108
+ update_progress! (progress:: Union{Nothing,WitnessSetsProgress} , W:: Nothing ) = nothing
107
109
update_progress! (progress:: Nothing ) = nothing
108
110
finish_progress! (progress:: Nothing ) = nothing
109
111
function finish_progress! (progress:: WitnessSetsProgress )
@@ -147,7 +149,7 @@ This is the core routine of the regeneration algorithm. It intersects a set of [
147
149
"""
148
150
function intersect_with_hypersurface! (
149
151
W:: WitnessPoints{T1,T2,Vector{ComplexF64}} ,
150
- X:: WitnessPoints{T3,T4,Vector{ComplexF64}} ,
152
+ X:: Union{ WitnessPoints{T3,T4,Vector{ComplexF64}},Nothing } ,
151
153
F:: AS ,
152
154
H:: WitnessSet{T5,T6,Vector{ComplexF64}} ,
153
155
u:: Variable ,
@@ -174,6 +176,11 @@ function intersect_with_hypersurface!(
174
176
deleteat! (P, m)
175
177
update_progress! (progress, W)
176
178
179
+ if isnothing (X)
180
+ return nothing
181
+ end
182
+
183
+
177
184
# Step 2:
178
185
# the points in P_next are used as starting points for a homotopy.
179
186
# where u^d-1 (u is the extra variable in u-regeneration) is deformed into g
@@ -203,10 +210,12 @@ function intersect_with_hypersurface!(
203
210
204
211
# here comes the loop for tracking
205
212
l_start = length (start)
213
+
206
214
for (i, s) in enumerate (start)
207
215
p = s[1 ]
208
216
p[end ] = s[2 ] # the last entry of s[1] is zero. we replace it with a d-th root of unity.
209
217
218
+
210
219
res = track (tracker, p, 1 )
211
220
if is_success (res) && is_finite (res) && is_nonsingular (res)
212
221
new = copy (tracker. state. solution)
@@ -217,6 +226,7 @@ function intersect_with_hypersurface!(
217
226
end
218
227
219
228
229
+
220
230
nothing
221
231
end
222
232
@@ -330,6 +340,7 @@ function is_contained!(
330
340
end
331
341
# check if x is among the points in U
332
342
_, added = add! (U, x, 0 )
343
+
333
344
if added
334
345
return false
335
346
else
@@ -537,11 +548,14 @@ function regeneration!(
537
548
# we have already intersected X ∩ Hᵢ.
538
549
update_progress! (progress, true )
539
550
for (k, W) in reverse (E) # k = codim(W) for W in Ws
540
- if k < min (i, n)
541
- X = out[k+ 1 ]
551
+ if k < i
552
+ if k < n
553
+ X = out[k+ 1 ]
554
+ else
555
+ X = nothing
556
+ end
542
557
# here is the intersection step
543
- # the next witness superset X is also passed to this function,
544
- # because we add points that do not belong to W∩Hᵢ to X.
558
+ # if k < min(i,n), the next witness superset X is also passed to this function, because we add points that do not belong to W∩Hᵢ to X.
545
559
# at this point the equation for W is f[1:(i-1)]
546
560
intersect_with_hypersurface! (
547
561
W,
@@ -559,7 +573,10 @@ function regeneration!(
559
573
end
560
574
end
561
575
576
+
577
+
562
578
Fᵢ = fixed (System (f[1 : i], variables = vars), compile = false )
579
+
563
580
# after the first loop that takes care of intersecting with Hᵢ
564
581
# we now check if we have added points that are already contained in
565
582
# witness sets of higher dimension.
@@ -1110,13 +1127,13 @@ witness_sets(N::NumericalIrreducibleDecomposition, dim::Int) = witness_sets(N, [
1110
1127
seed (N:: NumericalIrreducibleDecomposition ) = N. seed
1111
1128
1112
1129
"""
1113
- n_components (N::NumericalIrreducibleDecomposition;
1130
+ ncomponents (N::NumericalIrreducibleDecomposition;
1114
1131
dims::Union{Vector{Int},Nothing} = nothing)
1115
1132
1116
1133
Returns the total number of components in `N`.
1117
1134
`dims` specifies the dimensions that should be considered.
1118
1135
"""
1119
- function n_components (
1136
+ function ncomponents (
1120
1137
N:: NumericalIrreducibleDecomposition ;
1121
1138
dims:: Union{Vector{Int},Nothing} = nothing ,
1122
1139
)
@@ -1134,7 +1151,9 @@ function n_components(
1134
1151
1135
1152
out
1136
1153
end
1137
- n_components (N:: NumericalIrreducibleDecomposition , dim:: Int ) = n_components (N, dims = [dim])
1154
+ ncomponents (N:: NumericalIrreducibleDecomposition , dim:: Int ) = ncomponents (N; dims = [dim])
1155
+ n_components (N; dims = nothing ) = ncomponents (N; dims = dims)
1156
+ n_components (N, dim) = ncomponents (N; dims = [dim])
1138
1157
1139
1158
"""
1140
1159
0 commit comments