Minotaur 0.4.1
Docs for developers
Public Member Functions | Protected Attributes | List of all members
Minotaur::Solution Class Reference
Inheritance diagram for Minotaur::Solution:
Inheritance graph
[legend]
Collaboration diagram for Minotaur::Solution:
Collaboration graph
[legend]

Public Member Functions

 Solution ()
 Default constructor.
 
 Solution (double objval, const double *x, ProblemPtr problem)
 Construct a solution for a problem from an array of doubles.
 
 Solution (double objvalue, const DoubleVector &newx, ProblemPtr problem)
 Construct a solution for a problem from a vector of doubles.
 
 Solution (ConstSolutionPtr sol)
 Copy.
 
virtual ~Solution ()
 Destroy.
 
virtual void setPrimal (const double *x)
 Copy values of variables.
 
virtual void setDualOfCons (const double *vals)
 Copy values of dual variables of constraints.
 
virtual void setDualOfVars (const double *vals)
 Copy values of dual variables of variables. More...
 
virtual void setObjValue (double new_val)
 Set a new solution value.
 
virtual double getObjValue () const
 Return solution value.
 
virtual double getConstraintViolation ()
 Return the 2nd norm of constraint violations.
 
virtual const double * getPrimal () const
 Return a pointer to the solution.
 
virtual const double * getDualOfCons () const
 Return a pointer to the solution.
 
virtual const double * getDualOfVars () const
 Return a pointer to the solution.
 
virtual void write (std::ostream &out) const
 Write to a stream. More...
 
virtual void writePrimal (std::ostream &out, const VarVector *v=0) const
 Write primal values to a stream.
 
virtual void writeDual (std::ostream &out) const
 Write dual values to a stream.
 

Protected Attributes

UInt n_
 Number of variables.
 
UInt m_
 Number of constraints.
 
ProblemPtr problem_
 Original problem (For accessing variable names).
 
double * x_
 Store values of the variables in an array.
 
double * dualCons_
 
double * dualX_
 
double consViol_
 Violation.
 
double objValue_
 The objective value of this solution.
 
double comple_
 Complementarity.
 

Member Function Documentation

◆ setDualOfVars()

void Solution::setDualOfVars ( const double *  vals)
virtual

Copy values of dual variables of variables.

Reimplemented in Minotaur::IpoptSolution, and Minotaur::UnoSolution.

◆ write()

void Solution::write ( std::ostream &  out) const
virtual

Write to a stream.

Reimplemented in Minotaur::IpoptSolution, and Minotaur::UnoSolution.

Member Data Documentation

◆ dualCons_

double* Minotaur::Solution::dualCons_
protected

Store values of the dual variables associated with constraints in an array.

◆ dualX_

double* Minotaur::Solution::dualX_
protected

Store values of the dual variables associated with bounds on variables in an array.


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

Minotaur source code documented by Doxygen 1.9.4 on Thu Apr 24 2025