RSS

MFC:Using Numerical Recipe in C++

10 Apr

I was forced to come back to MFC, as the company I am now serving still uses VisualStudio.net 2002.

The happy days using C# are gone,… tears…

Below is my trial to use code from Numerical Recipe in C++, 3rd ed, in a MFC dialog application:

1. Include “nr3.h” where all the data structures and function interfaces are defined.

MFCNumericalRecipe_B

2. You need also to include specific module in which you are interested in. In this example, I am trying to use LU decomposition based methods to solve linear equation.

Define the coefficient matrix for Ax=b:

MFCNumericalRecipe_A

The solution is then obtained.

MFCNumericalRecipe_C

Cheers!

 
Leave a comment

Posted by on April 10, 2011 in MFC

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: