Implement multiplication operation for Grid instances
By implementing the dunder method __mul__()
for Grid
class, instances of the class may now be multiplied with each other.
A multiplication between two Grid
instances returns a new Grid
instance with a multi-index set that is the product of the multi-index sets of the operands.
Additionally:
- The test suite has been updated to include the changes.
- A how-to guide on
Grid
multiplication has been added to the docs. - The method
expand_dim()
may now accept another instance ofGrid
as the target dimension. It means that the current instance shall be expanded to the dimension of the target grid as long as the underlying generating function or points are compatible. In essence, it has a built-in error checking. - Generating points of higher dimension (i.e., more columns) than the multi-index set may now be specified for the construction of
Grid
instance. - The method
merge()
for theGrid
class has been implemented to support the common operation of dimension expansion, multiplication, and addition.
This MR should resolve Issue #154 (closed) and part of the refactoring and update of the Grid
class (see Issue #135).