File: SimplicialComplex.hh

package info (click to toggle)
topcom 0.17.8%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 78,572 kB
  • sloc: cpp: 16,640; sh: 975; makefile: 345; ansic: 40
file content (43 lines) | stat: -rw-r--r-- 1,057 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
////////////////////////////////////////////////////////////////////////////////
// 
// SimplicialComplex.hh 
//
//    produced: 21/08/97 jr
// last change: 24/01/98 jr
//
////////////////////////////////////////////////////////////////////////////////
#ifndef SIMPLICIALCOMPLEX_HH
#define SIMPLICIALCOMPLEX_HH

#include "FastSimplicialComplex.hh"
#include "SparseSimplicialComplex.hh"

#ifdef SPARSE
typedef SparseSimplicialComplex                     SimplicialComplex;
#else
typedef FastSimplicialComplex                       SimplicialComplex;
#endif

#if defined (STL_CONTAINERS) || defined (NEED_STL_HASH)

#include <tr1/unordered_map>
#include <tr1/unordered_set>

namespace std {
  namespace tr1 {
    template<>				
    struct hash<SimplicialComplex> {
      std::size_t operator()(const SimplicialComplex& sc) const {
	std::size_t result;
	for (size_type k = 0; k < sc.keysize(); ++k) {
	  result ^= sc.key(k);
	}
	return result;
      }
    };      
  };
};                                            
#endif

#endif
// eof SimplicialComplex.hh