Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

Generic_Neighborhood_System Class Reference

A class representing an geenric neighborhood system. More...

#include <Neighborhood_System.hpp>

Inheritance diagram for Generic_Neighborhood_System:

Neighborhood_System List of all members.

Public Member Functions

 Generic_Neighborhood_System ()
 Default constructor.
 ~Generic_Neighborhood_System ()
 Destructor.
void DeleteAll ()
 Free all the memory used by the object.
void GetNeighbors (uint site, vector< Weighted_Neighbor * > &neighs)
 Get the (weighted) neighbors for a given site.
void ReadFromFile (string filename)
void WriteToFile (string filename, bool save_weights)
 Writes the definition of the generic neighborhood system to a text file. weights may be discarded.
void WriteToFile (string filename)
 Writes the definition of the generic neighborhood system to a text file. weights included.
void Info ()

Detailed Description

Author:
Lemine Abdallahi
Date:
Aug. 2005
this is a class where all information about sites and their neighborhoods is given Explicitly.


Constructor & Destructor Documentation

Generic_Neighborhood_System::Generic_Neighborhood_System  ) 
 

Default constructor.

Sets the number of sites to zero.

Generic_Neighborhood_System::~Generic_Neighborhood_System  ) 
 

Default destructor.

Calls DeleteAll .


Member Function Documentation

void Generic_Neighborhood_System::DeleteAll  ) 
 

Frees all memory allocated and used by the neighborhood information.

void Generic_Neighborhood_System::GetNeighbors uint  site,
vector< Weighted_Neighbor * > &  neighs
[virtual]
 

Get the (weighted) neighbors for a given site.

Parameters:
[in] site : a site.
[out] neighs : the set of neighbors of the site site
Fills the vector neighs with the necessary neighborhood data for the site site.

Abstract. To be defined for the derived classes.

Reimplemented from Neighborhood_System.

void Generic_Neighborhood_System::Info  )  [virtual]
 

Display some info about the neighborhood system.

for verification purposes.

Displays :

  • the number of sites
  • The site with the maximum number of neighbors.
  • The site with the minimum number of neighbors.
  • The mean number of neighbors per site.

Reimplemented from Neighborhood_System.

void Generic_Neighborhood_System::ReadFromFile string  filename  )  [virtual]
 

Reads the object definition from a text file.

Parameters:
[in] filename : name of the input file.
Details of the file format may be described as follows:

The first line contains a number ( 0 or 1) depending on wether weights are present (1) or not (0).

The following lines give for each site i the following information

   i k j1, ....jk

where k is the number of neighbors , j1 ... jk are the neighbors of i.

and if weights are present (first line == 1 ) , the weights are appended to this line, this gives :

   i k j1 ... jk wi1 ... wik

a typical example file is :

   1  
   1 2 2 3 0.5 0.4
   2 1 1 0.7
   3 2 1 2 0.6 0.5

Reimplemented from Neighborhood_System.

void Generic_Neighborhood_System::WriteToFile string  filename  ) 
 

Write the neighborhood definition to a text file.

Forces the weights presence in the output.

Parameters:
[in] filename : name of the output file.
The format is described in ReadFromFile .

void Generic_Neighborhood_System::WriteToFile string  filename,
bool  save_weights
 

Write the neighborhood definition to a text file.

Parameters:
[in] filename : name of the output file.
[in] save_weights : boolean , wether to output weights or not.
The format is described in ReadFromFile .


The documentation for this class was generated from the following files:
Generated on Thu Jan 12 11:55:00 2006 for NEM by  doxygen 1.4.4