TSPLIB
Public Member Functions | Private Member Functions | Private Attributes | Friends
Instance Class Reference

#include <ValidateInstance.hpp>

List of all members.

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 ()
Instanceoperator= (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
GraphgetGraph () 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
Graphgraph

Friends

std::ostream & operator<< (std::ostream &os, Instance &instance)

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
nameName of the instance.
sourceSource of the instance.
descriptionDescription of the instance.
doublePrecisionPrecision of doubles.
ignoredDigitsNumber of ignored digits of double types. (The deviation of double values can be at most 1e-(DoublePrecision - IgnoredDigits).)
graphThe underlying weighted complete graph.

Definition at line 37 of file ValidateInstance.cpp.

Instance::Instance ( const Instance instance)

Copy constructor for the class Instance.

Parameters:
instanceInstance 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.


Member Function Documentation

std::string Instance::getDescription ( ) const [inline]

Returns the description of the instance.

Returns:
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.

Returns:
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.

Returns:
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.

Returns:
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).)

Returns:
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.

Returns:
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.

Returns:
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

Parameters:
nameName of the instance.
sourceSource of the instance.
descriptionDescription of the instance.
doublePrecisionPrecision of doubles.
ignoredDigitsNumber of ignored digits of double types. (The deviation of double values can be at most 1e-(DoublePrecision - IgnoredDigits).)
graphThe underlying weighted complete graph.

Definition at line 21 of file ValidateInstance.cpp.

Instance & Instance::operator= ( const Instance instance)

Implements the operator "=".

Parameters:
instanceRight side of the operator.
Returns:
Left side of the operator.

Definition at line 81 of file ValidateInstance.cpp.

References getDescription(), getDoublePrecision(), getGraph(), getIgnoredDigits(), getName(), and getSource().


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
Instance instance 
) [friend]

Implements the operator "<<".

Parameters:
osOstream.
instanceInstance.
Returns:
Ostream with the information about the instance instance.

Definition at line 107 of file ValidateInstance.cpp.


Member Data Documentation

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]

Name of the instance.

Definition at line 34 of file ValidateInstance.hpp.

Referenced by getName().

std::string Instance::source [private]

Source of the instance.

Definition at line 39 of file ValidateInstance.hpp.

Referenced by getSource().


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Friends Defines