Loading...
Searching...
No Matches
OptimisationProblem.h
// Copyright (C) 2014 Tianyi Li
//
// This file is part of DOLFIN.
//
// DOLFIN is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOLFIN is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
//
// First added: 2014-06-22
// Last changed: 2014-07-19
#ifndef __OPTIMISATION_PROBLEM_H
#define __OPTIMISATION_PROBLEM_H
#include "NonlinearProblem.h"
namespace dolfin
{
// Forward declarations
class GenericMatrix;
class GenericVector;
class OptimisationProblem : public NonlinearProblem
{
public:
OptimisationProblem() {}
virtual ~OptimisationProblem() {}
virtual double f(const GenericVector& x) = 0;
virtual void form(GenericMatrix& A, GenericMatrix& P, GenericVector& b,
const GenericVector& x)
{
// Do nothing if not supplied by the user
}
virtual void F(GenericVector& b, const GenericVector& x) = 0;
virtual void J(GenericMatrix& A, const GenericVector& x) = 0;
virtual void J_pc(GenericMatrix& P, const GenericVector& x)
{
// Do nothing if not supplied by the user
}
};
}
#endif
dolfin::GenericMatrix
This class defines a common interface for matrices.
Definition GenericMatrix.h:47
dolfin::GenericVector
This class defines a common interface for vectors.
Definition GenericVector.h:48
dolfin::NonlinearProblem::NonlinearProblem
NonlinearProblem()
Constructor.
Definition NonlinearProblem.h:41
dolfin::OptimisationProblem::J
virtual void J(GenericMatrix &A, const GenericVector &x)=0
Compute the Hessian :math:J(x) = f''(x).
dolfin::OptimisationProblem::F
virtual void F(GenericVector &b, const GenericVector &x)=0
Compute the gradient :math:F(x) = f'(x).
dolfin::OptimisationProblem::OptimisationProblem
OptimisationProblem()
Constructor.
Definition OptimisationProblem.h:43
dolfin::OptimisationProblem::form
virtual void form(GenericMatrix &A, GenericMatrix &P, GenericVector &b, const GenericVector &x)
Definition OptimisationProblem.h:54
dolfin::OptimisationProblem::J_pc
virtual void J_pc(GenericMatrix &P, const GenericVector &x)
Definition OptimisationProblem.h:73
dolfin::OptimisationProblem::f
virtual double f(const GenericVector &x)=0
Compute the objective function :math:f(x).
dolfin::OptimisationProblem::~OptimisationProblem
virtual ~OptimisationProblem()
Destructor.
Definition OptimisationProblem.h:46
dolfin
Definition adapt.h:30