/[escript]/trunk/paso/src/Functions.h
ViewVC logotype

Diff of /trunk/paso/src/Functions.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4836 by caltinay, Mon Apr 7 05:51:55 2014 UTC revision 4856 by caltinay, Wed Apr 9 06:46:55 2014 UTC
# Line 21  Line 21 
21  #include "Common.h"  #include "Common.h"
22  #include "esysUtils/Esys_MPI.h"  #include "esysUtils/Esys_MPI.h"
23  #include "performance.h"  #include "performance.h"
24    #include "SystemMatrix.h"
25    
26  enum Paso_FunctionType {  namespace paso {
     LINEAR_SYSTEM  
 };  
   
 typedef enum Paso_FunctionType Paso_FunctionType;  
27    
28  struct Paso_Function  struct Function
29  {  {
30      Paso_FunctionType kind;      Function(Esys_MPIInfo* mpi_info);
31      dim_t n;      virtual ~Function();
32      Esys_MPIInfo *mpi_info;  
33      double* b;      /// sets value=F(arg)
34      double* tmp;      virtual err_t call(double* value, const double* arg,
35                           Paso_Performance* pp) = 0;
36    
37        /// numerical calculation of the directional derivative J0w of F at x0 in
38        /// the direction w. f0 is the value of F at x0. setoff is workspace
39        err_t derivative(double* J0w, const double* w, const double* f0,
40                         const double* x0, double* setoff, Paso_Performance* pp);
41    
42        /// returns the length of the vectors used by this function
43        virtual dim_t getLen() = 0;
44    
45        Esys_MPIInfo* mpi_info;
46  };  };
47    
48  err_t Paso_FunctionDerivative(double* J0w, const double* w, Paso_Function* F,  struct LinearSystem : public Function
49                                const double* f0, const double* x0,  {
50                                double* setoff, Paso_Performance* pp);      LinearSystem(SystemMatrix_ptr A, double* b, Options* options);
51        virtual ~LinearSystem();
52    
53        virtual err_t call(double* value, const double* arg, Paso_Performance* pp);
54    
55  err_t Paso_FunctionCall(Paso_Function* F, double* value, const double* arg,      virtual dim_t getLen() { return n; }
56                          Paso_Performance* pp);  
57        SystemMatrix_ptr mat;
58        double* tmp;
59        double* b;
60        dim_t n;
61    };
62    
63  void Paso_Function_free(Paso_Function* F);  } // namespace paso
64    
65  #endif // __PASO_FUNCTIONS_H__  #endif // __PASO_FUNCTIONS_H__
66    

Legend:
Removed from v.4836  
changed lines
  Added in v.4856

  ViewVC Help
Powered by ViewVC 1.1.26