- 二阶微分图像增强 通过二阶微分算子对BMP图像进行微分
- IQ_Great 用J2ME写的一个益智类手机游戏
- lpc-demo 图形图象 图片显示 2D图形编程 3D图形编程 绘图程序 波变换 GIS编程 分形几何 图形图像处理 OpenGL 图形/文字识别 压缩解压 加密解密 CA认证 数值算法/人工智能 STL 数据结构 数学计算 人工智能/神经网络 matlab例程 生物技术 Java编程 Applet 游戏 JavaScript Jsp/Servlet Ajax *行业应用 医药行业 金融证券系统 教育系统应用 企业管理 邮电通讯系统 OA系统 电子政务应用 酒店行业 百货/超市行业 交通/航空行业 能源行业(电力石油煤炭) 家庭/个人应用 其他行业 数据库系统 Oracle数据库 SQL Server MySQL数据库 其他数据库 汇编语言 SCSI/ASPI 编译器/解释器 磁盘工具 语音合成与识别 编辑器/阅读器 杀毒 中文信息处理 FlashMX源码 并行计算 书籍源码 Delphi控件源码 操作系统开发 中间件编程
- wc_G14 跳跃表的实现
- vbs调用bat 的代码
- MyV2 可以实现labview与kinect连接
文件名称:juzhenxiangcheng
-
所属分类:
- 标签属性:
- 上传时间:2013-03-16
-
文件大小:10.87kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
编写程序,可以实现m*n矩阵和n*p矩阵相乘。m,n,p均小于10,矩阵元素为整数。
分析:
首先我们可以根据题意写出函数头。可以定为void MatrixMutiply(int m,int n,int p,long lMatrix1[MAX][MAX],long lMatrix2[MAX][MAX],long lMatrixResult[MAX][MAX]),其中lMatrix1和lMatrix2分别是输入的m*n矩阵和n*p矩阵,lMatrixResult是输出的m*p矩阵。
因为m,n和p都是未知量,要进行处理的矩阵大小是变量。但我们可以定义比较大的二维数组,只使用其中的部分数组元素。
矩阵相乘的算法比较简单,输入一个m*n矩阵和一个n*p矩阵,结果必然是m*p矩阵,有m*p个元素,每个元素都需要计算,可以使用m*p嵌套循环进行计算。
根据矩阵乘法公式:
可以用循环直接套用上面的公式计算每个元素。嵌套循环内部进行累加前,一定要注意对累加变量进行清零。-Write a program, you can achieve the m* n matrix and n* p matrix multiplied. m, n, p are less than 10, the matrix elements are integers. Analysis: First of all, we can write the function header according to the meaning of the questions. As void MatrixMutiply (int m, int n, int p, long lMatrix1 [MAX] [MAX], long lMatrix2 [MAX] [MAX], long lMatrixResult [MAX] [MAX]) of which lMatrix1 and lMatrix2, are input m* N matrix and n* p matrix, lMatrixResult is the output of m* p matrix. M, n and p are unknown quantity, the size of the matrix to be processed is variable. However, we can define a large two-dimensional arrays, which use only part of the array elements. M* p nested relatively simple matrix multiplication algorithm, the input of an m* n matrix, and an n* p matrix, the inevitable result is a matrix of m* p, there are m* p elements, each element needs to be calculated and can be used loop calculation. Matrix multiplication formula: cycle directly apply the above formula to calculate ea
分析:
首先我们可以根据题意写出函数头。可以定为void MatrixMutiply(int m,int n,int p,long lMatrix1[MAX][MAX],long lMatrix2[MAX][MAX],long lMatrixResult[MAX][MAX]),其中lMatrix1和lMatrix2分别是输入的m*n矩阵和n*p矩阵,lMatrixResult是输出的m*p矩阵。
因为m,n和p都是未知量,要进行处理的矩阵大小是变量。但我们可以定义比较大的二维数组,只使用其中的部分数组元素。
矩阵相乘的算法比较简单,输入一个m*n矩阵和一个n*p矩阵,结果必然是m*p矩阵,有m*p个元素,每个元素都需要计算,可以使用m*p嵌套循环进行计算。
根据矩阵乘法公式:
可以用循环直接套用上面的公式计算每个元素。嵌套循环内部进行累加前,一定要注意对累加变量进行清零。-Write a program, you can achieve the m* n matrix and n* p matrix multiplied. m, n, p are less than 10, the matrix elements are integers. Analysis: First of all, we can write the function header according to the meaning of the questions. As void MatrixMutiply (int m, int n, int p, long lMatrix1 [MAX] [MAX], long lMatrix2 [MAX] [MAX], long lMatrixResult [MAX] [MAX]) of which lMatrix1 and lMatrix2, are input m* N matrix and n* p matrix, lMatrixResult is the output of m* p matrix. M, n and p are unknown quantity, the size of the matrix to be processed is variable. However, we can define a large two-dimensional arrays, which use only part of the array elements. M* p nested relatively simple matrix multiplication algorithm, the input of an m* n matrix, and an n* p matrix, the inevitable result is a matrix of m* p, there are m* p elements, each element needs to be calculated and can be used loop calculation. Matrix multiplication formula: cycle directly apply the above formula to calculate ea
(系统自动生成,下载前可以参看下载内容)
下载文件列表
矩阵相乘.docx
1999-2046 搜珍网 All Rights Reserved.
本站作为网络服务提供者,仅为网络服务对象提供信息存储空间,仅对用户上载内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。
