escript  Revision_Unversioneddirectory
Functions.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16 
17 
18 #ifndef __PASO_FUNCTIONS_H__
19 #define __PASO_FUNCTIONS_H__
20 
21 #include "performance.h"
22 #include "SystemMatrix.h"
23 
24 namespace paso {
25 
26 struct Function
27 {
29  virtual ~Function();
30 
32  virtual err_t call(double* value, const double* arg, Performance* pp) = 0;
33 
36  err_t derivative(double* J0w, const double* w, const double* f0,
37  const double* x0, double* setoff, Performance* pp);
38 
40  virtual dim_t getLen() = 0;
41 
43 };
44 
45 struct LinearSystem : public Function
46 {
47  LinearSystem(SystemMatrix_ptr A, double* b, Options* options);
48  virtual ~LinearSystem();
49 
50  virtual err_t call(double* value, const double* arg, Performance* pp);
51 
52  virtual dim_t getLen() { return n; }
53 
55  double* tmp;
56  double* b;
58 };
59 
60 } // namespace paso
61 
62 #endif // __PASO_FUNCTIONS_H__
63 
virtual err_t call(double *value, const double *arg, Performance *pp)=0
sets value=F(arg)
Definition: Options.h:90
double * tmp
Definition: Functions.h:55
Function(esysUtils::JMPI &mpi_info)
Definition: Functions.cpp:24
esysUtils::JMPI mpi_info
Definition: Functions.h:42
virtual dim_t getLen()
returns the length of the vectors used by this function
Definition: Functions.h:52
Definition: performance.h:54
boost::shared_ptr< SystemMatrix > SystemMatrix_ptr
Definition: SystemMatrix.h:38
Definition: AMG.cpp:38
Definition: Functions.h:45
virtual ~Function()
Definition: Functions.cpp:29
int err_t
Definition: types.h:29
SystemMatrix_ptr mat
Definition: Functions.h:54
Definition: Functions.h:26
index_t dim_t
Definition: types.h:27
err_t derivative(double *J0w, const double *w, const double *f0, const double *x0, double *setoff, Performance *pp)
Definition: Functions.cpp:33
boost::shared_ptr< JMPI_ > JMPI
Definition: Esys_MPI.h:79
double * b
Definition: Functions.h:56
dim_t n
Definition: Functions.h:57
virtual dim_t getLen()=0
returns the length of the vectors used by this function