Use this method to assign weights to the variables of a polynomial ring.
The object setWeights is a method function.