TSPLIB
Public Member Functions | Private Member Functions | Private Attributes
TransformInstance Class Reference

#include <TransformConstantsClassesAndFunctions.hpp>

List of all members.

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)
TransformInstanceoperator= (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

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
typeType of the instance.
nameName of the instance.
sourceSource of the instance.
descriptionDescription of the instance.
nNumber of vertices in the graph of the instance.

Definition at line 52 of file TransformConstantsClassesAndFunctions.cpp.

References VALUE_TYPE_TSP.

Copy constructor for the class TransformInstance.

Parameters:
transformInstanceInstance to be copied.

Definition at line 73 of file TransformConstantsClassesAndFunctions.cpp.

References getDescription(), getN(), getName(), getSource(), and getType().


Member Function Documentation

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.

Parameters:
iRow.
jColumn.
Returns:
Value of the element on the i-th row and j-th 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.

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

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

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

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

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

Parameters:
typeType of the instance.
nameName of the instance.
sourceSource of the instance.
descriptionDescription of the instance.
nNumber 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 "=".

Parameters:
transformInstanceRight side of the operator.
Returns:
Left 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.

Parameters:
iRow.
jColumn.
valueNew 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().


Member Data Documentation

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().


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