HORIZON HASKELLDocslts/ghc-9.14.x7a6c33e2026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 7a6c33e · 2026-10-12

Modulenumeric-prelude-0.4.4Haskell98

MathObj.LaurentPolynomial

Polynomials with negative and positive exponents.

Contents
  1. Basic Operations
  2. Show
  3. Additive
  4. Module
  5. Ring
  6. Field.C
  7. Comparisons
  8. Transformations of arguments
Synopsis
datadata T a

Polynomial including negative exponents

Constructors

Instances9Functor, Eq, Show, C, …
  • Functor TDefined in numeric-prelude-0.4.4 · MathObj.LaurentPolynomial
  • C TDefined in numeric-prelude-0.4.4 · MathObj.LaurentPolynomial
  • (C a, C a b) => C a (T b)Defined in numeric-prelude-0.4.4 · MathObj.LaurentPolynomial
  • C a b => C a (T b)Defined in numeric-prelude-0.4.4 · MathObj.LaurentPolynomial
  • (Eq a, C a) => Eq (T a)Defined in numeric-prelude-0.4.4 · MathObj.LaurentPolynomial
  • Show a => Show (T a)Defined in numeric-prelude-0.4.4 · MathObj.LaurentPolynomial
  • C a => C (T a)Defined in numeric-prelude-0.4.4 · MathObj.LaurentPolynomial
  • C a => C (T a)Defined in numeric-prelude-0.4.4 · MathObj.LaurentPolynomial
  • (C a, C a) => C (T a)Defined in numeric-prelude-0.4.4 · MathObj.LaurentPolynomial

Basic Operations

value(!) :: C a => T a -> Int -> a
#
valuetranslate :: Int -> T a -> T a
#

Deprecated. In order to avoid confusion with Polynomial.translate, use shift instead

Show

Additive

valueadd :: C a => T a -> T a -> T a
#
valueaddShiftedMany :: C a => [Int] -> [[a]] -> [a]

Add lists of numbers respecting a relative shift between the starts of the lists. The shifts must be non-negative. The list of relative shifts is one element shorter than the list of summands. Infinitely many summands are permitted, provided that runs of zero shifts are all finite.

We could add the lists either with foldl or with foldr, foldl would be straightforward, but more time consuming (quadratic time) whereas foldr is not so obvious but needs only linear time.

(stars denote the coefficients, frames denote what is contained in the interim results) foldl sums this way:

| | | *******************************
| | +--------------------------------
| |          ************************
| +----------------------------------
|                        ************
+------------------------------------

I.e. foldl would use much time find the time differences by successive subtraction 1.

foldr mixes this way:

    +--------------------------------
    | *******************************
    |      +-------------------------
    |      | ************************
    |      |           +-------------
    |      |           | ************
valuesub :: C a => T a -> T a -> T a
#

Module

Ring

valuemul :: C a => T a -> T a -> T a
#

Field.C

valuediv :: (C a, C a) => T a -> T a -> T a
#

Comparisons

valueequivalent :: (Eq a, C a) => T a -> T a -> Bool

Two polynomials may be stored differently. This function checks whether two values of type LaurentPolynomial actually represent the same polynomial.

valueisAbsolute :: C a => T a -> Bool

Check whether a Laurent polynomial has only the absolute term, that is, it represents the constant polynomial.

Transformations of arguments

valueadjoint :: C a => T (T a) -> T (T a)

p(exp(i·x)) -> conjugate(p(exp(i·x)))

If you interpret (p*) as a linear operator on the space of Laurent polynomials, then (adjoint p *) is the adjoint operator.