Hi, yes, with "x = x.array().log()" the operation is done inplace, no temporary.
Gaƫl On Wed, Jul 29, 2020 at 12:22 AM Hung Dang <hungp...@gmail.com> wrote: > Hi, > > I need to compute x = log(x) in-place, with x can be either a vector or a > matrix. This task can be done using either a simple for-loop or x = > x.array().log(). The second solution is vectorized, however, I am not sure > if it can be done in-place. Is there any better solution? > > Regards, > Hung > > > > > > > >