• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 290
  • Last Modified:

Visual C++

Hi Experts,
                        How to apply Integral Calculas using VC++ is there any direct function for this.

Regards,
Vimal
0
vimalalex
Asked:
vimalalex
  • 5
  • 2
  • 2
  • +1
2 Solutions
 
phoffricCommented:
Sorry, there is no integral calculus built-in function in the C++ Standard Library.
0
 
phoffricCommented:
Here is what is available in Math:
   http://www.cplusplus.com/reference/clibrary/cmath/
0
 
TommySzalapskiCommented:
You could try one of these libraries.
http://www.mathtools.net/C_C__/Calculus/index.html
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
jkrCommented:
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
 
vimalalexAuthor Commented:
Hi All,

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

Regards,
Vimal.
0
 
phoffricCommented:
0
 
jkrCommented:
>> 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
 
phoffricCommented:

But this open source has more recommendations:
   http://sourceforge.net/projects/gattmath/
0
 
vimalalexAuthor Commented:
Hi phoffric,

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

Regards,
Vimal.
0
 
phoffricCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 5
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now