Skip to content

Commit

Permalink
unit test fromRatioOfQPolynomials
Browse files Browse the repository at this point in the history
  • Loading branch information
stla committed Apr 19, 2024
1 parent 56c710a commit 4cb2bf3
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import Math.Algebra.Hspray ( Spray,
(*.),
gegenbauerPolynomial,
evalSpraySpray,
RatioOfSprays (..),
RatioOfQSprays,
(%//%),
(%/%),
Expand All @@ -77,7 +78,9 @@ import Math.Algebra.Hspray ( Spray,
jacobiPolynomial,
asRatioOfSprays,
ParametricQSpray,
zeroRatioOfSprays
zeroRatioOfSprays,
fromRatioOfQPolynomials,
(^/^)
)
import MathObj.Matrix ( fromRows )
import qualified MathObj.Matrix as MathMatrix
Expand All @@ -96,7 +99,17 @@ main = defaultMain $ testGroup
"Testing hspray"

[
testCase "(.^)" $ do
testCase "fromRatioOfQPolynomials" $ do
let
a = outerQVariable
x = qlone 1
rOP = ((a AlgRing.^ 8 AlgAdd.- AlgRing.one) ^/^ (a AlgAdd.- AlgRing.one)) AlgRing.^ 3
AlgAdd.+ (a AlgAdd.+ AlgRing.one) :% a
rOQ = ((x^**^8 ^-^ unitSpray) %//% (x ^-^ unitSpray)) AlgRing.^ 3
AlgAdd.+ RatioOfSprays (x ^+^ unitSpray) x
assertEqual "" rOQ (fromRatioOfQPolynomials rOP)

, testCase "(.^)" $ do
let
x = lone 1 :: QSpray
y = lone 2 :: QSpray
Expand Down

0 comments on commit 4cb2bf3

Please sign in to comment.