astro-informatics/sopt

Possible bugs (dangling references) due to returning reference to temporary object in l1_proximal.h?

Opened this issue · 0 comments

In l1_proximal.h, we have

Vector<Real> const &weights() const { return L1TightFrame<Scalar>::weights(); }

Similarly, in , we have

LinearTransform<Vector<Scalar>> const &Psi() const { return L1TightFrame<Scalar>::Psi(); }

Can we please have a closer look at this (first visually, and then maybe through unit tests)? This was flagged in static analysis that there functions are likely returning references to temporary objects (i.e. dangling references).