【发布时间】:2021-07-24 12:09:14
【问题描述】:
我想在 GSL 中创建一个稀疏复杂矩阵,他们的文档 here 说所有函数都可用于多种矩阵类型,我感兴趣的一个是 gsl_spmatrix_complex。
所有函数都可用于每种标准数据类型。 double 的版本具有前缀 gsl_spmatrix,类似地,单精度浮点数组的版本具有 gsl_spmatrix_float 前缀。
我尝试使用gsl_spmatrix_complex_alloc 分配一个并在 GCC 中获取未定义的引用。
gsl_spmatrix mat = gsl_spmatrix_complex_alloc(matrix_header.m, matrix_header.n);
我认为我的包含可能是错误的(gsl/gsl_spmatrix.h,然后尝试了类似gsl/gsl_matrix_complex_double.h),但后来我运行cat /usr/include/gsl/* | grep gsl_spmatrix_complex,但没有得到任何结果,所以要么我的libgsl-dev(Ubuntu 20.04)坏了,要么文档是错误的。对于稀疏复杂类型,根本没有分配函数和矩阵函数!
鉴于文档使用 gsl_spmatrix_float 作为示例,我也对其进行了 grep,但不存在任何内容。
回到我的问题,如何按照文档在 GSL 中创建稀疏复杂矩阵?
【问题讨论】:
标签: c matrix sparse-matrix complex-numbers gsl