Skip to content

Commit 285a6a3

Browse files
committed
Fix format
1 parent d188245 commit 285a6a3

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

src/comparison.jl

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -307,21 +307,15 @@ ordering(p::AbstractPolynomialLike) = ordering(typeof(p))
307307
# of x < y is equal to the result of Monomial(x) < Monomial(y)
308308
# Without `Base.@pure`, TypedPolynomials allocates on Julia v1.6
309309
# with `promote(x * y, x)`
310-
Base.@pure function Base.cmp(
311-
v1::AbstractVariable,
312-
v2::AbstractVariable,
313-
)
310+
Base.@pure function Base.cmp(v1::AbstractVariable, v2::AbstractVariable)
314311
return -cmp(name(v1), name(v2))
315312
end
316313

317314
function Base.:(==)(m1::AbstractMonomialLike, m2::AbstractMonomialLike)
318315
return iszero(cmp(m1, m2))
319316
end
320317

321-
function Base.cmp(
322-
m1::AbstractMonomial,
323-
m2::AbstractMonomial,
324-
)
318+
function Base.cmp(m1::AbstractMonomial, m2::AbstractMonomial)
325319
s1, s2 = promote_variables(m1, m2)
326320
return cmp(ordering(m1)(), exponents(s1), exponents(s2))
327321
end
@@ -345,10 +339,7 @@ end
345339
# less than `b`, they are considered sort of equal.
346340
_cmp_coefficient(a, b) = 0
347341

348-
function Base.cmp(
349-
t1::AbstractTermLike,
350-
t2::AbstractTermLike,
351-
)
342+
function Base.cmp(t1::AbstractTermLike, t2::AbstractTermLike)
352343
Δ = cmp(monomial(t1), monomial(t2))
353344
if iszero(Δ)
354345
return _cmp_coefficient(coefficient(t1), coefficient(t2))

test/commutative/comparison.jl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,7 @@
146146
rinvlex = Reverse{InverseLexOrder}
147147
grevlex = Graded{rinvlex}
148148
@static if Symbol(Mod) == :DynamicPolynomials
149-
@testset "compare $M" for M in [
150-
lex,
151-
grlex,
152-
rinvlex,
153-
grevlex,
154-
]
149+
@testset "compare $M" for M in [lex, grlex, rinvlex, grevlex]
155150
Mod.@polyvar x y z monomial_order = M
156151
# [CLO13, p. 58]
157152
sgn = (M == lex || M == rinvlex) ? -1 : 1

0 commit comments

Comments
 (0)