Mon Sep 14 09:52:06 CEST 2009
So... This constraint business. The current algorithm uses N x 1
constraints. This needs to be generalized to N x 1 linear
constraints, then N x M systems.
Let's start with the most general first. I.e. a 3 x 2 system:
a x + b y + c z = d
q x + r y + s z = t
In general this can be solved using gaussian elimination. Given a
collection of known variables, a square system can be constructed
which then needs to be inverted. Since all coefficients are known at
compile time, the sequence of computations can be generated in-line to
produce a dataflow program, which can then be sequenced.
Pivoting can be used to yield optimal condition. Full-pivoting
searches for the element with largest absolute value in the
OK.. since this is all quite straightforward computable at run-time,
it might be good to do it numericall. Otoh, allowing rational numbers
might be interesting too (i.e. for sparse systems).
Yes, let's go for the rational numbers. Wait, since there are going
to be square roots of 2 and 3 in the constants, maybe also use field
It looks like it might be a good idea to abstract the _coefficient
domain_ of the equations using some kind of unit interface (like the
functor approach in ).