Change poly_degree attribute of MultiIndexSet to be a read-only property
Currently the attribute poly_degree
of a MultiIndexSet
instance is simply an instance attribute; after an instance has been created (either via the default constructor or from_degree()
) the attribute can be arbitrarily changed from the outside.
Exposing the attribute is potentially dangerous for the integrity of the instance. poly_degree
should only be changed via internal mechanism of the class, e.g., adding a set of exponents may change the value of the polynomial degree of a multi-index set.
To protect the attribute, define a corresponding private attribute (i.e., _poly_degree
) and implement read-only property to access the value of poly_degree
.