Define an empty MultiIndexSet instance.
An empty MultiIndexSet
instance has an empty array as its exponents. It can be created by passing an empty two-dimensional array to
the default constructor. Such a set has an lp-degree that is defined during construction; its spatial dimension, however, may be 0.
The properties of such a set are as follows:
-
exponents
: a two-dimensional empty array as specified. -
lp_degree
: as specified during construction (float). -
poly_degree
:None
(it cannot be computed). -
spatial_dimension
: according to the value of the second dimension of the given empty array (may be 0, int). -
is_complete
:False
a priori. -
is_downward_closed
:False
a priori. -
__len__()
: 0 (i.e., zero cardinality).
Empty sets are defined to support further set operations involving MultiIndexSet
.
Such a set cannot be used to construct polynomials or Grid
instances.
This MR should resolve Issue #132 (closed).
Several additional changes:
- A safeguard is introduced to the constructors of polynomials,
Grid
, andOrdinaryRegression
not to accept an empty set. - The test suite for
MultiIndexSet
is refactored to uniformly use class-based grouping for organization purposes. - The same test suite is updated with testing the behavior of all methods involving an empty set.
- The test suites for polynomials,
Grid
(newly added), andOrdinaryRegression
are updated with testing the construction using an empty set.
Edited by Damar Wicaksono