Skip to content

Commit

Permalink
fix principalSturmHabichtSequence
Browse files Browse the repository at this point in the history
  • Loading branch information
stla committed May 5, 2024
1 parent defb4a4 commit c0c0734
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hspray.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: hspray
version: 0.5.2.0
synopsis: Multivariate polynomials and fractions of multivariate polynomials.
description: Manipulation of multivariate polynomials over a commutative ring and fractions of multivariate polynomials over a commutative field, Gröbner bases, resultant and subresultants, and greatest common divisor. It is possible to deal with multivariate polynomials whose coefficients are fractions of multivariate polynomials, and they can be interpreted as parametric polynomials with symbolic parameters.
description: Manipulation of multivariate polynomials over a commutative ring and fractions of multivariate polynomials over a commutative field, Gröbner bases, resultant, subresultants, Sturm-Habicht sequence, and greatest common divisor. It is possible to deal with multivariate polynomials whose coefficients are fractions of multivariate polynomials, and they can be interpreted as parametric polynomials with symbolic parameters.
homepage: https://github.com/stla/hspray#readme
license: GPL-3
license-file: LICENSE
Expand Down
6 changes: 3 additions & 3 deletions src/Math/Algebra/Hspray.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Copyright : (c) Stéphane Laurent, 2022-2024
License : GPL-3
Maintainer : [email protected]
Deals with multivariate polynomials on a commutative ring.
Deals with multivariate polynomials over a commutative ring.
See README for examples.
-}
{-# LANGUAGE BangPatterns #-}
Expand Down Expand Up @@ -192,7 +192,7 @@ module Math.Algebra.Hspray
, substituteSpray
, composeSpray
, evalSpraySpray
-- * Division of a spray
-- * Division of sprays
, sprayDivision
, sprayDivisionRemainder
, pseudoDivision
Expand Down Expand Up @@ -2636,7 +2636,7 @@ principalSturmHabichtSequence var spray
sHS = sturmHabichtSequence var spray
permutation = [d - var + 1 .. d] ++ [1 .. d - var]
permutation' = [var + 1 .. d] ++ [1 .. var]
jcoeff j = if isZeroSpray sHSj
jcoeff j = if isZeroSpray sHSj || j >= length coeffs
then zeroSpray
else permuteVariables permutation' (coeffs !! j)
where
Expand Down
24 changes: 24 additions & 0 deletions tests/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,30 @@ main = defaultMain $ testGroup
]
)

, testCase "principalSturmHabichtSequence" $ do
let
x = qlone 1
y = qlone 2
p = x^**^4 ^*^ y ^+^ y^**^2
psh1 = principalSturmHabichtSequence 1 p
psh2 = principalSturmHabichtSequence 2 p
assertEqual ""
(psh1, psh2)
(
[
256 *^ y^**^10
, zeroSpray
, zeroSpray
, 4 *^ y
, y
],
[
x^**^8
, constantSpray 2
, constantSpray 1
]
)

, testCase "sturmHabichtSequence & principalSturmHabichtSequence" $ do
let
x = qlone 1
Expand Down

0 comments on commit c0c0734

Please sign in to comment.