Tricks and Tips: Using FFTW (the fastest FFT in the west) under Visual Studio 2010

First visit Fftw.org and download the version (32 or 64bit) of your interest. Then, extract the files in a target directory, say C:UsersPublicDocumentsFFTW32 or C:UsersPublicDocumentsFFTW64, depending on your relevant architecture. Copy now the lib.exe file located in C:Program Files (x86)Microsoft Visual Studio 10.0VCbin to the target directory. Also copy the files: msobj100.dll mspdb100.dll mspdbcore.dll mspdbsrv.exe located in the C:Program Files (x86)Microsoft Visual Studio 10.0Common7IDE ...
More

Finite Difference Time Domain Method

The Finite Difference Time Domain (FDTD) method is a very popular and rather intuitive method to solve partial differential equations describing time-evolving phenomena. The relevant partial differential equations are discretized in both time and space by finite differences. “Update equations” expressing the (unknown) future fields in terms of (known) past fields are established. We here focus on the electromagnetic case, in which Maxwell's equations should be solved, although FDTD is very ...
More

How to integrate Cuda in a Visual C++ Project

If you want to integrate CUDA in your application, first of all you have to download the CUDA Drivers/Toolkit from NVIDIA Download Page  and install them. Check the installation from a command window by running: nvcc -V If everything works properly the response will look like next figure: Without opening the Visual C++ Environment, copy all the .rules fi les from: C:/Program Files/NVIDIA GPU Computing Toolkit/ CUDA/v4.1/extras/ visual studio integration/rules to: C:/Program Files (x86...
More

Ant Colony Optimization

Suppose to connect the nest of a colony of Argentine ants to a food source by two bridges of equal lengths. Each ant starts exploring the neighborhood of the nest, randomly selects one of the two bridges and eventually reaches the food source. Along the path between food and nest, each ant deposits pheromone on the ground to mark the path that could lead other ants to food. Due to randomness, after some time one of the two bridges has a higher amount of pheromone attracting more ants. The more a...
More

Particle Swarm optimization

A swarm of bees flies across a field to find the points with the highest density of flowers. Initially, when no knowledge on the field has been gained yet, the bees move randomly. Each bee remembers the locations where it found the most flowers and knows from the others the other locations with high concentration of flowers. After the first random exploration, each bee is simultaneously pulled to returning to the location where it had found the most flowers and to the location reported by the f...
More

Genetic Algorithms

Genetic algorithms mimic the process of natural selection to solve optimization and search problems appearing in a huge number of very different application fields, from bioinformatics to economics and engineering. Suppose for example that you need to design a certain electronic equipment according to some specifications. This is an "optimization" problem in that the "optimal" solution will be one of the possibly many equipments meeting the specifications. Genetic algorithms serve i...
More

Expression Templates

Expression Templates is a template meta-programming technique that makes you able to improve code performance and legibility with a small effort. It consists in using templates to represent expressions and postpone their evaluation until necessary. By meta-programming you develop a code that produces a new code at complier time implementing functions you really want. We make it clear with a classical example. Suppose you need a Vector class with usual +, -, * operators, it is desirable you can w...
More