Minotaur 0.4.1
Docs for developers
Public Member Functions | Protected Attributes | List of all members
Minotaur::Option< T > Class Template Reference

#include <Option.h>

Collaboration diagram for Minotaur::Option< T >:
Collaboration graph
[legend]

Public Member Functions

 Option (const std::string &name, const std::string &desc, bool is_known=false, T val=0)
 Construct the option using name, description and value.
 
virtual ~Option ()
 Destroy.
 
virtual void setValue (T val)
 Set the value of this option.
 
virtual T getValue ()
 Get the value of option.
 
virtual const std::string & getName ()
 Get the name of this option.
 
virtual const std::string & getDesc ()
 Get the help description of this option.
 
virtual bool wasEverUsed ()
 Check if this option was used somewhere.
 
virtual void setUsedFlag (const bool &used_flag)
 Set the 'used' flag. Used flag is true if.
 
virtual bool isKnown ()
 Return true if the option is known to Minotaur.
 
virtual void setKnownFlag (const bool &known_flag)
 Set or unset the 'known' flag.
 
virtual void write (std::ostream &out) const
 Write to the output stream.
 

Protected Attributes

std::string name_
 
std::string desc_
 
val_
 
bool everUsed_
 
bool isKnown_
 True, if the option is known to minotaur.
 

Detailed Description

template<class T>
class Minotaur::Option< T >

Options are used to control the behavior of Minotaur: choice of algorithms, parameters, limits, outputs etc. They are also used to control the behavior of interfaces and engines that are linked with Minotaur: parameters for LP engine, verbosity, limits etc. This templated class works for any option whose value could be integer, double or string.

All options in Minotaur must be one of the above three types. In the command line, all option names must be entered with a preceding '–'. e.g. ./minotaur –assume_convex yes –node_limit=2 –time_limit 100

Either form '–option_name=option_value' or '–option_name option value' is acceptable.

Any simple options without values, like for instance '-v', '-q' are not allowed, but they can still be accepted if they are aliased to a minotaur acceptable option. In such cases, we need to tell Minotaur, how to expand small options like '-=', '-v', '-AMPL' into a proper Minotaur option. ... more to be added here.

Interfaces to Minotaur, like AMPL, can also add their own options to the Minotaur option-database.

Again, we assume that all options that begin with '–' have a value associated with it. We also assume that all options that begin with '-' do not have any value associated with it. So, for the command, ./minotaur -v 2 –assume_convex yes stub.nl we will assume that '2' is the name of input file, 'yes' is the value of option 'assume_convex' and stub.nl is also an input file.

Member Data Documentation

◆ desc_

template<class T >
std::string Minotaur::Option< T >::desc_
protected

A human-readable description of what the option does and what limits are expected.

◆ everUsed_

template<class T >
bool Minotaur::Option< T >::everUsed_
protected

True, if this option was ever used by any of the procedures. False otherwise.

◆ name_

template<class T >
std::string Minotaur::Option< T >::name_
protected

The name of the option should not have any spaces. All spaces should be converted to underscore (_). If the name consists of a period (.), then the option is meant for the external library referred to by the name before the period. For instance the name: ipopt.some_tolerance tells us to provide Ipopt with the option "some_tolerance". Again, spaces are not allowed even if the external library has spaces in the name.

◆ val_

template<class T >
T Minotaur::Option< T >::val_
protected

The value of the option. For now, we don't check if the user specified options lie in the suggested limits.


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