File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,15 @@ namespace RTE {
233233 // / @param rhs A Matrix reference as the right hand side operand.
234234 // / @return A reference to the resulting Vector.
235235 friend Vector operator *(const Vector& lhs, const Matrix& rhs) {
236+ // Multiplication might call Matrix::UpdateElements and therefore
237+ // needs to modify it.
238+ //
239+ // However, this function signature uses const ref for the matrix.
240+ //
241+ // Therefore, the only way to perform this as needed
242+ // without changing it to mut ref is by copying the matrix.
243+ //
244+ // TODO: see if we can unjank this?
236245 Matrix m (rhs);
237246 return m * lhs;
238247 }
@@ -248,6 +257,15 @@ namespace RTE {
248257 // / @param rhs A Matrix reference as the right hand side operand.
249258 // / @return A reference to the resulting Vector.
250259 friend Vector operator /(const Vector& lhs, const Matrix& rhs) {
260+ // Division might call Matrix::UpdateElements and therefore
261+ // needs to modify it.
262+ //
263+ // However, this function signature uses const ref for the matrix.
264+ //
265+ // Therefore, the only way to perform this as needed
266+ // without changing it to mut ref is by copying the matrix.
267+ //
268+ // TODO: see if we can unjank this?
251269 Matrix m (rhs);
252270 return m / lhs;
253271 }
You can’t perform that action at this time.
0 commit comments