compute Marcum Q-function by c++

Hi
i want compute Marcum Q-function in c++.How i can do it?
Here is an example of some random function:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
#include <iostream>
#include <cmath>

int main()
{
    const double PI = 3.14159265359; //Defines a constant PI, which will always be equal to 3.14159265359.
    double v = 0, area; //Declare some doubles.
    while(v <= 0) //While v has a value less than or equal to zero, get user input.
    {
        std::cout << "Enter variable: ";
        std::cin >> v;
    }
    area = 0.071 * (pow(v,3) / sqrt(9) * PI); //Pow --> Raises x to the power y. pow(x,y). //sqrt(x) finds square root of x.
    std::cout << "\nAnswer: " << area; //Output the answer.
    return 0;
}


Apply the method to putting in your formula.
I believe the boost library contains the modified Bessel functions you might need:
http://www.boost.org/doc/libs/1_35_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/bessel/bessel_over.html

Topic archived. No new replies allowed.