Computational Library for Linear Algebra

January 31, 2006

* 起源-BLAS
“BLAS(Basic Linear Algebra Subprograms基本线性代数子程序)是一个高质量的程序包,用于基本的矢量和矩阵运算。一级BLAS负责矢量-矢量运算,二级BLAS负责矢量-矩阵运算,而三级BLAS负责矩阵-矩阵运算。由于BLAS高效,可移植和广泛可用,在高质量线性代数软件中常常使用它。”
“The BLAS (Basic Linear Algebra Subprograms) are high quality ‘building block’ routines for performing basic vector and matrix operations. Level 1 BLAS do vector-vector operations, Level 2 BLAS do matrix-vector operations, and Level 3 BLAS do matrix-matrix operations. Because the BLAS are efficient, portable, and widely available, they’re commonly used in the development of high quality linear algebra software” --BLAS FAQ

BLAS常见问题(FAQ)是初学者最好的起点,可以了解BLAS以及它与ATLAS,LAPACK已经其他BLAS实现的关系。

* 优化的BLAS-Atlas
“ATLAS(Automatically Tuned Linear Algebra Software自动优化的线性代数软件)项目是一个进行中的研究项目,集中在使用实际经验技巧提供可移植的性能。目前它提供了C和Fortran77的编程界面用于连接一个可移植的高效BLAS实现,以及从LAPACK移植的几个子程序。”
“The ATLAS (Automatically Tuned Linear Algebra Software) project is an ongoing research effort focusing on applying empirical techniques in order to provide portable performance. At present, it provides C and Fortran77 interfaces to a portably efficient BLAS implementation, as well as a few routines from LAPACK.”

常见问题(FAQ)是学习的起点。ATLAS被使用在MAPLE,Matlab,Mathematica,Octave,GSL,R,Scilab。在Debian,Suse, FreeBSD和Mac OS X中都有。

* 超集-LAPACK(Linear Algebra PACKage线性代数包)
“LAPACK是用Fotran77写成,提供了子程序用来解线性方程组,最小二乘法,本征值问题和奇值问题。同时还提供了矩阵分解的子程序-LU,Cholesky, QR, SVD, Schur, 通用Schur,以及相关的运算例如Schur分解的重排,和条件数值的确定。它可以处理密集和条状矩阵,但不包括一般稀疏矩阵。所有这些子程序都提供了实数和复数的单精度和双精度版本。
“LAPACK is written in Fortran77 and provides routines for solving systems of simultaneous linear equations, least-squares solutions of linear systems of equations, eigenvalue problems, and singular value problems. The associated matrix factorizations (LU, Cholesky, QR, SVD, Schur, generalized Schur) are also provided, as are related computations such as reordering of the Schur factorizations and estimating condition numbers. Dense and banded matrices are handled, but not general sparse matrices. In all areas, similar functionality is provided for real and complex matrices, in both single and double precision.

LAPACK子程序尽量使用BLAS中的功能。LAPACK起初是为了更好的使用三级BLAS-一组进行不同矩阵乘法和解三角矩阵的Fortran子程序。因为三级BLAS运算的粗糙颗粒性(?),使用BLAS会在高性能计算机上有很高的效率,特别是如果制造商提供了特别的BLAS实现。” --LAPACK常见问题
LAPACK routines are written so that as much as possible of the computation is performed by calls to the Basic Linear Algebra Subprograms (BLAS). … LAPACK was designed at the outset to exploit the Level 3 BLAS — a set of specifications for Fortran subprograms that do various types of matrix multiplication and the solution of triangular systems with multiple right-hand sides. Because of the coarse granularity of the Level 3 BLAS operations, their use promotes high efficiency on many high-performance computers, particularly if specially coded implementations are provided by the manufacturer.” --LAPACK FAQ

LAPACK是BLAS的一个超集,它有自己的BLAS实现,以及额外的子程序。它是Linux/x86平台上最流行的两种BLAS实现之一,另一个是Intel Math Kernel Library数学核心裤
LAPACK is superset of BLAS, it has its own implementation of BLAS, and several extra routines too. It is one of two most popular implementations of BLAS on Linux/x86 platform besides Intel Math Kernel Library.

* 参考:
- 快速安装指南
- LAPACK安装指南
- LAPACK用户指南

* 附录:
开源的科学和工程库:
- uBLAS in Boost
- GNU科学库(GNU Scientific Library)(GSL)
- GSLwrap(C++ wrapper of GSL)


几个Firefox的插件

January 31, 2006

Video Size

January 31, 2006

Framebuffer:
colour depth || 640×480 || 800×600 || 1024×768 || 1280×1024
256 (8bit) || 0×301=769 || 0×303=771 || 0×305=773 || 0×307=775
32K (15bit) || 0×310=784 || 0×313=787 || 0×316=790 || 0×319=793
64K (16bit) || 0×311=785 || 0×314=788 || 0×317=791 || 0×31A=794
16M (24bit) || 0×312=786 || 0×315=789 || 0×318=792 || 0×31B=795

Display and Video:
QSIF || 160×120 || Quarter SIF
QCIF || 176×144 || Quarter CIF
CGA || 320×200 || Color Graphics Adapter
QVGA || 320×240 || Quarter VGA
SIF || 320×240 || Source Input Format
CIF || 352×288 || Videoconferencing Common Intermediate Format
EGA || 640×350 || Enhanced Graphics Adapter
VGA || 640×480 || Video Graphics Array
SVGA || 800×600 || Super VGA
XGA || 1024×748 || eXtended VGA (XVGA)
XGA+ || 1152×864 || XGA Plus
WXGA || 1280×768 || Wide XGA
SXGA || 1280×1024 || Super XGA
SXGA+ || 1400×1050 || Super XGA+
WXGA+ || 1440×900 || Wide XGA+
WSXGA || 1600×1024 || Wide XSGA
UXGA || 1600×1200 || Ultra-eXtended VGA
WSXGA+ || 1680×1050 || Wide SXGA+
WUXGA || 1920×1200 || Wide UXGA
QSXGA || 2560×2048 || Quad SXGA
QUXGA || 3200×2400 || Quad UXGA
WQUXGA || 3840×2400 || Wide QUXGA
HSXGA || 5120×4096 || Hex Super XGA
WHSXGA || 6400×4096 || Wide HSXGA
HUXGA || 6400×4800 || Hex Ultra XGA
WHUXGA || 7680×4800 || Wide HUXGA

TV:
NTSC: National Television System Committee
PAL: Phase Alternating Line
SECAM: Sequential Couleur Avec Memoire

Links:


gnuplot

January 31, 2006

为什么叫gnuplot,而不是GNUplot?
gnuplot与FSF或者GNU没有什么关系。当作者起名字的时候,“newplot”已经被用了,所有他就选了“gnuplot”。

Gnuplot和Emacs
Bruce Ravel写了一个给Emacs的模式, 可以在http://feff.phys.washington.edu/~ravel/software/gnuplot-mode/下载。在Fedora里面,安装gnuplot-emacs即可。

参考:


两篇值得Ph.D们一读的文章

January 30, 2006

都很老了,而且有些细节过时了,不过暇不掩瑜:

How to do Research At the MIT AI Lab

How to Be a Good Graduate Student

里面的一下摘录:
Publish-or-perish: 不是发表(论文)就是死亡!
Writing is a craft, a debugging process.
SPPN–Secret Paper Passing Network
Read with questions in mind

读Paper的三个阶段:
1. 感兴趣的东西
2. 好东西–the meat, the good stuff
3. 全部


KDE Address Map

January 28, 2006

在KDE的地址簿里,如果联系人有地址信息,KDE会用网上的地图服务,这样当点击这个地址,konqueror就会打开网上地图,指向联系人的地址位置,很贴心的一个功能,但是可能因为KDE的好多开发者在欧洲,默认的网上地图是一个欧洲公司提供的,只有欧洲的地图。不过在地址簿里可以设定使用其他的网站,因为konqueror不支持google map,我选择了yahoo map,大致如下,在地址簿->设定->常规的最下方有一个选项“位置地图”,研究一下就明白了:

%c: country, %s: address, %z: zip code, %r: state, %l: town

然后随便在Yahoo试一个地址,就可以知道URL的格式是:

http://maps.yahoo.com/maps_result?addr=%s&csz=%l,%r,%z&country=us

如果想用Yahoo新的基于Flash的地图功能,则是:

http://maps.yahoo.com/beta/index.php#maxp=search&q1=%s %l %r %z

写好然后试试,Bingo!

PS:其实地址簿里面预设了可以使用Mapquest查找美国地址,不过好像已经不工作了,如果想使用mapquest,自己研究一下它的URL格式吧,:)

PS^2:发现如果地址里有Apt No的话会出错,暂时只能不写Apt No了。
PS^3:如果想用Google,填入http://maps.google.com/maps?q=%s+%l+%r+%z&hl=en.


Graphviz

January 27, 2006

第一次遇到Graphviz是在使用doxygen的时候,doxygen用到了dot命令,当时纳闷,这是哪里来的命令啊,后来了解到它来自Graphviz,在doxygen里面用来生成类的继承图,当时觉得这个工具很不错,也没有深究。前一阵在网上看到一篇文章(Create relationship diagram with Graphviz),才发现原来Graphviz的语言很简单,有兴趣的人不妨一试。

现在又提起Graphviz是因为我发现了Debian下的一个命令apt-rdepends可以生成软件包的依赖关系图(dot格式),这样就可以一目了然的用图像来显示这些关系。

apt-rdepends -d bash > bash.dot;dot -Tpng -obash.png bash.dot

或者更简单:

apt-rdepends -d bash | dot -Tpng -obash.png

看看结果:

bash.dot

很不错吧, :)


ffmpeg demo

January 25, 2006

一直就想试试ffmpeg了,看了网上这篇文章,在我的kubuntu上试了试,结果如下:

  • 由于ffmpeg的API还在开发中,所以一直有变化,上面的demo是写给0.4.9的,已经过时了,在kubuntu下版本是cvs20050918,所以代码有一点小变化:
  • 83行codec.codec_type改成codec->codec_type。
  • 92行去掉&。
  • 删除103-107行的hack,frame_rate和frame_rate_base被time_base取代了。
  • 根据/usr/share/doc/ffmpeg/README.Debian,编译应使用如下命令:

gcc `ffmpeg-config –cflags` -c code.cpp -o code.o

gcc code.o -c code `ffmpeg-config –libs avformat avcodec` -lstdc++

大功告成!


Effective scientific electronic publishing

January 25, 2006

一篇关于如何更好的在网上发表科技文章的东东,写的清楚明了。推荐!

http://www.cl.cam.ac.uk/~mgk25/publ-tips/


Kommander

January 24, 2006

今天看了一个Kommander的介绍,使用感觉很像Visual Basic,可以说是一种GUI Scripting。它很好的结合了QT的signal/slot特性和UNIX下可用的众多脚本语言,使得RAD(快速应用程序开发Rapid Application Development)在Linux下比Windows更容易。有兴趣的不妨一试。