Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
330 stars 227 forks source link

runLengthEncoding failing on subscripted variables #765

Closed pzinn closed 5 years ago

pzinn commented 6 years ago

another easy one:

i1 : R=QQ[a..e]; describe R

o1 = QQ[a..e, Degrees => {5:1}, Heft => {1}, MonomialOrder => {MonomialSize => 32}, DegreeRank => 1]
                                                              {GRevLex => {5:1}  }
                                                              {Position => Up    }

but:

i1 : R=QQ[x_1..x_10]; describe R

o1 = QQ[x , x , x , x , x , x , x , x , x , x  , Degrees => {10:1}, Heft => {1}, MonomialOrder => ...]
         1   2   3   4   5   6   7   8   9   10                                                  

runLengthEncoding didn't do his job in the second case (should be x_1..x_10). the reason seems to be that it is given as input R.generatorExpressions, which in the case of subscripted variables are "Expression of class Subscript", and seems to expect "IndexedVariable" instead.

will work on this one next

pzinn commented 5 years ago

I'm still working on that one. tried various fixes, but not satisfied yet. I suspect only a complete rewrite would solve all the problems (which include handling double indices or a_1..e_3). actually! I think I found a way to get all these cases to work without a full rewrite. PR coming soon.

DanGrayson commented 5 years ago

Great, thanks!

DanGrayson commented 5 years ago

runLengthEncoding should handle both subscript expressions and indexed variables, right?