Closed CorentinB78 closed 4 years ago
Hey Corentin,
Thank you for posting the issue! This is indeed an inconsistency in the implementation of array and vector.
I checked and while the array class will just apply /=
using foreach
, vector will currently calculate the inverse
of the rhs and use blas::scal
to multiple all elements with this inverse.
These two operations (x/y
and x * (1/y)
) are not identical, c.f. https://godbolt.org/z/Yc41nf
@parcollet Was there a reason you opted for the two different solutions in vector and array?
@CorentinB78 I have made sure for both the unstable and the 3.0.x branch that we are using the array solution for the operator /=
instead.
Description
Operator
/=
on a vector of double do not always give the same result as on an array or standard division.Steps to Reproduce
Expected output:
Actual output:
Versions
Triqs 3.0.0 59c511fbfc39837570d419769a27455c051718dc
OS: on my FI workstation centos-release-7-7.1908.0.el7.centos.x86_64