Minotaur 0.4.1
Docs for developers
Classes | Public Member Functions | List of all members
Minotaur::SimpleTransformer Class Reference

Class for reformulating a problem using simple rules so that handlers can be applied to it. More...

#include <SimpleTransformer.h>

Inheritance diagram for Minotaur::SimpleTransformer:
Inheritance graph
[legend]
Collaboration diagram for Minotaur::SimpleTransformer:
Collaboration graph
[legend]

Public Member Functions

 SimpleTransformer ()
 Default Constructor.
 
 SimpleTransformer (EnvPtr env, ProblemPtr p, LPEnginePtr bte, LPEnginePtr cute, EnginePtr nlpe)
 Constructor.
 
 ~SimpleTransformer ()
 Destroy.
 
std::string getName () const
 Get the name of this Transformer. More...
 
SolutionPtr getSolOrig (ConstSolutionPtr sol, int &err)
 Translate the solution of reformulated problem into that of original problem. More...
 
SolutionPtr getSolTrans (ConstSolutionPtr sol, int &err)
 Translate the solution of originial problem into that of reformulated problem. More...
 
void reformulate (ProblemPtr &newp, HandlerVector &handlers, int &status)
 Perform the reformulation, and assign handlers. More...
 
void writeStats (std::ostream &out) const
 
- Public Member Functions inherited from Minotaur::Transformer
 Transformer ()
 Default Constructor.
 
 Transformer (EnvPtr env, ProblemPtr oldp)
 Constructor.
 
virtual ~Transformer ()
 Destroy.
 
virtual std::string getName () const =0
 Get the name of this Transformer. More...
 
virtual SolutionPtr getSolOrig (ConstSolutionPtr sol, int &err)=0
 Translate the solution of reformulated problem into that of original problem. More...
 
virtual SolutionPtr getSolTrans (ConstSolutionPtr sol, int &err)=0
 Translate the solution of originial problem into that of reformulated problem. More...
 
virtual void reformulate (ProblemPtr &newp, HandlerVector &handlers, int &status)=0
 Perform the reformulation, and assign handlers. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Minotaur::Transformer
bool allConsAssigned_ (ProblemPtr p, HandlerVector &handlers)
 Check if all constraints in a problem have been assigned to a handler. More...
 
void assignHandler_ (CGraphPtr cg, ConstraintPtr c)
 Assign an appropriate handler to a nonlinear constraint of the form $y_i = f(x)$. More...
 
void clearUnusedHandlers_ (HandlerVector &handlers)
 Delete unused handlers. More...
 
void copyLinear_ (ConstProblemPtr p, ProblemPtr newp)
 Copy all the linear constraints of the problem into the new problem. More...
 
void copyVars_ (ConstProblemPtr p, ProblemPtr newp)
 Copy all the linear constraints of the problem into the new problem. More...
 
virtual void makeObjLin_ ()
 
void minObj_ ()
 Convert a maximization objective into minimization.
 
VariablePtr newVar_ (VariablePtr iv, double d, ProblemPtr newp)
 Find the auxiliary variable associated with $y_i = x_j+d$ or create a new one. More...
 
VariablePtr newVar_ (LinearFunctionPtr lf, double d, ProblemPtr newp)
 Find the auxiliary variable associated with $y_i = c^Tx+d$ or create a new one. More...
 
VariablePtr newVar_ (CGraphPtr cg, ProblemPtr newp)
 Find the auxiliary variable associated with $y_i = f(x)+d$ or create a new one. More...
 
- Protected Attributes inherited from Minotaur::Transformer
EnvPtr env_
 The pointer to environment.
 
LinearHandlerPtr lHandler_
 Handler for linear constraints and variables.
 
LoggerPtr logger_
 Logger.
 
ProblemPtr newp_
 The transformed problem.
 
ProblemPtr p_
 The original problem.
 
kPowHandlerPtr kHandler_
 Handler for y = x^k type constraints.
 
QuadHandlerPtr qHandler_
 Handler for quadratic terms.
 
CxUnivarHandlerPtr uHandler_
 Handler for univariate constraints.
 
UnivarQuadHandlerPtr uqHandler_
 Handler for univariate quadratic constraints.
 
YEqLFsyLfs_
 Storage for auxiliary variables defined by relations of the form $y_i = c^Tx + d$.
 
YEqUCGsyUniExprs_
 Storage for auxiliary variables defined by relations of the form $y_i = f(x_j)$.
 
YEqVarsyVars_
 Storage for auxiliary variables defined by relations of the form $y_i = x_j + d$.
 
const double zTol_
 Tolerance for checking if a value is zero.
 

Detailed Description

Class for reformulating a problem using simple rules so that handlers can be applied to it.

No multilinear terms are created. QuadHandler is used only for terms $y=x_1x_2$. Squares etc. are handled by PowerHandler. ExpHandler takes care of exponential functions, and LogHandler handles logarithms. TrigHandler is used for trigonometric functions. Mainly used to teach Ashu some global optimization.

Member Function Documentation

◆ getName()

std::string SimpleTransformer::getName ( ) const
virtual

Get the name of this Transformer.

Implements Minotaur::Transformer.

◆ getSolOrig()

SolutionPtr SimpleTransformer::getSolOrig ( ConstSolutionPtr  sol,
int &  err 
)
virtual

Translate the solution of reformulated problem into that of original problem.

Parameters
[in]solSolution of the reformulated problem.
[out]errZero if no error is encountered, nonzero otherwise.
Returns
Solution of original problem.

Implements Minotaur::Transformer.

◆ getSolTrans()

SolutionPtr SimpleTransformer::getSolTrans ( ConstSolutionPtr  sol,
int &  err 
)
virtual

Translate the solution of originial problem into that of reformulated problem.

Parameters
[in]solSolution of the original problem.
[out]errZero if no error is encountered, nonzero otherwise.
Returns
Solution of the reformulated problem.

Implements Minotaur::Transformer.

◆ reformulate()

void SimpleTransformer::reformulate ( ProblemPtr newp,
HandlerVector &  handlers,
int &  status 
)
virtual

Perform the reformulation, and assign handlers.

Parameters
[out]newpThe new, reformulated problem.
[out]handlersA vector of handlers used to reformulate the problem.
[out]statusZero if reformulated successfully. Nonzero otherwise.

Implements Minotaur::Transformer.


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

Minotaur source code documented by Doxygen 1.9.4 on Sat May 17 2025