Functions.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2020 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
* Development from 2019 by School of Earth and Environmental Sciences
**
*****************************************************************************/
#ifndef __PASO_FUNCTIONS_H__
#define __PASO_FUNCTIONS_H__
#include "Paso.h"
#include "performance.h"
#include "SystemMatrix.h"
namespace paso {
struct Function
{
Function(const escript::JMPI& mpi_info);
virtual ~Function();
virtual SolverResult call(double* value, const double* arg, Performance* pp) = 0;
SolverResult derivative(double* J0w, const double* w, const double* f0,
const double* x0, double* setoff, Performance* pp);
virtual dim_t getLen() = 0;
const escript::JMPI mpi_info;
};
struct LinearSystem : public Function
{
LinearSystem(SystemMatrix_ptr<double> A, double* b, Options* options);
virtual ~LinearSystem();
virtual SolverResult call(double* value, const double* arg, Performance* pp);
virtual dim_t getLen() { return n; }
SystemMatrix_ptr<double> mat;
double* tmp;
double* b;
dim_t n;
};
} // namespace paso
#endif // __PASO_FUNCTIONS_H__
Paso.h
SystemMatrix.h
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:66
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:74
paso
Definition: BiCGStab.cpp:25
paso::SystemMatrix_ptr
boost::shared_ptr< SystemMatrix< T > > SystemMatrix_ptr
Definition: SystemMatrix.h:42
paso::SolverResult
SolverResult
Definition: Paso.h:44
performance.h
paso::Function
Definition: Functions.h:29
paso::Function::mpi_info
const escript::JMPI mpi_info
Definition: Functions.h:44
paso::Function::Function
Function(const escript::JMPI &mpi_info)
Definition: Functions.cpp:23
paso::Function::getLen
virtual dim_t getLen()=0
returns the length of the vectors used by this function
paso::Function::derivative
SolverResult derivative(double *J0w, const double *w, const double *f0, const double *x0, double *setoff, Performance *pp)
Definition: Functions.cpp:32
paso::Function::call
virtual SolverResult call(double *value, const double *arg, Performance *pp)=0
sets value=F(arg)
paso::Function::~Function
virtual ~Function()
Definition: Functions.cpp:28
paso::LinearSystem
Definition: Functions.h:48
paso::LinearSystem::~LinearSystem
virtual ~LinearSystem()
Definition: Solver_Function.cpp:36
paso::LinearSystem::call
virtual SolverResult call(double *value, const double *arg, Performance *pp)
sets value=F(arg)
Definition: Solver_Function.cpp:44
paso::LinearSystem::LinearSystem
LinearSystem(SystemMatrix_ptr< double > A, double *b, Options *options)
Definition: Solver_Function.cpp:26
paso::LinearSystem::mat
SystemMatrix_ptr< double > mat
Definition: Functions.h:56
paso::LinearSystem::getLen
virtual dim_t getLen()
returns the length of the vectors used by this function
Definition: Functions.h:54
paso::LinearSystem::b
double * b
Definition: Functions.h:58
paso::LinearSystem::tmp
double * tmp
Definition: Functions.h:57
paso::LinearSystem::n
dim_t n
Definition: Functions.h:59
paso::Options
Definition: Options.h:80
paso::Performance
Definition: performance.h:56