/home/coin/SVN-release/OS-1.0.0/OS/examples/instanceGenerator/instanceGenerator.cpp File Reference

#include <iostream>
#include <vector>
#include "OSConfig.h"
#include "OSInstance.h"
#include "OSiLWriter.h"
#include "OSParameters.h"
#include "OSnLNode.h"
#include "ErrorClass.h"

Include dependency graph for instanceGenerator.cpp:

Go to the source code of this file.

Functions

int main ()


Detailed Description

Author:
Robert Fourer, Jun Ma, Kipp Martin,
Version:
1.0, 10/05/2005
Since:
OS1.0
Remarks:
Copyright (C) 2005, Robert Fourer, Jun Ma, Kipp Martin, Northwestern University, and the University of Chicago. All Rights Reserved. This software is licensed under the Common Public License. Please see the accompanying LICENSE file in root directory for terms.
In this example we show how to use the OSInstance API to generate an OSiL problem instance.

The objective of this example is to illustrate how to build a problem instance using the OSIntance class API. In particular we illutrate a number of the set() methods in the OSInstance class. As written, we need the LINDO nonlinear solver.

Model: A nonlinear model with multiple local minimizers. Taken from the Samples directory of the LINDO API

maximize abs( x0 + 1) + .4 * x1;
s.t. x0 + x1 <= 4;
x0 * x1 + x1 <= 6;
x0 * x1 <= 0;
max(x0 , x1 + 1) >= 0;
if(x1, 1, x1) <= 0;
(x1 * 2 * x1 - x1) * x0 <= 0;
-100 <= x0 <= 100
x1 is binary

Definition in file instanceGenerator.cpp.


Function Documentation

int main (  ) 

Definition at line 59 of file instanceGenerator.cpp.

References OSInstance::addConstraint(), OSInstance::addObjective(), OSInstance::addVariable(), OSnLNode::createExpressionTreeFromPostfix(), ErrorClass::errormsg, OSnLNodeVariable::idx, Nl::idx, SparseVector::indexes, OSInstance::instanceData, OSnLNode::inumberOfChildren, OSnLNode::m_mChildren, OSExpressionTree::m_treeRoot, NonlinearExpressions::nl, InstanceData::nonlinearExpressions, NonlinearExpressions::numberOfNonlinearExpressions, Nl::osExpressionTree, OSINFINITY, DefaultSolver::osinstance, osinstance, OSNAN, DefaultSolver::osrl, OSInstance::setConstraintNumber(), OSInstance::setInstanceDescription(), OSInstance::setInstanceSource(), OSInstance::setLinearConstraintCoefficients(), OSInstance::setObjectiveNumber(), OSInstance::setVariableNumber(), LindoSolver::solve(), OSnLNodeNumber::value, SparseVector::values, and OSiLWriter::writeOSiL().


Generated on Thu May 15 22:15:06 2008 by  doxygen 1.4.7