2014/05/25

Deep Mandelbrotの紹介

Deep Mandelbrot」というソフトを紹介します。

■ソフトの目的


マンデルブロ集合を表示するソフトです。

■特徴


  • マルチスレッド対応
  • libgmpを用いた任意精度計算
  • PNG形式の画像を出力
  • 画像品質を向上させるオーバサンプリング
  • 簡単な動画作成機能(*1)
 *1: 私はまだ試したことがありません。

■入手先


 ページの最後のほうにある"Download"から"mandelbrot-1.0.tar.gz"を入手ずる。

■コンパイル方法


 基本的には"mandelbrot-1.0.tar.gz"の中に入っている"INSTAL"ファイルに記載されている手順を実行すればOKです。私はいつものごとくdebian/wheezy上でコンパイルしました。

(1) ライブラリの準備
 コンパイルには以下のライブラリが必要とのこと。

  • libgd2-xpm-dev
  • libgmp3-dev
 自分のdebianに入っていない場合は以下のコマンドでインストールします。
# apt-get install libgd2-xpm-dev
# apt-get install libgmp3-dev

(2) makeする
 makeが成功すると./docの下に"mandelbrot"という実行ファイルが出来ます。

# cmake .      (cmakeがない場合はapt-get install cmakeを実行)
# make
# make install (必要な場合)

■使い方


 引数"-?"を付けてコマンドを実行すると使用方法が表示されます。
$ mandelbrot -?
Deep Mandelbrot v1.0, (C)2008-2010 by Herbert Haas and Tim Horton
 Started: Sat May 24 19:46:25 2014
Deep Mandelbrot v1.0, (C)2008-2011 by Herbert Haas and Tim Horton

USAGE: mandelbrot [OPTIONS] 

 -?                 print this help
 -v                 be verbose during execution
 -V                 be even more verbose during execution
 -d                 create distance data file for further analysis
 -H                 create histogram file for further analysis
 -g                 create a PNG version with a white grid
 -i        maximum iteration depth (1-999999) [default: 200]
 -t    number of threads to be used (1-30) [default: 4]
 -o        filename for computed image (no file extension needed)
 -f         create PNG with data from this file (no computation)
                    (e.g. the result of a distance file (-d option) can be used)
 -s   amount of oversampling (1-8) [default: 2]
 -w          image pixel width (10-10000) [default: 500]
 -h         image pixel height (10-10000) [default: 500]
 -c     specify color mode (0-255) [default: 0] or 'auto'
 -m      color of Mandelbrot set (if not black) as six hexadecimal
                    digits, e. g. ffa500.

 -M          create movie using  frames
 -x       target of movie on x-axis in percent of current image
 -y       target of movie on y-axis in percent of current image
                 NOTE: valid x/y-parameters: {-100..+100}, with respect to the
                 center of the current frame {0,0}
 -r         radius of last movie frame in percent of first frame

 NOTE:
   Command line parameters overwrite the correspondig settings in .
   If only -w OR only -h is given, then the other parameter is assigned the same value.

■使用例


(1) デフォルト
 引数を何もつけずに実行するとマンデルブロ集合の全体図を出力します。

$ mandelbrot
$ ls
mandelbrot.png
$
図1 mandelbrot.png

(2) コンフィグファイルを指定して実行
 コンフィグファイルのサンプルが./doc/input_files/にあります。

$ ls doc/input_files/
README  neck  satellite  seahorse
$
リスト1 seahorse (コンフィグファイル)
# seahorse
centerx = -0.7435669
centery = 0.1314023
radius = 0.0011439
maxiter = 500
  • 表示したい位置の中心座標(centerx,cenery)
  • 半径(radius)
  • 計算の繰り返し上限値(maxiter)
$ mandelbrot seahorse
$ ls
seahorse.png
図2 seahorse.png

(3) コンフィグファイルと引数の組み合わせ例

$ namdelbrot -g seahorse       // PNG画像に座標目盛を付けます
$ namdelbrot -w 2000 seahorse  // PNG画像を2000x2000ピクセルで出力します
$ namdelbrot -i 3000 seahorse  // 計算の繰り返し上限値を3000にします(*2)
$ namdelbrot -s 3 seahorse     // オーバサンプリング値を3にします
 *2 : コンフィグファイルのmaxiter値と競合しますが、引数の値が優先されます

0 件のコメント:

コメントを投稿

【備忘録】時系列データの編集方法(R言語, tidyverse)

TimeSeries.knit 1 サンプルデータ作成 2 日付単位に集計する 2.1 月毎集計 2.2 四半期毎集計 ...