Showing posts with label Quantitative Development. Show all posts
Showing posts with label Quantitative Development. Show all posts

Wednesday, June 12, 2013

Return Reference and Return Value

1. It is a good thing to return the reference of objects instead of a copy of the object. This is done to save RAM resource.

2. Returning reference is most used in operator overloading += -= + and so on.

Thursday, June 6, 2013

Compile and Run Quantlib1.2.1 Examples on VS2010

Steps to compile and run Quantlib 1.2.1 on VS2010:

1. Download Boost 1.53.0 to your local system.
A link to Download Boost 1.53.0: http://www.boost.org/users/download/

2. Download  Quantlib 1.2.1 to your local machine and run the VS2010 solution in Quantlib folder.
A link to downloading Quantlib: http://sourceforge.net/projects/quantlib/files/QuantLib/1.2.1/

3. Select the first project in the solution, Right click ->Properties->Configuration Properties -> C/C++ -> General-> Additional Include Directories.
Add the full path of the boost folder here. In my laptop, it is E:\Program Files\Boost\boost_1_53_0\boost_1_53_0.

4. Repeat step 3 for all the projects and everything is done. Now Quantlib can compile and run in your machine now.

Attention:
1. Add getchar() before the end of each main method so that you could see the information display on the terminal. If not, the terminal will just pop out and then disappear.
2. You also could write your own examples to use the Quantlib library. Just reverse-engineer the examples.
3. Quantlib 1.2.1 can now only support VS2010. You will get an "unknown Microsoft compiler" error if you use VS2012.

Best,