wtgrev=weightGrevlex(wtR)


It is standard in other algebra systems to have a weighted monomial ordering based on one row of weights such as matrix{{5,6,6}} being extended to matrix{{5,6,6},{1,1,0},{1,0,0}}, whereas M2 would extend it to matrix{{5,6,6},{1,1,1},{1,1,0}}. The method here allows for more than one independent row of weights matrix{{5,6,6},{3,6,0}} to be extended to matrix{{5,6,6},{3,6,0},{1,0,0}}. Note that the number of rows necessarily matches the number of (free) variables, those of P, since the rightmost square submatrix defines a monomial ordering on P.
The object weightGrevlex is a method function.