HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulenumeric-prelude-0.4.4Haskell98

MathObj.RefinementMask2

  • 1 type
  • 8 values
newtypenewtype T a
#
Instances3Functor, Show, Arbitrary
  • Functor TDefined in numeric-prelude-0.4.4 · MathObj.RefinementMask2
  • Show a => Show (T a)Defined in numeric-prelude-0.4.4 · MathObj.RefinementMask2
  • (Arbitrary a, C a) => Arbitrary (T a)Defined in numeric-prelude-0.4.4 · MathObj.RefinementMask2
valuefromPolynomial :: C a => T a -> T a
#

Determine mask by Gauss elimination.

R - alternating binomial coefficients L - differences of translated polynomials in columns

p2 = L * R^(-1) * m

R * L^(-1) * p2 = m

Property
genAdmissibleMask /\ \(mask,poly) -> hasMultipleZero (fromMaybe 0 $ Poly.degree poly) 1 (polyFromMask (Mask.fromPolynomial poly) - polyFromMask mask)
Property
genShortPolynomial 5 /\ \poly -> maybe False (Poly.collinear poly) $ Mask.toPolynomial $ Mask.fromPolynomial poly
valuetoPolynomial :: C a => T a -> Maybe (T a)
#

If the mask does not sum up to a power of 1/2 then the function returns Nothing.

Example1 expression
fmap ((6::Rational) *>) $ Mask.toPolynomial (Mask.fromCoeffs [0.1, 0.02, 0.005::Rational])Just (Polynomial.fromCoeffs [-12732 % 109375,272 % 625,-18 % 25,1 % 1])
valuerefinePolynomial :: C a => T a -> T a -> T a
#
Property
genShortPolynomial 5 /\ \poly -> poly == Mask.refinePolynomial (Mask.fromPolynomial poly) poly
Example1 expression
fmap (round :: Double -> Integer) $ fmap (1000000*) $ nest 50 (Mask.refinePolynomial (Mask.fromCoeffs [0.1, 0.02, 0.005])) (Poly.fromCoeffs [0,0,0,1])Polynomial.fromCoeffs [-116407,435200,-720000,1000000]
valueconvolvePolynomial :: C a => T a -> T a -> T a
#

Convolve polynomials via refinement mask.

(mask x + ux*(-1,1)^degree x) * (mask y + uy*(-1,1)^degree y)