Previous Page Next Page Contents

Dom::Product -- homogeneous direct products

Introduction

Dom::Product(Set, n) is an n-fold direct product of the domain Set.

Domain

Dom::Product(Set <, n>)

Parameters

Set - an arbitrary domain of elements, i.e., a domain of category Cat::BaseCategory
n - the dimension of the product (a positive integer); default is 1

Creating Elements

Dom::Product(Set <, n>)(e1, e2..., en)
Dom::Product(Set <, n>)(List)

Parameters

e1, e2..., en - elements of Set or objects convertible into such
List - a list of n elements of Set or objects convertible into such

Categories

Cat::HomogeneousFiniteProduct(Set)

Details

Entries

card

is the cardinal number of Dom::Product(Set, n), which is equal to n.

coeffRing

is the domain S.

one

is the n-tuple (Set::one, Set::one, ..., Set::one). This entry only exists if Set is a monoid, i.e., a domain of category Cat::Monoid.

zero

is the n-tuple (Set::zero, Set::zero, ..., Set::zero). This entry only exists if Set is an Abelian group, i.e., a domain of category Cat::AbelianGroup.

Method _divide: divide tuples

Method _invert: computes the inverse of a tuple

Method _less: less-than relation

Method _mult: multiplies tuples by tuples and scalars

Method _negate: negates an n-tuple

Method _power: the ith power of a tuple

Method _plus: adds tuples

Method D: the differential operator

Method diff: differentiation of n-tuples

Method equal: test on equality of n-tuples

Method intmult: multiple of a tuple

Method iszero: test on zero

Method random: random tuple generation

Method _index: tuple indexing

Method map: apply a function to tuple components

Method mapCanFail: apply a function to tuple components

Method op: components of a tuple

Method set_index: assigning tuple components

Method subs: substitution of tuple components

Method testEach: check every component for a certain condition

Method testOne: check an component for a certain condition

Method zip: combine tuples component-wise

Method zipCanFail: combine tuples component-wise

Method convert: conversion into an n-tuple

Method expr: conversion into an object of a kernel domain

Example 1

Define the 3-fold direct product of the rational numbers:

>> P3 := Dom::Product(Dom::Rational, 3)
                      Dom::Product(Dom::Rational, 3)

and create elements:

>> a := P3([1, 2/3, 0])
                                [1, 2/3, 0]
>> b := P3(2/3, 4, 1/2)
                               [2/3, 4, 1/2]

We use the standard arithmetical operators to calculate with such tuples:

>> a + b, a*b, 2*a
               [5/3, 14/3, 1/2], [2/3, 8/3, 0], [2, 4/3, 0]

Some system functions were overloaded for such elements, such as diff, map or zip (see the description of the corresponding methods "diff", "map" and "zip" above).

For example, to divide each component of a by 2 we enter:

>> map(a, `/`, 2) 
                               [1/2, 1/3, 0]

The quoted character `/` is another notation for the function _divide, the functional form of the division operator /.

Be careful that the mapping function returns elements of the domain the product is defined over. This is not checked by the function map (for efficiency reasons) and may lead to ``invalid'' tuples. For example:

>> b := map(a, sin); domtype(b)
                           [sin(1), sin(2/3), 0]
      
                      Dom::Product(Dom::Rational, 3)

But the components of b are no longer rational numbers!

Super-Domain

Dom::BaseDomain

Axioms

if Set has Ax::canonicalRep, then
Ax::canonicalRep
if Set has Cat::AbelianMonoid and Set has Ax::normalRep, then
Ax::normalRep

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000