Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 11 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
intro_cblas 的 irix 手册页非常好:
http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?cmd=getdoc&coll=0650&db=man&fname=3%20INTRO_CBLAS
The irix man page for intro_cblas is pretty good:
http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?cmd=getdoc&coll=0650&db=man&fname=3%20INTRO_CBLAS
本文通过一个简单的示例展示了如何在 C 中使用 cblas(和其他): http://www.seehuhn .de/pages/linear
我引用了下面的相关部分,以防网站出现故障。
使用 BLAS
为了测试 BLAS 例程,我们想要执行简单的矩阵向量乘法。读取blas2-paper.ps.gz文件,我们发现对应的Fortran函数的名称是DGEMV。文本 blas2-paper.ps.gz 还解释了该函数的参数的含义。在cblas.ps.gz中我们发现对应的C函数名称是cblas_dgemv。以下示例使用此函数计算矩阵向量积
示例文件 testblas.c:
为了编译这个程序,我们使用以下命令。
该测试程序的输出是
这表明一切工作正常,我们甚至没有错误地使用转置矩阵。
This article shows how to use cblas (and others) in C with a simple example: http://www.seehuhn.de/pages/linear
I have quoted the relevant part below in case the site goes down.
Using BLAS
To test the BLAS routines we want to perform a simple matrix-vector multiplication. Reading the file blas2-paper.ps.gz we find that the name of the corresponding Fortran function is DGEMV. The text blas2-paper.ps.gz also explains the meaning of the arguments to this function. In cblas.ps.gz we find that the corresponding C function name is cblas_dgemv. The following example uses this function to calculate the matrix-vector product
Example file testblas.c:
To compile this program we use the following command.
The output of this test program is
which shows that everything worked fine and that we did not even use the transposed matrix by mistake.