文件名称:SparseMatrixSummation
介绍说明--下载内容均来自于网络,请自行研究使用
数据结构
1、算法思路:
先定义一个三元组,创建稀疏矩阵m和n。依次扫描A和B的行号和列号,若A的当前项的行号等于B的当前项的行号,则比较其列号,将较小列的项存入C中,如果列号也相等,则将对应的元素值相加后存入C中;若A的当前项的行号小于B的当前项的行号,则将A的项存入C中;若A的当前项的行号大于B的当前项的行号,则将B的项存入C中。
-Data Structures 1, algorithm ideas: first define a triple to create sparse matrix m and n. A and B followed by scanning line number and column number, if the A s current line number of the equivalent B of the current line number, then set out to compare their number, will be heading out into the smaller C, if the column has also equal to the corresponding elements will add value in deposit C if A current of the line number is less than B s current line-item number, the item will be A deposit of C if A current items Bank B is greater than its current line-item number, the item will be deposited in B in C.
1、算法思路:
先定义一个三元组,创建稀疏矩阵m和n。依次扫描A和B的行号和列号,若A的当前项的行号等于B的当前项的行号,则比较其列号,将较小列的项存入C中,如果列号也相等,则将对应的元素值相加后存入C中;若A的当前项的行号小于B的当前项的行号,则将A的项存入C中;若A的当前项的行号大于B的当前项的行号,则将B的项存入C中。
-Data Structures 1, algorithm ideas: first define a triple to create sparse matrix m and n. A and B followed by scanning line number and column number, if the A s current line number of the equivalent B of the current line number, then set out to compare their number, will be heading out into the smaller C, if the column has also equal to the corresponding elements will add value in deposit C if A current of the line number is less than B s current line-item number, the item will be A deposit of C if A current items Bank B is greater than its current line-item number, the item will be deposited in B in C.
相关搜索: 最小二乘
(系统自动生成,下载前可以参看下载内容)
下载文件列表
实验3 稀疏矩阵求和.doc