mm0.cpp 425 Bytes
Newer Older
Ignacio Labarca Figueroa's avatar
Ignacio Labarca Figueroa committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
 * Programming Techniques for Scientific Simulations I
 * HS 2019
 * Exercise 10
 */

#include "matrix_multiplication.hpp"

// Trivial implementation
void mm0(matrix_t const & A, matrix_t const & B, matrix_t & C, std::size_t N) noexcept {
	for (std::size_t i = 0; i < N; ++i) {
		for (std::size_t j = 0; j < N; ++j) {
			for (std::size_t k = 0; k < N; ++k) {
				C[i + j * N] += A[i + k * N] * B[k + j * N];
			}
		}
	}
}