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?

Ralf



(298) -> mat := matrix [[1,1,1,1],[1,5,3,4],[1,4,9,16],[2,3,5,7]]

          +1  1  1  1 +
          |           |
          |1  5  3  4 |
   (298)  |           |
          |1  4  9  16|
          |           |
          +2  3  5  7 +
(300) -> rowEchelon mat

          +1  0  0  13+
          |           |
          |0  1  0  5 |
   (300)  |           |
          |0  0  1  0 |
          |           |
          +0  0  0  17+
                                  Type: Matrix(Integer)

(301) -> rowEchelon(mat::Matrix(Fraction Integer))

          +1  0  0  0+
          |          |
          |0  1  0  0|
   (301)  |          |
          |0  0  1  0|
          |          |
          +0  0  0  1+
                                  Type: Matrix(Fraction(Integer))

--
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/052233c5-8e83-e052-7606-52158f0327f5%40hemmecke.de.

Reply via email to