相关疑难解决方法(0)

使用LAPACK包装器估算行列式,以便在Cython中进行LU分解

我在这里定义了计算矩阵行列式的函数.但有时我会得到错误的信号.我从这个答案中建模了我的功能.

from scipy.linalg.cython_lapack cimport dgetrf

cpdef double det_c(double[:, ::1] A, double[:, ::1] work, double[::1] ipiv):
    '''obtain determinant of float type square matrix A

    Notes
    -----
    As is, this function is not yet computing the sign of the determinant
    correctly, help!

    Parameters
    ----------
    A : memoryview (numpy array)
        n x n array to compute determinant of
    work : memoryview (numpy array)
        n x n array to use within function
    ipiv : memoryview (numpy array)
        length n vector use within …
Run Code Online (Sandbox Code Playgroud)

python numpy cython scipy lapack

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

标签 统计

cython ×1

lapack ×1

numpy ×1

python ×1

scipy ×1