I am facing a major problem that I am trying to solve in vain for 3 days. I have got a And here is the CDS.cpp with definition of I have implemented the function to implement another source file and use the Therefore, I have to define the big_gamma member function in my But obviously, this does not work and I get the following error message: CDS class with the
intensity_func member function and the
big_gamma member function which is basically an integral part of the member
Intensity_func function
#include
intensity_func member function:
#include & lt; Vector & gt; # Include & lt; Random & gt; # Include & lt; Semith & gt; #include "CDS.h" double cds :: intensity_funk (double t) {vector & lt; Double & gt; X = it-> M_intensity; Of vector & lt; Double & gt; Y = it- & gt; M_paytimes; If (t> = y.back ()) t
index_beta function
intensity_func member Simpson's law in the function). Here is the code:
double simple_accommonation (double (* fct) (double), double a, double b) {// [a; Making an integral part of a (continuous) function on b] // Simpson's rule used to return (BA) * (FTP) + FCT (B) + 4 * FCT ((A + B) / 2)) / 6 ; }; Double integration (double (* fct) (double), double a, double b, double n) {// integral is calculated using simple_ination function double plus = 0; Double H = (B-A) / N; For (double x = a; x & lt; b; x = x + h) {sum + = simple_integration (fct, x, x + h); } Refund Amount; }; Int index_beta (vector & lefthinum; double> gt; x, double tau) is to increase the vector x in order and if tau is double (tote & lt; x.back ()) {vector and lefthinini; Double & gt; :: Iterator = x. Start (); Int n = 0; While (* this & lt; tau) {++; ++ n; // or n ++; } Return n; } And {return x.size (); }};
CDS.cpp :
Double CDS :: Big_Gamma ( Double t) {return integration (it-> intensity, 0, t); };
The reference to the non static member function should be called . I again tried to convert the
intensity member function to a fixed function but new problems came out: I can not use the
this-> m_intensity and
- & Gt; M_paytimes and as I get the following error message:
Invalid use outside of a non-static member function .
double (* fct) (double) type "pointer-to- Function ", you need to declare it as an" indicator-to-member function ":
double (cds :: * fct) (double) . In addition, you need the object on which you are called Pointer-to-Member:
(someObject-> fct) (someDouble);
No comments:
Post a Comment