Matrix3 Matrix3::operator*(const Matrix3& rhs) const { double out[] = { e_[0]*rhs.at(0) + e_[1]*rhs.at(3) + e_[2]*rhs.at(6), e_[0]*rhs.at(1) + e_[1]*rhs.at(4) + e_[2]*rhs.at(7), e_[0]*rhs.at(2) + e_[1]*rhs.at(5) + e_[2]*rhs.at(8), e_[3]*rhs.at(0) + e_[4]*rhs.at(3) + e_[5]*rhs.at(6), e_[3]*rhs.at(1) + e_[4]*rhs.at(4) + e_[5]*rhs.at(7), e_[3]*rhs.at(2) + e_[4]*rhs.at(5) + e_[5]*rhs.at(8), e_[6]*rhs.at(0) + e_[7]*rhs.at(3) + e_[8]*rhs.at(6), e_[6]*rhs.at(1) + e_[7]*rhs.at(4) + e_[8]*rhs.at(7), e_[6]*rhs.at(2) + e_[7]*rhs.at(5) + e_[8]*rhs.at(8) }; return Matrix3(out); }
void Matrix3::operator=(const Matrix3& lhs) { for(int i = 0; i < 9; i++) this->e_[i] = lhs.at(i); }