diff --git a/include/mitsuba/core/matrix.h b/include/mitsuba/core/matrix.h index 5eb5f9cb..c40207cf 100644 --- a/include/mitsuba/core/matrix.h +++ b/include/mitsuba/core/matrix.h @@ -198,6 +198,33 @@ public: return *this; } + /// Scalar division (creates a temporary) + inline Matrix operator/(T value) const { + Matrix result; +#ifdef MTS_DEBUG + if (value == 0) + SLog(EWarn, "Matrix: Division by zero!"); +#endif + Float recip = 1/value; + for (int i=0; i inline Matrix operator*(const Matrix &mat) const { BOOST_STATIC_ASSERT(N == M2);