26 April, 2010

Matplot-python [FROM http://www.kunli.info/2009/02/08/matplot-python-manual/]

【FROM http://www.kunli.info/2009/02/08/matplot-python-manual/】

本文是给自己的Matplot-python用法速查列表,并非任何正式文章,如果看不明白不用奇怪,不感兴趣的朋友直接跳过。
最近上Data Mining课作业老要求画图,反正都是用python做,实在厌倦了Gnuplot,所以决定完全投身Matplot怀抱。但因为使用频率不高,每次要 用的时候就感觉忘了,查manual太累,放狗搜又没有什么好的中文教程,所以把一些常用方法记录在这里,主要是几种常画图的典型例子。以后多接触一种, 就添加一种,随时更新。
顺便提一句,如果是pythoner,坚决推荐用matplot画图,方便程度仅次于matlab,但与python无缝接合。
典型的Matplot例子

import numpy as np
import matplotlib.pyplot as plt

def f(t):
return np.exp(-t) * np.cos(2*np.pi*t)
t1 = np.arange(0.0, 5.0, 0.1)
t2 = np.arange(0.0, 5.0, 0.02)
plt.figure(1)
plt.subplot(211)
plt.plot(t1, f(t1), ‘bo’, t2, f(t2), ‘k’)
plt.subplot(212)
plt.plot(t2, np.cos(2*np.pi*t2), ‘r–’)
题目,坐标轴设置
最简单的就是通过title,xlabel和ylabel设置,比如
xlabel(”xxxx”, fontsize=18, color=”red”)
这里title是某个axis的title,如果希望整个figure有title,那么需要用suptitle() 函数,用法和title是一样的。
x和y轴的范围设定是通过
plt.axis([0, 6, 0, 20])
这就是表示x轴是0到6,y轴是0到20。也可以用xlim和ylim单独控制,比如
ylim( ymin, ymax )
当然还可以用yscale和xscale指定坐标轴的scale类型,分别是‘linear’ | ‘log’ | ‘symlog’,比如
xscale("log")
还可以通过yaxis.grid和xaxis.grid控制怎么显示网格,是否显示网格。grid的函数是这样的
grid(self, b=None, which=’major’, **kwargs)
Set the axis grid on or off; b is a boolean use which =
‘major’ | ‘minor’ to set the grid for major or minor ticks
如果用yaxis.grid (false),就表示不用显示y轴方向的网格。
有时候我们需要在坐标轴上放文字,比如在x轴上放置月份名称之类,这就需要xticks函数。其用法是比如
xticks( arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue') )
这里,第一个参数表示放置位置,第二个是放置内容。
设置曲线特征
lines = plt.plot(x1, y1, x2, y2)
# use keyword args
plt.setp(lines, color='r', linewidth=2.0)
# or matlab style string value pairs
plt.setp(lines, 'color', 'r', 'linewidth', 2.0)
如果希望知道有哪些属性可以指定,可以传递对象给setp()函数,比如
In [69]: lines = plt.plot([1,2,3])
In [70]: plt.setp(lines)
alpha: float
animated: [True | False]
antialiased or aa: [True | False]
…snip
具体能控制的属性参见这 里
文字处理
text()命令可以被用来放置文字在绝对坐标轴上,用法是
text(60, .025, r'$\mu=100,\ \sigma=15$', horizontalalignment='left', verticalalignment='top')
放置的东西前面加个r表示包括数学公式。具体能控制的属性可以参见属 性列表。具体的数学公式和符号的表达方式参见这 里
这只是放置文字,还有一种需求是要求放置文字标注比如这种图:
这时候就要用到anotate()函数了,用法大概是这样的,
plt.annotate('local max', xy=(2, 1), xytext=(3, 1.5), arrowprops=dict(facecolor='black', shrink=0.05), )
第一个参数是要放置的文字,第二个参数是要指向的坐标,第三个是放置文字的坐标,最后一个是箭头属性。相关属性设置参见这 里
对于经常写公式的人来讲,可能latex的格式会感觉更加常用一点。这时候,可以在放置text之前先用
rc('text', usetex=True)
然后与文字有关的地方都用r”"来引用,比如
title(r"\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!",
fontsize=16, color='r')
画函数
plt.plot最简单的形式就是take一组列表数据
plt.plot([1,2,3])
此时plot自动将其认为是y轴的数据,x轴数据自动分配,相当于是
plt.plot([0,1,2],[1,2,3])
也就是说,对于plot,标准形式是
plt.plot([1,2,3,4], [1,4,9,16])
当然,后面可以跟控制表示形式的参数,比如
plt.plot([1,2,3,4], [1,4,9,16], 'ro')
就表示用红色点表示,而不是直线。参数默认是’b-’,表示蓝色直线。
plot还支持同时在一张图里面绘制多个图形,比如

import matplotlib.pyplot as plt
plt.plot(x1, y1, 'r--', x2, y2, 'bs', x3, y3, 'g^')
就可以用不同的形式绘制三条曲线。
画子图
用plt.subplot(xxx),第一个数字表示numrows,第二个表示numcols,第三个表示fignum。fignum的数量最高 也就是numrows乘以numcols。
如果是想产生多个图,每个图包含几个子图,那用figure()来控制图的数量。
画直方图
用函数
hist(x, bins=10, range=None, normed=False, cumulative=False,
bottom=None, histtype='bar', align='mid',
orientation='vertical', rwidth=None, log=False, **kwargs)
具体用法参加这 里
画分布图
函数
scatter(x, y, s=20, c='b', marker='o', cmap=None, norm=None,
vmin=None, vmax=None, alpha=1.0, linewidths=None,
verts=None, **kwargs)
具体参数看这 里,唯一一个不是很确定的是s的取值,我曾经估计是s值要和x和y的列表长度一样,也就是大概是点的个数?但具体画的时候发现不是这样,点的个数 取决于x和y的列表长度。有待研究。
画Box Plot图
用matplot画Box Plot不知道有多方便,直接用函数
boxplot(x, notch=0, sym='+', vert=1, whis=1.5,
positions=None, widths=None)
你直接把一组数用x送进去,出来就是Box图。如果你想一个图表示多个Box,也很简单,让xappend多个list,出来的就是这些list的 box图。一个例子如下
for attribute in iris[type].keys():
list = iris[type][attribute]
data.append(list)
subplot(2,2,count)
title("Boxplot of %s" % type, fontsize=18, color="red")
xticks(arange(5),("","Sepal len","Sepal wid","Petal len","Petal wid"))
ylabel("Value")
boxplot(data,0,'gd')

详细的属性控制参见这 里
画幂函数图
例子
from matplotlib.matlab import *
x = linspace(-4, 4, 200)
f1 = power(10, x)
f2 = power(e, x)
f3 = power(2, x)

plot(x, f1, 'r', x, f2, 'b', x, f3, 'g', linewidth=2)
axis([-4, 4, -0.5, 8])
text(1, 7.5, r'$10^x$', fontsize=16)
text(2.2, 7.5, r'$e^x$', fontsize=16)
text(3.2, 7.5, r'$2^x$', fonsize=16)
title('A simple example', fontsize=16)

savefig('power.png', dpi=75)
show()

显示图形中的数学公式
Matplotlib 可以支持一部分 TeX 的排版指令,因此用户在绘制含有数学公式的图形时会感到很方便并且可以得到比较满意的显示效果,所需要的仅仅是一些 TeX 的排版知识。下面的这个例子显示了如何在图形的不同位置上, 如坐标轴标签,图形的标题以及图形中适当的位置处,显示数学公式。相应的 Python 程序如下:
from matplotlib.matlab import *
def f(x, c):
m1 = sin(2*pi*x)
m2 = exp(-c*x)
return multiply(m1, m2)
x = linspace(0, 4, 100)
sigma = 0.5
plot(x, f(x, sigma), 'r', linewidth=2)
xlabel(r'$\rm{time} \ t$', fontsize=16)
ylabel(r'$\rm{Amplitude} \ f(x)$', fontsize=16)
title(r'$f(x) \ \rm{is \ damping \ with} \ x$', fontsize=16)
text(2.0, 0.5, r'$f(x) = \rm{sin}(2 \pi x^2) e^{\sigma x}$', fontsize=20)
savefig('latex.png', dpi=75)
show()

build gnuplot on Mac OS X

gnuplot on Mac OS X

./configure –with-readline=bsd –x-include=/usr/include/X11 –x-libraries=/usr/X11/lib

make && make install

Fink on Mac OS X

【FROM http://www.kunli.info/2009/12/11/mac-install-pink/】

苹果上自带的Unix其实是很少的,像gcc,make,gnuplot,unrar啊这种杀人越货必备武器都默认没有的。gcc这帮工具好说,安装xcode就行了,其他东西以前用Mac的时候都是用MacPort来搞,但是这次的新Mac在安装Unix工具的时候,上网搜了一下,发现Fink这个更好的工具。

Fink工程的目的和MacPort一样,通过修改 Unix 软件来port到Mac OS X 上,然后提供某种下载安装机制供大家使用。在Fink里面你可以像Ubuntu中那样用apt这套工具直接安装二进制包,也可以直接使用Fink来通过源代码编译安装。一般直接用Fink比较好,因为里面的东西比较新。


Fink 的所有文件几乎都安装在 /sw (或你选择安装的地方)。因此,如果你想删除 Fink,输入下面的命令:

sudo rm -rf /sw

升级fink自身

fink selfupdate
fink selfupdate-rsync
fink index -f
fink selfupdate

安装

fink install xxx

卸载

fink remove xxx

如果想把依赖包也一起卸载,加-r。如果想配置文件一并卸载,用

fink purge

类似与ubuntu里面的remove –purge

更新所有已安装包

fink update-all

查看可安装包

fink list xxx 或者 fink apropos xxx

也支持正泽表达式

fink list “xxx*”

查看相关包的描述

fink info

如果不小心删除了某个包的文件,想重新安装整个包

fink reinstall

显示某个包的依赖关系

fink show-deps xxx

23 April, 2010

开源科学计算 open source sci

linpack

* 软件名称 Linear Algebra Package
* 程序设计语言 Fortran 77
* 发布日期 1980
* 资源网址 http://www.netlib.org/linpack
* 下载专栏 Linpack压缩包
* 功能概述 解线性方程和线性最小二乘问题的子程序包(各项性能已经被lapack超过)

lapack

* 软件名称 Linear Algebra Package
* 程序设计语言 Fortran 77
* 发布日期 Version 3.0, 1999,9,30 (1999, 10, 31发布升级包)
* 资源网址 http://www.netlib.org/lapack
* 下载专栏 Lapack压缩包 ,Lapack升级包,Lapack Quick Reference
* 功能概述 线性代数计算子程序包

lapack++

* 软件名称 Linear Algebra Package in c++
* 程序设计语言 c++
* 资源网址 http://math.nist.gov/lapack++/
* 功能概述 c++版的线性代数计算子程序包

BLAS

* 软件名称 Basic Linear Algebra Subroutines
* 程序设计语言 Fortran 77
* 版本信息 V1.0, 1999,3,1
* 主要开发者 Kagstrom B. ,Ling P. ,Van Loan C.
* 资源网址 http://www.netlib.org/blas
* 下载专栏 Blas完整包 :Blas1压缩包 ,Blas2压缩包 ,Blas3压缩包 ,Blas Quick Reference
* 功能概述 Blas是执行向量和矩阵运算的子程序集合。

gsl

* 软件名称 GNU Scientific Library
* 当前版本号 gsl-1.5 was released in June 2004.
* 程序设计语言 C , C++ compable
* 资源网址 http://www.gnu.org/software/gsl/
* 下载专栏 ftp://ftp.gnu.org/gnu/gsl/
* 手册 http://www.gnu.org/software/gsl/manual/gsl-ref_toc.html
* 功能概述 范围广泛, 包括数值分析的常见内容

CXML

* 软件名称 C the Extended Math Library
* 当前版本号 CXML Version 5.2.0 for Alpha LINUX -- Released 10/01/2002.
* 程序设计语言 C
* 资源网址 http://www.hp.com/techservers/software/cxml.html
* 下载专栏 http://h18000.www1.hp.com/math/download/index.html
* 功能概述 包括四个库: Blas, lapack, Sparse, Signal processing

CXML is a collection of mathematical routines optimized for Alpha systems. These subroutines perform numerically intensive operations that occur frequently in engineering and scientific computing, such as linear algebra and signal processing. CXML can help reduce the cost of computation, enhance portability, and improve productivity.
IMSL

* 软件名称 IMSL C Numerical Library
* 当前版本号 5.5
* 程序设计语言 C, Forton
* 资源网址 http://www.vni.com/ http://www.vni.com/products/imsl/c/imslc.html
* 功能概述 分为统计库和数学库两部分. 数学库包含应用数学和特殊函数.IMSL 程序库 - 已成为数值分析解决方案的工业标准。 IMSL 程序库提供最完整与最值得信赖的函数库。 IMSL 数值程序库提供目前世界上最广泛被使用的 IMSL 算法,有超过 370 验证过、最正确与 thread-safe 的数学与统计程序。 IMSL FORTRAN 程序库提供新一代以 FORTRAN 90 为程序库基础的程序,能展现出最佳化的演算法能力应用于多处理器与其它高效能运算系统。

其中应用数学部分解决以下问题:

* 线性代数方程,最小平方差问题等.
* 特征值与系统等问题
* 内差法与逼近法之各种应用计算
* 数值积分与微分
* 常微分方程组初值与边值问题,二三维之典型Poisson方程.
* 正反Fourier与Laplace变换
* 实复系数函数或非线性方程组零根求解等问题
* 不设限或简单设限数理规划最优化等各种问题
* 基本线性代数各种运算所需程序(BLAS)
* 打印,排序,计时随即数,简易绘图等各种工具

统计部分包括

* 基本统计
* 回归
* 相关
* 变异数分析
* 类别及离散资料分析
* 无母数统计
* 适合度及随机性检定
* 时间序列分析及预测
* 共变异结构与因子分析
* 区别分析
* 抽样
* 生存分析
* 多维标度
* 密度及危险估计
* 标率分布及其反函数

特殊函数部分包括

* 指数对数等基本函数
* 正反三角函数及双曲等函数
* 积分函数如: Exponential, integral等
* Gamma函数
* 误差函数
* Bessel 函数
* Kelvin函数
* Airy函数
* 积分函数
* 椭圆函数
* 几率分布函数和其反函数
* Mathieu函数
* 其它如正文多项式运算等.

deal.II

* 软件名称 A Finite Element Differential Equations Analysis Library
* 当前版本号 Release 5.0.0
* 程序设计语言 C++
* 资源网址 http://gaia.iwr.uni-heidelberg.de/~deal/
* 功能概述 a C++ program library targeted at adaptive finite elements and error estimation. It uses state-of-the-art programming techniques of the C++ programming language to offer you a modern interface to the complex data structures and algorithms required for adaptivity and enables you to use a variety of finite elements in one, two, and three space dimensions, as well as time-dependent problems.

SCALAPACK

* 软件名称 Scalible Linear Algebra Package
* 版本信息 1.5 (1.5+ 升级版),1997,11,15
* 程序设计语言 Fortran 77
* 资源网址 http://www.netlib.org/scalapack
* 下载专栏 ScaLapack压缩包 ,ScaLapack升级包,ScaLapack Quick Reference
* 功能概述 多机线性代数计算子程序包

MPI

* 软件名称 Message-Passing Interface
* 版本信息 version 2.0, 1997
* 程序设计语言 Fortran 77
* 资源网址 http://www-unix.mcs.anl.gov/mpi/index.html
* 下载专栏 MPI自由应用的版本:mpich-1.1.2 ,mpich-1.2
* 功能概述 消息传递通讯库

PVM

* 软件名称 Parallel Virtual Machine
* 当前版本号 3.4.3, 2000, 2, 18
* 程序设计语言 Fortran 77
* 资源网址 http://www.epm.ornl.gov/pvm/pvm_home.html
* 下载专栏 PVM 3.4.0,PVM 3.4.3
* 功能概述 从网络模拟大型并行机的通讯库

PETSc

* 软件名称 Portable, Extensible Toolkit for Scientific Computation
* 当前版本号 2.2.1
* 程序设计语言 C, C++, and Fortran.
* 资源网址 http://www-unix.mcs.anl.gov/petsc/petsc-2/
* 功能概述 PETSc is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the MPI standard for all message-passing communication.

22 April, 2010

Color code chart

Color code chart

COLOR NAMECODECOLOR
Black#000000Black
Gray0#150517Gray0
Gray18#250517Gray18
Gray21#2B1B17Gray21
Gray23#302217Gray23
Gray24#302226Gray24
Gray25#342826Gray25
Gray26#34282CGray26
Gray27#382D2CGray27
Gray28#3b3131Gray28
Gray29#3E3535Gray29
Gray30#413839Gray30
Gray31#41383CGray31
Gray32#463E3FGray32
Gray34#4A4344Gray34
Gray35#4C4646Gray35
Gray36#4E4848Gray36
Gray37#504A4BGray37
Gray38#544E4FGray38
Gray39#565051Gray39
Gray40#595454Gray40
Gray41#5C5858Gray41
Gray42#5F5A59Gray42
Gray43#625D5DGray43
Gray44#646060Gray44
Gray45#666362Gray45
Gray46#696565Gray46
Gray47#6D6968Gray47
Gray48#6E6A6BGray48
Gray49#726E6DGray49
Gray50#747170Gray50
Gray#736F6EGray
Slate Gray4#616D7ESlate Gray4
Slate Gray#657383Slate Gray
Light Steel Blue4#646D7ELight Steel Blue4
Light Slate Gray#6D7B8DLight Slate Gray
Cadet Blue4#4C787ECadet Blue4
Dark Slate Gray4#4C7D7EDark Slate Gray4
Thistle4#806D7EThistle4
Medium Slate Blue#5E5A80Medium Slate Blue
Medium Purple4#4E387EMedium Purple4
Midnight Blue#151B54Midnight Blue
Dark Slate Blue#2B3856Dark Slate Blue
Dark Slate Gray#25383CDark Slate Gray
Dim Gray#463E41Dim Gray
Cornflower Blue#151B8DCornflower Blue
Royal Blue4#15317ERoyal Blue4
Slate Blue4#342D7ESlate Blue4
Royal Blue#2B60DERoyal Blue
Royal Blue1#306EFFRoyal Blue1
Royal Blue2#2B65ECRoyal Blue2
Royal Blue3#2554C7Royal Blue3
Deep Sky Blue#3BB9FFDeep Sky Blue
Deep Sky Blue2#38ACECDeep Sky Blue2
Slate Blue#357EC7Slate Blue
Deep Sky Blue3#3090C7Deep Sky Blue3
Deep Sky Blue4#25587EDeep Sky Blue4
Dodger Blue#1589FFDodger Blue
Dodger Blue2#157DECDodger Blue2
Dodger Blue3#1569C7Dodger Blue3
Dodger Blue4#153E7EDodger Blue4
Steel Blue4#2B547ESteel Blue4
Steel Blue#4863A0Steel Blue
Slate Blue2#6960ECSlate Blue2
Violet#8D38C9Violet
Medium Purple3#7A5DC7Medium Purple3
Medium Purple#8467D7Medium Purple
Medium Purple2#9172ECMedium Purple2
Medium Purple1#9E7BFFMedium Purple1
Light Steel Blue#728FCELight Steel Blue
Steel Blue3#488AC7Steel Blue3
Steel Blue2#56A5ECSteel Blue2
Steel Blue1#5CB3FFSteel Blue1
Sky Blue3#659EC7Sky Blue3
Sky Blue4#41627ESky Blue4
Slate Blue#737CA1Slate Blue
Slate Blue#737CA1Slate Blue
Slate Gray3#98AFC7Slate Gray3
Violet Red#F6358AViolet Red
Violet Red1#F6358AViolet Red1
Violet Red2#E4317FViolet Red2
Deep Pink#F52887Deep Pink
Deep Pink2#E4287CDeep Pink2
Deep Pink3#C12267Deep Pink3
Deep Pink4#7D053FDeep Pink4
Medium Violet Red#CA226BMedium Violet Red
Violet Red3#C12869Violet Red3
Firebrick#800517Firebrick
Violet Red4#7D0541Violet Red4
Maroon4#7D0552Maroon4
Maroon#810541Maroon
Maroon3#C12283Maroon3
Maroon2#E3319DMaroon2
Maroon1#F535AAMaroon1
Magenta#FF00FFMagenta
Magenta1#F433FFMagenta1
Magenta2#E238ECMagenta2
Magenta3#C031C7Magenta3
Medium Orchid#B048B5Medium Orchid
Medium Orchid1#D462FFMedium Orchid1
Medium Orchid2#C45AECMedium Orchid2
Medium Orchid3#A74AC7Medium Orchid3
Medium Orchid4#6A287EMedium Orchid4
Purple#8E35EFPurple
Purple1#893BFFPurple1
Purple2#7F38ECPurple2
Purple3#6C2DC7Purple3
Purple4#461B7EPurple4
Dark Orchid4#571B7eDark Orchid4
Dark Orchid#7D1B7EDark Orchid
Dark Violet#842DCEDark Violet
Dark Orchid3#8B31C7Dark Orchid3
Dark Orchid2#A23BECDark Orchid2
Dark Orchid1#B041FFDark Orchid1
Plum4#7E587EPlum4
Pale Violet Red#D16587Pale Violet Red
Pale Violet Red1#F778A1Pale Violet Red1
Pale Violet Red2#E56E94Pale Violet Red2
Pale Violet Red3#C25A7CPale Violet Red3
Pale Violet Red4#7E354DPale Violet Red4
Plum#B93B8FPlum
Plum1#F9B7FFPlum1
Plum2#E6A9ECPlum2
Plum3#C38EC7Plum3
Thistle#D2B9D3Thistle
Thistle3#C6AEC7Thistle3
Lavendar Blush2#EBDDE2Lavender Blush2
Lavendar Blush3#C8BBBELavender Blush3
Thistle2#E9CFECThistle2
Thistle1#FCDFFFThistle1
Lavendar#E3E4FALavender
Lavendar Blush#FDEEF4Lavender Blush
Light Steel Blue1#C6DEFFLight Steel Blue1
Light Blue#ADDFFFLight Blue
Light Blue1#BDEDFFLight Blue1
Light Cyan#E0FFFFLight Cyan
Slate Gray1#C2DFFFSlate Gray1
Slate Gray2#B4CFECSlate Gray2
Light Steel Blue2#B7CEECLight Steel Blue2
Turquoise1#52F3FFTurquoise1
Cyan#00FFFFCyan
Cyan1#57FEFFCyan1
Cyan2#50EBECCyan2
Turquoise2#4EE2ECTurquoise2
Medium Turquoise#48CCCDMedium Turquoise
Turquoise#43C6DBTurquoise
Dark Slate Gray1#9AFEFFDark Slate Gray1
Dark Slate Gray2#8EEBECDark slate Gray2
Dark Slate Gray3#78c7c7Dark Slate Gray3
Cyan3#46C7C7Cyan3
Turquoise3#43BFC7Turquoise3
Cadet Blue3#77BFC7Cadet Blue3
Pale Turquoise3#92C7C7Pale Turquoise3
Light Blue2#AFDCECLight Blue2
Dark Turquoise#3B9C9CDark Turquoise
Cyan4#307D7ECyan4
Light Sea Green#3EA99FLight Sea Green
Light Sky Blue#82CAFALight Sky Blue
Light Sky Blue2#A0CFECLight Sky Blue2
Light Sky Blue3#87AFC7Light Sky Blue3
Sky Blue#82CAFFSky Blue
Sky Blue2#79BAECSky Blue2
Light Sky Blue4#566D7ELight Sky Blue4
Sky Blue#6698FFSky Blue
Light Slate Blue#736AFFLight Slate Blue
Light Cyan2#CFECECLight Cyan2
Light Cyan3#AFC7C7Light Cyan3
Light Cyan4#717D7DLight Cyan4
Light Blue3#95B9C7Light Blue3
Light Blue4#5E767ELight Blue4
Pale Turquoise4#5E7D7EPale Turquoise4
Dark Sea Green4#617C58Dark Sea Green4
Medium Aquamarine#348781Medium Aquamarine
Medium Sea Green#306754Medium Sea Green
Sea Green#4E8975Sea Green
Dark Green#254117Dark Green
Sea Green4#387C44Sea Green4
Forest Green#4E9258Forest Green
Medium Forest Green#347235Medium Forest Green
Spring Green4#347C2CSpring Green4
Dark Olive Green4#667C26Dark Olive Green4
Chartreuse4#437C17Chartreuse4
Green4#347C17Green4
Medium Spring Green#348017Medium Spring Green
Spring Green#4AA02CSpring Green
Lime Green#41A317Lime Green
Spring Green#4AA02CSpring Green
Dark Sea Green#8BB381Dark Sea Green
Dark Sea Green3#99C68EDark Sea Green3
Green3#4CC417Green3
Chartreuse3#6CC417Chartreuse3
Yellow Green#52D017Yellow Green
Spring Green3#4CC552Spring Green3
Sea Green3#54C571Sea Green3
Spring Green2#57E964Spring Green2
Spring Green1#5EFB6ESpring Green1
Sea Green2#64E986Sea Green2
Sea Green1#6AFB92Sea Green1
Dark Sea Green2#B5EAAADark Sea Green2
Dark Sea Green1#C3FDB8Dark Sea Green1
Green#00FF00Green
Lawn Green#87F717Lawn Green
Green1#5FFB17Green1
Green2#59E817Green2
Chartreuse2#7FE817Chartreuse2
Chartreuse#8AFB17Chartreuse
Green Yellow#B1FB17Green Yellow
Dark Olive Green1#CCFB5DDark Olive Green1
Dark Olive Green2#BCE954Dark Olive Green2
Dark Olive Green3#A0C544Dark Olive Green3
Yellow#FFFF00Yellow
Yellow1#FFFC17Yellow1
Khaki1#FFF380Khaki1
Khaki2#EDE275Khaki2
Goldenrod#EDDA74Goldenrod
Gold2#EAC117Gold2
Gold1#FDD017Gold1
Goldenrod1#FBB917Goldenrod1
Goldenrod2#E9AB17Goldenrod2
Gold#D4A017Gold
Gold3#C7A317Gold3
Goldenrod3#C68E17Goldenrod3
Dark Goldenrod#AF7817Dark Goldenrod
Khaki#ADA96EKhaki
Khaki3#C9BE62Khaki3
Khaki4#827839Khaki4
Dark Goldenrod1#FBB117Dark Goldenrod1
Dark Goldenrod2#E8A317Dark Goldenrod2
Dark Goldenrod3#C58917Dark Goldenrod3
Sienna1#F87431Sienna1
Sienna2#E66C2CSienna2
Dark Orange#F88017Dark Orange
Dark Orange1#F87217Dark Orange1
Dark Orange2#E56717Dark Orange2
Dark Orange3#C35617Dark Orange3
Sienna3#C35817Sienna3
Sienna#8A4117Sienna
Sienna4#7E3517Sienna4
Indian Red4#7E2217Indian Red4
Dark Orange3#7E3117Dark Orange3
Salmon4#7E3817Salmon4
Dark Goldenrod4#7F5217Dark Goldenrod4
Gold4#806517Gold4
Goldenrod4#805817Goldenrod4
Light Salmon4#7F462CLight Salmon4
Chocolate#C85A17Chocolate
Coral3#C34A2CCoral3
Coral2#E55B3CCoral2
Coral#F76541Coral
Dark Salmon#E18B6BDark Salmon
Salmon1#F88158Pale Turquoise4
Salmon2#E67451Salmon2
Salmon3#C36241Salmon3
Light Salmon3#C47451Light Salmon3
Light Salmon2#E78A61Light Salmon2
Light Salmon#F9966BLight Salmon
Sandy Brown#EE9A4DSandy Brown
Hot Pink#F660ABHot Pink
Hot Pink1#F665ABHot Pink1
Hot Pink2#E45E9DHot Pink2
Hot Pink3#C25283Hot Pink3
Hot Pink4#7D2252Hot Pink4
Light Coral#E77471Light Coral
Indian Red1#F75D59Indian Red1
Indian Red2#E55451Indian Red2
Indian Red3#C24641Indian Red3
Red#FF0000Red
Red1#F62217Red1
Red2#E41B17Red2
Firebrick1#F62817Firebrick1
Firebrick2#E42217Firebrick2
Firebrick3#C11B17Firebrick3
Pink#FAAFBEPink
Rosy Brown1#FBBBB9Rosy Brown1
Rosy Brown2#E8ADAARosy Brown2
Pink2#E7A1B0Pink2
Light Pink#FAAFBALight Pink
Light Pink1#F9A7B0Light Pink1
Light Pink2#E799A3Light Pink2
Pink3#C48793Pink3
Rosy Brown3#C5908ERosy Brown3
Rosy Brown#B38481Rosy Brown
Light Pink3#C48189Light Pink3
Rosy Brown4#7F5A58Rosy Brown4
Light Pink4#7F4E52Light Pink4
Pink4#7F525DPink4
Lavender Blush4#817679Lavendar Blush4
Light Goldenrod4#817339Light Goldenrod4
Lemon Chiffon4#827B60Lemon Chiffon4
Lemon Chiffon3#C9C299Lemon Chiffon3
Light Goldenrod3#C8B560Light Goldenrod3
Light Golden2#ECD672Light Golden2
Light Goldenrod#ECD872Light Goldenrod
Light Goldenrod1#FFE87CLight Goldenrod1
Lemon Chiffon2#ECE5B6Lemon Chiffon2
Lemon Chiffon#FFF8C6Lemon Chiffon
Light Goldenrod Yellow#FAF8CCLight Goldenrod Yellow


15 April, 2010

lapackpp-2.5.3 on Mac OS X 10.6.3

today, I have successfully installed lapackpp-2.5.3 (lapack++-2.5.3) on Mac OS X 10.6.3

1. download "lapackpp-2.5.3.tar.gz" form http://sourceforge.net/projects/lapackpp/

2. uncompress and install

tar -xvf lapackpp-2.5.3.tar.gz
cd lapackpp-2.5.3
./configure --with-prefix=(path to the directory)
make
make install

3. fix some bugs in the code

cd (path to the directory)/include/lapackpp
perl -pi -w -e 's//"laversion.h"/g;' *
perl -pi -w -e 's//"f2c.h"/g;' *
perl -pi -w -e 's//"lafnames.h"/g;' *
perl -pi -w -e 's//"lacomplex"/g;' *

4. test a simple program

file name : "test.cpp"
code:

#include <lapackpp/lapackpp.h>
#include <iostream>

using namespace std;

int main() {
    int i,j,size;
    size = 4;
    LaGenMatDouble A(size,size);
    for (i=0;i<size;i++){
        for (j=0;j<size;j++)
            cout << A(i,j) <<' ';
        cout << endl;
    }
    return 0;
}


compile:
g++ test.cpp -I(path to the directory)/include -L(path to the directory)/lib -llapackpp
./a.out


0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0