Cleanup MultiIndex generation and use
In order to support hybrid (i.e. runtime-sized) multi-indices, the PowerPreBasis and CompositePrebasis currently rely on using ReservedVector as MultiIndex. The allocated size is determined automatically using *PreBasisFactory::requiredMultiIndexSize and the determined MultiIndex type is forwarded to all involved PreBasis instances as template parameter. This has a severe drawback: For uniform (i.e. with statically known size) multi-indices, you cannot use a statically sized MultiIndex like std::array. The reason for this is that PowerPreBasis and CompositePrebasis need to know the size of the multi-indices generated by its children while constructing the final exported multi-indices.
Storing this size the way ReservedVector does it is most natural.
As a remedy I propose the following changes:
- Rename
*PreBasisFactory::requiredMultiIndexSizeto*PreBasisFactory::maxMultiIndexSizeand add*PreBasisFactory::minMultiIndexSize. This allows to detect uniform multi-indices. - Allow different types for stored and exported multi-indices. Using
ReservedVectorfor caching allows to build multi-indices as outlined above. For uniform multi-indices the statically sized internal array is better suited.
In order to implement this we have to:
- Remove/ignore
MultiIndextemplate parameter from*PreBasisand*NodeIndexSet. The type of the stored multi-index can be deduced in theindices()method and the type of the exportet multi-indices is not needed. - Add template parameters
CachedMultiIndexandMultiIndextoDefaultNodalBasisandDefaultLocalIndexSetand let them decay multi-indices from the cached to the exported type automatically. - As an alternative: Pass
minMultiIndexSizeandmaxMultiIndexSizetoDefaultNodalBasisand hard-wire appropriateCachedMultiIndexandMultiIndextypes.