Revision 771690b8 utility/matrix.h
utility/matrix.h | ||
---|---|---|
147 | 147 |
return ret; |
148 | 148 |
} |
149 | 149 |
|
150 |
Matrix operator * (Matrix m)
|
|
150 |
Matrix operator*(const Matrix& m) const
|
|
151 | 151 |
{ |
152 | 152 |
Matrix ret; |
153 |
for(int x = 0; x < N; x++)
|
|
153 |
for (int i = 0; i < N; i++)
|
|
154 | 154 |
{ |
155 |
for(int y = 0; y < N; y++) |
|
155 |
Vector<N> row = row_to_vector(i); |
|
156 |
for (int j = 0; j < N; j++) |
|
156 | 157 |
{ |
157 |
Vector<N> row = row_to_vector(x); |
|
158 |
Vector<N> col = m.col_to_vector(y); |
|
159 |
ret.cell(x, y) = row.dot(col); |
|
158 |
ret.cell(i, j) = row.dot(m.col_to_vector(j)); |
|
160 | 159 |
} |
161 | 160 |
} |
162 | 161 |
return ret; |
Also available in: Unified diff