Skip to content

Commit

Permalink
numberOfRealRootsInInterval
Browse files Browse the repository at this point in the history
  • Loading branch information
stla committed May 4, 2024
1 parent 7738a3b commit 4a0819e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/signAnalysis2.hs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ signVariations' = _signVariations signFunc
| AlgAbs.signum a == AlgRing.one = '+'
| otherwise = '-'

wStHa :: (Eq a, AlgRing.C a) => ([a] -> Int) -> Spray a -> (a, a) -> Int
wStHa signVariationsFunc spray (alpha, beta) =
_numberOfRealRootsInInterval ::
(Eq a, AlgRing.C a) => ([a] -> Int) -> Spray a -> (a, a) -> Int
_numberOfRealRootsInInterval signVariationsFunc spray (alpha, beta) =
signVariationsFunc galpha - signVariationsFunc gbeta
where
g = filter (not . isZeroSpray) (sturmHabichtSequence 1 spray)
Expand All @@ -80,13 +81,13 @@ numberOfRealRootsInInterval ::
(Eq a, Num a, AlgRing.C a) => Spray a -> (a, a) -> Int
numberOfRealRootsInInterval spray =
if isUnivariate spray
then wStHa signVariations spray
then _numberOfRealRootsInInterval signVariations spray
else error "numberOfRealRootsInInterval: the spray is not univariate."

numberOfRealRootsInInterval' :: (Eq a, AlgAbs.C a) => Spray a -> (a, a) -> Int
numberOfRealRootsInInterval' spray =
if isUnivariate spray
then wStHa signVariations' spray
then _numberOfRealRootsInInterval signVariations' spray
else error "numberOfRealRootsInInterval': the spray is not univariate."


Expand Down

0 comments on commit 4a0819e

Please sign in to comment.