MFEM  v4.6.0
Finite element discretization library
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
mfem::OptimizationProblem Class Referenceabstract

#include <solvers.hpp>

Inheritance diagram for mfem::OptimizationProblem:
[legend]
Collaboration diagram for mfem::OptimizationProblem:
[legend]

Public Member Functions

 OptimizationProblem (int insize, const Operator *C_, const Operator *D_)
 In parallel, insize is the number of the local true dofs. More...
 
virtual double CalcObjective (const Vector &x) const =0
 Objective F(x). In parallel, the result should be reduced over tasks. More...
 
virtual void CalcObjectiveGrad (const Vector &x, Vector &grad) const
 The result grad is expected to enter with the correct size. More...
 
void SetEqualityConstraint (const Vector &c)
 
void SetInequalityConstraint (const Vector &dl, const Vector &dh)
 
void SetSolutionBounds (const Vector &xl, const Vector &xh)
 
const OperatorGetC () const
 
const OperatorGetD () const
 
const VectorGetEqualityVec () const
 
const VectorGetInequalityVec_Lo () const
 
const VectorGetInequalityVec_Hi () const
 
const VectorGetBoundsVec_Lo () const
 
const VectorGetBoundsVec_Hi () const
 
int GetNumConstraints () const
 

Public Attributes

const int input_size
 

Protected Member Functions

bool NewX () const
 

Protected Attributes

const OperatorC
 Not owned, some can remain unused (NULL). More...
 
const OperatorD
 
const Vectorc_e
 
const Vectord_lo
 
const Vectord_hi
 
const Vectorx_lo
 
const Vectorx_hi
 

Friends

class HiopOptimizationProblem
 

Detailed Description

Defines operators and constraints for the following optimization problem:

Find x that minimizes the objective function F(x), subject to C(x) = c_e, d_lo <= D(x) <= d_hi, x_lo <= x <= x_hi.

The operators F, C, D must take input of the same size (same width). Gradients of F, C, D might be needed, depending on the OptimizationSolver. When used with Hiop, gradients of C and D must be DenseMatrices. F always returns a scalar value, see CalcObjective(), CalcObjectiveGrad(). C and D can have arbitrary heights. C and D can be NULL, meaning that their constraints are not used.

When used in parallel, all Vectors are assumed to be true dof vectors, and the operators are expected to be defined for tdof vectors.

Definition at line 816 of file solvers.hpp.

Constructor & Destructor Documentation

◆ OptimizationProblem()

mfem::OptimizationProblem::OptimizationProblem ( int  insize,
const Operator C_,
const Operator D_ 
)

In parallel, insize is the number of the local true dofs.

Definition at line 2304 of file solvers.cpp.

Member Function Documentation

◆ CalcObjective()

virtual double mfem::OptimizationProblem::CalcObjective ( const Vector x) const
pure virtual

Objective F(x). In parallel, the result should be reduced over tasks.

◆ CalcObjectiveGrad()

virtual void mfem::OptimizationProblem::CalcObjectiveGrad ( const Vector x,
Vector grad 
) const
inlinevirtual

The result grad is expected to enter with the correct size.

Definition at line 846 of file solvers.hpp.

◆ GetBoundsVec_Hi()

const Vector* mfem::OptimizationProblem::GetBoundsVec_Hi ( ) const
inline

Definition at line 859 of file solvers.hpp.

◆ GetBoundsVec_Lo()

const Vector* mfem::OptimizationProblem::GetBoundsVec_Lo ( ) const
inline

Definition at line 858 of file solvers.hpp.

◆ GetC()

const Operator* mfem::OptimizationProblem::GetC ( ) const
inline

Definition at line 853 of file solvers.hpp.

◆ GetD()

const Operator* mfem::OptimizationProblem::GetD ( ) const
inline

Definition at line 854 of file solvers.hpp.

◆ GetEqualityVec()

const Vector* mfem::OptimizationProblem::GetEqualityVec ( ) const
inline

Definition at line 855 of file solvers.hpp.

◆ GetInequalityVec_Hi()

const Vector* mfem::OptimizationProblem::GetInequalityVec_Hi ( ) const
inline

Definition at line 857 of file solvers.hpp.

◆ GetInequalityVec_Lo()

const Vector* mfem::OptimizationProblem::GetInequalityVec_Lo ( ) const
inline

Definition at line 856 of file solvers.hpp.

◆ GetNumConstraints()

int mfem::OptimizationProblem::GetNumConstraints ( ) const

Definition at line 2340 of file solvers.cpp.

◆ NewX()

bool mfem::OptimizationProblem::NewX ( ) const
inlineprotected

Implementations of CalcObjective() and CalcObjectiveGrad() can use this method to check if the argument Vector x has been changed after the last call to CalcObjective() or CalcObjectiveGrad(). The result is on by default, and gets set by the OptimizationSolver.

Definition at line 835 of file solvers.hpp.

◆ SetEqualityConstraint()

void mfem::OptimizationProblem::SetEqualityConstraint ( const Vector c)

Definition at line 2314 of file solvers.cpp.

◆ SetInequalityConstraint()

void mfem::OptimizationProblem::SetInequalityConstraint ( const Vector dl,
const Vector dh 
)

Definition at line 2322 of file solvers.cpp.

◆ SetSolutionBounds()

void mfem::OptimizationProblem::SetSolutionBounds ( const Vector xl,
const Vector xh 
)

Definition at line 2332 of file solvers.cpp.

Friends And Related Function Documentation

◆ HiopOptimizationProblem

friend class HiopOptimizationProblem
friend

Definition at line 819 of file solvers.hpp.

Member Data Documentation

◆ C

const Operator* mfem::OptimizationProblem::C
protected

Not owned, some can remain unused (NULL).

Definition at line 828 of file solvers.hpp.

◆ c_e

const Vector* mfem::OptimizationProblem::c_e
protected

Definition at line 829 of file solvers.hpp.

◆ D

const Operator * mfem::OptimizationProblem::D
protected

Definition at line 828 of file solvers.hpp.

◆ d_hi

const Vector * mfem::OptimizationProblem::d_hi
protected

Definition at line 829 of file solvers.hpp.

◆ d_lo

const Vector * mfem::OptimizationProblem::d_lo
protected

Definition at line 829 of file solvers.hpp.

◆ input_size

const int mfem::OptimizationProblem::input_size

Definition at line 838 of file solvers.hpp.

◆ x_hi

const Vector * mfem::OptimizationProblem::x_hi
protected

Definition at line 829 of file solvers.hpp.

◆ x_lo

const Vector * mfem::OptimizationProblem::x_lo
protected

Definition at line 829 of file solvers.hpp.


The documentation for this class was generated from the following files: