On Fri, May 12, 2023 at 02:03:15PM +0200, Ralf Hemmecke wrote:
> Hello,
>
> the result of rowEchelon is nice, but a bit too much for what I need.
> Is there a function that just kills the elements below the diagonal and
> doesn't care about the upper triangular part.
>
> So I would be happy with rowEchelon with a replacement of the loop coming at
> the end
>
> https://github.com/fricas/fricas/blob/master/src/algebra/matfuns.spad#L119
>
> -- perform row operations so that jth column has only one 1
> for k in minR..maxR repeat
> if k ~= i and not((pp := qelt(x, k, j)) = 0) then
> row_op(x, i, j + 1, k, maxC, pp)
> qsetelt!(x, k, j, 0)
>
> by
>
> for k in i+1..maxR repeat
> if not((pp := qelt(x, k, j)) = 0) then
> row_op(x, i, j + 1, k, maxC, pp)
> qsetelt!(x, k, j, 0)
>
> Of course, such a function needs a new name, and the above covers only the
> Field case not EuclideanDomain.
>
> Any ideas about what to do?
I am not sure if understand what you actually want. In general
"row echelon" form is quite non-unique. To make it better determined
we require that all elements above diagonal are reduced as
much as possible, which in case of working over a field means
reduced to zero in columns containing pivots
So do you want "row echelon" form but are worried about cost of
zeroing elements above diagonal? Or do you want to preserve
information in upper part?
You probably should look at LU decomposition ('LUDecomp' in
package LUDecomposition). 'LUDecomp' is oriented towards
equation solving and produces more results than you apparently
want, but in a sense performs minimal number of operations
needed to turn elements below diagonal into zeros.
'LUDecomp' has restrictions (I think that it wants nonzero
pivot in each column), but there is generalization without
such restriction (I have uncommited version which I developed
for unfinished modular solver for linear systems).
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/20230512210630.nb33cgntluz66uzn%40fricas.math.uni.wroc.pl.