复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// matrixMulti.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <iostream>
#define N 4
#define Len 16
void multi(int a[],int b[]){
int i,j,t,k;
//int cLen=N*N;
int c[Len]={0};
for(k=0;k<N*N;k++){
i=k/N;
j=k%N;
for(t=0;t<N;t++)
{
c[k]+=a[N*i+t]*b[j+t*N];
}
printf("%d ",c[k]);
}
}
int main(int argc, char* argv[])
{
int a[]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
int b[]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
multi(a,b);
return 0;
}
最后
以上就是哭泣悟空最近收集整理的关于矩阵相乘 一维数组表示的全部内容,更多相关矩阵相乘内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复