You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
About OR-Tools OR-Tools is an open source software suite for optimization, tuned for tackling the world's toughest problems in vehicle routing, flows, integer and linear programming, and constraint programming. After modeling your problem in the programming language of your choice, you can use any of a half dozen solvers to solve it: commercial solvers such as Gurobi or CPLEX, or open-source solve
In a previous post, I demonstrated how to use libffi to perform fully dynamic calls to C code, where "fully dynamic" means that even the types of the arguments and return values are determined at runtime. Here I want to discuss how the same task is done from Python, both with the existing stdlib ctypes package and the new cffi library, developed by the PyPy team and a candidate for inclusion into
roguelazer's website: beating the compiler なかなか面白かったので翻訳して紹介する。 たとえば、97%の場合において、僅かな効率など忘れるべきである。。早すぎる最適化は諸悪の根源である。とはいえ、残りの重要な3%の機会を逃すべからず。 -- Donald Knuth 計測せよ。計測するまで速度の最適化を施してはならぬ。たとえ計測したにせよ、一部のコードが残りを圧倒するまではまだ最適化してはならぬ。 Rob Pike 最新のWebサービスを主体とした技術の業界に長年浸かった我々は、パフォーマンスの問題を忘れがちである。SQLAlchemy ORMの中で行うリクエスト一つが8,9秒かかる中で、関数呼び出しひとつを3ミリ秒最適化したところで何になるというのか。とはいえ、時にはそのような最適化スキルを養っておくのもいいことだ。今回は、ある簡単な課題を最適化
いままで「SCons とか gyp とか、なんで C++ のシステムに python 入れなあかんねん」とか「せっかく python 入れたのに windows でビルドするには cygwin 版が必要とかいい加減にしろ」とか色んな事があったのですが、ninja を使う事で悩みが解消するかもしれません。 Ninja, a small build system with a focus on speed Ninja is a small build system with a focus on speed. It differs from other build systems in two majo... http://martine.github.io/ninja/ 如何にも外国人ウケしそうなプロジェクト名です。 ninja は chromium ブラウザの開発者が現行のビルドシステムに
Python API¶ Python/C APIチュートリアル : http://docs.python.org/extending/index.html Python/C APIリファレンス : http://docs.python.org/c-api/index.html Python APIはPythonインストール標準のC言語APIを使用し、拡張モジュールを作成します。 #include <Python.h> static PyObject * fact(PyObject *self, PyObject *args) { int n; int i; int ret=1; if (!PyArg_ParseTuple(args, "i", &n)) return NULL; for (i=n; i>0; i--) ret *= i; return Py_BuildValue("i",
DynamicFusion is a method for reconstructing and tracking non-rigid scenes in real-time by extending KinectFusion. It uses a volumetric truncated signed distance function (TSDF) to integrate depth maps from multiple viewpoints into a global reconstruction. Live depth frames are aligned to a dense surface prediction generated by raycasting the TSDF. This closes the loop between mapping and localiza
What is it? Pythran is a python to c++ compiler for a subset of the python language. It takes a python module annotated with a few interface description and turns it into a native python module with the same interface, but (hopefully) faster. It is meant to efficiently compile scientific programs, and takes advantage of multi-cores and SIMD instruction units. Pythran development is currently done
突然ですが私はPythonが好きです。でもPythonは遅いです。 何が遅いかというと、致命的なことに四則演算が遅いです。でも他の動的型付け言語でスクリプト言語と呼ばれるPerl, Ruby, Javascript も C, Javaのようなコンパイルを行う静的型付け言語に比べれば圧倒的に遅いです(近年ではJavascriptのように著しく進歩した言語もあるので必ずしもそうだとは言えませんが)。 スクリプト言語が遅い原因の一つは、変数の型が指定されていないので型のチェックを毎回行う必要があるからです。この特性があるおかげ自動的に型を変換してオーバーフローを防いでくれるというメリットもあるのですが、どうしても静的型付け言語よりは速度を出すことができません。 ならPythonのコードに型指定を加えてコンパイルしちゃえばいいじゃん!というのがCythonです。正確にはPythonライクな文法で書
例題9-1:ハードウェアに付属のDLLを使う(1)¶ A: さて、突然だが今回は上級編ということで雑談はなしでいきなり本題に入る。 B: なんですか突然。悪いものでも食ったんですか。 A: 何を言うか。最近仕事に追われていて余裕がないんだよ、余裕が。 んで、最近久しぶりにctypesを使わないといけない事態が発生したんで復習がてら書きしるしておこうというわけだ。 なにしろctypesは数あるプログラミング言語の中から今後どれを使っていこうか迷っている時に「これからはpythonでいくかなぁ」と思うようになったきっかけの機能だからな。 ぜひこのえーかげん講座でも触れておきたかった。 B: ctypes? ってなんですか? A: 実験をしていると、特殊な計測機器などをプログラムから制御したくなることがよくある。 いや、「よくある」ってほどでもないかも知れないが、ちょっと凝ったことをしようとする
最近コーディングにはC++をメインに使っているのだけれど,軽いを処理はやっぱりスクリプト言語の方が楽.以前はラッパーを作るのにSWIGを使ったことがあるけれど,インタフェースファイルを用意するのにだいぶ苦労したので手軽にラッパーを書ける感覚がなかった.Boost本 (Boost C++ Librariesプログラミング第2版) を眺めていたら「boost::python」というページがあって,かなり手軽にPythonラッパーが書けそうな気がしたので試してみたのでメモ こんな感じのコードを用意する. #include <string> #include <boost/python.hpp> std::string add_hello (std::string s) { return "Hello, " + s; } int square (int n) { return n * n; } B
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く