| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | Protected Member Functions
TeGeneralizedProxMatrix< Set > Class Template Reference

A class to represent a generalized proximity matrix. More...

`#include <TeGeneralizedProxMatrix.h>`

List of all members.

## Public Member Functions

| TeGeneralizedProxMatrix ()
| Empty constructor.
| TeGeneralizedProxMatrix (const int &id, const string &tableName, TeProxMatrixImplementation *imp, TeProxMatrixWeightsStrategy *ws)
| Constructor.
| TeGeneralizedProxMatrix (TeProxMatrixConstructionStrategy< Set > *sc, TeProxMatrixWeightsStrategy *sw=0, TeProxMatrixSlicingStrategy *ss=0, const TeGPMImplementation &type=TeGraphBreymann, const int &gpmId=-1, const bool &isDefault=false, const string &neigsTable="", const int &slices=1)
| Constructor parametrized with specific strategies. Each stragegy must be previously created and correctly parametrized.
| TeGeneralizedProxMatrix (TeSTElementSet *objects, TeGeomRep geom_type, const TeGPMImplementation &type=TeGraphBreymann)
| Constructor based on default strategies: (a) Local adjacency of first order; (b) No siling; and (c) No weighs (all equal to 1).
| TeGeneralizedProxMatrix (const TeGeneralizedProxMatrix &p)
| Copy constructor.
TeGeneralizedProxMatrix & | operator= (const TeGeneralizedProxMatrix &p)
| Attribution Operator.
bool | clearImplementation ()
bool | operator== (const TeGeneralizedProxMatrix &p) const
| Comparison Operator.
bool | constructMatrix ()
| Reconstruct matrix and recompute weights and slicing, accornding to current strategies.
bool | recomputeWeights ()
| Recomputes the weigths, given a new strategy. The matrix is not reconstructed.
bool | recomputeSlicing ()
| Sets the slicing strategy for neighbours selection.
bool | isConnected (const string &object_id1, const string &object_id2)
| Verify if two objects are connected.
bool | connectObjects (const string &object_id1, const string &object_id2, const TeProxMatrixAttributes &attr)
| Connect two objects.
bool | connectObjects (const string &object_id1, const string &object_id2)
| Connect two objects.
bool | disconnectObjects (const string &object_id1, const string &object_id2)
| Disconnect two objects.
bool | removeObject (const string &object_id)
| Remove object.
bool | getConnectionAttributes (const string &object_id1, string &object_id2, TeProxMatrixAttributes &attr)
| Get connection attributes.
int | numberOfObjects ()
| Return the number of objects.
int | numerOfSlices ()
| Return the number of slices.
bool | saveTextFile (const string &name, map< string, string > *ids=0)
| Save the matrix in a text file.
bool | saveGALFile (const string &name, map< string, string > *ids=0)
| Save the matrix in a text file.
bool | saveGWTFile (const string &name, map< string, string > *ids=0)
| Save the matrix in a text file.
bool | saveTextFile (const string &name, vector< string > *ids)
| Save the matrix in a text file.
bool | saveGALFile (const string &name, vector< string > *ids)
| Save the matrix in a text file.
bool | saveGWTFile (const string &name, vector< string > *ids)
| Save the matrix in a text file.
virtual | ~TeGeneralizedProxMatrix ()
| Destructor.
getNeighbours Methods for return the neighbours
All methods return the neighbours of a given object in a given slice. The default is the first slice. Slices are defined according to the Slicing Strategy in use (e.g., according to distance zones, corresponding to neighbourhood orders, weights intervals, etc.). If the parameter slice is not provided, the first slice is returned. The operator[] method should preferably be used For each object, all the connection attributes are stored as properties (weight is the first).
TeNeighbours | getNeighbours (const string &object_id, int slice=1)
| Return the neighbours of an object in a slice, packed in a TeNeighbours.
TeNeighboursMap | getMapNeighbours (const string &object_id, int slice=1)
| Return the neighbours of an object in a slice, packed in a TeNeighboursMap.
TeNeighbours | operator[] (const string &object_id)
| Operator [], return the neighbours packed in a TeNeighbours.
TeSTElementSet | getSTENeighbours (const string &object_id)
| Return the neighbours of an object and their attributes in a spatial temporal element set (TeSTElementSet)
ChangeStrategies Methods for changing current strategies
change current strategies
bool | setCurrentConstructionStrategy (TeProxMatrixConstructionStrategy< Set > *sc)
| Set current construction strategy.
bool | setCurrentWeightsStrategy (TeProxMatrixWeightsStrategy *sw)
| Set current weights strategy.
bool | setCurrentSlicingStrategy (TeProxMatrixSlicingStrategy *ss)
| Set current slicing strategy.
TeProxMatrixConstructionParams * | getConstructionParams ()
| Get current construction params.
TeProxMatrixWeightsParams * | getWeightsParams ()
| Get current weights params.
TeProxMatrixSlicingParams * | getSlicingParams ()
| Get current slicing params.

## Public Attributes

int | gpm_id_
bool | is_default_
int | total_slices_
string | neighbourhood_table_
TeGPMImplementation | impl_strategy_

## Protected Member Functions

TeProxMatrixImplementation * | getImplementation (const TeGPMImplementation &implementation_type=TeGraphBreymann)
| Get the implementation from a concrete factory defined by impl_type.
bool | isValid () const
| Verify if a matrix was created correctly by the constructors.

## Detailed Description

### template<typename Set>
class TeGeneralizedProxMatrix< Set >

A class to represent a generalized proximity matrix.

Examples:

  createProximityMatrix.cpp, and proxMatrixAndSpatialStatistics.cpp.

## Constructor & Destructor Documentation

template<typename Set>

TeGeneralizedProxMatrix< Set >::TeGeneralizedProxMatrix | ( |  | ) | `[inline]`

Empty constructor.

template<typename Set>

TeGeneralizedProxMatrix< Set >::TeGeneralizedProxMatrix | ( | const int & | id,
|  | const string & | tableName,
|  | TeProxMatrixImplementation * | imp,
|  | TeProxMatrixWeightsStrategy * | ws
| ) |  | `[inline]`

Constructor.

template<typename Set >

TeGeneralizedProxMatrix< Set >::TeGeneralizedProxMatrix | ( | TeProxMatrixConstructionStrategy< Set > * | sc,
|  | TeProxMatrixWeightsStrategy * | sw = `0`,
|  | TeProxMatrixSlicingStrategy * | ss = `0`,
|  | const TeGPMImplementation & | type = `TeGraphBreymann`,
|  | const int & | gpmId = `-1`,
|  | const bool & | isDefault = `false`,
|  | const string & | neigsTable = `""`,
|  | const int & | slices = `1`
| ) |  |

Constructor parametrized with specific strategies. Each stragegy must be previously created and correctly parametrized.

template<typename Set >

TeGeneralizedProxMatrix< Set >::TeGeneralizedProxMatrix | ( | TeSTElementSet * | objects,
|  | TeGeomRep | geom_type,
|  | const TeGPMImplementation & | type = `TeGraphBreymann`
| ) |  |

Constructor based on default strategies: (a) Local adjacency of first order; (b) No siling; and (c) No weighs (all equal to 1).

template<typename Set >

TeGeneralizedProxMatrix< Set >::TeGeneralizedProxMatrix | ( | const TeGeneralizedProxMatrix< Set > & | p | ) |

Copy constructor.

template<typename Set>

virtual TeGeneralizedProxMatrix< Set >::~TeGeneralizedProxMatrix | ( |  | ) | `[inline, virtual]`

Destructor.

## Member Function Documentation

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::clearImplementation | ( |  | ) |

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::connectObjects | ( | const string & | object_id1,
|  | const string & | object_id2,
|  | const TeProxMatrixAttributes & | attr
| ) |  |

Connect two objects.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::connectObjects | ( | const string & | object_id1,
|  | const string & | object_id2
| ) |  |

Connect two objects.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::constructMatrix | ( |  | ) |

Reconstruct matrix and recompute weights and slicing, accornding to current strategies.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::disconnectObjects | ( | const string & | object_id1,
|  | const string & | object_id2
| ) |  |

Disconnect two objects.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::getConnectionAttributes | ( | const string & | object_id1,
|  | string & | object_id2,
|  | TeProxMatrixAttributes & | attr
| ) |  |

Get connection attributes.

template<typename Set>

TeProxMatrixConstructionParams* TeGeneralizedProxMatrix< Set >::getConstructionParams | ( |  | ) | `[inline]`

Get current construction params.

template<typename Set >

TeProxMatrixImplementation * TeGeneralizedProxMatrix< Set >::getImplementation | ( | const TeGPMImplementation & | implementation_type = `TeGraphBreymann` | ) | `[protected]`

Get the implementation from a concrete factory defined by impl_type.

template<typename Set >

TeNeighboursMap TeGeneralizedProxMatrix< Set >::getMapNeighbours | ( | const string & | object_id,
|  | int | slice = `1`
| ) |  |

Return the neighbours of an object in a slice, packed in a TeNeighboursMap.

template<typename Set >

TeNeighbours TeGeneralizedProxMatrix< Set >::getNeighbours | ( | const string & | object_id,
|  | int | slice = `1`
| ) |  |

Return the neighbours of an object in a slice, packed in a TeNeighbours.

template<typename Set>

TeProxMatrixSlicingParams* TeGeneralizedProxMatrix< Set >::getSlicingParams | ( |  | ) | `[inline]`

Get current slicing params.

template<typename Set >

TeSTElementSet TeGeneralizedProxMatrix< Set >::getSTENeighbours | ( | const string & | object_id | ) |

Return the neighbours of an object and their attributes in a spatial temporal element set (TeSTElementSet)

template<typename Set>

TeProxMatrixWeightsParams* TeGeneralizedProxMatrix< Set >::getWeightsParams | ( |  | ) | `[inline]`

Get current weights params.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::isConnected | ( | const string & | object_id1,
|  | const string & | object_id2
| ) |  |

Verify if two objects are connected.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::isValid | ( |  | ) | const`[protected]`

Verify if a matrix was created correctly by the constructors.

template<typename Set >

int TeGeneralizedProxMatrix< Set >::numberOfObjects | ( |  | ) |

Return the number of objects.

template<typename Set>

int TeGeneralizedProxMatrix< Set >::numerOfSlices | ( |  | ) | `[inline]`

Return the number of slices.

template<typename Set >

TeGeneralizedProxMatrix< Set > & TeGeneralizedProxMatrix< Set >::operator= | ( | const TeGeneralizedProxMatrix< Set > & | p | ) |

Attribution Operator.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::operator== | ( | const TeGeneralizedProxMatrix< Set > & | p | ) | const

Comparison Operator.

template<typename Set >

TeNeighbours TeGeneralizedProxMatrix< Set >::operator[] | ( | const string & | object_id | ) |

Operator [], return the neighbours packed in a TeNeighbours.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::recomputeSlicing | ( |  | ) |

Sets the slicing strategy for neighbours selection.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::recomputeWeights | ( |  | ) |

Recomputes the weigths, given a new strategy. The matrix is not reconstructed.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::removeObject | ( | const string & | object_id | ) |

Remove object.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::saveGALFile | ( | const string & | name,
|  | map< string, string > * | ids = `0`
| ) |  |

Save the matrix in a text file.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::saveGALFile | ( | const string & | name,
|  | vector< string > * | ids
| ) |  |

Save the matrix in a text file.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::saveGWTFile | ( | const string & | name,
|  | map< string, string > * | ids = `0`
| ) |  |

Save the matrix in a text file.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::saveGWTFile | ( | const string & | name,
|  | vector< string > * | ids
| ) |  |

Save the matrix in a text file.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::saveTextFile | ( | const string & | name,
|  | map< string, string > * | ids = `0`
| ) |  |

Save the matrix in a text file.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::saveTextFile | ( | const string & | name,
|  | vector< string > * | ids
| ) |  |

Save the matrix in a text file.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::setCurrentConstructionStrategy | ( | TeProxMatrixConstructionStrategy< Set > * | sc | ) |

Set current construction strategy.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::setCurrentSlicingStrategy | ( | TeProxMatrixSlicingStrategy * | ss | ) |

Set current slicing strategy.

template<typename Set >

bool TeGeneralizedProxMatrix< Set >::setCurrentWeightsStrategy | ( | TeProxMatrixWeightsStrategy * | sw | ) |

Set current weights strategy.

## Member Data Documentation

template<typename Set>

int TeGeneralizedProxMatrix< Set >::gpm_id_

template<typename Set>

TeGPMImplementation TeGeneralizedProxMatrix< Set >::impl_strategy_

template<typename Set>

bool TeGeneralizedProxMatrix< Set >::is_default_

template<typename Set>

string TeGeneralizedProxMatrix< Set >::neighbourhood_table_

template<typename Set>

int TeGeneralizedProxMatrix< Set >::total_slices_

The documentation for this class was generated from the following file:

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeGeneralizedProxMatrix.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines