Solved

Visual C++

Posted on 2011-03-24
10
283 Views
Last Modified: 2012-05-11
Hi Experts,
                        How to apply Integral Calculas using VC++ is there any direct function for this.

Regards,
Vimal
0
Comment
Question by:vimalalex
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 32

Expert Comment

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

Expert Comment

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

Expert Comment

by:TommySzalapski
ID: 35209353
You could try one of these libraries.
http://www.mathtools.net/C_C__/Calculus/index.html
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Expert Comment

by:jkr
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";

Open in new window

0
 
LVL 2

Author Comment

by:vimalalex
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

by:phoffric
ID: 35217274
0
 
LVL 86

Accepted Solution

by:
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

by:phoffric
ID: 35217299

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

Author Comment

by:vimalalex
ID: 35217380
Hi phoffric,

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

Regards,
Vimal.
0
 
LVL 32

Assisted Solution

by:phoffric
phoffric earned 250 total points
ID: 35217903
This site grants you permission to download this book:
     http://astronu.jinr.ru/wiki/upload/d/d6/NumericalRecipesinC.pdf

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question