|Re: [eigen] Memory leaks|
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
Am 15.04.2015 um 14:04 schrieb Gael Guennebaud:
On Wed, Apr 15, 2015 at 11:14 AM, Christoph Hertzberg <
While the test-suite ran without (new) failures, I found a possible reason
for calling the Base constructor. When compiling with
the Base::_set_noalias(other) call would assert (which it should not for
the constructor). Adding a call to resizeLike(other) -- not
_resize_to_match -- should do the job.
yes, we could call resizeLike either from the ctor or _set_noalias making
sure that _set_noalias will always be called from ctors only.
IMO, the first makes more sense.
Two other things:
The ReturnByValue constructor does not implicitly transpose the result if
required, is this intended? Implementing this would require a few lines of
additional code in the assignment logic.
hm, have to check first whether operator=(ReturnByValue) does implicit
transposition without extra copy.
Actually most uses of ReturnByValue have been replaced during the Evaluator refactorings. E.g.,
is now overwritten by
and returns a Solve object instead of a ReturnByValue
Matrix3d M = Matrix3d::Random();
x.transpose() = M.triangularView<Upper>().solve(M.col(0));
x.transpose() = M.triangularView<Upper>().solve<OnTheRight>(M.row(0));
x = M.triangularView<Upper>().solve<OnTheRight>(M.row(0));
I assume the remaining ReturnByValues should actually also be replaced by corresponding Evaluator expressions?
Then the question is if we need to keep ReturnByValue, in case it is used by user-code.
|Mail converted by MHonArc 2.6.19+||http://listengine.tuxfamily.org/|