Integrating Numerical Methods in VC++: Library Recommendations and Compatibility

Click For Summary

Discussion Overview

The discussion revolves around finding and integrating numerical methods libraries in C++ using Visual Studio. Participants explore various library options, compatibility issues, and the challenges of using external libraries for numerical integration.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Homework-related

Main Points Raised

  • One participant inquires about free online libraries for numerical integration that are compatible with VC++ and mentions the GNU Scientific Library (GSL) as potentially Linux-specific.
  • Another participant asserts that GSL is portable and works well under Windows, suggesting it as a viable option.
  • Boost is recommended by some participants as a powerful library for C++ development, with an assumption that the inquirer is familiar with it.
  • A participant expresses uncertainty about using Boost due to a lack of experience with external libraries and seeks resources for learning how to integrate them into their program.
  • Another participant warns that using Boost may require a significant time investment to understand its complexities.
  • Questions are raised about the nature of the integration task, specifically whether it involves a constant function or data from a plot.
  • NETLIB is mentioned as a potential source for routines, though it is noted that many routines are in FORTRAN, which may require translation.
  • A suggestion is made that adding references in Visual Studio is similar to adding .dll files, with a link to MSDN for further guidance.
  • One participant provides examples of linking to Oracle and OpenGL libraries in the stdafx.h file, illustrating how to include external libraries in a C++ project.

Areas of Agreement / Disagreement

Participants express varying opinions on the best libraries to use, with no consensus on a single recommended library. There are also differing levels of experience with external libraries, leading to a range of advice on how to proceed.

Contextual Notes

Some participants express uncertainty about the integration process and the complexity of using certain libraries, indicating a need for more foundational knowledge in using external libraries.

Who May Find This Useful

This discussion may be useful for C++ developers seeking to integrate numerical methods libraries, particularly those using Visual Studio and looking for guidance on library compatibility and usage.

DukeLuke
Messages
92
Reaction score
0
I'm doing some numerical integration using C++ with Visual Studio. Are there any free online libraries where I can find routines to help with this? If there are, what is recommended and would be compatible with VC++? I have looked at the GNU library, but from what I understand this only works on Linux. Any advice would be great.
 
Technology news on Phys.org
DukeLuke said:
I'm doing some numerical integration using C++ with Visual Studio. Are there any free online libraries where I can find routines to help with this? If there are, what is recommended and would be compatible with VC++? I have looked at the GNU library, but from what I understand this only works on Linux. Any advice would be great.

GSL works perfectly well under Windows; it is, after all, portable code. The first result on a google search for "gnu scientific library" + "visual studio" gives here, for example.

There are also loads of other relevant libraries. Given that you're developing in C++ I'll assume that you're already familiar with Boost. Why not use that?
 
There are also loads of other relevant libraries. Given that you're developing in C++ I'll assume that you're already familiar with Boost. Why not use that?

Thanks, I took a trip to the library and found a lot of what I was looking for in a few books. I have heard a lot about boost, so I downloaded the standard package. I'm not sure how to use it though, because I have never used outside libraries before. I tried to read the instructions, but most of it was over my head. Is there a place where I learn the basics of using other libraries in my program.
 
DukeLuke said:
Thanks, I took a trip to the library and found a lot of what I was looking for in a few books. I have heard a lot about boost, so I downloaded the standard package. I'm not sure how to use it though, because I have never used outside libraries before. I tried to read the instructions, but most of it was over my head. Is there a place where I learn the basics of using other libraries in my program.

If you've never used an external library in your code you're probably getting a bit ahead of yourself by attempting to use Boost; it's an immensely powerful set of (mainly header) libraries and, as a result, requires a correspondingly large investment of time to understand.

If you're interested to see how to include external libraries you could do worse than checking out Jeff Cogswell's C++ Cookbook (O'Reilly).
 
Are you integrating a function all the time?
Is it the same function all the time?

Or are you integrating data from a plot?

The NETLIB site might have a routine, but most of the routines posted there are written in FORTRAN. You would either have to f2c the code, or translate it manually.
 
DukeLuke said:
Is there a place where I learn the basics of using other libraries in my program.

In Visual studio that's equivalent to adding references. You left click your project and add reference. Browse to .dll files and add them. (I have been doing this in c# and I am sure that c++ should be very similar).
Rest is same as using any other standard library.

Refer to
http://msdn.microsoft.com/en-us/library/e6w9eycd(VS.80).aspx

P.S. Using external libraries is really easy and you do not need to know anything about it other than 6-10 lines instructions. Yes, first time can be bit hard.
 
I place all of the following information in the stdafx.h file.


This is an example linking to Oracle libraries...

Code:
#include "C:\Oracle\Ora92\oo4o\CPP\INCLUDE\oracl.h"

#ifdef _DEBUG
	#pragma comment(lib, "C:\\Oracle\\Ora92\\oo4o\\CPP\\LIB\\DBG\\ORACLM32.lib")
#else // _DEBUG
	#pragma comment(lib, "C:\\Oracle\\Ora92\\oo4o\\CPP\\LIB\\ORACLM32.lib")
#endif // _DEBUG

This is an example linking to OpenGL libraries...

Code:
#include <gl\gl.h>
#include <gl\glu.h>
#include <gl\glaux.h>

#pragma comment(lib, "glu32.lib")
#pragma comment(lib, "glaux.lib")
#pragma comment(lib, "opengl32.lib")
 
Last edited:

Similar threads

  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 17 ·
Replies
17
Views
5K
Replies
13
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K