OSResult Class Reference

The Result Class. More...

#include <OSResult.h>

Collaboration diagram for OSResult:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 OSResult ()
 Default constructor.
 ~OSResult ()
 Class destructor.
GeneralStatusgetGeneralStatus ()
 Get the general status.
std::string getGeneralStatusType ()
 Get the general status type, which can be: success, error, warning.
std::string getGeneralStatusDescription ()
 Get the general status description.
std::string getServiceName ()
 Get service name.
std::string getServiceURI ()
 Get service uri.
std::string getInstanceName ()
 Get instance name.
std::string getJobID ()
 Get the job id.
std::string getGeneralMessage ()
 Get the general message.
int getTimeNumber ()
 Get the number of time measurements.
double getTimeValue ()
 Get the time measurement.
std::vector< IndexValuePair * > getOptimalPrimalVariableValues (int solIdx)
 Get one solution of optimal primal variable values.
double getOptimalObjValue (int objIdx, int solIdx)
 Get one solution of optimal objective values.
std::vector< IndexValuePair * > getOptimalDualVariableValues (int solIdx)
 Get one solution of optimal dual variable values.
OptimizationSolutionStatusgetSolutionStatus (int solIdx)
 Get the [i]th optimization solution status, where i equals the given solution index.
std::string getSolutionStatusType (int solIdx)
 Get the [i]th optimization solution status type, where i equals the given solution index.
std::string getSolutionStatusDescription (int solIdx)
 Get the [i]th optimization solution status description, where i equals the given solution index.
std::string getSolutionMessage (int solIdx)
 Get the [i]th optimization solution message, where i equals the given solution index.
int getVariableNumber ()
 Get variable number.
int getObjectiveNumber ()
 Get objective number.
int getConstraintNumber ()
 Get constraint number.
int getSolutionNumber ()
 get the number of solutions.
int getNumberOfOtherVariableResults (int solIdx)
 Get numberOfOtherVariableResult.
int getAnOtherVariableResultNumberOfVar (int solIdx, int iOther)
 Get getAnOtherVariableResultNumberOfVar.
bool setGeneralStatus (GeneralStatus *status)
 Set the general status.
bool setGeneralStatusType (std::string type)
 Set the general status type, which can be: success, error, warning.
bool setGeneralStatusDescription (std::string description)
 Set the general status description.
bool setGeneralMessage (std::string message)
 Set the general message.
bool setServiceName (std::string serviceName)
 Set service name.
bool setServiceURI (std::string serviceURI)
 Set service uri.
bool setInstanceName (std::string instanceName)
 Set instance name.
bool setJobID (std::string jobID)
 Set job id.
bool setTime (double time)
 Set time.
bool addTimingInformation (std::string type, std::string category, std::string unit, std::string description, double value)
 Add timing information.
bool setTimeNumber (int timeNumber)
 Set the number of time measurements.
bool setVariableNumber (int variableNumber)
 Set the variable number.
bool setObjectiveNumber (int objectiveNumber)
 Set the objective number.
bool setConstraintNumber (int constraintNumber)
 Set the constraint number.
bool setSolutionNumber (int number)
 set the number of solutions.
bool setSolutionStatus (int solIdx, std::string type, std::string description)
 Set the [i]th optimization solution status, where i equals the given solution index.
bool setSolutionTargetObjectiveIdx (int solIdx, int objectiveIdx)
 Set the [i]th optimization solution's objective index, where i equals the given solution index.
bool setSolutionMessage (int solIdx, std::string msg)
 Set the [i]th optimization solution's message, where i equals the given solution index.
bool setNumberOfPrimalVariableValues (int solIdx, int n)
 Set the [i]th optimization solution's number of primal variable values, where i equals the given solution index.
bool setPrimalVariableValuesSparse (int solIdx, std::vector< IndexValuePair * > x)
 Set the [i]th optimization solution's primal variable values, where i equals the given solution index.
bool setPrimalVariableValuesDense (int solIdx, double *x)
 Set the [i]th optimization solution's primal variable values, where i equals the given solution index.
bool setNumberOfOtherVariableResults (int solIdx, int numberOfOtherVariableResults)
 Set the [i]th optimization solution's other (non-standard/solver specific)variable-related results, where i equals the given solution index.
bool setAnOtherVariableResultSparse (int solIdx, int otherIdx, std::string name, std::string value, std::string description, int *idx, std::string *s, int n)
 Set the [i]th optimization solution's other (non-standard/solver specific)variable-related results, where i equals the given solution index.
bool setAnOtherVariableResultDense (int solIdx, int otherIdx, std::string name, std::string value, std::string description, std::string *s)
 Set the [i]th optimization solution's other (non-standard/solver specific)variable-related results, where i equals the given solution index.
bool setNumberOfObjectiveValues (int solIdx, int n)
 Set the [i]th optimization solution's number of objective values, where i equals the given solution index.
bool setObjectiveValuesSparse (int solIdx, std::vector< IndexValuePair * > x)
 Set the [i]th optimization solution's objective values, where i equals the given solution index.
bool setObjectiveValuesDense (int solIdx, double *objectiveValues)
 Set the [i]th optimization solution's objective values, where i equals the given solution index.
bool setNumberOfDualVariableValues (int solIdx, int n)
 Set the [i]th optimization solution's number of dual variable values, where i equals the given solution index.
bool setDualVariableValuesSparse (int solIdx, std::vector< IndexValuePair * > x)
 Set the [i]th optimization solution's dual variable values, where i equals the given solution index.
bool setDualVariableValuesDense (int solIdx, double *y)
 Set the [i]th optimization solution's dual variable values, where i equals the given solution index.
bool setConstraintValuesDense (int solIdx, double *constraintValues)
 Set the [i]th optimization solution's constraint values, where i equals the given solution index.
 OSResult ()
 Default constructor.
 ~OSResult ()
 Class destructor.
GeneralStatusgetGeneralStatus ()
 Get the general status.
std::string getGeneralStatusType ()
 Get the general status type, which can be: success, error, warning.
std::string getGeneralStatusDescription ()
 Get the general status description.
std::string getServiceName ()
 Get service name.
std::string getServiceURI ()
 Get service uri.
std::string getInstanceName ()
 Get instance name.
std::string getJobID ()
 Get the job id.
std::string getGeneralMessage ()
 Get the general message.
int getTimeNumber ()
 Get the number of time measurements.
double getTimeValue ()
 Get the time measurement.
double * getOptimalPrimalVariableValues (int objIdx)
 Get one solution of optimal primal variable values.
double * getOptimalDualVariableValues (int objIdx)
 Get one solution of optimal dual variable values.
OptimizationSolutionStatusgetSolutionStatus (int solIdx)
 Get the [i]th optimization solution status, where i equals the given solution index.
std::string getSolutionStatusType (int solIdx)
 Get the [i]th optimization solution status type, where i equals the given solution index.
std::string getSolutionStatusDescription (int solIdx)
 Get the [i]th optimization solution status description, where i equals the given solution index.
std::string getSolutionMessage (int solIdx)
 Get the [i]th optimization solution message, where i equals the given solution index.
int getVariableNumber ()
 Get variable number.
int getObjectiveNumber ()
 Get objective number.
int getConstraintNumber ()
 Get constraint number.
int getSolutionNumber ()
 get the number of solutions.
int getNumberOfOtherVariableResults (int solIdx)
 Get numberOfOtherVariableResult.
bool setGeneralStatus (GeneralStatus *status)
 Set the general status.
bool setGeneralStatusType (std::string type)
 Set the general status type, which can be: success, error, warning.
bool setGeneralStatusDescription (std::string description)
 Set the general status description.
bool setGeneralMessage (std::string message)
 Set the general message.
bool setServiceName (std::string serviceName)
 Set service name.
bool setServiceURI (std::string serviceURI)
 Set service uri.
bool setInstanceName (std::string instanceName)
 Set instance name.
bool setJobID (std::string jobID)
 Set job id.
bool setTime (double time)
 Set time.
bool addTimingInformation (std::string type, std::string category, std::string unit, std::string description, double value)
 Add timing information.
bool setTimeNumber (int timeNumber)
 Set the number of time measurements.
bool setVariableNumber (int variableNumber)
 Set the variable number.
bool setObjectiveNumber (int objectiveNumber)
 Set the objective number.
bool setConstraintNumber (int constraintNumber)
 Set the constraint number.
bool setSolutionNumber (int number)
 set the number of solutions.
bool setSolutionStatus (int solIdx, std::string type, std::string description)
 Set the [i]th optimization solution status, where i equals the given solution index.
bool setSolutionObjectiveIndex (int solIdx, int objectiveIdx)
 Set the [i]th optimization solution's objective index, where i equals the given solution index.
bool setNumberOfPrimalVariableValues (int solIdx, int n)
 Set the [i]th optimization solution's number of primal variable values, where i equals the given solution index.
bool setPrimalVariableValues (int solIdx, double *x, int n)
 Set the [i]th optimization solution's primal variable values, where i equals the given solution index.
bool setNumberOfOtherVariableResults (int solIdx, int numberOfOtherVariableResults)
 Set the [i]th optimization solution's other (non-standard/solver specific)variable-related results, where i equals the given solution index.
bool setAnOtherVariableResult (int solIdx, int otherIdx, std::string name, std::string description, int *indexes, std::string *s, int n)
 Set the [i]th optimization solution's other (non-standard/solver specific)variable-related results, where i equals the given solution index.
bool setObjectiveValues (int solIdx, double *objectiveValues, int n)
 Set the [i]th optimization solution's objective values, where i equals the given solution index.
bool setDualVariableValues (int solIdx, double *lbValues, double *ubValues, int n)
 Set the [i]th optimization solution's dual variable values, where i equals the given solution index.
bool setDualVariableValues (int solIdx, double *y, int n)
 Set the [i]th optimization solution's dual variable values, where i equals the given solution index.
bool setConstraintValues (int solIdx, double *constraintValues, int n)
 Set the [i]th optimization solution's constraint values, where i equals the given solution index.

Public Attributes

GeneralResultgeneral
 general holds the first child of the OSResult specified by the OSrL Schema.
SystemResultsystem
 system holds the second child of the OSResult specified by the OSrL Schema.
ServiceResultservice
 service holds the third child of the OSResult specified by the OSrL Schema.
JobResultjob
 job holds the fourth child of the OSResult specified by the OSrL Schema.
OptimizationResultoptimization
 optimization holds the fifth child of the OSResult specified by the OSrL Schema.
int m_iVariableNumber
 m_iVariableNumber holds the variable number.
int m_iObjectiveNumber
 m_iObjectiveNumber holds the objective number.
int m_iConstraintNumber
 m_iConstraintNumber holds the constraint number.
int m_iNumberOfOtherVariableResults
 m_iNumberOfOtherVariableResults holds the number of OtherVariableResult objects.
double * m_mdPrimalValues
 m_mdPrimalValues a vector of primal variables.
double * m_mdDualValues
 m_mdDualValues a vector of dual variables.
std::vector< IndexValuePair * > primalVals
std::vector< IndexValuePair * > dualVals
GeneralResultgeneral
 general holds the first child of the OSResult specified by the OSrL Schema.
SystemResultsystem
 system holds the second child of the OSResult specified by the OSrL Schema.
ServiceResultservice
 service holds the third child of the OSResult specified by the OSrL Schema.
JobResultjob
 job holds the fourth child of the OSResult specified by the OSrL Schema.
OptimizationResultoptimization
 optimization holds the fifth child of the OSResult specified by the OSrL Schema.
double * m_mdPrimalValues
 m_mdPrimalValues a vector of primal variables.
double * m_mdDualValues
 m_mdDualValues a vector of primal variables.

Detailed Description

The Result Class.

Author:
Robert Fourer, Horand Gassmann, Jun Ma, Kipp Martin
Version:
1.0, 03/14/2004
Since:
OS 1.0
Remarks:
A class for holding all the solution information.

Definition at line 1351 of file OSResult.h.


Constructor & Destructor Documentation

OSResult::OSResult (  ) 

Default constructor.

Definition at line 33 of file OSResult.cpp.

References general, job, optimization, service, and system.

OSResult::~OSResult (  ) 

Class destructor.

Definition at line 52 of file OSResult.cpp.

References dualVals, general, job, k, m_mdDualValues, m_mdPrimalValues, optimization, primalVals, service, and system.

OSResult::OSResult (  ) 

Default constructor.

OSResult::~OSResult (  ) 

Class destructor.


Member Function Documentation

GeneralStatus * OSResult::getGeneralStatus (  ) 

Get the general status.

Returns:
the general status.

Definition at line 720 of file OSResult.cpp.

References general, and GeneralResult::generalStatus.

string OSResult::getGeneralStatusType (  ) 

Get the general status type, which can be: success, error, warning.

Returns:
the general status type, null if none.

Definition at line 725 of file OSResult.cpp.

References general, GeneralResult::generalStatus, and GeneralStatus::type.

string OSResult::getGeneralStatusDescription (  ) 

Get the general status description.

Returns:
the general status description, null or empty std::string if none.

Definition at line 730 of file OSResult.cpp.

References GeneralStatus::description, general, and GeneralResult::generalStatus.

string OSResult::getServiceName (  ) 

Get service name.

Returns:
the service name.

Definition at line 735 of file OSResult.cpp.

References general, and GeneralResult::serviceName.

string OSResult::getServiceURI (  ) 

Get service uri.

Returns:
the service uri.

Definition at line 739 of file OSResult.cpp.

References general, and GeneralResult::serviceURI.

string OSResult::getInstanceName (  ) 

Get instance name.

Returns:
the instance name.

Definition at line 743 of file OSResult.cpp.

References general, and GeneralResult::instanceName.

string OSResult::getJobID (  ) 

Get the job id.

Returns:
the job id.

Definition at line 747 of file OSResult.cpp.

References general, and GeneralResult::jobID.

string OSResult::getGeneralMessage (  ) 

Get the general message.

Returns:
the general message.

Definition at line 752 of file OSResult.cpp.

References general, and GeneralResult::message.

int OSResult::getTimeNumber (  ) 

Get the number of time measurements.

Returns:
the number of time measurements

Definition at line 765 of file OSResult.cpp.

References job, TimingInformation::numberOfTimes, and JobResult::timingInformation.

double OSResult::getTimeValue (  ) 

Get the time measurement.

In the first instance, assume that there is only a single measure, which is the total elapsed time in seconds

Returns:
the time measurement

Definition at line 757 of file OSResult.cpp.

References job, TimingInformation::numberOfTimes, TimingInformation::time, JobResult::timingInformation, and Time::value.

double * OSResult::getOptimalPrimalVariableValues ( int  solIdx  ) 

Get one solution of optimal primal variable values.

Parameters:
solIdx holds the solution index the optimal solution corresponds to.
Returns:
a vector of variable indexes and values, an empty vector if no optimal value.

Definition at line 849 of file OSResult.cpp.

References getSolutionNumber(), IndexValuePair::idx, m_mdPrimalValues, optimization, primalVals, OptimizationResult::solution, OptimizationSolution::status, OptimizationSolutionStatus::type, IndexValuePair::value, VariableSolution::values, VariableValues::var, and OptimizationSolution::variables.

Referenced by getOSResult(), and main().

double OSResult::getOptimalObjValue ( int  objIdx,
int  solIdx 
)

Get one solution of optimal objective values.

Parameters:
objIdx holds the objective index the optimal value corresponds to.
solIdx holds the solution index the optimal value corresponds to.
Returns:
a double with the optimal objective function value.

Definition at line 915 of file OSResult.cpp.

References ErrorClass::errormsg, and getSolutionNumber().

Referenced by getOSResult(), and main().

double * OSResult::getOptimalDualVariableValues ( int  solIdx  ) 

Get one solution of optimal dual variable values.

Parameters:
solIdx holds the solution index the optimal solution corresponds to.
Returns:
a vector of variable indexes and values, an empty vector if no optimal value.

Definition at line 888 of file OSResult.cpp.

References DualVariableValues::con, OptimizationSolution::constraints, dualVals, ConstraintSolution::dualValues, getSolutionNumber(), IndexValuePair::idx, m_mdDualValues, optimization, OptimizationResult::solution, OptimizationSolution::status, OptimizationSolutionStatus::type, and IndexValuePair::value.

Referenced by main().

OptimizationSolutionStatus * OSResult::getSolutionStatus ( int  solIdx  ) 

Get the [i]th optimization solution status, where i equals the given solution index.

The solution status includes the status type, optional descriptions and possibly substatuses.

Parameters:
solIdx holds the solution index to get the solution status.
Returns:
the optimization solution status that corresponds to solIdx, null if none.
See also:
org.optimizationservices.oscommon.datastructure.osresult.OptimizationSolutionStatus

Definition at line 815 of file OSResult.cpp.

References OptimizationResult::numberOfSolutions, optimization, OptimizationResult::solution, and OptimizationSolution::status.

string OSResult::getSolutionStatusType ( int  solIdx  ) 

Get the [i]th optimization solution status type, where i equals the given solution index.

The solution status type can be: unbounded, globallyOptimal, locallyOptimal, optimal, bestSoFar, feasible, infeasible, stoppedByLimit, unsure, error, other

Parameters:
solIdx holds the solution index to get the solution status type.
Returns:
the optimization solution status type that corresponds to solIdx, null or empty std::string if none.

Definition at line 823 of file OSResult.cpp.

References OptimizationResult::numberOfSolutions, optimization, OptimizationResult::solution, OptimizationSolution::status, and OptimizationSolutionStatus::type.

Referenced by getOSResult(), and main().

string OSResult::getSolutionStatusDescription ( int  solIdx  ) 

Get the [i]th optimization solution status description, where i equals the given solution index.

Parameters:
solIdx holds the solution index to get the solution status description.
Returns:
the optimization solution status description that corresponds to solIdx, null or empty std::string if none.

Definition at line 832 of file OSResult.cpp.

References OptimizationSolutionStatus::description, OptimizationResult::numberOfSolutions, optimization, OptimizationResult::solution, and OptimizationSolution::status.

Referenced by getOSResult().

string OSResult::getSolutionMessage ( int  solIdx  ) 

Get the [i]th optimization solution message, where i equals the given solution index.

Parameters:
solIdx holds the solution index to get the solution message.
Returns:
the optimization solution message that corresponds to solIdx, null or empty if none.

Definition at line 841 of file OSResult.cpp.

References OptimizationSolution::message, OptimizationResult::numberOfSolutions, optimization, and OptimizationResult::solution.

int OSResult::getVariableNumber (  ) 

Get variable number.

Returns:
variable number, -1 if no information.

Definition at line 772 of file OSResult.cpp.

References m_iVariableNumber, OptimizationResult::numberOfVariables, and optimization.

Referenced by main(), setNumberOfPrimalVariableValues(), and setPrimalVariableValuesDense().

int OSResult::getObjectiveNumber (  ) 

Get objective number.

Returns:
objective number, -1 if no information.

Definition at line 782 of file OSResult.cpp.

References m_iObjectiveNumber, OptimizationResult::numberOfObjectives, and optimization.

Referenced by setNumberOfObjectiveValues(), and setObjectiveValuesDense().

int OSResult::getConstraintNumber (  ) 

Get constraint number.

Returns:
constraint number, -1 if no information.

Definition at line 791 of file OSResult.cpp.

References m_iConstraintNumber, OptimizationResult::numberOfConstraints, and optimization.

Referenced by main(), setConstraintValuesDense(), setDualVariableValuesDense(), and setNumberOfDualVariableValues().

int OSResult::getSolutionNumber (  ) 

get the number of solutions.

Returns:
the number of solutions, 0 if none.

Definition at line 799 of file OSResult.cpp.

References OptimizationResult::numberOfSolutions, optimization, and OptimizationResult::solution.

Referenced by getAnOtherVariableResultNumberOfVar(), getOptimalDualVariableValues(), getOptimalObjValue(), getOptimalPrimalVariableValues(), setConstraintValues(), setConstraintValuesDense(), setDualVariableValues(), setDualVariableValuesDense(), setDualVariableValuesSparse(), setNumberOfDualVariableValues(), setNumberOfObjectiveValues(), setNumberOfOtherVariableResults(), setNumberOfPrimalVariableValues(), setObjectiveValues(), setObjectiveValuesDense(), setObjectiveValuesSparse(), setPrimalVariableValues(), setPrimalVariableValuesDense(), setPrimalVariableValuesSparse(), setSolutionMessage(), setSolutionObjectiveIndex(), and setSolutionTargetObjectiveIdx().

int OSResult::getNumberOfOtherVariableResults ( int  solIdx  ) 

Get numberOfOtherVariableResult.

Returns:
numberOfOtherVariableResult, -1 if no information.

Definition at line 806 of file OSResult.cpp.

References m_iNumberOfOtherVariableResults, VariableSolution::numberOfOtherVariableResults, optimization, VariableSolution::other, OptimizationResult::solution, and OptimizationSolution::variables.

int OSResult::getAnOtherVariableResultNumberOfVar ( int  solIdx,
int  iOther 
)

Get getAnOtherVariableResultNumberOfVar.

Returns:
the number of variables in the i'th other variable result, -1 if no information.

Definition at line 877 of file OSResult.cpp.

References getSolutionNumber(), VariableSolution::numberOfOtherVariableResults, OtherVariableResult::numberOfVar, optimization, VariableSolution::other, OptimizationResult::solution, and OptimizationSolution::variables.

bool OSResult::setGeneralStatus ( GeneralStatus status  ) 

Set the general status.

Parameters:
status holds the general status.
Returns:
whether the general status is set successfully.

Definition at line 942 of file OSResult.cpp.

References general, and GeneralResult::generalStatus.

bool OSResult::setGeneralStatusType ( std::string  type  ) 

Set the general status type, which can be: success, error, warning.

Parameters:
type holds the general status type
Returns:
whether the general status type is set successfully or not.

Referenced by LindoSolver::buildSolverInstance(), KnitroSolver::buildSolverInstance(), IpoptSolver::buildSolverInstance(), CouenneSolver::buildSolverInstance(), CoinSolver::buildSolverInstance(), BonminSolver::buildSolverInstance(), IpoptProblem::finalize_solution(), LindoSolver::generateLindoModel(), CoinSolver::getCoinSolverType(), getJobID(), kill(), knock(), main(), LindoSolver::optimize(), LindoSolver::processConstraints(), LindoSolver::processNonlinearExpressions(), LindoSolver::processQuadraticTerms(), LindoSolver::processVariables(), retrieve(), send(), CoinSolver::setCoinPackedMatrix(), LindoSolver::setSolverOptions(), IpoptSolver::setSolverOptions(), CouenneSolver::setSolverOptions(), BonminSolver::setSolverOptions(), LindoSolver::solve(), KnitroSolver::solve(), IpoptSolver::solve(), CouenneSolver::solve(), CoinSolver::solve(), BonminSolver::solve(), CouenneSolver::writeResult(), CoinSolver::writeResult(), and BonminSolver::writeResult().

bool OSResult::setGeneralStatusDescription ( std::string  description  ) 

Set the general status description.

Parameters:
description holds the general status description.
Returns:
whether the general status description is set successfully or not.

bool OSResult::setGeneralMessage ( std::string  message  ) 

Set the general message.

Parameters:
message holds the general message.
Returns:
whether process message is set successfully.

Referenced by LindoSolver::buildSolverInstance(), KnitroSolver::buildSolverInstance(), IpoptSolver::buildSolverInstance(), CouenneSolver::buildSolverInstance(), CoinSolver::buildSolverInstance(), BonminSolver::buildSolverInstance(), IpoptProblem::finalize_solution(), LindoSolver::generateLindoModel(), CoinSolver::getCoinSolverType(), getJobID(), kill(), knock(), main(), LindoSolver::optimize(), LindoSolver::processConstraints(), LindoSolver::processNonlinearExpressions(), LindoSolver::processQuadraticTerms(), LindoSolver::processVariables(), retrieve(), send(), CoinSolver::setCoinPackedMatrix(), LindoSolver::setSolverOptions(), IpoptSolver::setSolverOptions(), CouenneSolver::setSolverOptions(), BonminSolver::setSolverOptions(), LindoSolver::solve(), KnitroSolver::solve(), IpoptSolver::solve(), CouenneSolver::solve(), CoinSolver::solve(), BonminSolver::solve(), CouenneSolver::writeResult(), and BonminSolver::writeResult().

bool OSResult::setServiceName ( std::string  serviceName  ) 

Set service name.

Parameters:
serviceName holds the name of the service.
Returns:
whether the service name is set successfully.

Referenced by IpoptProblem::finalize_solution(), main(), LindoSolver::optimize(), KnitroSolver::solve(), CouenneSolver::solve(), CoinSolver::solve(), BonminSolver::solve(), CouenneSolver::writeResult(), and BonminSolver::writeResult().

bool OSResult::setServiceURI ( std::string  serviceURI  ) 

Set service uri.

Parameters:
serviceURI holds the uri of the service.
Returns:
whether the service uri is set successfully.

bool OSResult::setInstanceName ( std::string  instanceName  ) 

Set instance name.

Parameters:
instanceName holds the name of the instance.
Returns:
whether the instance name is set successfully.

Referenced by IpoptProblem::finalize_solution(), main(), LindoSolver::optimize(), KnitroSolver::solve(), CouenneSolver::solve(), CoinSolver::solve(), BonminSolver::solve(), CouenneSolver::writeResult(), and BonminSolver::writeResult().

bool OSResult::setJobID ( std::string  jobID  ) 

Set job id.

Parameters:
jobID holds the job id.
Returns:
whether the job id is set successfully.

bool OSResult::setTime ( double  time  ) 

Set time.

Parameters:
time holds the time.
Returns:
whether the time is set successfully.

Definition at line 1010 of file OSResult.cpp.

References addTimingInformation().

Referenced by LindoSolver::solve(), and CoinSolver::writeResult().

bool OSResult::addTimingInformation ( std::string  type,
std::string  category,
std::string  unit,
std::string  description,
double  value 
)

Add timing information.

Parameters:
type holds the timer type (cpuTime/elapsedTime/other).
category holds the timer category (total/input/preprocessing, etc.)
unit holds the timer unit (tick/milliscond/second/minute/etc.)
description holds further information about the timer.
value holds the time measurement.
Returns:
whether the time is set successfully.

Definition at line 953 of file OSResult.cpp.

References Time::category, Time::description, job, nt, TimingInformation::numberOfTimes, TimingInformation::time, JobResult::timingInformation, Time::type, Time::unit, and Time::value.

Referenced by setTime().

bool OSResult::setTimeNumber ( int  timeNumber  ) 

Set the number of time measurements.

Parameters:
timeNumber holds the number of measurements
Returns:
whether the time number is set successfully or not.

Definition at line 1015 of file OSResult.cpp.

References job, TimingInformation::numberOfTimes, and JobResult::timingInformation.

bool OSResult::setVariableNumber ( int  variableNumber  ) 

Set the variable number.

Parameters:
variableNumber holds the number of variables
Returns:
whether the variable number is set successfully or not.

Definition at line 1028 of file OSResult.cpp.

References OptimizationResult::numberOfVariables, and optimization.

Referenced by IpoptProblem::finalize_solution(), main(), LindoSolver::optimize(), KnitroSolver::solve(), CouenneSolver::solve(), CoinSolver::solve(), BonminSolver::solve(), CouenneSolver::writeResult(), and BonminSolver::writeResult().

bool OSResult::setObjectiveNumber ( int  objectiveNumber  ) 

Set the objective number.

Parameters:
objectiveNumber holds the number of objectives
Returns:
whether the objective number is set successfully or not.

Definition at line 1037 of file OSResult.cpp.

References OptimizationResult::numberOfObjectives, and optimization.

Referenced by IpoptProblem::finalize_solution(), main(), LindoSolver::optimize(), KnitroSolver::solve(), CouenneSolver::solve(), CoinSolver::solve(), BonminSolver::solve(), CouenneSolver::writeResult(), and BonminSolver::writeResult().

bool OSResult::setConstraintNumber ( int  constraintNumber  ) 

Set the constraint number.

Parameters:
constraintNumber holds the number of constraints
Returns:
whether the constraint number is set successfully or not.

Definition at line 1046 of file OSResult.cpp.

References OptimizationResult::numberOfConstraints, and optimization.

Referenced by IpoptProblem::finalize_solution(), main(), LindoSolver::optimize(), KnitroSolver::solve(), CouenneSolver::solve(), CoinSolver::solve(), BonminSolver::solve(), CouenneSolver::writeResult(), and BonminSolver::writeResult().

bool OSResult::setSolutionNumber ( int  number  ) 

set the number of solutions.

This method must be called before setting other optimization solution related results. Before this method is called, the setVariableNumber(int), setObjectiveNumber(int), setConstraintNumber(int) methods have to be called first.

Parameters:
number holds the number of solutions to set.
Returns:
whether the solution number is set successfully.
See also:
setVariableNumber(int)

setObjectiveNumber(int)

setConstraintNumber(int)

Definition at line 1055 of file OSResult.cpp.

References OptimizationResult::numberOfSolutions, optimization, and OptimizationResult::solution.

Referenced by IpoptProblem::finalize_solution(), main(), LindoSolver::optimize(), KnitroSolver::solve(), CouenneSolver::solve(), CoinSolver::solve(), BonminSolver::solve(), CouenneSolver::writeResult(), and BonminSolver::writeResult().

bool OSResult::setSolutionStatus ( int  solIdx,
std::string  type,
std::string  description 
)

Set the [i]th optimization solution status, where i equals the given solution index.

The solution status includes the status type, optional descriptions and possibly substatuses. Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the solution status.
status holds the optimization solution status to set.
Returns:
whether the optimization solution status is set successfully or not.
See also:
org.optimizationservices.oscommon.datastructure.osresult.OptimizationSolutionStatus

setSolutionNumber(int)

Referenced by IpoptProblem::finalize_solution(), main(), LindoSolver::optimize(), KnitroSolver::solve(), CouenneSolver::solve(), BonminSolver::solve(), CouenneSolver::writeResult(), CoinSolver::writeResult(), and BonminSolver::writeResult().

bool OSResult::setSolutionTargetObjectiveIdx ( int  solIdx,
int  objectiveIdx 
)

Set the [i]th optimization solution's objective index, where i equals the given solution index.

The first objective's index should be -1, the second -2, and so on. Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the objective index.
objectiveIdx holds the objective index to set. All the objective indexes are negative starting from -1 downward.
Returns:
whether the optimization objective index is set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1088 of file OSResult.cpp.

References getSolutionNumber(), optimization, OptimizationResult::solution, and OptimizationSolution::targetObjectiveIdx.

bool OSResult::setSolutionMessage ( int  solIdx,
std::string  msg 
)

Set the [i]th optimization solution's message, where i equals the given solution index.

The first objective's index should be -1, the second -2, and so on. Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the objective index.
msg holds the solution message to set.
Returns:
whether the optimization objective index is set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1104 of file OSResult.cpp.

References getSolutionNumber(), OptimizationSolution::message, optimization, and OptimizationResult::solution.

bool OSResult::setNumberOfPrimalVariableValues ( int  solIdx,
int  n 
)

Set the [i]th optimization solution's number of primal variable values, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the primal variable values.
n holds the number of elements in the array x
Returns:
whether primal variable values are set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1120 of file OSResult.cpp.

References getSolutionNumber(), getVariableNumber(), VariableValues::numberOfVar, optimization, OptimizationResult::solution, VariableSolution::values, and OptimizationSolution::variables.

bool OSResult::setPrimalVariableValuesSparse ( int  solIdx,
std::vector< IndexValuePair * >  x 
)

Set the [i]th optimization solution's primal variable values, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the primal variable values.
x holds a vector of type IndexValuePair; the idx component holds the index of the variable; the value component holds its value. The vector could be null if all variables are 0.
Returns:
whether primal variable values are set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1143 of file OSResult.cpp.

References getSolutionNumber(), VariableValues::numberOfVar, optimization, OptimizationResult::solution, VariableSolution::values, VariableValues::var, and OptimizationSolution::variables.

bool OSResult::setPrimalVariableValuesDense ( int  solIdx,
double *  x 
)

Set the [i]th optimization solution's primal variable values, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the primal variable values.
x holds the a double dense array of variable values to set; it could be null if all variables are 0.
Returns:
whether primal variable values are set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1172 of file OSResult.cpp.

References getSolutionNumber(), getVariableNumber(), VariableValues::numberOfVar, optimization, OptimizationResult::solution, VariableSolution::values, VariableValues::var, and OptimizationSolution::variables.

Referenced by IpoptProblem::finalize_solution(), main(), LindoSolver::optimize(), KnitroSolver::solve(), CouenneSolver::writeResult(), CoinSolver::writeResult(), and BonminSolver::writeResult().

bool OSResult::setNumberOfOtherVariableResults ( int  solIdx,
int  numberOfOtherVariableResults 
)

Set the [i]th optimization solution's other (non-standard/solver specific)variable-related results, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first. This method then allocates the memory for the new OtherVariableResult objects

Parameters:
solIdx is the solution index
numberOfOtherVariableResult holds the number of OtherVariableResult objects Each other variable result contains the name (required), an optional description (std::string) and an optional value (std::string). Each other variable result can also optionally contain an array OtherVarResult for each variable. The OtherVarResult contains a variable idx (required) and an optional std::string value.
Returns:
whether the other variable results are set successfully or not.
See also:
org.optimizationservices.oscommon.datastructure.osresult.OtherVariableResult

org.optimizationservices.oscommon.datastructure.osresult.OtherVarResult

setSolutionNumber(int)

Definition at line 1202 of file OSResult.cpp.

References getSolutionNumber(), VariableSolution::numberOfOtherVariableResults, optimization, VariableSolution::other, OptimizationResult::solution, and OptimizationSolution::variables.

Referenced by IpoptProblem::finalize_solution(), main(), LindoSolver::optimize(), and CoinSolver::writeResult().

bool OSResult::setAnOtherVariableResultSparse ( int  solIdx,
int  otherIdx,
std::string  name,
std::string  value,
std::string  description,
int *  idx,
std::string *  s,
int  n 
)

Set the [i]th optimization solution's other (non-standard/solver specific)variable-related results, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index
otherIdx holds the index of the new OtherVariableResult object
name holds the name of the other element
value holds the value of the other element
idx holds a pointer to the indexes of the var element
s holds a pointer to the array of values of the var element
n holds the number of elements of the array
Returns:
whether the other variable results are set successfully or not.
See also:
org.optimizationservices.oscommon.datastructure.osresult.OtherVariableResult

org.optimizationservices.oscommon.datastructure.osresult.OtherVarResult

setSolutionNumber(int)

Referenced by IpoptProblem::finalize_solution(), and CoinSolver::writeResult().

bool OSResult::setAnOtherVariableResultDense ( int  solIdx,
int  otherIdx,
std::string  name,
std::string  value,
std::string  description,
std::string *  s 
)

Set the [i]th optimization solution's other (non-standard/solver specific)variable-related results, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index
otherIdx holds the index of the new OtherVariableResult object
name holds the name of the other element
value holds the value of the other element
s holds a pointer to the array of values of the var element
Returns:
whether the other variable results are set successfully or not.
See also:
org.optimizationservices.oscommon.datastructure.osresult.OtherVariableResult

org.optimizationservices.oscommon.datastructure.osresult.OtherVarResult

setSolutionNumber(int)

Referenced by main(), and LindoSolver::optimize().

bool OSResult::setNumberOfObjectiveValues ( int  solIdx,
int  n 
)

Set the [i]th optimization solution's number of objective values, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the objective values.
n holds the number of elements in the array x
Returns:
whether objective values are set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1279 of file OSResult.cpp.

References getObjectiveNumber(), getSolutionNumber(), ObjectiveValues::numberOfObj, OptimizationSolution::objectives, optimization, OptimizationResult::solution, and ObjectiveSolution::values.

bool OSResult::setObjectiveValuesSparse ( int  solIdx,
std::vector< IndexValuePair * >  x 
)

Set the [i]th optimization solution's objective values, where i equals the given solution index.

Usually one of the objective is what the solution was solved for (or based on). Its index should be indicated in the solution's objectiveIdx attribute. Based on this objective's solution, the rest of the objective values are (optionally) calculated. Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the objective values.
x holds a vector of type IndexValuePair; the idx component holds the index of the objective; the value component holds its value. The vector could be null if all ojectives are 0. Possibly only the objective that the solution is based on has the value, and the rest of the objective values all get a Double.NaN value, meaning that they are not calculated.
Returns:
whether objective values are set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1304 of file OSResult.cpp.

References getSolutionNumber(), ObjectiveValues::numberOfObj, ObjectiveValues::obj, OptimizationSolution::objectives, optimization, OptimizationResult::solution, and ObjectiveSolution::values.

bool OSResult::setObjectiveValuesDense ( int  solIdx,
double *  objectiveValues 
)

Set the [i]th optimization solution's objective values, where i equals the given solution index.

Usually one of the objective is what the solution was solved for (or based on). Its index should be indicated in the solution's objectiveIdx attribute. Based on this objective's solution, the rest of the objective values are (optionally) calculated. Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the objective values.
objectiveValues holds the double sparse array of objective values to set. Possibly only the objective that the solution is based on has the value, and the rest of the objective values all get a Double.NaN value, meaning that they are not calculated.
Returns:
whether objective values are set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1335 of file OSResult.cpp.

References getObjectiveNumber(), getSolutionNumber(), ObjectiveValues::numberOfObj, ObjectiveValues::obj, OptimizationSolution::objectives, optimization, OptimizationResult::solution, and ObjectiveSolution::values.

Referenced by IpoptProblem::finalize_solution(), main(), LindoSolver::optimize(), KnitroSolver::solve(), CouenneSolver::writeResult(), CoinSolver::writeResult(), and BonminSolver::writeResult().

bool OSResult::setNumberOfDualVariableValues ( int  solIdx,
int  n 
)

Set the [i]th optimization solution's number of dual variable values, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the dual variable values.
n holds the number of elements in the array x
Returns:
whether dual variable values are set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1366 of file OSResult.cpp.

References OptimizationSolution::constraints, ConstraintSolution::dualValues, getConstraintNumber(), getSolutionNumber(), DualVariableValues::numberOfCon, optimization, and OptimizationResult::solution.

bool OSResult::setDualVariableValuesSparse ( int  solIdx,
std::vector< IndexValuePair * >  x 
)

Set the [i]th optimization solution's dual variable values, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the dual variable values.
x holds a vector of type IndexValuePair; the idx component holds the index of the constraint; the value component holds its value. The vector could be null if all dual variables are 0.
Returns:
whether dual variable values are set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1391 of file OSResult.cpp.

References DualVariableValues::con, OptimizationSolution::constraints, ConstraintSolution::dualValues, getSolutionNumber(), DualVariableValues::numberOfCon, optimization, and OptimizationResult::solution.

bool OSResult::setDualVariableValuesDense ( int  solIdx,
double *  y 
)

Set the [i]th optimization solution's dual variable values, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the dual variable values.
y holds a double dense array of variable dual values; it could be NULL if all values are 0.
Returns:
whether dual variable values are set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1424 of file OSResult.cpp.

References DualVariableValues::con, OptimizationSolution::constraints, ConstraintSolution::dualValues, getConstraintNumber(), getSolutionNumber(), DualVariableValues::numberOfCon, optimization, and OptimizationResult::solution.

Referenced by IpoptProblem::finalize_solution(), main(), LindoSolver::optimize(), KnitroSolver::solve(), and CoinSolver::writeResult().

bool OSResult::setConstraintValuesDense ( int  solIdx,
double *  constraintValues 
)

Set the [i]th optimization solution's constraint values, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the constraint values.
constraintValues holds the a double dense array of constraint values to set; it could be null if all constraint values are 0.
Returns:
whether constraint values are set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1457 of file OSResult.cpp.

References DualVariableValues::con, OptimizationSolution::constraints, ConstraintSolution::dualValues, getConstraintNumber(), getSolutionNumber(), DualVariableValues::numberOfCon, optimization, and OptimizationResult::solution.

GeneralStatus* OSResult::getGeneralStatus (  ) 

Get the general status.

Returns:
the general status.

std::string OSResult::getGeneralStatusType (  ) 

Get the general status type, which can be: success, error, warning.

Returns:
the general status type, null if none.

std::string OSResult::getGeneralStatusDescription (  ) 

Get the general status description.

Returns:
the general status description, null or empty std::string if none.

std::string OSResult::getServiceName (  ) 

Get service name.

Returns:
the service name.

std::string OSResult::getServiceURI (  ) 

Get service uri.

Returns:
the service uri.

std::string OSResult::getInstanceName (  ) 

Get instance name.

Returns:
the instance name.

std::string OSResult::getJobID (  ) 

Get the job id.

Returns:
the job id.

std::string OSResult::getGeneralMessage (  ) 

Get the general message.

Returns:
the general message.

int OSResult::getTimeNumber (  ) 

Get the number of time measurements.

Returns:
the number of time measurements

double OSResult::getTimeValue (  ) 

Get the time measurement.

In the first instance, assume that there is only a single measure, which is the total elapsed time in seconds

Returns:
the time measurement

double* OSResult::getOptimalPrimalVariableValues ( int  objIdx  ) 

Get one solution of optimal primal variable values.

Parameters:
objIdx holds the objective index the optimal value corresponds to.
Returns:
a double dense array of the optimal values, null if no optimal value.

double* OSResult::getOptimalDualVariableValues ( int  objIdx  ) 

Get one solution of optimal dual variable values.

Parameters:
objIdx holds the objective index the optimal value corresponds to.
Returns:
a double dense array of the optimal dual values, null if no optimal value.

OptimizationSolutionStatus* OSResult::getSolutionStatus ( int  solIdx  ) 

Get the [i]th optimization solution status, where i equals the given solution index.

The solution status includes the status type, optional descriptions and possibly substatuses.

Parameters:
solIdx holds the solution index to get the solution status.
Returns:
the optimization solution status that corresponds to solIdx, null if none.
See also:
org.optimizationservices.oscommon.datastructure.osresult.OptimizationSolutionStatus

std::string OSResult::getSolutionStatusType ( int  solIdx  ) 

Get the [i]th optimization solution status type, where i equals the given solution index.

The solution status type can be: unbounded, globallyOptimal, locallyOptimal, optimal, bestSoFar, feasible, infeasible, stoppedByLimit, unsure, error, other

Parameters:
solIdx holds the solution index to get the solution status type.
Returns:
the optimization solution status type that corresponds to solIdx, null or empty std::string if none.

std::string OSResult::getSolutionStatusDescription ( int  solIdx  ) 

Get the [i]th optimization solution status description, where i equals the given solution index.

Parameters:
solIdx holds the solution index to get the solution status description.
Returns:
the optimization solution status description that corresponds to solIdx, null or empty std::string if none.

std::string OSResult::getSolutionMessage ( int  solIdx  ) 

Get the [i]th optimization solution message, where i equals the given solution index.

Parameters:
solIdx holds the solution index to get the solution message.
Returns:
the optimization solution message that corresponds to solIdx, null or empty if none.

int OSResult::getVariableNumber (  ) 

Get variable number.

Returns:
variable number, -1 if no information.

int OSResult::getObjectiveNumber (  ) 

Get objective number.

Returns:
objective number, -1 if no information.

int OSResult::getConstraintNumber (  ) 

Get constraint number.

Returns:
constraint number, -1 if no information.

int OSResult::getSolutionNumber (  ) 

get the number of solutions.

Returns:
the number of solutions, 0 if none.

int OSResult::getNumberOfOtherVariableResults ( int  solIdx  ) 

Get numberOfOtherVariableResult.

Returns:
numberOfOtherVariableResult, -1 if no information.

bool OSResult::setGeneralStatus ( GeneralStatus status  ) 

Set the general status.

Parameters:
status holds the general status.
Returns:
whether the general status is set successfully.

bool OSResult::setGeneralStatusType ( std::string  type  ) 

Set the general status type, which can be: success, error, warning.

Parameters:
type holds the general status type
Returns:
whether the general status type is set successfully or not.

bool OSResult::setGeneralStatusDescription ( std::string  description  ) 

Set the general status description.

Parameters:
description holds the general status description.
Returns:
whether the general status description is set successfully or not.

bool OSResult::setGeneralMessage ( std::string  message  ) 

Set the general message.

Parameters:
message holds the general message.
Returns:
whether process message is set successfully.

bool OSResult::setServiceName ( std::string  serviceName  ) 

Set service name.

Parameters:
serviceName holds the name of the service.
Returns:
whether the service name is set successfully.

bool OSResult::setServiceURI ( std::string  serviceURI  ) 

Set service uri.

Parameters:
serviceURI holds the uri of the service.
Returns:
whether the service uri is set successfully.

bool OSResult::setInstanceName ( std::string  instanceName  ) 

Set instance name.

Parameters:
instanceName holds the name of the instance.
Returns:
whether the instance name is set successfully.

bool OSResult::setJobID ( std::string  jobID  ) 

Set job id.

Parameters:
jobID holds the job id.
Returns:
whether the job id is set successfully.

bool OSResult::setTime ( double  time  ) 

Set time.

Parameters:
time holds the time.
Returns:
whether the time is set successfully.

bool OSResult::addTimingInformation ( std::string  type,
std::string  category,
std::string  unit,
std::string  description,
double  value 
)

Add timing information.

Parameters:
type holds the timer type (cpuTime/elapsedTime/other).
category holds the timer category (total/input/preprocessing, etc.)
unit holds the timer unit (tick/milliscond/second/minute/etc.)
description holds further information about the timer.
value holds the time measurement.
Returns:
whether the time is set successfully.

bool OSResult::setTimeNumber ( int  timeNumber  ) 

Set the number of time measurements.

Parameters:
timeNumber holds the number of measurements
Returns:
whether the time number is set successfully or not.

bool OSResult::setVariableNumber ( int  variableNumber  ) 

Set the variable number.

Parameters:
variableNumber holds the number of variables
Returns:
whether the variable number is set successfully or not.

bool OSResult::setObjectiveNumber ( int  objectiveNumber  ) 

Set the objective number.

Parameters:
objectiveNumber holds the number of objectives
Returns:
whether the objective number is set successfully or not.

bool OSResult::setConstraintNumber ( int  constraintNumber  ) 

Set the constraint number.

Parameters:
constraintNumber holds the number of constraints
Returns:
whether the constraint number is set successfully or not.

bool OSResult::setSolutionNumber ( int  number  ) 

set the number of solutions.

This method must be called before setting other optimization solution related results. Before this method is called, the setVariableNumber(int), setObjectiveNumber(int), setConstraintNumber(int) methods have to be called first.

Parameters:
number holds the number of solutions to set.
Returns:
whether the solution number is set successfully.
See also:
setVariableNumber(int)

setObjectiveNumber(int)

setConstraintNumber(int)

bool OSResult::setSolutionStatus ( int  solIdx,
std::string  type,
std::string  description 
)

Set the [i]th optimization solution status, where i equals the given solution index.

The solution status includes the status type, optional descriptions and possibly substatuses. Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the solution status.
status holds the optimization solution status to set.
Returns:
whether the optimization solution status is set successfully or not.
See also:
org.optimizationservices.oscommon.datastructure.osresult.OptimizationSolutionStatus

setSolutionNumber(int)

bool OSResult::setSolutionObjectiveIndex ( int  solIdx,
int  objectiveIdx 
)

Set the [i]th optimization solution's objective index, where i equals the given solution index.

The first objective's index should be -1, the second -2, and so on. Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the objective index.
objectiveIdx holds the objective index to set. All the objective indexes are negative starting from -1 downward.
Returns:
whether the optimization objective index is set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 990 of file OSResult.cpp.

References getSolutionNumber(), optimization, OptimizationResult::solution, and OptimizationSolution::targetObjectiveIdx.

bool OSResult::setNumberOfPrimalVariableValues ( int  solIdx,
int  n 
)

Set the [i]th optimization solution's number of primal variable values, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the primal variable values.
n holds the number of elements in the array x
Returns:
whether primal variable values are set successfully or not.
See also:
setSolutionNumber(int)

bool OSResult::setPrimalVariableValues ( int  solIdx,
double *  x,
int  n 
)

Set the [i]th optimization solution's primal variable values, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the primal variable values.
x holds the a double dense array of variable values to set; it could be null if all variables are 0.
n holds the number of elements in the array x
Returns:
whether primal variable values are set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1028 of file OSResult.cpp.

References getSolutionNumber(), VariableValues::numberOfVar, optimization, OptimizationResult::solution, VariableSolution::values, VariableValues::var, and OptimizationSolution::variables.

Referenced by main().

bool OSResult::setNumberOfOtherVariableResults ( int  solIdx,
int  numberOfOtherVariableResults 
)

Set the [i]th optimization solution's other (non-standard/solver specific)variable-related results, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first. This method then allocates the memory for the new OtherVariableResult objects

Parameters:
solIdx is the solution index
numberOfOtherVariableResult holds the number of OtherVariableResult objects Each other variable result contains the name (required), an optional description (std::string) and an optional value (std::string). Each other variable result can also optionally contain an array OtherVarResult for each variable. The OtherVarResult contains a variable idx (required) and an optional std::string value.
Returns:
whether the other variable results are set successfully or not.
See also:
org.optimizationservices.oscommon.datastructure.osresult.OtherVariableResult

org.optimizationservices.oscommon.datastructure.osresult.OtherVarResult

setSolutionNumber(int)

bool OSResult::setAnOtherVariableResult ( int  solIdx,
int  otherIdx,
std::string  name,
std::string  description,
int *  indexes,
std::string *  s,
int  n 
)

Set the [i]th optimization solution's other (non-standard/solver specific)variable-related results, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index
otherIdx holds the index of the new OtherVariableResult object
name holds the name of the other element
s holds a pointer to the array of values of the var element
n holds the number of elements of the array
Returns:
whether the other variable results are set successfully or not.
See also:
org.optimizationservices.oscommon.datastructure.osresult.OtherVariableResult

org.optimizationservices.oscommon.datastructure.osresult.OtherVarResult

setSolutionNumber(int)

Referenced by main().

bool OSResult::setObjectiveValues ( int  solIdx,
double *  objectiveValues,
int  n 
)

Set the [i]th optimization solution's objective values, where i equals the given solution index.

Usually one of the objective is what the solution was solved for (or based on). Its index should be indicated in the solution's objectiveIdx attribute. Based on this objective's solution, the rest of the objective values are (optionally) calculated. Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the objective values.
objectiveValues holds the a double dense array of objective values to set. Possibly only the objective that the solution is based on has the value, and the rest of the objective values all get a Double.NaN value, meaning that they are not calculated.
n holds the dimension of the objectiveValues array
Returns:
whether objective values are set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1130 of file OSResult.cpp.

References getSolutionNumber(), ObjectiveValues::numberOfObj, ObjectiveValues::obj, OptimizationSolution::objectives, optimization, OptimizationResult::solution, and ObjectiveSolution::values.

Referenced by main().

bool OSResult::setDualVariableValues ( int  solIdx,
double *  lbValues,
double *  ubValues,
int  n 
)

Set the [i]th optimization solution's dual variable values, where i equals the given solution index.

The method allows setting dual values at both the constraints' lower and upper bounds. Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the dual variable values.
lbValues holds the a double dense array of variable dual values to set at the lower bounds; it could be null if all values are 0.
ubValues holds the a double dense array of variable dual values to set at the upper bounds; it could be null if all values are 0.
n holds the number of values in the lbValues and ubValues arrays
Returns:
whether dual variable values are set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1184 of file OSResult.cpp.

References DualVariableValues::con, OptimizationSolution::constraints, ConstraintSolution::dualValues, getSolutionNumber(), DualVariableValues::numberOfCon, optimization, and OptimizationResult::solution.

Referenced by main().

bool OSResult::setDualVariableValues ( int  solIdx,
double *  y,
int  n 
)

Set the [i]th optimization solution's dual variable values, where i equals the given solution index.

The method allows setting dual values at both the constraints' lower and upper bounds. Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the dual variable values.
y holds a double dense array of variable dual values; it could be NULL if all values are 0.
n holds the number of elements of the array y.
Returns:
whether dual variable values are set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1261 of file OSResult.cpp.

References DualVariableValues::con, OptimizationSolution::constraints, ConstraintSolution::dualValues, getSolutionNumber(), DualVariableValues::numberOfCon, optimization, and OptimizationResult::solution.

bool OSResult::setConstraintValues ( int  solIdx,
double *  constraintValues,
int  n 
)

Set the [i]th optimization solution's constraint values, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the constraint values.
constraintValues holds the a double dense array of constraint values to set; it could be null if all constraint values are 0.
n holds the dimension of the array constraintValues.
Returns:
whether constraint values are set successfully or not.
See also:
setSolutionNumber(int)

Definition at line 1293 of file OSResult.cpp.

References DualVariableValues::con, OptimizationSolution::constraints, ConstraintSolution::dualValues, getSolutionNumber(), DualVariableValues::numberOfCon, optimization, and OptimizationResult::solution.


Member Data Documentation

GeneralResult* OSResult::general

general holds the first child of the OSResult specified by the OSrL Schema.

Definition at line 1358 of file OSResult.h.

Referenced by getGeneralMessage(), getGeneralStatus(), getGeneralStatusDescription(), getGeneralStatusType(), getInstanceName(), getJobID(), getServiceName(), getServiceURI(), OSResult(), setGeneralStatus(), OSrLWriter::writeOSrL(), and ~OSResult().

SystemResult* OSResult::system

system holds the second child of the OSResult specified by the OSrL Schema.

Definition at line 1363 of file OSResult.h.

Referenced by OSResult(), OSrLWriter::writeOSrL(), and ~OSResult().

ServiceResult* OSResult::service

service holds the third child of the OSResult specified by the OSrL Schema.

Definition at line 1368 of file OSResult.h.

Referenced by OSResult(), OSrLWriter::writeOSrL(), and ~OSResult().

JobResult* OSResult::job

job holds the fourth child of the OSResult specified by the OSrL Schema.

Definition at line 1373 of file OSResult.h.

Referenced by addTimingInformation(), getTimeNumber(), getTimeValue(), OSResult(), setTimeNumber(), OSrLWriter::writeOSrL(), and ~OSResult().

OptimizationResult* OSResult::optimization

optimization holds the fifth child of the OSResult specified by the OSrL Schema.

Definition at line 1378 of file OSResult.h.

Referenced by getAnOtherVariableResultNumberOfVar(), getConstraintNumber(), getNumberOfOtherVariableResults(), getObjectiveNumber(), getOptimalDualVariableValues(), getOptimalPrimalVariableValues(), getSolutionMessage(), getSolutionNumber(), getSolutionStatus(), getSolutionStatusDescription(), getSolutionStatusType(), getVariableNumber(), main(), OSResult(), setConstraintNumber(), setConstraintValues(), setConstraintValuesDense(), setDualVariableValues(), setDualVariableValuesDense(), setDualVariableValuesSparse(), setNumberOfDualVariableValues(), setNumberOfObjectiveValues(), setNumberOfOtherVariableResults(), setNumberOfPrimalVariableValues(), setObjectiveNumber(), setObjectiveValues(), setObjectiveValuesDense(), setObjectiveValuesSparse(), setPrimalVariableValues(), setPrimalVariableValuesDense(), setPrimalVariableValuesSparse(), setSolutionMessage(), setSolutionNumber(), setSolutionObjectiveIndex(), setSolutionTargetObjectiveIdx(), setVariableNumber(), OSrLWriter::writeOSrL(), and ~OSResult().

int OSResult::m_iVariableNumber

m_iVariableNumber holds the variable number.

Definition at line 1396 of file OSResult.h.

Referenced by getVariableNumber().

int OSResult::m_iObjectiveNumber

m_iObjectiveNumber holds the objective number.

Definition at line 1401 of file OSResult.h.

Referenced by getObjectiveNumber().

int OSResult::m_iConstraintNumber

m_iConstraintNumber holds the constraint number.

Definition at line 1406 of file OSResult.h.

Referenced by getConstraintNumber().

int OSResult::m_iNumberOfOtherVariableResults

m_iNumberOfOtherVariableResults holds the number of OtherVariableResult objects.

Definition at line 1411 of file OSResult.h.

Referenced by getNumberOfOtherVariableResults().

double* OSResult::m_mdPrimalValues

m_mdPrimalValues a vector of primal variables.

Definition at line 1416 of file OSResult.h.

Referenced by getOptimalPrimalVariableValues(), and ~OSResult().

double* OSResult::m_mdDualValues

m_mdDualValues a vector of dual variables.

Definition at line 1421 of file OSResult.h.

Referenced by getOptimalDualVariableValues(), and ~OSResult().

std::vector<IndexValuePair*> OSResult::primalVals

Definition at line 1424 of file OSResult.h.

Referenced by getOptimalPrimalVariableValues(), and ~OSResult().

std::vector<IndexValuePair*> OSResult::dualVals

Definition at line 1426 of file OSResult.h.

Referenced by getOptimalDualVariableValues(), and ~OSResult().

GeneralResult* OSResult::general

general holds the first child of the OSResult specified by the OSrL Schema.

Definition at line 1310 of file OSResult.h.

SystemResult* OSResult::system

system holds the second child of the OSResult specified by the OSrL Schema.

Definition at line 1315 of file OSResult.h.

ServiceResult* OSResult::service

service holds the third child of the OSResult specified by the OSrL Schema.

Definition at line 1320 of file OSResult.h.

JobResult* OSResult::job

job holds the fourth child of the OSResult specified by the OSrL Schema.

Definition at line 1325 of file OSResult.h.

OptimizationResult* OSResult::optimization

optimization holds the fifth child of the OSResult specified by the OSrL Schema.

Definition at line 1330 of file OSResult.h.

double* OSResult::m_mdPrimalValues

m_mdPrimalValues a vector of primal variables.

Definition at line 1368 of file OSResult.h.

double* OSResult::m_mdDualValues

m_mdDualValues a vector of primal variables.

Definition at line 1373 of file OSResult.h.


The documentation for this class was generated from the following files:
Generated on Mon Aug 3 03:07:59 2009 by  doxygen 1.4.7