NZMATH  1.2.0
About: NZMATH is a Python based number theory oriented calculation system.
  Fossies Dox: NZMATH-1.2.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

nzmath.poly.formalsum Namespace Reference


class  DictFormalSum
class  FormalSumContainerInterface
class  ListFormalSum

Detailed Description

formalsum --- formal sum, or linear combination.

The formalsum is mathematically a finite sum of terms.
The term consists of two parts: coefficient and base.
The coefficients must be in a ring.  The base is arbitrary.

Two formalsums can be added in the following way.
If there are terms with common base, they are fused into a
new term with the same base and coefficients added.

A coefficient can be looked up from the base.
If the specified base does not appear in the formalsum,
it is null.

abstract data type FS:
  FS: list(tuple(B, C)) -> FS

  +: FS x FS -> FS
     FS -> FS
  -: FS x FS -> FS
     FS -> FS
  *: C x FS -> FS
     FS x C -> FS

  []: FS x B -> C
  bases: FS -> list(B)
  coefficeints: FS -> list(C)
  terms: FS -> list(tuple(B, C))
  ==: FS x FS -> bool
  !=: FS x FS -> bool
  len: FS -> int
  repr: FS -> str