| 1 |
/* { dg-do compile } */ |
| 2 |
/* Testcase by Martin Michlmayr <[email protected]> */ |
| 3 |
|
| 4 |
class Matrix |
| 5 |
{ |
| 6 |
public: |
| 7 |
double data[4][4]; |
| 8 |
Matrix operator* (const Matrix matrix) const; |
| 9 |
void makeRotationAboutVector (void); |
| 10 |
}; |
| 11 |
void Matrix::makeRotationAboutVector (void) |
| 12 |
{ |
| 13 |
Matrix irx; |
| 14 |
*this = irx * (*this); |
| 15 |
} |
| 16 |
Matrix Matrix::operator* (const Matrix matrix) const |
| 17 |
{ |
| 18 |
Matrix ret; |
| 19 |
for (int i = 0; i < 4; i++) |
| 20 |
for (int j = 0; j < 4; j++) |
| 21 |
ret.data[j][i] = matrix.data[j][2] + matrix.data[j][3]; |
| 22 |
return ret; |
| 23 |
} |
| 24 |
|