Move operations and definition of "Valid state" for Tensor/FullTensor/SparseTensor
As of now our definition of a valid state of a FullTensor is that it is that all variables are consistent. I.e. size is the product of dimensions, the data pointer points to an array of size size
and the factor is a valid value (not inf,...).
Following the design of the C++ std lib move operations should leave the object in question in such a valid state. Currently this is NOT fulfilled by our move-operations. In particular the FullTensor move constructors use the Tensor move constructors which do not preserve the consistency between size and dimensions and also do not leave the data pointer in a consistent state.
Therefore I would suggest to either:
-
Weaken the definition of valid state for FullTensor/Tensor/SparseTensor to allow such inconsistencies and require a call to reset before the object can be used again.
-
Or remove the move-operations for FullTensor/Tensor/SparseTensor altogether as a rigorous implementation of the current definition does not allow any gains compared to the non-move operations.