高斯消元算法GE(A [0 ... n -1,0 ... n])?

时间:2015-11-29 09:56:54

标签: algorithm pseudocode gaussian

GE(A[0..n-1,0..n])
// Input an n × (n + 1) matrix A[0 . . n − 1, 0 . . n] of real numbers
for i = 0 to n − 2
  for j = i + 1 to n − 1
    for k = i to n
      A[j, k] = A[j, k] − A[i, k] ∗ A[j, i]/A[i, i]

如何正式计算其运行时间?

2 个答案:

答案 0 :(得分:0)

> distances = dist(movies[2:20], method="euclidean")
> clusterMovies = hclust(distances, method="ward")
> plot(clusterMovies)
Error in plot.hclust(clusterMovies) : 'merge' matrix has invalid contents

答案 1 :(得分:0)

如果您在问题中更具体,那将会更有帮助。 如果要使用特定输入的语言函数计算运行时间,可以使用System.nanoTime()。

但是如果你想要一个渐近运行时间,它将是O(n ^ 3),其中n是输入大小。

相关问题