Boost logo

Boost :

From: Ullrich Koethe (koethe_at_[hidden])
Date: 2001-03-29 06:09:24


Jeremy Siek wrote:
>
> I've briefly sketched out the concepts for a "linear algebra" that we were
> planning on using for MTL v3.0.
>
> http://www.lsc.nd.edu/~jsiek/tlc/multi_array/libs/numeric/doc/LinearAlgebraConcepts.html
>
> Cheers,
> Jeremy

Very good list! However, the necessary constraints are missing, for
example:

Additive Abelian Group:

1.1) a + b == b + a
1.2) a - a == zero(a)
1.3) a + zero(a) == a
1.4) zero(a) - a == -a

Multiplicative Ring with Identity:

2.1) (a * b) * c == a * (b * c)
2.2) a * identity(a) == a

Field

3.1) (a + b) + c == a + (b + c)
3.2) a * b == b * a
3.3) a * (b + c) == a * b + a * c
3.4) a / b is undefined if and only if b == zero(a)
3.5) a * b == zero(a) if and only if a == zero(a) or b == zero(a)

Unfortunately, these constraints lead to serious practical problems,
because none of the build-in types fulfills them:

float and double fail because of limited accuracy (especially on
conditions 2.1 and 2.2 - what does the IEEE floating point standard say
here ?)

the integer types fail on the condition (3.5), e.g.

unsigned char a = 16;
a * a == zero(a)

How can these problems be solved?

Regards
Ulli

-- 
 ________________________________________________________________
|                                                                |
| Ullrich Koethe  Universität Hamburg / University of Hamburg    |
|                 FB Informatik / Dept. of Computer Science      |
|                 AB Kognitive Systeme / Cognitive Systems Group |
|                                                                |
| Phone: +49 (0)40 42883-2573                Vogt-Koelln-Str. 30 |
| Fax:   +49 (0)40 42883-2572                D - 22527 Hamburg   |
| Email: u.koethe_at_[hidden]               Germany             |
|        koethe_at_[hidden]                        |
| WWW:   http://kogs-www.informatik.uni-hamburg.de/~koethe/      |
|________________________________________________________________|

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk