Solved

Visual C++

Posted on 2011-03-24
280 Views
Hi Experts,
How to apply Integral Calculas using VC++ is there any direct function for this.

Regards,
Vimal
0
Question by:vimalalex
• 5
• 2
• 2
• +1

LVL 32

Expert Comment

ID: 35209281
Sorry, there is no integral calculus built-in function in the C++ Standard Library.
0

LVL 32

Expert Comment

ID: 35209298
Here is what is available in Math:
http://www.cplusplus.com/reference/clibrary/cmath/
0

LVL 37

Expert Comment

ID: 35209353
You could try one of these libraries.
http://www.mathtools.net/C_C__/Calculus/index.html
0

LVL 86

Expert Comment

ID: 35209432
Take a look at this article: http://www.codeproject.com/KB/recipes/FastNumericalIntegration.aspx ("Fast Numerical Integration") which shows a very elegant approach to numerical integration using templates. The result can be as simple as
class DemoFunction
{
public:
double operator()(double x) const
{
return exp(-x/5.0)*(2.0 + sin(2.0*x));
}
};

DemoFunction f;
int evaluations;
double errorEstimate;
double integral = DEIntegrator<DemoFunction>::Integrate
(f, 0, 10, 1e-6, evaluations, errorEstimate);
std::cout << integral << ", " << errorEstimate
<< ", " << evaluations << "\n";
0

LVL 2

Author Comment

ID: 35217253
Hi All,

I am using Visual C++ is there any opensource or free library for thus purpose.

Regards,
Vimal.
0

LVL 32

Expert Comment

ID: 35217274
0

LVL 86

Accepted Solution

jkr earned 250 total points
ID: 35217282
>> is there any opensource or free library for thus purpose.

Well, see the link above: http://www.codeproject.com/KB/recipes/FastNumericalIntegration.aspx ("Fast Numerical Integration")
0

LVL 32

Expert Comment

ID: 35217299

But this open source has more recommendations:
http://sourceforge.net/projects/gattmath/
0

LVL 2

Author Comment

ID: 35217380
Hi phoffric,

Will this " http://sourceforge.net/projects/gattmath/ " solve the complete requirements of Integration.

Regards,
Vimal.
0

LVL 32

Assisted Solution

phoffric earned 250 total points
ID: 35217903

You can copy the c code from it, and with the lengthy explanations, you can customize it for your needs.

(My mistake about the previous links - they are not for C/C++.)
0

Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

groupSumClump challenge 9 102
Windows Batch File - Display current time and date in FOR command 8 67
C# Error - Add Failed 12 78
Terminology ..percentile etc 4 37
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…