def left_eliminate!
      #    inv = Algebra.SquareMatrix(ground, rsize).unity
      k = ground.unity
      pi = 0
      each_j do |j|
        next unless i = (pi...rsize).find { |i1| !self[i1, j].zero? }
        if i != pi
          swap_r!(pi, i) # ; inv.swap_r!(pi, i)
          k = -k
        end
        c = ground.unity / self[pi, j] # this lets the entries be in ground
        multiply_r!(pi, c) # ; inv.multiply_r!(pi, c)
        k *= c
        each_i do |i0|
          next if i0 == pi
          d = self[i0, j] # / self[pi, j]
          mix_r!(i0, pi, -d) # ; inv.mix_r!(i0, pi, -d)
        end
        pi += 1
      end
      [left, k]
    end
def left_eliminate!
      #    inv = Algebra.SquareMatrix(ground, rsize).unity
      k = ground.unity
      pi = 0
      each_j do |j|
        next unless i = (pi...rsize).find { |i1| !self[i1, j].zero? }
        if i != pi
          swap_r!(pi, i) # ; inv.swap_r!(pi, i)
          k = -k
        end
        c = ground.unity / self[pi, j] # this lets the entries be in ground
        multiply_r!(pi, c) # ; inv.multiply_r!(pi, c)
        k *= c
        each_i do |i0|
          next if i0 == pi
          d = self[i0, j] # / self[pi, j]
          mix_r!(i0, pi, -d) # ; inv.mix_r!(i0, pi, -d)
        end
        pi += 1
      end
      [left, k]
    end
def mix_c(i, j, c = nil)
    dup.mix_c!(i, j, c)
  end