Skip navigation.

陷入虚无的天狼

Posts tagged with "program"

编译了一堆东西,累人啊

准备开始学习了,目标:VC8,boost,QT,图像处理,准备学GIL,和boost一起的。

用vc8编译了zlib、libpng、jpeg、tiff,其中tiff/tools/tiff2pdf没有过去,算了,反正也用不着这个。在编译boost时,遇到一个问题,说regex_traits_defaults.cpp含有当前codepage cp936中未包含的字符,然后cl.exe报错,网上搜了一下,找到了解决方案。

由于regex_traits_defaults.cpp文件中有西欧Windows编码的字符,所以在中文下不能被
正确识别。
解决方法:
方法1、用MS word打开regex_traits_defaults.cpp,会弹出对话框让选择编码,选择西欧Windows
编码;把此文件再存成Unicode编码的文件,替换掉原来的regex_traits_defaults.cpp。

方法2、把系统的默认语言改成英语(美国),重启动;把VS2005的International Settings设置成和windows设置一致(Tools–〉Options–〉Environment–〉International Settings);
这样编译时便没有那些讨厌的Warning,也可以正常编译Regex

计算机图像类库

计算机图像类库
1.IPL ( Intel Image Processing Library) Intel公司出品,收费。

2.OpenCV

http://sourceforge.net/projects/opencvlibrary/
http://www.opencv.org.cn/index.php/首页
开放源代码的计算机视觉类库OpenCv ( Intel Open SourceComputerVision L ibrary)由英特尔公司位于俄罗斯的研究实验室所开发,它是一套可免费获得的由一些C函数和C ++类所组成的库,用来实现一些常用的图像处理及计算机视觉算法。OpenCv与英特尔公司所开发的另一图像处理库IPL ( Intel Image Processing L ibrary)兼容, IPL(收费)用于实现对数字图像的一些低级处理,而OpenCv则主要用于对图像进行一些高级处理,比如说特征检测与跟踪、运动分析、目标分割与识别以及3D 重建等。由于OpenCv的源代码是完全开放的,而且源代码的编写简洁而又高效,特别是其中大部分的函数都已经过汇编最优化,以使之能高效而充分地利用英特尔系列处理芯片的设计体系,对于PentiumMMX, Pentium, PentiumⅢ及Pentium4这些处理器而言,OpenCv的代码执行效率是非常高的,所以近年来在国外的图像处理相关领域中被广泛地使用,成为一种流行的图像处理软件。

3.FreeImage

http://freeimage.sourceforge.net/

C语言的体系,大量使用指针运算速度可以保证,内含先进的多种插值算法。另外独有的支持meta exif信息的读取。该库最大的特点就是比较简练,只把重点放在对各种格式图像的读取写入支持上,没有显示部分,实际编程的时候还是需要调用API函数进行显示

4. Adobe GIL(Generic Image Library)

http://opensource.adobe.com/gil/

通过boost的认证,被boost接受成为其一部分。

5.DevIL

http://openil.sourceforge.net/

6.CxImage

http://www.codeproject.com/bitmap/cximage.asp

该开发包完全开放源代码,图像封装为一个类,功能极为强大,与Windows、MFC支持极好,支持图像的多种操作(线性滤波、中值滤波、直方图操作、旋转缩放、区域选取、阈值处理、膨胀腐蚀、alpha混合等等),支持从文件、内存或者win32api定义的位图图像格式中读取图像,支持将图像显示在任意窗口,功能可谓很强大了,而且对像素的操作很方便,另外还有一个界面很强的demo,可以直接在上面进行二次开发,推荐使用!
缺点:里面的子库很多,用起来可能较麻烦;而且感觉速度稍慢

7.CImg

就一个.h文件所以用起来很简明,但感觉功能上不如CxImage。可以与CxImage配合使用,因为CImg提供了基于lapack的矩阵运算函数和完善的线性滤波卷积函数,同时CImg做像素运算还是很方便的。另外,独有Display类可以方便的实现各种显示,包括显示图像、打字、画线等等。还有,该库有个基于光流的多尺度图像配准例子,很好

Vim - DoxyGen Highlighting on top of c/c++/java

http://www.jeffhung.net/blog/articles/jeffhung/447/
   1. 建立 ~/.vim/after/syntax 目录;
   2. 自网页上下载 [URL=http://vim.sourceforge.net/download.php]doxygen[/URL];
   3. 解开后得到 doxygen.vim 与 doxygen.txt 两个文件,前者是 syntax ,后者是说明。
      都放到 ~/.vim/after/syntax 目录下;
   4. 对于每一个想要使用 doxygen syntax coloring 功能的文件类型,做一个 soft link 如下:

      cd ~/.vim/after/syntax;
      ln -s doxygen.vim c.vim;
      ln -s doxygen.vim cpp.vim;
      ln -s doxygen.vim java.vim;

   5. 如果是在 Windows 下,那就在第四步時改用 copy。


另外,以下是看到的几套,doxygen 整合其他 IDE 的 solutions:

* Eclox - Eclox is a simple doxygen frontend plug-in for eclipse.
* Doxbar - DoxBar is an add-in for using doxygen from within Developer Studio (VC6).
* DoxyComment for Visual Studio 2005 - DoxyComment is an add-in for Visual Studio 2005, which can help you insert comment blocks in C/C++ code. Comment blocks are generated based on the current context of the cursor. The add-in integrates nicely into Visual Studio, so you can bind your favourite short-cut keys to its commands.

贴一篇新闻组上的文章,关于常量

Matt wrote:
> Does the language have header files containing definitions of numbers
> such as pi and e?
>
> I believe some implementations used to have those, but I can't find them
> in Stroustrup.
>
> Thanks.

FWIW...

There is a history to trying to solve constants problem in an elegant
way with various solutions having being proposed and rejected on
gmane.comp.lib.boost.devel newsgroup.

The solutions fell into 4 areas IIRC:

solution1: Use a variable e.g

//some math header

extern const double pi;

Note that one shouldnt define it in the header due to the ODR rule so
it would require linking a library in the application or defining in a
source file, which was felt to be inconvenient. The other drawback was
that it cant simultaneously be float, double and long double so it will
never be right for everybody.

solution 2: use a function e.g
inline double pi()
{
return  3.141592653589793238462643383279502884197;
}

This suffers in that you cant control the floating point type and it
seems that people hate the function notation to call it. You could make
it a template of course, but you would have to provide the template
parameter when invoked.

solution 3: Use a smart object
struct pi{
template <typename T>
T pi_function(); // get pi as a T
template <typename T>
operator T()  { return pi_function<T>();}
}


This may or may not be how it went. Whatever... The problem this had
was deducing the type to convert to in some situations IIRC.

solution 4: My preferred solution and the one I use, but suffers from
various of the problems above
template <typename T>
struct constant_{

static const T pi;
static const T e;
};

// convenient version for My Favourite float
#ifndef MY_FAVOURITE_FLOAT
#define MY_FAVOURITE_FLOAT double
#endif
struct constant : constant_<MY_FAVOURITE_FLOAT>{};

int main()
{
float val1 = constant_<float>::pi;
double val = constant::pi;
}

Of course this requires a library or source and visible use of
templates in the first invocation at least.


Finally there is an M_PI macro available in some versions of <cmath>
normally via its nested include <math.h>, but that is horrible...

So If anyone has any ideas .... ???

regards
Andy Little

常用数值计算库

常用数值计算库
Intel Math Kernel Library
1.基本线形代数运算(BLAS) 向量与向量、向量与矩阵、矩阵与矩阵的运算
2.稀疏线形代数运算
3.快速傅立叶变换(单精度/双精度)(fftw)
4.LAPACK(求解线形方程组、最小方差、特征值、Sylvester方程等)
5.向量数学库(VML)
6.向量统计学库(VSL)
7.高级离散傅立叶变换

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

lapack
软件名称 Linear Algebra Package
程序设计语言 Fortran 77
资源网址 http://www.netlib.org/lapack
功能概述 线性代数计算子程序包

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

BLAS
软件名称 Basic Linear Algebra Subroutines
程序设计语言 Fortran 77
主要开发者 Kagstrom B. ,Ling P. ,Van Loan C.
资源网址 http://www.netlib.org/blas
功能概述 Blas是执行向量和矩阵运算的子程序集合。

uBLAS
BLAS in C++ with expression templates. 表达式模版形式的 C++中的BLAS ,

gsl
软件名称 GNU Scientific Library (linux)
程序设计语言 C , C++ compable
资源网址 http://www.gnu.org/software/gsl/
功能概述 范围广泛, 包括数值分析的常见内容

Blitz++
软件名称 Blitz++ (不兼容vc6编译器)
资源网址 http://sourceforge.net/project/showfiles.php?group_id=63961
功能概述 The current versions provide dense arrays and vectors, random number generators, and small vectors and matrices.是一个高效率的数值计算函数库,它的设计目的是希望建立一套既具像 C++ 一样方便,同时又比 Fortran 速度更快的数值计算环境。通常,用 C++ 所写出的数值程序,比 Fortran 慢 20% 左右,因此Blitz++ 正是要改掉这个缺点。方法是利用 C++ 的 template 技术,程序执行甚至可以比 Fortran 更快。

MTL
软件名称 Matrix Template Library(兼容vc6编译器)
资源网址 http://www.osl.iu.edu/research/mtl/
功能概述 The Matrix Template Library (MTL) is a high-performance generic component library that provides comprehensive linear algebra functionality for a wide variety of matrix formats. MTL专注于线性代数相关的计算任务,如各种形式矩阵的生成(对角,共轭,稀疏,对称等),相关的计算,变换,以及与一维向量的运算。
November 2009
S M T W T F S
October 2009December 2009
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30