АК
Size: a a a
АК
IZ
ВП
ES
IZ
AS
template<size_t L, size_t M>
struct matrix {
private:
double cells[L][M];
template<size_t L1, size_t M1, size_t N1>
friend matrix<L1, N1> operator*(matrix<L1, M1> const&, matrix<M1, N1> const&);
};
template<size_t L, size_t M, size_t N>
matrix<L, N> operator*(matrix<L, M> const& a, matrix<M, N> const& b) {
matrix<L, N> tmp{};
for(size_t i = 0; i < L; ++i) {
for(size_t j = 0; j < N; ++j) {
for(size_t r = 0; r < M; ++r) {
tmp.cells[i][j] += a.cells[i][r]*b.cells[r][j];
}
}
}
return tmp;
}
int main() {
matrix<2, 3> a{};
matrix<3, 5> b{};
auto c = a*b;
}
AS
Return value
If the function succeeds, the return value is a handle to the module.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
AS
AS
AS
AS
D