From e0a021019e39f937bee88cf6088e2d5f351c95ec Mon Sep 17 00:00:00 2001 From: Caleb Donovick Date: Tue, 15 Nov 2016 04:35:54 -0800 Subject: [PATCH] Add Dscalar operator*=(DScalar1&) --- include/mitsuba/core/autodiff.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/mitsuba/core/autodiff.h b/include/mitsuba/core/autodiff.h index 7cb6eec5..990bbebd 100644 --- a/include/mitsuba/core/autodiff.h +++ b/include/mitsuba/core/autodiff.h @@ -254,6 +254,12 @@ public: grad *= v; return *this; } + + inline DScalar1& operator*=(const DScalar1 &v) { + grad = v.grad * value + grad * v.value; + value *= v.value; + return *this; + } /// @} // ======================================================================