COPASI API  4.16.103
CPraxis.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/optimization/CPraxis.h,v $
3 // $Revision: 1.11 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2009/08/14 13:49:28 $
7 // End CVS Header
8 
9 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
11 // and The University of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc. and EML Research, gGmbH.
16 // All rights reserved.
17 
18 #ifndef COPASI_CPraxis
19 #define COPASI_CPraxis
20 
21 #include <limits>
22 
23 class CRandom;
24 
25 class FPraxis
26 {
27 public:
28  virtual ~FPraxis() {};
29 
30  virtual const C_FLOAT64 & operator()(C_FLOAT64 * C_UNUSED(value), C_INT * C_UNUSED(n))
31  {
32  static C_FLOAT64 NaN = std::numeric_limits<C_FLOAT64>::quiet_NaN();
33  return NaN;
34  }
35 };
36 
37 template <class CType> class FPraxisTemplate : public FPraxis
38 {
39 private:
40  const C_FLOAT64 &(CType::*mMethod)(C_FLOAT64 *, C_INT *); // pointer to member function
41  CType * mpType; // pointer to object
42 
43 public:
44 
45  // constructor - takes pointer to an object and pointer to a member and stores
46  // them in two private variables
47  FPraxisTemplate(CType * pType,
48  const C_FLOAT64 &(CType::*method)(C_FLOAT64 *, C_INT*))
49  {
50  mpType = pType;
51  mMethod = method;
52  };
53 
54  virtual ~FPraxisTemplate() {};
55 
56  // override operator "()"
57  virtual const C_FLOAT64 & operator()(C_FLOAT64 *value, C_INT *n)
58  {return (*mpType.*mMethod)(value, n);} ; // execute member function
59 };
60 
61 class CPraxis
62 {
63 public:
64 
65  struct Global
66  {
69  };
70 
71  struct Q
72  {
73  C_FLOAT64 v[10000] /* was [100][100] */, q0[100], q1[100], qa, qb, qc, qd0,
74  qd1, qf1;
75  };
76 
77  CPraxis();
78  ~CPraxis();
79 
80 private:
82 
84  Q q_1;
85 
86 public:
87 
89  C_FLOAT64 *machep,
90  C_FLOAT64 *h0,
91  C_INT *n,
92  C_INT *prin,
93  C_FLOAT64 *x,
94  FPraxis *f, // Functor for function under investigation
95  C_FLOAT64 *fmin);
96 
97  int min_(C_INT *, C_INT *, C_INT *,
98  C_FLOAT64 *, C_FLOAT64 *, C_FLOAT64 *, bool *, FPraxis *f,
101  int quad_(C_INT *, FPraxis *f, C_FLOAT64 *, C_FLOAT64 *, C_FLOAT64 *, C_FLOAT64 *);
102  int print_(C_INT *n, C_FLOAT64 *x, C_INT *prin, C_FLOAT64 *fmin);
103  int minfit_(C_INT *, C_INT *, C_FLOAT64 *, C_FLOAT64 *, C_FLOAT64 *, C_FLOAT64 *);
104 };
105 
106 #endif // COAPSI_CPraxis
C_FLOAT64 praxis_(C_FLOAT64 *t0, C_FLOAT64 *machep, C_FLOAT64 *h0, C_INT *n, C_INT *prin, C_FLOAT64 *x, FPraxis *f, C_FLOAT64 *fmin)
Definition: CPraxis.cpp:69
#define C_INT
Definition: copasi.h:115
FPraxisTemplate(CType *pType, const C_FLOAT64 &(CType::*method)(C_FLOAT64 *, C_INT *))
Definition: CPraxis.h:47
C_FLOAT64 qd1
Definition: CPraxis.h:73
~CPraxis()
Definition: CPraxis.cpp:64
virtual ~FPraxis()
Definition: CPraxis.h:28
CRandom * mpRandom
Definition: CPraxis.h:81
const C_FLOAT64 &(CType::* mMethod)(C_FLOAT64 *, C_INT *)
Definition: CPraxis.h:40
int minfit_(C_INT *, C_INT *, C_FLOAT64 *, C_FLOAT64 *, C_FLOAT64 *, C_FLOAT64 *)
Definition: CPraxis.cpp:800
C_FLOAT64 fx
Definition: CPraxis.h:67
virtual const C_FLOAT64 & operator()(C_FLOAT64 *value, C_INT *n)
Definition: CPraxis.h:57
Q q_1
Definition: CPraxis.h:84
C_FLOAT64 q1[100]
Definition: CPraxis.h:73
#define C_UNUSED(p)
Definition: copasi.h:220
C_FLOAT64 v[10000]
Definition: CPraxis.h:73
int quad_(C_INT *, FPraxis *f, C_FLOAT64 *, C_FLOAT64 *, C_FLOAT64 *, C_FLOAT64 *)
Definition: CPraxis.cpp:1717
int min_(C_INT *, C_INT *, C_INT *, C_FLOAT64 *, C_FLOAT64 *, C_FLOAT64 *, bool *, FPraxis *f, C_FLOAT64 *, C_FLOAT64 *, C_FLOAT64 *, C_FLOAT64 *)
Definition: CPraxis.cpp:1329
C_FLOAT64 qc
Definition: CPraxis.h:73
C_FLOAT64 dmin__
Definition: CPraxis.h:67
CType * mpType
Definition: CPraxis.h:41
int print_(C_INT *n, C_FLOAT64 *x, C_INT *prin, C_FLOAT64 *fmin)
Definition: CPraxis.cpp:1849
C_FLOAT64 NaN
Definition: COptItem.cpp:33
C_FLOAT64 qb
Definition: CPraxis.h:73
#define C_FLOAT64
Definition: copasi.h:92
C_FLOAT64 qd0
Definition: CPraxis.h:73
C_FLOAT64 flin_(C_INT *, C_INT *, C_FLOAT64 *, FPraxis *, C_FLOAT64 *, C_INT *)
Definition: CPraxis.cpp:1591
C_FLOAT64 q0[100]
Definition: CPraxis.h:73
C_FLOAT64 ldt
Definition: CPraxis.h:67
virtual const C_FLOAT64 & operator()(C_FLOAT64 *C_UNUSED(value), C_INT *C_UNUSED(n))
Definition: CPraxis.h:30
Global global_1
Definition: CPraxis.h:83
CPraxis()
Definition: CPraxis.cpp:58
virtual ~FPraxisTemplate()
Definition: CPraxis.h:54
C_FLOAT64 qf1
Definition: CPraxis.h:73
C_FLOAT64 qa
Definition: CPraxis.h:73