LoginSignup
2
2

More than 5 years have passed since last update.

Binary Decision Diagramを扱うためにCUDDをインストール

Last updated at Posted at 2018-06-25

お試し中のメモ。

ダウンロードとかパッケージの情報

インストール

  • デフォルトでconfigureするとエラーが出た(記憶がある)ので、g++-mp-6を指定してビルドするように修正(環境でMacPortsを利用していることを想定)
  • インストールした結果、/usr/local/includeにファイルが置かれるようになった(おそらく変更できる)
./configure CC=gcc-mp-6 CXX=g++-mp-6 --enable-silent-rules --enable-shared --enable-obj
make
sudo make install

はじめてのビルド

#include <iostream>
#include "cuddObj.hh"

using namespace std;

int main() {
  Cudd mgr;
  BDD x = mgr.bddVar();
  BDD y = mgr.bddVar();
  BDD f = x * y;
  BDD g = y +!x;
  cout << "f is" << (f <= g ? "" : " not")
       << " less than or equal to g" << endl;
  return 0;
}
  • ビルド方法
g++ -Wall -o main main.cpp -I/usr/local/include -lcudd
  • 実行結果
    • おそらく実行されている感じ
./main
#> f is less than or equal to g

next

  • もう少し複雑な例題をC++側のインタフェースを利用して使って見る(動作確認含む)
2
2
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2