Skip to content

Commit

Permalink
CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
stla committed May 4, 2024
1 parent 05e8d1d commit 4174371
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,3 +293,7 @@ spray.

* Function `principalSturmHabichtSequence`, to compute the principal
Sturm-Habicht sequence of a spray.

* Functions `numberOfRealRoots`, `numberOfRealRootsInOpenInterval` and
`numberOfRealRootsInClosedInterval`, to compute the total number of real
roots of a suitable spray or its number of real roots in a given interval.
12 changes: 10 additions & 2 deletions src/Math/Algebra/Hspray.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2727,7 +2727,8 @@ numberOfRealRootsInOpenInterval spray =
else error "numberOfRealRootsInOpenInterval: the spray is not univariate."

-- | Number of real roots of a spray in a closed interval (that makes sense
-- only for a spray on a ring embeddable in the real numbers).
-- only for a spray on a ring embeddable in the real numbers). The roots are
-- not counted with their multiplicity.
numberOfRealRootsInClosedInterval ::
(Num a, AlgRing.C a, Ord a) => Spray a -> (a, a) -> Int
numberOfRealRootsInClosedInterval spray =
Expand All @@ -2745,7 +2746,8 @@ numberOfRealRootsInOpenInterval' spray =
else error "numberOfRealRootsInOpenInterval': the spray is not univariate."

-- | Number of real roots of a spray in a closed interval (that makes sense
-- only for a spray on a ring embeddable in the real numbers).
-- only for a spray on a ring embeddable in the real numbers). The roots are
-- not counted with their multiplicity.
numberOfRealRootsInClosedInterval' ::
(AlgAbs.C a, Ord a) => Spray a -> (a, a) -> Int
numberOfRealRootsInClosedInterval' spray =
Expand Down Expand Up @@ -2828,6 +2830,9 @@ _C signPermanencesAndVariationsFunc (blocks, epsilons) = sum pvs - sum epsilons
let (p, v) = signPermanencesAndVariationsFunc as in p - v
pvs = map permanencesMinusVariations blocks

-- | Number of real roots of a spray (that makes sense only for a spray on a
-- ring embeddable in the real numbers). The roots are not counted with their
-- multiplicity.
numberOfRealRoots :: (Eq a, AlgRing.C a, Num a) => Spray a -> Int
numberOfRealRoots spray =
if isUnivariate spray
Expand All @@ -2842,6 +2847,9 @@ numberOfRealRoots spray =
where
as = map getConstantTerm (principalSturmHabichtSequence 1 spray)

-- | Number of real roots of a spray (that makes sense only for a spray on a
-- ring embeddable in the real numbers). The roots are not counted with their
-- multiplicity.
numberOfRealRoots' :: (Eq a, AlgAbs.C a) => Spray a -> Int
numberOfRealRoots' spray =
if isUnivariate spray
Expand Down

0 comments on commit 4174371

Please sign in to comment.