TSPLIB
|
#include <TransformConstantsClassesAndFunctions.hpp>
Public Member Functions | |
TransformInstance (const std::string &type, const std::string &name, const std::string &source, const std::string &description, const std::vector< std::vector< double > >::size_type n) | |
TransformInstance (const TransformInstance &transformInstance) | |
TransformInstance & | operator= (const TransformInstance &transformInstance) |
std::string | getType () const |
std::string | getName () const |
std::string | getSource () const |
std::string | getDescription () const |
std::vector< std::vector < double > >::size_type | getN () const |
void | setAdjacencyMatrixElement (const std::vector< std::vector< double > >::size_type i, const std::vector< double >::size_type j, const double value) |
double | getAdjacencyMatrixElement (const std::vector< std::vector< double > >::size_type i, const std::vector< double >::size_type j) const |
Private Member Functions | |
void | init (const std::string &type, const std::string &name, const std::string &source, const std::string &description, const std::vector< std::vector< double > >::size_type n) |
Private Attributes | |
std::string | type |
std::string | name |
std::string | source |
std::string | description |
std::vector< std::vector < double > >::size_type | n |
std::vector< std::vector < double > > | adjacencyMatrix |
Saves one instance with the graph in the form of an adjacency matrix. If the instance is symmetric the program saves only the lower part of the adjacency matrix. This class provides no checks of validity or ranges.
Definition at line 331 of file TransformConstantsClassesAndFunctions.hpp.
TransformInstance::TransformInstance | ( | const std::string & | type, |
const std::string & | name, | ||
const std::string & | source, | ||
const std::string & | description, | ||
const std::vector< std::vector< double > >::size_type | n | ||
) |
Constructor for the class TransformInstance.
type | Type of the instance. |
name | Name of the instance. |
source | Source of the instance. |
description | Description of the instance. |
n | Number of vertices in the graph of the instance. |
Definition at line 52 of file TransformConstantsClassesAndFunctions.cpp.
References VALUE_TYPE_TSP.
TransformInstance::TransformInstance | ( | const TransformInstance & | transformInstance | ) |
Copy constructor for the class TransformInstance.
transformInstance | Instance to be copied. |
Definition at line 73 of file TransformConstantsClassesAndFunctions.cpp.
References getDescription(), getN(), getName(), getSource(), and getType().
double TransformInstance::getAdjacencyMatrixElement | ( | const std::vector< std::vector< double > >::size_type | i, |
const std::vector< double >::size_type | j | ||
) | const [inline] |
Returns one element in the adjacency matrix. The parameters are not checked.
i | Row. |
j | Column. |
Definition at line 483 of file TransformConstantsClassesAndFunctions.hpp.
References adjacencyMatrix, type, and VALUE_TYPE_TSP.
Referenced by readInputFileTSPLIB(), writeOutputFile(), and writeOutputFileWithoutUsingAParser().
std::string TransformInstance::getDescription | ( | ) | const [inline] |
Returns the description of the instance.
Definition at line 437 of file TransformConstantsClassesAndFunctions.hpp.
References description.
Referenced by operator=(), TransformInstance(), writeOutputFile(), and writeOutputFileWithoutUsingAParser().
std::vector<std::vector<double> >::size_type TransformInstance::getN | ( | ) | const [inline] |
Returns the number of vertices in the graph of the instance.
Definition at line 445 of file TransformConstantsClassesAndFunctions.hpp.
References n.
Referenced by main(), operator=(), TransformInstance(), writeOutputFile(), and writeOutputFileWithoutUsingAParser().
std::string TransformInstance::getName | ( | ) | const [inline] |
Returns the name of the instance.
Definition at line 421 of file TransformConstantsClassesAndFunctions.hpp.
References name.
Referenced by operator=(), TransformInstance(), writeOutputFile(), and writeOutputFileWithoutUsingAParser().
std::string TransformInstance::getSource | ( | ) | const [inline] |
Returns the source of the instance.
Definition at line 429 of file TransformConstantsClassesAndFunctions.hpp.
References source.
Referenced by operator=(), TransformInstance(), and writeOutputFile().
std::string TransformInstance::getType | ( | ) | const [inline] |
Returns the type of the instance.
Definition at line 413 of file TransformConstantsClassesAndFunctions.hpp.
References type.
Referenced by operator=(), TransformInstance(), writeOutputFile(), and writeOutputFileWithoutUsingAParser().
XERCES_CPP_NAMESPACE_USE void TransformInstance::init | ( | const std::string & | type, |
const std::string & | name, | ||
const std::string & | source, | ||
const std::string & | description, | ||
const std::vector< std::vector< double > >::size_type | n | ||
) | [private] |
Initializes the name, the source, the description and n
type | Type of the instance. |
name | Name of the instance. |
source | Source of the instance. |
description | Description of the instance. |
n | Number of vertices in the graph of the instance. |
Definition at line 39 of file TransformConstantsClassesAndFunctions.cpp.
TransformInstance & TransformInstance::operator= | ( | const TransformInstance & | transformInstance | ) |
Implements the operator "=".
transformInstance | Right side of the operator. |
Definition at line 90 of file TransformConstantsClassesAndFunctions.cpp.
References getDescription(), getN(), getName(), getSource(), and getType().
void TransformInstance::setAdjacencyMatrixElement | ( | const std::vector< std::vector< double > >::size_type | i, |
const std::vector< double >::size_type | j, | ||
const double | value | ||
) | [inline] |
Sets one element in the adjacency matrix. The parameters are not checked. The new value will be rounded according to the constants DOUBLE_PRECISION and IGNORED_DIGITS.
i | Row. |
j | Column. |
value | New value of the element on the i-th row and j-th column. |
Definition at line 457 of file TransformConstantsClassesAndFunctions.hpp.
References adjacencyMatrix, roundToDoublePrecisionAndDoubleFloatField(), type, and VALUE_TYPE_TSP.
Referenced by readInputFileTSPLIB().
std::vector<std::vector<double> > TransformInstance::adjacencyMatrix [private] |
Adjacency matrix of the instance. If the instance is symmetric the program saves only the lower part of the adjacency matrix.
Definition at line 363 of file TransformConstantsClassesAndFunctions.hpp.
Referenced by getAdjacencyMatrixElement(), and setAdjacencyMatrixElement().
std::string TransformInstance::description [private] |
Description of the instance.
Definition at line 351 of file TransformConstantsClassesAndFunctions.hpp.
Referenced by getDescription().
std::vector<std::vector<double> >::size_type TransformInstance::n [private] |
Number of vertices in the graph of the instance.
Definition at line 356 of file TransformConstantsClassesAndFunctions.hpp.
Referenced by getN().
std::string TransformInstance::name [private] |
Name of the instance.
Definition at line 341 of file TransformConstantsClassesAndFunctions.hpp.
Referenced by getName().
std::string TransformInstance::source [private] |
Source of the instance.
Definition at line 346 of file TransformConstantsClassesAndFunctions.hpp.
Referenced by getSource().
std::string TransformInstance::type [private] |
Type of the instance.
Definition at line 336 of file TransformConstantsClassesAndFunctions.hpp.
Referenced by getAdjacencyMatrixElement(), getType(), and setAdjacencyMatrixElement().