mercredi 22 juillet 2015

standard and efficient map between objects

I am working on clustering problem where I have something called distance matrix. This distance matrix is something like: Distance Matrix

  1. the number of nodes(g) are N (dynamic)
  2. This matrix is Symmetric (dist[i,j]==dist[j,i])
  3. g1,g2,.... are object (they contain strings , integers and may even more..)
  4. I want to be able to reach any value by simple way like dist[4][3] or even more clear way like dist(g1,g5) (here g1 and g5 may be some kind of pointer or reference)
  5. many std algorithm will be applied on this distance matrix like min, max, accumulate ..etc
  6. preferably but not mandatory, I would like not to use boost or other 3rd party libraries

What is the best standard way to declare this matrix.

Aucun commentaire:

Enregistrer un commentaire