TSPLIB
|
#include <ValidateInstance.hpp>
Public Member Functions | |
Instance (const std::string &name, const std::string &source, const std::string &description, const std::streamsize doublePrecision, const std::streamsize ignoredDigits, const Graph &graph) | |
Instance (const Instance &instance) | |
~Instance () | |
Instance & | operator= (const Instance &instance) |
std::string | getName () const |
std::string | getSource () const |
std::string | getDescription () const |
std::streamsize | getDoublePrecision () const |
std::streamsize | getIgnoredDigits () const |
double | getDoubleZero () const |
Graph * | getGraph () const |
Private Member Functions | |
void | init (const std::string &name, const std::string &source, const std::string &description, const std::streamsize doublePrecision, const std::streamsize ignoredDigits, const Graph &graph) |
Private Attributes | |
std::string | name |
std::string | source |
std::string | description |
std::streamsize | doublePrecision |
std::streamsize | ignoredDigits |
double | doubleZero |
Graph * | graph |
Friends | |
std::ostream & | operator<< (std::ostream &os, Instance &instance) |
Saves one instance of the orienteering problem with the graph in the form of a weighted complete graph. This class provides no checks of ranges.
Definition at line 29 of file ValidateInstance.hpp.
Instance::Instance | ( | const std::string & | name, |
const std::string & | source, | ||
const std::string & | description, | ||
const std::streamsize | doublePrecision, | ||
const std::streamsize | ignoredDigits, | ||
const Graph & | graph | ||
) |
Constructor for the class Instance.
name | Name of the instance. |
source | Source of the instance. |
description | Description of the instance. |
doublePrecision | Precision of doubles. |
ignoredDigits | Number of ignored digits of double types. (The deviation of double values can be at most 1e-(DoublePrecision - IgnoredDigits).) |
graph | The underlying weighted complete graph. |
Definition at line 37 of file ValidateInstance.cpp.
Instance::Instance | ( | const Instance & | instance | ) |
Copy constructor for the class Instance.
instance | Instance to be copied. |
Definition at line 56 of file ValidateInstance.cpp.
References getDescription(), getDoublePrecision(), getGraph(), getIgnoredDigits(), getName(), and getSource().
Destructor for the class Instance.
Definition at line 75 of file ValidateInstance.cpp.
std::string Instance::getDescription | ( | ) | const [inline] |
Returns the description of the instance.
Definition at line 152 of file ValidateInstance.hpp.
References description.
Referenced by Instance(), main(), operator<<(), and operator=().
std::streamsize Instance::getDoublePrecision | ( | ) | const [inline] |
Returns the precision of doubles.
Definition at line 160 of file ValidateInstance.hpp.
References doublePrecision.
Referenced by Instance(), operator<<(), and operator=().
double Instance::getDoubleZero | ( | ) | const [inline] |
Returns the maximum of an absolute value considered as zero.
Definition at line 180 of file ValidateInstance.hpp.
References doubleZero.
Referenced by operator<<().
Graph* Instance::getGraph | ( | ) | const [inline] |
Returns the underlying weighted undirected complete graph.
Definition at line 188 of file ValidateInstance.hpp.
References graph.
Referenced by Instance(), main(), operator<<(), and operator=().
std::streamsize Instance::getIgnoredDigits | ( | ) | const [inline] |
Returns the number of ignored digits of double types. (The deviation of double values can be at most 1e-(DoublePrecision - IgnoredDigits).)
Definition at line 172 of file ValidateInstance.hpp.
References ignoredDigits.
Referenced by Instance(), operator<<(), and operator=().
std::string Instance::getName | ( | ) | const [inline] |
Returns the name of the instance.
Definition at line 136 of file ValidateInstance.hpp.
References name.
Referenced by Instance(), main(), operator<<(), and operator=().
std::string Instance::getSource | ( | ) | const [inline] |
Returns the source of the instance.
Definition at line 144 of file ValidateInstance.hpp.
References source.
Referenced by Instance(), main(), operator<<(), and operator=().
void Instance::init | ( | const std::string & | name, |
const std::string & | source, | ||
const std::string & | description, | ||
const std::streamsize | doublePrecision, | ||
const std::streamsize | ignoredDigits, | ||
const Graph & | graph | ||
) | [private] |
Initializes the class variables
name | Name of the instance. |
source | Source of the instance. |
description | Description of the instance. |
doublePrecision | Precision of doubles. |
ignoredDigits | Number of ignored digits of double types. (The deviation of double values can be at most 1e-(DoublePrecision - IgnoredDigits).) |
graph | The underlying weighted complete graph. |
Definition at line 21 of file ValidateInstance.cpp.
Implements the operator "=".
instance | Right side of the operator. |
Definition at line 81 of file ValidateInstance.cpp.
References getDescription(), getDoublePrecision(), getGraph(), getIgnoredDigits(), getName(), and getSource().
std::ostream& operator<< | ( | std::ostream & | os, |
Instance & | instance | ||
) | [friend] |
Implements the operator "<<".
os | Ostream. |
instance | Instance. |
Definition at line 107 of file ValidateInstance.cpp.
std::string Instance::description [private] |
Description of the instance.
Definition at line 44 of file ValidateInstance.hpp.
Referenced by getDescription().
std::streamsize Instance::doublePrecision [private] |
Precision of doubles.
Definition at line 49 of file ValidateInstance.hpp.
Referenced by getDoublePrecision().
double Instance::doubleZero [private] |
Maximum of an absolute value considered as zero.
Definition at line 60 of file ValidateInstance.hpp.
Referenced by getDoubleZero().
Graph* Instance::graph [private] |
The underlying weighted complete graph.
Definition at line 65 of file ValidateInstance.hpp.
Referenced by getGraph().
std::streamsize Instance::ignoredDigits [private] |
Number of ignored digits of double types. (The deviation of double values can be at most 1e-(DoublePrecision - IgnoredDigits).)
Definition at line 55 of file ValidateInstance.hpp.
Referenced by getIgnoredDigits().
std::string Instance::name [private] |
std::string Instance::source [private] |
Source of the instance.
Definition at line 39 of file ValidateInstance.hpp.
Referenced by getSource().