- for (unsigned i = 0; i < SGMatrix<T>::nCols-1; ++i)
- (*this)(i,3) += T(t(i));
+ for (unsigned i = 0; i < 3; ++i) {
+ T tmp = T(t(i));
+ if (tmp == 0)
+ continue;
+ (*this)(i,0) += tmp*(*this)(3,0);
+ (*this)(i,1) += tmp*(*this)(3,1);
+ (*this)(i,2) += tmp*(*this)(3,2);
+ (*this)(i,3) += tmp*(*this)(3,3);
+ }