# Cmathtuts **Repository Path**: uesoft/Cmathtuts ## Basic Information - **Project Name**: Cmathtuts - **Description**: No description available - **Primary Language**: C - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2018-04-30 - **Last Updated**: 2021-03-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 翻译:有道在线翻译 校核:李国斌 长沙优易软件开发有限公司 翻译日期:2018.04.30 C语言的数学库收集 当我开始在C中做线性代数时,我惊讶地发现,BLAS、LAPACK和其他基本api的教程太少了。尽管它们是许多其他库的构建块。因为这个原因,我开始收集所有我能在网上找到的例子,包括BLAS, LAPACK, CLAPACK, LAPACKE, ATLAS,OpenBLAS…在Github库。好吧,我得提醒你,作为一名机械工程师,我在管理这类问题上几乎没有什么经验,而且它可能首先对你们来说是一团糟。然而,如果你设法克服了混乱,你会发现各种各样的例子和说明可能会有所帮助。我已经试过了我提到过的库的大多数,一些没有编译。我已经修改了它们中的许多,以便与GNU编译器(gcc、g++和gfortran)一起编译。我已经制作了一些文件,您可以通过阅读来了解如何在C或c++程序中调用单独的fortran例程。我还为mac和linux放了一些安装指令(对不起,windows的家伙们!)。我想确保如果您是一个C开发人员,无论您的平台或硬件,您能使用任何这些库,没有任何问题。 问题: 1。无法在mac OS x上编译ATLAS。错误报告是在sourceforce上做的:https://sourceforge.net/p/math-atlas/bugs/261/。 2。对于一些BLAS和CBLAS示例,编译需要 -lgfortran。我不知道为什么!(在mac OS X上,您需要安装gfortran,然后寻找libgfortran.dylib并在编译时将其链接起来) 要做的: 1。为不同平台的所有库进行编译/安装。 2。检查其他平台上的Makefile(只在mac OS X上测试) # A collection of math tutorials in C While ago, when I started doing some linear algebra in C, it came to me as a surprise to see there are so few tutorials for BLAS, LAPACK and other fundamental APIs. Despite the fact that they are somehow the building blocks of many other libraries. For that reason I started collecting all the examples I could find all over the net for BLAS, LAPACK, CLAPACK, LAPACKE, ATLAS, OpenBLAS ... in this Github repo. Well, I should warn you that as a mechanical engineer I have little experience in managing such a repo and it might firstly seems as a complete mess to you guys. However if you manage to get over the mess you will find all kind of examples and instructions which might be help. I have tried the most and the ones does not compile I have mentioned. I have modified many of them to be compilable with GNU compilers (gcc, g++ and gfortran). I have made make files which you can read to learn how you can call individual fortran routines in a C or C++ program. I have also put some installations instructions for mac and linux (sorry windows guys!). I want to make sure if you are a C developer you can use any of these libraries without any problems regardless of your platform or hardware issues: 1. not able to compile ATLAS on mac OS X. a bug report was made on sourceforce: https://sourceforge.net/p/math-atlas/bugs/261/ 2. for some of the BLAS and CBLAS examples the -lgfortran is requred to compile. I don't know why! (on mac OS X you need to install gfortran and then look for libgfortran.dylib and link against it while compiling) to do: 1. make compiling/installation for all libraries for different platforms 2. check the Makefile s on other platforms(tested only on mac OS X) sources to be studied: 1. http://physics.oregonstate.edu/~landaur/nacphy/lapack/cprogp.html 2. https://people.sc.fsu.edu/~jburkardt/c_src/clapack/clapack.html 3. http://stackoverflow.com/questions/22085277/how-to-call-clapack-from-c 4. ftp://ftp.icm.edu.pl/packages/netlib/lapack/lapacke.txt 5. https://pleiades.ucsc.edu/hyades/LAPACK 6. http://www.ccp4.ac.uk/dist/checkout/lapack-3.5.0/lapacke/example/example_DGELS_colmajor.c 7. http://www.linuxquestions.org/linux/answers/programming/installation_and_use_common_scientific_libraries_unix_part_2_lapack_and_its_wrappers_lapacke_and_atlas 8. http://theoryno3.blogspot.nl/2010/12/compiling-lapack-as-shared-library-in.html 9. http://www.dreamincode.net/forums/topic/287490-anyone-familiar-with-lapack-and-blas/ 10. https://software.intel.com/sites/products/documentation/doclib/mkl_sa/11/mkl_lapack_examples/index.htm#zgesv.htm 11. https://pleiades.ucsc.edu/hyades/BLAS 12. https://software.intel.com/en-us/node/522288 13. http://stackoverflow.com/questions/17858104/what-is-the-relation-between-blas-lapack-and-atlas/17858345#17858345 14. http://stackoverflow.com/questions/1303182/how-does-blas-get-such-extreme-performance/11421344#11421344 15. http://stackoverflow.com/questions/1380371/what-are-the-most-widely-used-c-vector-matrix-math-linear-algebra-libraries-a/1452950#1452950 16. http://stackoverflow.com/questions/8206563/purpose-of-lda-argument-in-blas-dgemm/8209290#8209290 17. http://stackoverflow.com/questions/966249/scientific-math-with-functional-languages/966324#966324 18. http://stackoverflow.com/questions/24071622/replicating-blas-matrix-multiplication-performance-can-i-match-it 19. Cephes --> http://www.netlib.org/cephes/ 20. CRlibm --> http://lipforge.ens-lyon.fr/www/crlibm/index.html 李国斌从上面列表摘录了一些感兴趣的链接 2. https://people.sc.fsu.edu/~jburkardt/c_src/clapack/clapack.html 李国斌加了一些上面没列出的感兴趣的链接 https://github.com/Reference-LAPACK/lapack 稀疏特征值求解器ARPACK,fortran语言,带有BLAS和CBLAS,带cmake后者还附带着基本线性代数库BLAS和线性代数软件包LAPACK。 http://www.netlib.org/clapack/ https://gitee.com/uesoft/Computing/blob/master/doc/CLAPACK-README.txt 介绍了1993-1994加州大学伯克利分校等使用f2c转换LAPACK为CLAPACK的步骤 http://www.netlib.org/lapack/#_magma https://math.nist.gov/lapack++/ Lapack++ (v. 1.1a) 2000.02.29完成的一个C++接口,可以使用CLAPACK或LAPACK库。它已被TNT项目取代。 https://github.com/xianyi/OpenBLAS 使用c或汇编优化的BLAS http://math-atlas.sourceforge.net/faq.html#doc 用于blas,lapack的c接口atlas https://github.com/starseeker/SPOOLES 使用cmake,稀疏面向对象线性方程组求解器SPOOLES 2.2,一种用于求解稀疏实数和复数线性方程组的库,用面向对象设计的C语言编写。 https://github.com/damian0815/spooles http://www.netlib.org/linalg/spooles/ 使用autoconf http://www.netlib.org/linalg/ 各种线性代数求解器 http://www.netlib.org/master_counts2.html#linalg 代码库列表 https://github.com/100/Cranium A portable, header-only, artificial neural network library written in C99 https://gitee.com/uesoft/Cmathtuts/blob/master/README-zh.md 本文档 http://www.caam.rice.edu/software/ARPACK/ 稀疏特征值求解器,fortran http://www.caam.rice.edu/software/ARPACK/ARPACK++/arpack++.tar.gz 稀疏特征值求解器,arpack C++ https://github.com/opencollab/arpack-ng 稀疏特征值求解器,fortran https://github.com/m-reuter/arpackpp Arpack++ with patches (C++ interface to ARPACK) https://github.com/eigenteam/eigen-git-mirror Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. https://github.com/yixuan/spectra Spectra是C++写的基于eigen的稀疏特征值求解器,仅使用头文件,它模仿 ARPACK算法设计,但接口不同于arpack和arpack++。