说明:
1、用法:代码从MatrixOne.txt和MatrixTwo.txt中各读取一个矩阵数据进行乘运算,将计算所得矩阵输出到 MatrixResult.txt文件中;
2、MatrixOne.txt为乘式,MatrixTwo.txt为被乘式,前者矩阵的列数等于后者矩阵的行数;
3、所处理数据均为自然数,负数,浮点数,字母等情况未做处理。
4、代码中字符串类型PathOne,PathTwo,PathOut分别为MatrixOne.txt,MatrixOne.txt,MatrixOut.txt路径;
5、代码中主要函数
int GetkMatrixCol(string str);
1、用法:代码从MatrixOne.txt和MatrixTwo.txt中各读取一个矩阵数据进行乘运算,将计算所得矩阵输出到 MatrixResult.txt文件中;
2、MatrixOne.txt为乘式,MatrixTwo.txt为被乘式,前者矩阵的列数等于后者矩阵的行数;
3、所处理数据均为自然数,负数,浮点数,字母等情况未做处理。
4、代码中字符串类型PathOne,PathTwo,PathOut分别为MatrixOne.txt,MatrixOne.txt,MatrixOut.txt路径;
5、代码中主要函数
int GetkMatrixCol(string str);
int GetMatrixRow(string str);
vector<int> GetNumber(string str);
void MatrixCalculate(vector<int>, vector<int>, int, int, int, int,string);
6、另有一种实现方法,相对简单 C/C++实现矩阵相乘(二)
#include<iostream>
#include<fstream>
#include<vector>
#include<list>
#include<string>
using nam