QNANO
Parameter_Pointer_Function.h
1 #ifndef QNANO_NEW_PARAMETER_POINTER_FUNCTION_DEFINED_H
2 #define QNANO_NEW_PARAMETER_POINTER_FUNCTION_DEFINED_H
3 
4 #include <vector>
5 #include <cstdlib>
6 
8 public:
9  std::vector<double*> param_ptr;
10 
12  virtual size_t get_DIM()const{return param_ptr.size();}
13 
15  virtual void set_params(const double *d_start){
16  for(size_t i=0; i<param_ptr.size(); i++)*param_ptr[i]=d_start[i];
17  }
19  virtual void get_params(double *d_start)const{
20  for(size_t i=0; i<param_ptr.size(); i++)d_start[i]=*param_ptr[i];
21  }
22 
24  virtual double fct()=0;
25  virtual double f(const double *d_start){
26  set_params(d_start);
27  return fct();
28  }
29 
30 };
31 
32 
33 #endif
virtual void get_params(double *d_start) const
copy Parameters int the specified double vector
Definition: Parameter_Pointer_Function.h:19
Definition: Parameter_Pointer_Function.h:7
virtual void set_params(const double *d_start)
set Parameters from the specified double vector
Definition: Parameter_Pointer_Function.h:15
virtual size_t get_DIM() const
get dimension
Definition: Parameter_Pointer_Function.h:12
virtual double fct()=0
actual function