cephar
cephar
2021-01-20 19:28

求大神指点!!!R语言怎么用算法求矩阵的reduced echelon form(行阶梯矩阵形式)?

  • r语言

以下是一个没有完善的提示 (Ri代表矩阵的第i行)

INPUT matrix A

OUTPUT reduced echelon form of matrix A

SET m TO number of rows of A

SET n TO number of columns of A

SET p TO 1

SET q TO 1

WHILE p ≤ m AND q ≤ n

Find the smallest j ≥ q with Ak,j = 0 for some k ≥ p

IF k = p

Replace Rp by Rp/Ak,j

ELSE

Replace Rp by Rp + Rk/Ak,j

IF there are other rows with non-zero entries in the j th column

Replace Ri by Ri - Ai,j*Rp

SET p TO p + 1

SET q TO j + 1

RETURN A

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

0条回答

为你推荐

换一换