- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# KnitroSolver Class Reference

the KnitroSolver class solves problems using Knitro. More...

`#include <OSKnitroSolver.h>`

Inheritance diagram for KnitroSolver:

[legend]
Collaboration diagram for KnitroSolver:

[legend]
List of all members.

## Public Member Functions
| KnitroSolver ()
| the KnitroSolver class constructor
| ~KnitroSolver ()
| the KnitroSolver class constructor
virtual void | buildSolverInstance () throw (ErrorClass)
| buildSolverInstance is a virtual function -- the actual solvers will implement their own solve method -- the solver instance is the instance the individual solver sees in its api
virtual void | setSolverOptions () throw (ErrorClass)
| The implementation of the virtual functions.
virtual void | solve () throw (ErrorClass)
| solve results in an instance being read into the Knitro data structrues and optimized
void | dataEchoCheck ()
| use this for debugging, print out the instance that the solver thinks it has and compare this with the OSiL file
## Private Member Functions
Methods to block default compiler methods.
The compiler automatically generates the following three methods. Since the default compiler implementation is generally not what you want (for all but the most simple classes), we usually put the declarations of these methods in the private section and never implement them. This prevents the compiler from implementing an incorrect "default" behavior without us knowing. (See Scott Meyers book, "Effective C++")
| KnitroSolver (const KnitroSolver &)
KnitroSolver & | operator= (const KnitroSolver &)
## Private Attributes
OSrLWriter * | osrlwriter
std::string | knitroErrorMsg

## Detailed Description

the KnitroSolver class solves problems using Knitro.

Author:
  Robert Fourer, Jun Ma, Kipp Martin

Version:
  1.0, 03/14/2004

Since:
  OS 1.0

Remarks:
  this class takes an OSiL instance and optimizes it using the Knitro solver

Definition at line 143 of file OSKnitroSolver.h.

## Constructor & Destructor Documentation

KnitroSolver::KnitroSolver | ( |  | ) |

the KnitroSolver class constructor

Definition at line 526 of file OSKnitroSolver.cpp.

References knitroErrorMsg, DefaultSolver::osresult, and osrlwriter.

KnitroSolver::~KnitroSolver | ( |  | ) |

the KnitroSolver class constructor

Definition at line 563 of file OSKnitroSolver.cpp.

References DefaultSolver::osresult, and osrlwriter.

KnitroSolver::KnitroSolver | ( | const KnitroSolver & |  | ) | `[private]`

## Member Function Documentation

void KnitroSolver::buildSolverInstance | ( |  | ) | throw (ErrorClass)`[virtual]`

buildSolverInstance is a virtual function -- the actual solvers will implement their own solve method -- the solver instance is the instance the individual solver sees in its api

Implements DefaultSolver.

Definition at line 534 of file OSKnitroSolver.cpp.

References ErrorClass::errormsg, DefaultSolver::osresult, DefaultSolver::osrl, osrlwriter, OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), and OSrLWriter::writeOSrL().

void KnitroSolver::setSolverOptions | ( |  | ) | throw (ErrorClass)`[virtual]`

The implementation of the virtual functions.

Returns:
  void.

Implements DefaultSolver.

void KnitroSolver::solve | ( |  | ) | throw (ErrorClass)`[virtual]`

solve results in an instance being read into the Knitro data structrues and optimized

Implements DefaultSolver.

Definition at line 578 of file OSKnitroSolver.cpp.

References ErrorClass::errormsg, g_pOptProblem, OSInstance::getConstraintNumber(), OSInstance::getInstanceName(), OSInstance::getVariableNumber(), DefaultSolver::osil, DefaultSolver::osinstance, DefaultSolver::osresult, DefaultSolver::osrl, osrlwriter, OSiLReader::readOSiL(), OSResult::setConstraintNumber(), OSResult::setDualVariableValuesDense(), OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), OSResult::setInstanceName(), OSResult::setObjectiveNumber(), OSResult::setObjectiveValuesDense(), OSResult::setPrimalVariableValuesDense(), OSResult::setServiceName(), OSResult::setSolutionNumber(), OSResult::setSolutionStatus(), OSResult::setVariableNumber(), wrapperEvalFC(), wrapperEvalGA(), wrapperEvalHorHV(), and OSrLWriter::writeOSrL().

void KnitroSolver::dataEchoCheck | ( |  | ) |

use this for debugging, print out the instance that the solver thinks it has and compare this with the OSiL file

Definition at line 808 of file OSKnitroSolver.cpp.

References QuadraticTerms::coefficients, OSInstance::getConstraintLowerBounds(), OSInstance::getConstraintNames(), OSInstance::getConstraintNumber(), OSInstance::getConstraintUpperBounds(), OSInstance::getDenseObjectiveCoefficients(), OSInstance::getInstanceDescription(), OSInstance::getInstanceName(), OSInstance::getInstanceSource(), OSInstance::getLinearConstraintCoefficientNumber(), OSInstance::getLinearConstraintCoefficientsInColumnMajor(), OSInstance::getNumberOfQuadraticTerms(), OSInstance::getObjectiveMaxOrMins(), OSInstance::getQuadraticTerms(), OSInstance::getVariableLowerBounds(), OSInstance::getVariableNames(), OSInstance::getVariableNumber(), OSInstance::getVariableTypes(), OSInstance::getVariableUpperBounds(), SparseMatrix::indexes, OSInstance::instanceData, Objectives::numberOfObjectives, Objectives::obj, InstanceData::objectives, DefaultSolver::osinstance, QuadraticTerms::rowIndexes, SparseMatrix::starts, SparseMatrix::values, QuadraticTerms::varOneIndexes, and QuadraticTerms::varTwoIndexes.

KnitroSolver& KnitroSolver::operator= | ( | const KnitroSolver & |  | ) | `[private]`

## Member Data Documentation

OSrLWriter* KnitroSolver::osrlwriter`[private]`

Definition at line 178 of file OSKnitroSolver.h.

Referenced by buildSolverInstance(), KnitroSolver(), solve(), and ~KnitroSolver().

std::string KnitroSolver::knitroErrorMsg`[private]`

Definition at line 195 of file OSKnitroSolver.h.

Referenced by KnitroSolver().

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

- /home/coin/SVN-release/OS-2.3.5/OS/src/OSSolverInterfaces/OSKnitroSolver.h
- /home/coin/SVN-release/OS-2.3.5/OS/src/OSSolverInterfaces/OSKnitroSolver.cpp