按照上一篇文章中的说明安装GSL和编译(从DevKit运行的mingw)
wget ftp.gnu.org/gnu/gsl/gsl-1.15.tar.gz
tar xf gsl*
cd gsl*
./configure
# Warning, make takes about 7 min.
make
make install
一切似乎都运行到某个点,然后在make过程中发生编译错误
$ make
/usr/Bin/make all-recursive
make[1]: Entering directory `/c/cygwin/home/Seamus/gsl-1.15'
Making
我可以成功地在我的主目录中安装gsl库,但是当我尝试安装gsl gem时,我得到了一大堆我不理解的错误。我想知道是否有人可以告诉我为什么我会得到这些错误。我可以说我有:
成功安装了gsl;至少它看起来是这样的。我指出了gsl-config的路径
错误日志如下所示:
Building native extensions. This could take a while...
ERROR: Error installing gsl:
ERROR: Failed to build gem native extension.
/home/ted/ruby-1.9.1/bin/
我正试着用写一个牛顿求解器。这是一个由两个方程组成的系统,它采用笛卡儿坐标(x,y)并将它们转换成两个角度(这是我正在构建的机器人手臂项目;这些角度被发送到步进电机,将执行器移动到笛卡儿输入坐标)。
这是我的功能:
int
calc_angles(gsl_vector* coords, gsl_vector* result_angles)
{
const gsl_multiroot_fdfsolver_type* T;
gsl_multiroot_fdfsolver* s;
int status;
size_t i, iter = 0;
const s
我正在尝试为R安装gsl包,据我所知,这只是OSX下GSL的一个包装器。我尝试过显而易见的:
> install.packages('gsl')
Installing package into ‘/Users/myusername/Library/R/3.1/library’
(as ‘lib’ is unspecified)
package ‘gsl’ is available as a source package but not as a binary
Warning in install.packages :
package ‘gsl’ is not
我们一直试图在R上安装"copula“软件包,但是它失败了,出现了以下错误消息:
ERROR: dependency ‘gsl’ is not available for package ‘copula’
安装了GSL (GSL)之后,它一直在抱怨,但这次的错误如下:
** package ‘gsl’ successfully unpacked and MD5 sums checked
checking for gsl-config... no
configure: error: gsl-config not found, is GSL installed? <<-----
基本上我需要上面的东西。我已经拖网了谷歌,却找不到实现这一目标的方法。
我在这里找到了这个函数,,但是它太慢了。我甚至按照MATLAB的程序编写了我自己的Pade近似,但它比链接中的Pade更快一些。
令我吃惊的是数学计算矩阵指数的速度有多快(它是否关心矩阵是否是三角图,我不知道)。
有人能帮忙吗?
编辑:这是我想出的,有什么评论吗?希望对未来的读者有用。
我离开c++已经有一段时间了,所以下面的代码可能有点烦琐/慢,所以如果您看到改进,请告诉我。
//Program will compute the matrix exponential expm( i gA ). where i = sqr
我正在使用Cython,我想要导入gnu科学C库。
#gsl_test.pyx
cdef extern from "gsl/gsl_math.h":
double gsl_pow_int (double x, int n)
def gibbs(double k, int t):
y = gsl_pow_int (k, t)
return y
#setup.py
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils impor
我正在尝试使用GSL得到一个相对较大的矩阵A^T的零空间的基数。到目前为止,我一直在提取对应于消失奇异值的SVD的右奇异向量,但对于我感兴趣的矩阵的大小来说,这变得太慢了。
我知道在A的QR分解中,可以将空空间提取为Q矩阵的最后m-r列,其中r是A的秩,但我不确定揭示秩的分解是如何工作的。
这是我第一次尝试使用
int m = 4;
int n = 3;
gsl_matrix* A = gsl_matrix_calloc(m,n);
gsl_matrix_set(A, 0,0, 3);gsl_matrix_set(A, 0,1, 6);gsl_matrix_set(A, 0,2, 1);
g
我想删除gsl_matrix的一个列( i-th列),然后将其内容复制到另一个gsl_matrix中。这是我的密码:
#include <stdio.h>
#include <iostream>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_vector.h>
int remove_col (int K,
int N,
int i,//between range 1 to N
gsl_matrix *Sn
在我的研究工作中,我用R做模拟。最近,出于速度原因,我转向C+GSL。为了举例说明,我首先通过R编写一些简单的代码,如下所示。
n = 10
nsim = 20
out = array(0,c(nsim,1))
set.seed(123) # for reproducibility
for (i in 1:nsim){
d = rnorm(n, mean=1, sd=0.1) # generate data
m = mean(d)
out[i] = m
}
print(out)
然后我尝试使
我正在尝试安装一个软件包,它依赖于gsl。在包文档中,提到了:
0. This installation is known to work easily if you use Mac OS X and have
installed python and gsl using MacPorts.
1. Modify the setup_cfg.py
Change the 'GSL_INCLUDE' and 'GSL_LIB' variables to your path to the GSL
header and library files. For examp