escript  Revision_
Functions.h
Go to the documentation of this file.
00001 
00002 /*****************************************************************************
00003 *
00004 * Copyright (c) 2003-2014 by University of Queensland
00005 * http://www.uq.edu.au
00006 *
00007 * Primary Business: Queensland, Australia
00008 * Licensed under the Open Software License version 3.0
00009 * http://www.opensource.org/licenses/osl-3.0.php
00010 *
00011 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
00012 * Development 2012-2013 by School of Earth Sciences
00013 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
00014 *
00015 *****************************************************************************/
00016 
00017 
00018 #ifndef __PASO_FUNCTIONS_H__
00019 #define __PASO_FUNCTIONS_H__
00020 
00021 #include "performance.h"
00022 #include "SystemMatrix.h"
00023 
00024 namespace paso {
00025 
00026 struct Function
00027 {
00028     Function(Esys_MPIInfo* mpi_info);
00029     virtual ~Function();
00030 
00032     virtual err_t call(double* value, const double* arg, Performance* pp) = 0;
00033 
00036     err_t derivative(double* J0w, const double* w, const double* f0,
00037                      const double* x0, double* setoff, Performance* pp);
00038 
00040     virtual dim_t getLen() = 0;
00041 
00042     Esys_MPIInfo* mpi_info;
00043 };
00044 
00045 struct LinearSystem : public Function
00046 {
00047     LinearSystem(SystemMatrix_ptr A, double* b, Options* options);
00048     virtual ~LinearSystem();
00049 
00050     virtual err_t call(double* value, const double* arg, Performance* pp);
00051 
00052     virtual dim_t getLen() { return n; }
00053 
00054     SystemMatrix_ptr mat;
00055     double* tmp;
00056     double* b;
00057     dim_t n;
00058 };
00059 
00060 } // namespace paso
00061 
00062 #endif // __PASO_FUNCTIONS_H__
00063