Developing algorithm using matrix asks for number of tools. First a straight forward and proven tool is needed like Matlab. It is better to minimize unknowns when a new algorithm is tried. You have to be sure that the result is solely come from one source - mostly from maturing algorithm. And that is the reason why you sticks to a tool that you are familiar with.
After making up an algorithm with matrix, it is time to make it a working code. It is not desirable to stick to the algorithm development tool as it comes together with a big library and license. It is MTL4 's turn to play.
MTL stands for Matrix Template Library. It is C++ template based and make no dependencies on a library file nor dll. Hence it goes in a small foot print and can be deployed in any platform.
But as template library goes, the most of the work comes down to a successful compilation of the source code. There are number of things to note. First, download appropriate zip files and copies files to an appropriate folders. In Windows, you can download from here and copies whole usr folder and name it MTL4. Second there is conflict in variable names between MTL4 and WinDefs. Refer below code snippet to fix the compilation error in Windows.
There are number of warning that can be ignored - I know I am lazy on it and will pay the debt at someday but until then. The code to include the MTL4 will be like below.
Now time to port the algorithm code to C++ code using MTL4. Refer below code snippet.
As above code shows, the C++ code can be very similar to a code in the Matlab thanks to operator overloading in MTL4. In here, very limited features of MTL4 is shown and you can find more in the MTL4.
essay on programming languages, computer science, information techonlogies and all.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment