Skip to content

Commit a088d2f

Browse files
committed
Rename extrema to map_extrema
1 parent f0c9417 commit a088d2f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/certificate.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Inspired from SOSTools
2-
import Base.extrema
32
export getmonomialsforcertificate, randpsd, randsos
43

5-
function extrema(f, itr)
4+
function map_extrema(f::Function, itr::AbstractVector)
65
state = start(itr)
76
it1, state = next(itr, state)
87
mini = maxi = f(it1)
@@ -47,8 +46,8 @@ function getmonomialsforcertificate(Z::MonomialVector, sparse=:No)
4746
n = length(Z.Z[1])
4847
minmultideg, maxmultideg = Vector{Int}(n), Vector{Int}(n)
4948
for i in 1:n
50-
a, b = extrema(z->z[i], Z.Z)
51-
minmultideg[i], maxmultideg[i] = cfld(extrema(z->z[i], Z.Z), 2)
49+
a, b = map_extrema(z->z[i], Z.Z)
50+
minmultideg[i], maxmultideg[i] = cfld(map_extrema(z->z[i], Z.Z), 2)
5251
end
5352
MonomialVector(vars(Z), mindeg:maxdeg, z -> reduce(&, true, minmultideg .<= z .<= maxmultideg))
5453
else

0 commit comments

Comments
 (0)