相关疑难解决方法(0)

在 numpy 的 svd 方法中使用替代 LAPACK 驱动程序?

我正在使用 numpy.svd 来计算条件不良矩阵的奇异值分解。对于某些特殊情况,svd 不会收敛并引发 Linalg.Error。我做了一些研究,发现 numpy 使用 LAPACK 中的 DGEESDD 例程。标准实现的硬编码迭代限制为 35 次或更多迭代。如果我尝试在 Matlab 中分解相同的矩阵,一切都会正常,我认为有两个原因: 1. Matlab 使用 DGESVD 而不是 DGEESDD,后者通常看起来更稳健。2. Matlab 在例程中使用 75 次迭代限制。(他们在源代码中更改了它并重新编译了它。)

现在的问题是:是否有一种简单的方法可以将 numpy 中使用的后端从 DGEESDD 更改为 DGESVD,而无需修改 numpy 源?

预先感谢米莎

numpy exception svd lapack

5
推荐指数
1
解决办法
1377
查看次数

f2py:一些返回的数组未更改/为空

嗨,我是用f2py包裹LAPACK例行dgesvd,通过编译dgesvd.f文件和链接它反对llapack,如解释在这里

根据文档字符串,dgesvd 模块具有签名:

dgesvd - Function signature:
  dgesvd(jobu,jobvt,m,n,a,s,u,vt,work,lwork,info,[lda,ldu,ldvt])
Required arguments:
  jobu : input string(len=1)
  jobvt : input string(len=1)
  m : input int
  n : input int
  a : input rank-2 array('d') with bounds (lda,*)
  s : input rank-1 array('d') with bounds (*)
  u : input rank-2 array('d') with bounds (ldu,*)
  vt : input rank-2 array('d') with bounds (ldvt,*)
  work : input rank-1 array('d') with bounds (*)
  lwork : input int
  info : input int
Optional arguments:
  lda := shape(a,0) …
Run Code Online (Sandbox Code Playgroud)

arrays return zero f2py

1
推荐指数
1
解决办法
1086
查看次数

标签 统计

arrays ×1

exception ×1

f2py ×1

lapack ×1

numpy ×1

return ×1

svd ×1

zero ×1