Skip to content

WIP: add converting constructors to preBases

Summary

Add converting-copy/move constructurs to DefaultGlobalBasis, CompositePreBasis and PowerPreBasis to create copies with possibly different IndexMergingStrategy or MultiIndex type.

Details

Currently it is difficult to create a flat basis from a blocked basis or vice versa without manually using the basis factory (Maybe except for the approach in !125 (merged)). One step in this direction could be to allow copies of PreBases with different template parameters, especially those for IndexMergingStrategy and MultiIndex. Then, a simple type transformation, replacing IMS and MultiIndex recursively, would allow to perform the task.

Discussion

The complicated part when changing the IndexMergingStrategy is the choice of the MultiIndex type. A completely flat basis might have the MultiIndex type FlatMultiIndex<size_t> or ReservedVector<size_t,1>. This can not hold more than 1 index and is thus not applicable in blocked bases. While this can be handled manually by correctly specifying the target preBasis type, it is not done automatically like in the factories. Maybe its necessary to provide a generic tool for that or provide a compile-time check that the MultiIndex type can hold the indices of the chosen index-merging strategy (But this is currently also not checked in the existing constructor).

Edited by Simon Praetorius

Merge request reports