I use Fedore Eclipse IDE to run C++ code. I need to use the Scythe Statistical toolbox which implements random number generators from different functions (gamma, beta etc). I have added the toolbox's location to the path of header files in Eclipse and added the

#include "distribution"

(available in this toolbox) at the beginning of my code. From 'distribution.h' I need to use the gammafn function. Its function declaration is:

double gammafn (double val)

Therefore in the my C++ code, I just have a function call :

double k=gammafn(5.0);

I get an error saying 'undefined function: function not declared in scope'.

I am not sure if I have missed in the code or in Eclipse.
Please advice.

6 Years
Discussion Span
Last Post by Sandhya212

The function is defined in a namespace:

namespace scythe {
  /*! @cond */
  /* Forward declarations */
  double gammafn (double);

So you have to call it like this:

double k=scythe::gammafn(5.0);

It seems completely crazy to me that they do not include any examples!!

Good luck.



Also, I notice you only have

#include "distribution"

if daviddoria's suggestion doesn't help, try adding a ".h" to the name i.e.:

#include "distribution[B].h[/B]"

Dear Daviddoria and Fbody,

I have just retained it as #include "distribution" and used the 'scythe::' to call the function. It has worked now :). Thank you very much.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.