三角矩阵在压缩存储下的转置矩阵源代码.docVIP

  • 25
  • 0
  • 约1.36千字
  • 约 3页
  • 2018-04-17 发布于河南
  • 举报

三角矩阵在压缩存储下的转置矩阵源代码.doc

三角矩阵在压缩存储下的转置矩阵源代码

#includestdio.h #includestdlib.h #define max 20 #define zero 0 typedef struct{ int i,j,v; }node; typedef struct{ node data[max]; int m; }TSmatrix; TSmatrix *Setmatrix(){ //建三对角矩阵 TSmatrix *T; T=(TSmatrix *)malloc(sizeof(TSmatrix)); printf(请输入矩阵行数或列数:\n); scanf(%d,T-m); printf(建立三对角矩阵:\n); for(int n=0;n3*T-m-2;n++) scanf(%d%d%d,T-data[n].i,T-data[n].j,T-data[n].v); return T; } TSmatrix *Trabsmatrix(TSmatrix *T){ //三对角矩阵转置 int n,k,temp; TSmatrix *F; F=(TSmatrix *)malloc(sizeof(TSmatrix)); F-m=T-m; for(n=0;n3*T-m-2;n++){ //将结点信息存入新三元组表中 temp=2*T-data[n].j+T-data[n].i;

文档评论(0)

1亿VIP精品文档

相关文档