The above topic has been closed but one statement concerning TMatrixDSym or for that matter the whole linear algebra package has to be clarified / corrected.
Enrico stated
Unfortunately, however, it is not possible to assign a TMatrixDSym with a certain shape to a TMatrixDSym with another shape!
As the documentation (once upon a time…) stated this is by design !
Shapes of vectors and matrices can only be changed by invoking “ResizeTo” .
So the correct code would be:
~ root -l
root [0] TMatrixDSym rdf_var; // this is the internal RDF variable, default-constructed
root [1] TMatrixDSym s(3, 4); // this is your `s`
root [2] rdf_var.ResizeTo(3, 4);
root [3] rdf_var = s // does work!
Hi Eddy,
please do suggest improvements to the documentation in an issue or a pull request .
Note that the workaround you suggest cannot easily be applied to solve the original problem, as what happens there is that RDF has templated code that instantiates a variable of type T for every user-defined callable that returns a T, and then it simply assigns rdf_var = user_callable(...) . There is no hook to inject a ResizeTo before every such assignment unless we special-case RDF’s logic in several places for all types that require this.
I believe that the ROOT team has a week devoted in September to bring the
documentation up to snuff, so there is a plan of action, no need to interfere with a
pull request
I have not enough knowledge about the RDF implementation but bringing copy assignment operators allowing size changes in the linear algebra does not sound attractive.