lolo 回复 第2楼 的 Ihavenothing: 现在我想使用LAPACK库,已经下载好了LAPACK 3.3,该怎么使用它? 看网上使用LAPACK需要库文件blas.lib、lapack.lib,这些需要用CMAKE进行编译,这个我也下载好了,接着该怎么办,如何编译?
rtist If you believe the R default is not optimal for you, during the compilation and installation of R, you have the choice of which (better optimized) blas/lapack library to link to.
rtist It seems to me that the reason to use those fortran code is either doing single precision computations (where R does not support) or using optimized routines for each processor types (which R has already solved by allowing us to link to a different lib).
lolo 回复 第7楼 的 Ihavenothing:我意思是想将循环放在FORTRAN中去做,但循环中可能包含矩阵运算(这部分代码是用FORTRAN写的).一般如果想在FOTRAN中想用矩阵,需要用一些数学库.但我的FORTRAN中并没包含这些库.听了你的解释是说R已经对LAPACK进行了封装,是不是意味着即使我现在FOTRAN没有安装这些库(比如LAPACK,IMSL),R在调用FORTRAN遇到矩阵运算时也能利用已封装的LAPCK对其进行运算?
Ihavenothing 回复 第9楼 的 lolo: 是这样的,LAPACK的相关函数已经封装在Rlapack.dll里面了,你可以就当它是一个数学运算库了。我原来直接用C调用过R.dll里面的函数,你可以参考一下这里。函数原型的定义都在include文件夹的头文件中,链接就用-lR -lRlapack之类的。
lolo 回复 第10楼 的 Ihavenothing: LAPACK的问题我再研究.现在又遇到一个问题. 我在将FORTRAN生成对应的DLL文件后,使用dyn.load装载后,再用is.loaded检验总是"FALSE". dyn.load("temp.dll")## 一切正常,没任何提示<br /> is.loaded("temp")## 结果为FALSE </p>