所属分类:
其他
开发工具:LINUX
文件大小:1KB
下载次数:1
上传日期:2017-06-14 13:43:57
说明: 矩阵乘法
给定两个矩阵 A 和 B,其中 A 是具有 M 行、K 列的矩阵, B 为 K 行、N 列的矩阵, A 和
B 的矩阵积为矩阵 C, C 为 M 行、N 列。矩阵 C 中第 i 行、第 j 列的元素 Cij 就是矩阵 A
第 i 行每个元素和矩阵 B 第 j 列每个元素乘积的和,即
要求:每个 Ci j 的计算用一个独立的工作线程,因此它将会涉及生成 M×N 个工作线程。主
线程(或称为父线程)将初始化矩阵 A 和 B,并分配足够的内存给矩阵 C,它将容纳矩阵 A
和 B 的积。这些矩阵将声明为全局数据,以使每个工作线程都能访问矩阵 A、B 和 C。
(Matrix multiplication
Given two matrices A and B, where A is a matrix with M rows, K columns, B is K rows, N columns are matrices, A, and
The matrix product of B is matrix C, C is M row, and N column. The element J in column I and column C in matrix Cij is the matrix A
Line I, the sum of the products of each element and the matrix B, column J, i.e.
Requirements: each Ci J is computed with an independent worker thread, so it will involve generating M * N worker threads. main
The thread (or parent thread) will initialize the matrix A and B, and enough memory allocated to the C matrix, it will accommodate matrix A
Product of B. These matrices will be declared global data so that each worker thread can access matrices A, B, and C.)
文件列表:
matrix
matrix\Fibonacci.c
matrix\matrix.c