scsolver::numeric::nlp::Model Class Reference

#include <nlpmodel.hxx>

List of all members.

Public Member Functions

 Model ()
 Model (const Model &)
 ~Model () throw ()
void print () const
void setPrecision (unsigned long n)
unsigned long getPrecision () const
void setGoal (scsolver::numeric::GoalType goal)
scsolver::numeric::GoalType getGoal () const
void setVerbose (bool b)
bool getVerbose () const
void setFuncObject (BaseFuncObj *pFuncObj)
BaseFuncObjgetFuncObject () const
void pushVar (double var)
void getVars (::std::vector< double > &vars) const
double getVarBound (size_t index, BoundType bound) const
void setVarBound (size_t index, BoundType bound, double value)
bool isVarBounded (size_t index, BoundType bound) const
void pushConstraint (BaseFuncObj *pFunc, EqualityType eq, double rightValue)
const ::std::vector
< Constraint > & 
getAllConstraints () const

Private Attributes

::std::auto_ptr
< ModelImpl
m_pImpl


Detailed Description

Definition at line 61 of file nlpmodel.hxx.


Constructor & Destructor Documentation

scsolver::numeric::nlp::Model::Model (  ) 

Definition at line 292 of file nlpmodel.cxx.

scsolver::numeric::nlp::Model::Model ( const Model other  ) 

Definition at line 296 of file nlpmodel.cxx.

scsolver::numeric::nlp::Model::~Model (  )  throw ()

Definition at line 300 of file nlpmodel.cxx.


Member Function Documentation

void scsolver::numeric::nlp::Model::print (  )  const

Print model information to standard output.

Definition at line 304 of file nlpmodel.cxx.

References m_pImpl.

Referenced by scsolver::NlpModelBuilderImpl::getModel(), scsolver::numeric::nlp::Rosenbrock::solve(), scsolver::numeric::nlp::HookeJeeves::solve(), scsolver::numeric::nlp::CyclicCoordinate::solve(), and scsolver::SolveModelImpl::solveNlp().

void scsolver::numeric::nlp::Model::setPrecision ( unsigned long  n  ) 

Set desired precision for optimized solution.

Parameters:
n desired precision

Definition at line 309 of file nlpmodel.cxx.

References m_pImpl.

unsigned long scsolver::numeric::nlp::Model::getPrecision (  )  const

Get current desired precision.

Returns:
unsigned long desired precision.

Definition at line 314 of file nlpmodel.cxx.

References m_pImpl.

Referenced by scsolver::numeric::nlp::QuasiNewtonImpl::calcDefMatrix(), scsolver::numeric::nlp::QuasiNewtonImpl::runIteration(), and scsolver::numeric::nlp::QuasiNewtonImpl::solve().

void scsolver::numeric::nlp::Model::setGoal ( scsolver::numeric::GoalType  goal  ) 

Set optimization goal.

Parameters:
goal 

Definition at line 319 of file nlpmodel.cxx.

References m_pImpl.

Referenced by scsolver::SolveModelImpl::solveNlp().

GoalType scsolver::numeric::nlp::Model::getGoal (  )  const

Get current optimization goal.

Returns:
scsolver::numeric::Goal

Definition at line 324 of file nlpmodel.cxx.

References m_pImpl.

Referenced by scsolver::numeric::nlp::QuasiNewtonImpl::calcDefMatrix(), and scsolver::numeric::nlp::QuasiNewtonImpl::runLinearSearch().

void scsolver::numeric::nlp::Model::setVerbose ( bool  b  ) 

Control whether or not to produce verbose output to standard output during optimization run.

Parameters:
b flag to control verbose ouput

Definition at line 329 of file nlpmodel.cxx.

References m_pImpl.

bool scsolver::numeric::nlp::Model::getVerbose (  )  const

Get the current verbose setting.

Returns:
bool verbose setting flag

Definition at line 334 of file nlpmodel.cxx.

References m_pImpl.

void scsolver::numeric::nlp::Model::setFuncObject ( BaseFuncObj pFuncObj  ) 

Set a pointer to the function object to be used that represents the objective function in a model. Note that this model class does NOT manage the life cycle of the function object passed to this function; it is the responsibility of the calling function to ensure that the instance of the function object gets deleted after the optimization code has run.

Parameters:
pFuncObj pointer to function object.

Definition at line 339 of file nlpmodel.cxx.

References m_pImpl.

Referenced by scsolver::NlpModelBuilderImpl::getModel().

BaseFuncObj * scsolver::numeric::nlp::Model::getFuncObject (  )  const

Get a pointer to the current function object.

Returns:
BaseFuncObj* pointer to current function object.

Definition at line 344 of file nlpmodel.cxx.

References m_pImpl.

Referenced by scsolver::numeric::nlp::BaseAlgorithm::getSolution(), scsolver::numeric::nlp::Penalty::initFromModel(), scsolver::numeric::nlp::Rosenbrock::solve(), scsolver::numeric::nlp::QuasiNewtonImpl::solve(), scsolver::numeric::nlp::HookeJeeves::solve(), and scsolver::numeric::nlp::CyclicCoordinate::solve().

void scsolver::numeric::nlp::Model::pushVar ( double  var  ) 

Push a variable to the end of variable list. Calling this method will increase the number of variables by one.

Parameters:
var variable value

Definition at line 349 of file nlpmodel.cxx.

References m_pImpl.

Referenced by scsolver::NlpModelBuilderImpl::getModel().

void scsolver::numeric::nlp::Model::getVars ( ::std::vector< double > &  vars  )  const

Get all variables that are currently in the model as an array.

Returns:
const::std::vector<double>

Referenced by scsolver::numeric::nlp::Rosenbrock::solve(), scsolver::numeric::nlp::QuasiNewtonImpl::solve(), scsolver::numeric::nlp::HookeJeeves::solve(), and scsolver::numeric::nlp::CyclicCoordinate::solve().

double scsolver::numeric::nlp::Model::getVarBound ( size_t  index,
BoundType  bound 
) const

Get the boundary value of a variable specified by the index. Note especially that the caller needs to ensure that the bounardy specified is actually bounded by calling isVarBounded(). Calling this function for an unbounded boundary leads to an undefined behavior.

Parameters:
index index value for the variable (0-based).
bound BOUND_UPPER or BOUND_LOWER for upper and lower bounds, respectrively.
Returns:
double boundary value

Definition at line 359 of file nlpmodel.cxx.

References m_pImpl.

void scsolver::numeric::nlp::Model::setVarBound ( size_t  index,
BoundType  bound,
double  value 
)

Set boundary value for a boundary specified by variable index and side (either upper or lower). Setting a boundary value by calling this method will cause isVarBounded() for this boundary to return true.

Parameters:
index index value for the variable (0-based)
bound BOUND_UPPER or BOUND_LOWER for upper and lower bounds, respectively.
value boundary value to be set.

Definition at line 364 of file nlpmodel.cxx.

References m_pImpl.

bool scsolver::numeric::nlp::Model::isVarBounded ( size_t  index,
BoundType  bound 
) const

Check whether or not the specified boundary for a specified variable is bounded.

Parameters:
index variable index (0-based)
bound BOUND_UPPER or BOUND_LOWER for upper and lower bounds, respectively.
Returns:
bool true if bounded, or false otherwise.

Definition at line 369 of file nlpmodel.cxx.

References m_pImpl.

void scsolver::numeric::nlp::Model::pushConstraint ( BaseFuncObj pFunc,
EqualityType  eq,
double  rightValue 
)

Definition at line 374 of file nlpmodel.cxx.

References m_pImpl.

const vector< Constraint > & scsolver::numeric::nlp::Model::getAllConstraints (  )  const

Definition at line 379 of file nlpmodel.cxx.

References m_pImpl.

Referenced by scsolver::numeric::nlp::Penalty::initFromModel().


Member Data Documentation

::std::auto_ptr<ModelImpl> scsolver::numeric::nlp::Model::m_pImpl [private]

Definition at line 192 of file nlpmodel.hxx.

Referenced by getAllConstraints(), getFuncObject(), getGoal(), getPrecision(), getVarBound(), getVerbose(), isVarBounded(), print(), pushConstraint(), pushVar(), setFuncObject(), setGoal(), setPrecision(), setVarBound(), and setVerbose().


The documentation for this class was generated from the following files:
Generated on Mon Jul 28 09:13:52 2008 for scsolver by  doxygen 1.5.3