c++

boost fusion dynamic at_n

usage boost::fusion::vector<int,double,std::string,char> vec(9 ,2.2 ,"aaa" ,'b'); std::cout << at_n_dynamic<double>(vec, 1) << std::endl; //=> 2.2 detail #include <boost/fusion/include/vector.hpp> //#include <boost/fusion/algorithm.hpp> template<typename V> struct fusion_at_n_functor { mutable int i…</typename></boost/fusion/algorithm.hpp></boost/fusion/include/vector.hpp></double></int,double,std::string,char>

boost.variantの補助ツール

boost::variant に以下の動作をさせたい variant<int,int> => int variant<int,double> => double variant<int , boost::rational<int> > => boost::rational<int> variant<int , double , std::string> => variant<double,std::string> しかしこうなってくれないので自分で拡張ツールを作った。 https://github.com/niitsuma/variant_shrink(要するにdecltype(int+d</double,std::string></int></int></int></int,double></int,int>…

pyublas

boost1.35をinstallした後 install pyublas ./configure --boost-inc-dir=/usr/local/include/boost-1_35/ --boost-lib-dir=/usr/local/lib/ --boost-python-libname=boost_python-gcc41-mt make clean make make install sample code のMakefile sample_ext…

boost 1.35

ubuntu7.10では./configre make checkinstallでtarballからでdebパッケージとしてinstallできる. installされる場所は/usr/local/libなど /home/mynameの下に環境を作りたい場合 ./configre --prefix=/home/myname --with-python=/home/myname/bin/python ma…

svd using ublas

boost.ublasを使ったsvdのプログラムがないか探した。 OpenTissue http://www.opentissue.org/wikitissue/index.php/Main_Page (OpenTissue is [a collection of] generic algorithms and data structures for rapid development of interactive modeling and…

Verrazano

Verrazano http://common-lisp.net/project/fetter/ はswigよりも賢くcffiインターフェイスを生成してくれるtool install sudo apt-get install darcs cl-s-xml cl-ppcre #sudo apt-get install cl-parse-number #donot have ubuntu? install http://www.cli…

cmakeの使い方

cmakeはクロスプラットフォームなconfigureだ.簡単な日本語の解説は http://fseek.exblog.jp/5637217 にもある.使い方は CMakeList.txtというファイルにコンパイル(make)したいプログラムの情報を書く cmake . (最後の"."を忘れないこと) make で目的のプ…

cable swig

http://www.itk.org/HTML/CableSwig.html cable swig は従来のswigが自動で生成できなかった複雑なc++のコードでもwrapを生成できるツール。使いかたは http://www.nabble.com/CSWIG-use-td15071343.html ここに書いてるようにすればいいようだ。最後の 4) g…

Py++

http://language-binding.net/pyplusplus/pyplusplus.html Py++ はboost.pythonのwrapコードを自動生成するtoolのようだ。GUIで使うことができる。 これでBIASのwrapを自動生成しようとしたが動かなかった。複雑なc++コードを扱うにはいくつかの設定がいるの…

様々なbinding

cのbindingをpythonとlispではどちらより良いかが少し議論されている。 http://alohakun.blog7.fc2.com/blog-entry-929.html pythonの方が便利ということらしい

BIASをpythonから呼べるようにする

BIASという画像処理と幾何学処理を行うc++ libraryをpythonから呼べるようにすることを試みた. swigはc++のtemplateと#defineの部分を認識しなかった。基のコードをかなり単純にしてcとしてwrapする必要があるようだ。単純化するためにc++のコードをいじるぐ…

pythonとc++のインターフェイスの比較 swig boost.python ctypes

pythonとc++のインターフェイスを作る方法には boost.pythonを使う方法 swigを使う方法 python.ctypesを使う方法 f2py (Fortranを使うためのInterface)を使う方法 pyreを使う方法 直接Cのインターフェイスを作る方法 があるようだ。 http://www.scipy.org/Co…

cmake FindBoost

cmakeにFindBoostというコマンド追加されたらしい http://www.cmake.org/Bug/view.php?id=6257 これでboostのpathをmakeに書かなくてもよくなったのかもしれない

linux C++開発環境 memo

emacs c++ 開発環境memo Makefileの書き方 Makefileの書き方 わかりやすく内容も充実 http://www.morijp.com/masarl/homepage3.nifty.com/masarl/article/gnu-make/rule.html http://www.jsk.t.u-tokyo.ac.jp/~k-okada/makefile/ http://kommy.s254.xrea.com…

emacs C++開発環境

emacs C++ 開発環境を学習する emacsでc++開発をする方法は以下の順番で下記リンクを読むことで学ぶことができる. Emacs で C 言語プログラミングを始める人へのイントロダクション で基本を学ぶ etagsの使いかた tag fileの生成は以下 sudo apt-get instal…

まとめと .emcas

emacsでc++をするための情報をまとめたリンクまとめおよびその他の周辺情報のリンクemacs C++ 開発環境link集をまとめた開発環境は以下で作れる.なおここで紹介している方法の大部分はemacs22でしか動かないので注意. まず必要なソフトをインストールする…

.emacsの使いかた

リンク集の情報をまとめた.emacsの使いかたをまとめた C-c C-q (c-indent-defun) 関数全体のindent M-x align そろえる M-; (comment-dwim) 選択領域をコメントアウトまたは逆 M-x comment-region リージョンをコメント・アウトする。 M-x uncomment-region …

emacs C++ 開発環境 link集

emacsでc++開発を行うための情報を集めました。まとめをここでしています 以下それぞれのリンク Emacs で C 言語プログラミングを始める人へのイントロダクション 初心者向けdocment 以下の2項目が役立つ タグジャンプ ここで説明しているtagファイルの作成…

boost.pythonをcmakeでコンパイルする方法

boost.pythonをcmakeでコンパイルする方法です. ubuntu7.10,centos5で動作を確認しています. cmake はunix windos両方で動くクロスプラットフォームなmakeです. boost.python cmake をインストールしてください. ubuntuの場合は apt-get install cmake boost…

3次元画像処理

http://www.openscenegraph.org/projects/osg

BIAS - Basic Image AlgorithmS Library

この記事の英語版 BIAS http://www.mip.informatik.uni-kiel.de/tiki-index.php?page=BIAS http://www.mip.informatik.uni-kiel.de/~wwwadmin/Software/ は様々な3次元幾何学処理アルゴリズムがインプリメントされた画像処理ライブラリー. 基礎行列の計算や…

cmakeでdebug

cmakeでmakeするプログラムをデバックする方法 $ cmake -DCMAKE_BUILD_TYPE=Debug . $ make $ gdb a.out でdebugできる. 参考サイト http://www.cmake.org/Wiki/CMake_FAQ

cmakeとflymakeを組み合わせる

flymakeはemacsでc++のdebugを行うのに便利な機能だ.flymakeはdebugを行うのにMakefileを必要とする.cmakeは環境にあわせたMakefileを自動生成する.自動生成されたmakefileでもflymakeのdebugが機能したので確認のためメモしておく.やったことは 簡単なc…