贡献者: addis
Intel MKL 提供的 Lapack 函数搜索。
如果有 Driver routine 就用尽量用,其次再选 Computational。
问题类型
矩阵类型
以下是一些分类搜索结果
?gesv 解方矩阵线性方程组,多个 RHS
?gesvx gesv 并提供误差
?gesvxx 用额外循环减小 gesv 的误差(mkl 特供,非标准)
?gbsv gesv 的带对角矩阵版本
?gbsvx gbsv 并提供误差
?gbsvxx 用额外循环减小 gbsv 的误差
?gtsv gesv 的三对角矩阵版本
?gtsvx gtsv 并提供误差
结果优化
?gbsv 的结果可以用 ?gbrfs 进一步用迭代法缩小误差(矩阵的条件数越大,就越有效)。
?getrf 可进行 LU 分解,然后 ?getri 求逆矩阵。注意没有 driver 可用。
?syev 对称矩阵的本征值和本征矢(可选)
?syevd syev 使用 divide and conquer 算法
?spev syev 用 packed storage
?spevd spev 用 packed storage
?sbev syev 用带对角矩阵
?sbevd sbev 用 divide and conquer 算法
?stev syev 使用三对角矩阵
?gels Uses QR or LQ factorization to solve a overdetermined or underdetermined linear system with full rank matrix.
?gelsy Computes the minimum-norm solution to a linear least squares problem using a complete orthogonal factorization of A.
?gelss Computes the minimum-norm solution to a linear least squares problem using the singular value decomposition of A.
?gelsd Computes the minimum-norm solution to a linear least squares problem using the singular value decomposition of A and a divide and conquer method.
apt install libblas-dev libblas64-dev liblapacke-dev liblapacke64-dev。
cmake -LH 查看)
cmake -DBUILD_INDEX64=OFF -DBUILD_SHARED_LIBS=ON \
-DLAPACKE=ON -DCBLAS=ON ../lapack-3.*/
BUILD_INDEX64 选择是使用 32bit 的整数还是 64bit 的。
BUILD_SHARED_LIBS 选择是编译 .so 库还是 .a 库。
LAPACKE 和 CBLAS 选择是否编译 C 接口。
BLAS++ 和 LAPACK++ 编译 C++ 接口。
BUILD_HTML_DOCUMENTATION 生成 html 文档,需要 Doxygen。
BUILD_TESTING 生成测试目录
CMAKE_BUILD_TYPE 填 Release 或者 Debug
CMAKE_INSTALL_PREFIX 安装目录,默认 /usr/local
USE_OPTIMIZED_BLAS 和 USE_OPTIMIZED_LAPACK 使用其他 blas(例如 MKL),而不是 netlib 的 reference blas
USE_XBLAS 内部四精度实现以及混合精度接口。见 “BLAS 简介”。
安装的 Blas 文件
/usr/local/include 中的 cblas.h,cblas_mangling.h。
/usr/local/lib64 中的 libcblas.so或a 和 libcblas64.so或a
64 的是 BUILD_INDEX64=true 生成的,否则是 32 位整数。下同。
cblas(64).so 会调用 blas(64).so。
libgfortran.so 和 lbquadmath.so,下同。
安装的 lapack 文件
/usr/local/include 中的 lapack.h,lapacke.h,lapacke_config.h,lapacke_mangling.h,lapacke_utils.h。
/usr/local/lib64 中的 liblapack.a或so 和 liblapacke64.a或so,以及 liblapacke.a或so 和 liblapack64.a或so
lapacke(64).so 会调用 lapack(64).so 以及 blas(64).so
#include <cblas.h> 以及 #include <lapacke.h> 即可。
#define CBLAS_INT int,#define lapack_int int。如果程序中要使用 64 位,需要在这两个 include 之前自定义 #define CBLAS_INT long long,#define lapack_int long long
-l cblas.so 和 -l lapacke.so 即可。
 
 
 
 
 
 
 
 
 
 
 
友情链接: 超理论坛 | ©小时科技 保留一切权利