|
Interior-point-optimisation
1.0-1
Interior-pointoptimisationlibrary
|
Model used for finding an initial feasible solution in phase I of interior-pont optimisation. More...
#include <PhaseIModel.hpp>


Public Member Functions | |
| PhaseIModel (Model &model) | |
| Constructor. More... | |
| double | getInitial_s (gsl::vector const &vector) const |
| Get an initial value for s from a vector of length one less than the number of variables of this model. More... | |
| bool | findFeasibleSolution () |
| Find a feasible solution to the base Model by partial optimisation of the PhaseIModel and copy the result to the variables of the base Model on success. More... | |
Public Member Functions inherited from ipo::Model | |
| Model () | |
| Constructor. More... | |
| virtual void | notify () |
| Notify function that model must implement. More... | |
| void | setObjective (Objective &objective) |
| Set the objective function. More... | |
| Objective | getObjective () |
| Get the objective function. More... | |
| void | addConstraint (Constraint &constraint) |
| Add a constraint. More... | |
| bool | removeConstraint (Constraint &constraint) |
| Remove a constraint. More... | |
| std::vector< Constraint > const & | getConstraints () const |
| Get list of constraints. More... | |
| std::vector< LinearConstraint > const & | getEqualityConstraints () const |
| Get list of equality constraints. More... | |
| bool | isFeasible () |
| Test whether current values of variables give a feasible solution. More... | |
| bool | isStrictlyFeasible () |
| Test whether current values of variables give a feasible solution. More... | |
| bool | minimise () |
| Try to minimise the objective function subject to the constraints. More... | |
| bool | maximise () |
| Try to maximise the objective function subject to the constraints. More... | |
| virtual bool | findFeasible () |
| Try to find a set of values for the variables that gives a feasible solution. More... | |
| Parameters & | getParameters () |
| Get parameters by reference. More... | |
| detail::NewtonDescent::Parameters & | getNewtonDescentParameters () |
| Get Newton descent parameters by reference. More... | |
| detail::LineSearch::Parameters & | getLineSearchParameters () |
| Get line search parameters by reference. More... | |
| bool | checkSize () const |
| Check objective and constraint functions. More... | |
| void | testSizes () const |
| Check objective and constraint functions. More... | |
| void | summary (std::ostream &ostream=std::cout) const |
| Create a summary of this model. More... | |
Private Member Functions | |
| bool | findEqualityConstraintFeasibleSolution () |
| Find a solution that satisfies equality constraints. More... | |
| virtual void | setIndices () |
| Sets the values of objectiveIndices, constraintIndices and variableIndices from Model. More... | |
Private Attributes | |
| Model & | model |
| The Model this is based on. More... | |
| std::map< Variable, Variable > | crossIndex |
| A map so we can look up Variable of this from Variable of model. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ipo::Model | |
| gsl::vector | getVectorFromVariables () const |
| Get a vector from values of variables. More... | |
| void | setVariablesFromVector (gsl::vector const &vector) |
| Set variable values from a vector. More... | |
| bool | stoppingCriterion (double const t) const |
| Check whether or not stopping criterion has been met. More... | |
| virtual bool | optimise (bool const minimise) |
| Try to optimise the objective function subject to the constraints. More... | |
| void | setObjectiveIndices () |
| Set objectiveIndices. More... | |
| void | setConstraintIndices () |
| Set constraintIndices. More... | |
Protected Attributes inherited from ipo::Model | |
| std::vector< Constraint > | constraints |
| The set of constraints. More... | |
| std::vector < ipo::LinearConstraint > | equalityConstraints |
| The set of equality constraints. More... | |
| Objective | objective |
| The objective function. More... | |
| std::shared_ptr< Subvector > | objectiveIndices |
| Used internally to match the variables in the objective to indices in a vector: objectiveIndices[i] is the index in a gsl::vector of the ith variable in objective.getVariables() after a call to setIndices(). More... | |
| std::vector< std::shared_ptr < Subvector > > | constraintIndices |
| Used internally to match the variables in each constraint to indices in a vector: (*constraintIndices[j])()[i] is the index in a gsl::vector of the ith variable in constraint[j]->getVariables() after a call to setIndices(). More... | |
| std::vector< std::shared_ptr < Subvector > > | equalityConstraintIndices |
| Used internally to match the variables in each equality constraint to indices in a vector: (*constraintIndices[j])()[i] is the index in a gsl::vector of the ith variable in * constraint[j]->getVariables() after a call to setIndices(). More... | |
| std::map< Variable, size_t > | indexMap |
| Used internally to match the variables in each variable to indices in a vector. More... | |
| bool | variablesChanged = false |
| Value that indicates if any variables, objective or constraints have been modified in such a way that we may have to update them. More... | |
| detail::NewtonDescent::Parameters | newtonDescentParameters |
| Parameters used by Newton descent algorithm during optimisation. More... | |
| detail::LineSearch::Parameters | lineSearchParameters |
| Parameters used by backtracking line search algorithm during optimisation. More... | |
Model used for finding an initial feasible solution in phase I of interior-pont optimisation.
This model needs to be based on another model, which is provided with its constructor.
Definition at line 36 of file PhaseIModel.hpp.
| PhaseIModel::PhaseIModel | ( | Model & | model | ) |
Constructor.
Definition at line 28 of file PhaseIModel.cc.
References ipo::Model::lineSearchParameters, ipo::Model::newtonDescentParameters, ipo::Model::parameters, setIndices(), and ipo::Model::variablesChanged.
|
private |
Find a solution that satisfies equality constraints.
Set variables to the values found.
Definition at line 294 of file PhaseIModel.cc.
References crossIndex, ipo::Model::equalityConstraints, ipo::Model::indexMap, IPOE, model, setIndices(), and ipo::Variable::setValue().
Referenced by findFeasibleSolution().
| bool PhaseIModel::findFeasibleSolution | ( | ) |
Find a feasible solution to the base Model by partial optimisation of the PhaseIModel and copy the result to the variables of the base Model on success.
Definition at line 253 of file PhaseIModel.cc.
References crossIndex, findEqualityConstraintFeasibleSolution(), getInitial_s(), ipo::Model::getNewtonDescentParameters(), ipo::Model::indexMap, ipo::Model::isStrictlyFeasible(), ipo::Model::minimise(), model, setIndices(), ipo::detail::NewtonDescent::Parameters::setPhaseI(), and ipo::Model::setVariablesFromVector().
Referenced by ipo::Model::findFeasible().
| double PhaseIModel::getInitial_s | ( | gsl::vector const & | vector | ) | const |
Get an initial value for s from a vector of length one less than the number of variables of this model.
| vector | A vector: (vector,s) will be an initial feasible solution for PhaseIModel on return |
| IPOException | if vector has wrong length |
Definition at line 37 of file PhaseIModel.cc.
References ipo::Model::constraintIndices, ipo::Model::constraints, ipo::Model::indexMap, ipo::infinity, IPOE, lowerBound, ipo::minusInfinity, model, ipo::Model::setIndices(), and upperBound.
Referenced by findFeasibleSolution().
|
privatevirtual |
Sets the values of objectiveIndices, constraintIndices and variableIndices from Model.
This is called when the model is initialised and can be called again if Model changes.
Reimplemented from ipo::Model.
Definition at line 83 of file PhaseIModel.cc.
References ipo::Model::constraintIndices, ipo::Model::constraints, crossIndex, ipo::Model::equalityConstraints, ipo::detail::ModelFunction::getFunction(), ipo::Variable::getName(), ipo::Array::getName(), ipo::Objective::getVariables(), ipo::Model::indexMap, ipo::infinity, lowerBound, ipo::minusInfinity, model, name, ipo::Model::objective, ipo::Array::push_back(), ipo::Model::setConstraintIndices(), ipo::Model::setIndices(), ipo::Model::setObjectiveIndices(), upperBound, and ipo::Model::variablesChanged.
Referenced by findEqualityConstraintFeasibleSolution(), findFeasibleSolution(), and PhaseIModel().
A map so we can look up Variable of this from Variable of model.
Definition at line 80 of file PhaseIModel.hpp.
Referenced by findEqualityConstraintFeasibleSolution(), findFeasibleSolution(), and setIndices().
|
private |
The Model this is based on.
Definition at line 76 of file PhaseIModel.hpp.
Referenced by findEqualityConstraintFeasibleSolution(), findFeasibleSolution(), getInitial_s(), and setIndices().