The qhull library has a central point with a few samples to start from when you want to use it in your code. Most interestingly, the developers invite you to call the qconvex program as an external application in case you want to calculate the convex hull of a point […]
C++
Well, the task is neither new nor unsolved. I was particularly interested in the fancy possibility to use a map container for binary search. Of course, boost offers better (read: faster and shorter) ways. Both of them can be implemented in a few lines. #include <map> #include <boost/random.hpp> #define CHOICES […]
Once again, portage is unhappy and complains about this command tunix calibre # g++ -O2 -march=native -pipe -fPIC -O2 -march=native -pipe -pthread -I/usr/include/python2.7 -I/usr/include -I/usr/include/podofo -c /var/tmp/portage/app-text/calibre-0.9.6/work/calibre/src/calibre/utils/podofo/output.cpp -o /var/tmp/portage/app-text/calibre-0.9.6/work/calibre/build/objects/podofo/output.o In file included from /usr/include/podofo/podofo-base.h:27:0, from /usr/include/podofo/podofo.h:34, from /var/tmp/portage/app-text/calibre-0.9.6/work/calibre/src/calibre/utils/podofo/global.h:14, from /var/tmp/portage/app-text/calibre-0.9.6/work/calibre/src/calibre/utils/podofo/output.cpp:8: /usr/include/podofo/base/PdfDefines.h:66:28: fatal error: boost/config.hpp: No such file or directory compilation […]
Retrieving information on the possible frame rates for a given pixel format (RGB, YUYV, …) and a given frame size (640*480, …) using v4l2 should be simple. However, it took me some time to find the appropriate section in the documentation. In case you already have a file descriptor fd […]
C++ has great features. And dangerous ones. Consider this piece of code: #include <iostream> using namespace std; #define sizeof(x) __LINE__*4 int main(void) { cout << sizeof(int) << endl; cout << sizeof(int) << endl; } This code is perfectly valid and prints 32 and 36. This error should be extremely hard […]
boost::program_options ist recht hilfreich, hat aber eine merkwürdige Standardformatierung bei der Ausgabe – hier ein Beispiel aus einer aktuellen Beta-Anwendung: Die Beschränkung von 80 Zeichen pro Zeile ist konservativ gewählt und nachvollziehbar, wenngleich nicht immer nötig. Darüberhinaus sind unterschiedliche Gruppen (options_description) unterschiedlich formatiert, was die ohnehin eingeschränkte Übersichtlichkeit nicht gerade […]
Profiling ist trotz Anwendungen wie Valgrind auch in Verbindung mit kcachegrind nicht gerade einfach – insbesondere dann nicht, wenn Nebenläufigkeit eine Rolle spielt. In diesem Fall lohnt sich ein Blick auf Intel® VTune™ Amplifier XE 2013. Im Zusammenspiel mit C++-Anwendungen unter Linux kommt dann bei der Performance-Analyse stellenweise tatsächlich etwas […]
Beispielimplementierung FFT Dieser Eintrag befasst sich mit einem Beispielprogramm für die Durchführung der Fast-Fourier-Transformation. Als Programmiersprache kommt C zum Einsatz. Wer nur am Programm interessiert ist, kann die einzelnen Code-Fragemente einfach nacheinander in eine .c-Datei einfügen. GCC benötigt noch das Flag -lm, durch das die mathematischen Funktionen gelinkt werden können. […]
Im Folgenden möchte ich kurz eine mögliche Lösung kommentiert vorstellen, durch die von gegebenen Eingangsdaten die diskrete Fourier-Transformierte berechnet werden kann. Als Programmiersprache kommt C zum Einsatz. Wer nur am Programm interessiert ist, kann die einzelnen Code-Fragemente einfach nacheinander in eine .c-Datei einfügen. GCC benötigt noch das Flag -lm, durch […]
Tritt beim Kompilieren mit cmake der Fehler cmake: error while loading shared libraries: libstdc++.so.6 auf, und zeigt gcc-config folgende Fehlermeldung # gcc-config -l * gcc-config: Active gcc profile is invalid! [1] i686-pc-linux-gnu-4.4.3 dann hilft es, das Profil umzustellen – in diesem Fall mit # gcc-config -f 1