摘要
对三角矩阵的存储映射问题进行了讨论.对于n阶下三角矩阵,若按行主顺序仅将下三角部分各元素依次存储到向量B[1∶n(n+1)/2]中,则可获得矩阵下标集合到向量下标集合的一个一一映射f(i,j)=i(i-1)/2+j,其逆映射为f-1(k)=(p,k-p(p-1)/2).这里i≥j且p=(8k+1-1)/2.对于上三角矩阵,若按列主顺序仅存上三角部分,则可对称地获得类似的一一映射:g(i,j)=f(j,i)=j(j-1)/2+i,g-1(k)=(k-p(p-1)/2,p),其中i j,p同前.一般地,对于对称矩阵,若仅如前地存储下三角部分或上三角部分,则得到一个多对一映射h∶h(i,j)=f(i,j)(若i j)或g(i,j)(若i<j).
In this paper, the storage mapping of triangular matrix is discussed. For an nth lower triangular matrix, by storing the lower triangular parts based on the row_major order into a vector B,a one_to_one mapping from the matrix index set to the vector index set can be obtained, that is f(i,j)=i(i-1)/2+j. Its inverse mapping is f-1(k)=(p,k-p(p-1)/2).where i≥j,p=(8k+1-1)/2. Symmetrically, for an nth upper triangular matrix, by storing the upper triangular parts based on the column_major order into the vector B, a similar one_to_one mapping can also be obtained:g(i,j)=f(j,i)=j(j-1)/2+i,g-1(k)=(k-p(p-1)/2,p),where ij.Generally, for an nth symmetric matrix, by storing its upper or lower triangular parts into B as indicated above, a many_to_one mapping can be obtained∶h(i,j)=f(i,j)(if ij) or g(i,j)(if i<j).
出处
《四川师范学院学报(自然科学版)》
2002年第4期393-396,共4页
Journal of Sichuan Teachers College(Natural Science)
基金
四川省教育厅资助项目(川教计[2000]141号)