19 SparseDistributedPolynomial

This file contains an implementation of polynomials in arbitrarily many variables given by the domain V over an ring A. The representation of the power products is given through the domain J.

The tests can be found in test/poly/distpoly.as.nw.

525* 13+   505  535
-------------------------------------------------------------------
----
---- Combinat
---- Copyright (C) Ralf Hemmecke <ralf@hemmecke.de>
---- svn co svn://svn.risc.uni-linz.ac.at/hemmecke/combinat/
----
-------------------------------------------------------------------

#include "combinat"
dom: SparseDistributedPolynomial 526

Type Constructor

SparseDistributedPolynomial

Usage

Description

Implements Polynomials in infinitely many variables.

This domain implements the polynomial domain A[x1,x2,x3,] where each variable xi has weight i.

526dom: SparseDistributedPolynomial 526  (525)
SparseDistributedPolynomial(
    A: with {
            zero?: % -> Boolean;
            one?: % -> Boolean;
            0: %;
            1: %;
            +: (%, %) -> %;
            *: (%, %) -> %;
    },
    V: TotallyOrderedType, -- VariableType
    J: with {
            TotallyOrderedType;
            1: %;
            *: (%, %) -> %;
    }-- == SparseIndexedPowerProduct(V, NonNegativeMachineInteger);
): with {
        exports: SparseDistributedPolynomial 527
} == SparseFiniteMonoidRing(A, J) add {
        Rep == SparseFiniteMonoidRing(A, J);
        import from Rep, A, J;
        implementation: SparseDistributedPolynomial 528b
}

Defines:
SparseDistributedPolynomial, used in chunks 55, 307, 626, 707, 710–17, 719, 721, 723, 725–27, 749, and 751.

Uses SparseFiniteMonoidRing 501, SparseIndexedPowerProduct 506, and TotallyOrderedType 571.

Exports of SparseDistributedPolynomial

IndexedFreeArithmeticType(A, J);

coerce: A -> % Inclusion monomorphism.

coerce: J -> % Inclusion monomorphism.

*: (A, %) -> % Module multiplication by a coefficient.

if A has with {*: (Integer, %) -> %} then {

*: (Integer, %) -> % -module multiplication.

}

if A has with {*: (Fraction Integer, %) -> %} then {

*: (Fraction Integer, %) -> % -module multiplication.

}

527exports: SparseDistributedPolynomial 527  (526)  528a
IndexedFreeArithmeticType(A, J);

Uses IndexedFreeArithmeticType 495.

Export of SparseDistributedPolynomial

coerce: A -> %

Description

Inclusion monomorphism.

528aexports: SparseDistributedPolynomial 527+   (526)  527  529a
coerce: A -> %;
528bimplementation: SparseDistributedPolynomial 528b  (526)  529b
coerce(a: A): % == [a, 1$J];

Export of SparseDistributedPolynomial

coerce: J -> %

Description

Inclusion monomorphism.

529aexports: SparseDistributedPolynomial 527+   (526)  528a  530a
coerce: J -> %;
529bimplementation: SparseDistributedPolynomial 528b+   (526)  528b  530b
coerce(j: J): % == [1$A, j];

Export of SparseDistributedPolynomial

*: (A, %) -> %

Description

Module multiplication by a coefficient.

The call a*x for a: A and x: % is equivalent to (a :: %) * x.

530aexports: SparseDistributedPolynomial 527+   (526)  529a  531b
*: (A, %) -> %;
530bimplementation: SparseDistributedPolynomial 528b+   (526)  529b  532
(a: A) * (x: %): % == {
        zero? a => 0;
        map((b: A): A +-> a*b)(x);
}

Export of SparseDistributedPolynomial

*: (Integer, %) -> %

Description

-module multiplication.

The call z*x for z: Integer and x: % is equivalent to multiplying every coefficient of x by z.

531aexports: SparseDistributedPolynomial: Z-module 531a  (531b)
*: (Integer, %) -> %;

Uses Integer 66.
531bexports: SparseDistributedPolynomial 527+   (526)  530a  533b
if A has with {*: (Integer, %) -> %} then {
        exports: SparseDistributedPolynomial: Z-module 531a
}

Uses Integer 66.
531cimplementation: SparseDistributedPolynomial: Z-module 531c  (532)
(z: Z) * (x: %): % == {
        zero? z => 0;
        map((a: A): A +-> z*a)(x);
}

Uses Z 47.
532implementation: SparseDistributedPolynomial 528b+   (526)  530b  534
if A has with {*: (Integer, %) -> %} then {
        implementation: SparseDistributedPolynomial: Z-module 531c
}

Uses Integer 66.

Export of SparseDistributedPolynomial

*: (Fraction Integer, %) -> %

Description

-module multiplication.

The call q*x for q: Fraction(Integer) and x: % is equivalent to multiplying every coefficient of x with q.

533aexports: SparseDistributedPolynomial: Q-module 533a  (533b)
*: (Fraction Integer, %) -> %;

Uses Integer 66.
533bexports: SparseDistributedPolynomial 527+   (526)  531b
if A has with {*: (Fraction Integer, %) -> %} then {
        exports: SparseDistributedPolynomial: Q-module 533a
}

Uses Integer 66.
533cimplementation: SparseDistributedPolynomial: Q-module 533c  (534)
(q: Q) * (x: %): % == {
        zero? q => 0;
        map((a: A): A +-> q*a)(x);
}

Uses Q 47.
534implementation: SparseDistributedPolynomial 528b+   (526)  532
if A has with {*: (Fraction Integer, %) -> %} then {
        implementation: SparseDistributedPolynomial: Q-module 533c
}

Uses Integer 66.