ALPS Home Libraries License Support People ALPS Web Site

PrevUpHomeNext

Class template graph_helper

alps::graph_helper

Synopsis

// In header: <alps/lattice/graph_helper.h>

template<typename G = coordinate_graph_type> 
class graph_helper : public alps::LatticeLibrary {
public:
  // types
  typedef G                                                                                                                 graph_type;                        
  typedef lattice_graph< hypercubic_lattice< coordinate_lattice< simple_lattice< GraphUnitCell > > >, graph_type >          lattice_type;                      
  typedef graph_traits< graph_type >::vertex_iterator                                                                       vertex_iterator;                   
  typedef graph_traits< graph_type >::edge_iterator                                                                         edge_iterator;                     
  typedef graph_traits< graph_type >::out_edge_iterator                                                                     out_edge_iterator;                 
  typedef graph_traits< graph_type >::in_edge_iterator                                                                      in_edge_iterator;                  
  typedef graph_traits< graph_type >::edge_descriptor                                                                       edge_descriptor;                   
  typedef graph_traits< graph_type >::vertex_descriptor                                                                     vertex_descriptor;                 
  typedef graph_traits< graph_type >::vertices_size_type                                                                    vertices_size_type;                
  typedef graph_traits< graph_type >::edges_size_type                                                                       edges_size_type;                   
  typedef graph_traits< graph_type >::degree_size_type                                                                      degree_size_type;                  
  typedef graph_traits< graph_type >::adjacency_iterator                                                                    adjacency_iterator;                
  typedef graph_traits< graph_type >::site_iterator                                                                         site_iterator;                     
  typedef graph_traits< graph_type >::bond_iterator                                                                         bond_iterator;                     
  typedef graph_traits< graph_type >::neighbor_bond_iterator                                                                neighbor_bond_iterator;            
  typedef graph_traits< graph_type >::bond_descriptor                                                                       bond_descriptor;                   
  typedef graph_traits< graph_type >::site_descriptor                                                                       site_descriptor;                   
  typedef graph_traits< graph_type >::sites_size_type                                                                       sites_size_type;                   
  typedef graph_traits< graph_type >::bonds_size_type                                                                       bonds_size_type;                   
  typedef graph_traits< graph_type >::neighbors_size_type                                                                   neighbors_size_type;               
  typedef graph_traits< graph_type >::neighbor_iterator                                                                     neighbor_iterator;                 
  typedef lattice_traits< lattice_type >::unit_cell_type                                                                    unit_cell_type;                    
  typedef lattice_traits< lattice_type >::cell_descriptor                                                                   cell_descriptor;                   
  typedef lattice_traits< lattice_type >::offset_type                                                                       offset_type;                       
  typedef lattice_traits< lattice_type >::vector_type                                                                       vector_type;                       
  typedef lattice_traits< lattice_type >::size_type                                                                         size_type;                         
  typedef lattice_traits< lattice_type >::cell_iterator                                                                     cell_iterator;                     
  typedef lattice_traits< lattice_type >::momentum_iterator                                                                 momentum_iterator;                 
  typedef lattice_traits< lattice_type >::basis_vector_iterator                                                             basis_vector_iterator;             
  typedef lattice_traits< lattice_type >::boundary_crossing_type                                                            boundary_crossing_type;            
  typedef property_map< edge_type_t, graph_type, type_type >::const_type                                                    edge_type_map_type;                
  typedef edge_type_map_type                                                                                                bond_type_map_type;                
  typedef property_map< vertex_type_t, graph_type, type_type >::const_type                                                  vertex_type_map_type;              
  typedef vertex_type_map_type                                                                                              site_type_map_type;                
  typedef boost::vector_property_map< type_type >                                                                           inhomogeneous_vertex_type_map_type;
  typedef inhomogeneous_vertex_type_map_type                                                                                inhomogeneous_site_type_map_type;  
  typedef boost::vector_property_map< type_type, typename property_map< edge_index_t, graph_type, type_type >::const_type > inhomogeneous_edge_type_map_type;  
  typedef inhomogeneous_edge_type_map_type                                                                                  inhomogeneous_bond_type_map_type;  

  // construct/copy/destruct
  graph_helper(std::istream &, const Parameters &);
  graph_helper(const alps::Parameters &);
  graph_helper(const graph_helper &);
  const graph_helper & operator=(const graph_helper &);
  ~graph_helper();

  // public member functions
  graph_type & graph();
  const graph_type & graph() const;
  template<typename H> graph_traits< H >::graph_type & graph(H &) const;
  template<typename H> 
    const graph_traits< H >::graph_type & graph(const H &) const;
  lattice_type & lattice();
  const lattice_type & lattice() const;
  vertices_size_type num_vertices() const;
  edges_size_type num_edges() const;
  std::pair< vertex_iterator, vertex_iterator > vertices() const;
  std::pair< edge_iterator, edge_iterator > edges() const;
  degree_size_type out_degree(const vertex_descriptor &) const;
  degree_size_type in_degree(const vertex_descriptor &) const;
  degree_size_type degree(const vertex_descriptor &) const;
  std::pair< out_edge_iterator, out_edge_iterator > 
  out_edges(const vertex_descriptor &) const;
  std::pair< in_edge_iterator, in_edge_iterator > 
  in_edges(const vertex_descriptor &) const;
  std::pair< adjacency_iterator, adjacency_iterator > 
  adjacent_vertices(const vertex_descriptor &) const;
  vertex_descriptor vertex(vertices_size_type) const;
  site_descriptor source(const bond_descriptor &) const;
  site_descriptor target(const bond_descriptor &) const;
  template<typename H> 
    graph_traits< H >::vertices_size_type num_vertices(const H &) const;
  template<typename H> 
    graph_traits< H >::edges_size_type num_edges(const H &) const;
  template<typename H> 
    std::pair< typename graph_traits< H >::vertex_iterator, typename graph_traits< H >::vertex_iterator > 
    vertices(const H &) const;
  template<typename H> 
    std::pair< typename graph_traits< H >::edge_iterator, typename graph_traits< H >::edge_iterator > 
    edges(const H &) const;
  template<typename H> 
    graph_traits< H >::degree_size_type 
    out_degree(const typename graph_traits< H >::vertex_descriptor &, 
               const H &) const;
  template<typename H> 
    graph_traits< H >::degree_size_type 
    in_degree(const typename graph_traits< H >::vertex_descriptor &, 
              const H &) const;
  template<typename H> 
    graph_traits< H >::degree_size_type 
    degree(const typename graph_traits< H >::vertex_descriptor &, const H &) const;
  template<typename H> 
    std::pair< typename graph_traits< H >::out_edge_iterator, typename graph_traits< H >::out_edge_iterator > 
    out_edges(const typename graph_traits< H >::vertex_descriptor &, 
              const H &) const;
  template<typename H> 
    std::pair< typename graph_traits< H >::in_edge_iterator, typename graph_traits< H >::in_edge_iterator > 
    in_edges(const typename graph_traits< H >::vertex_descriptor &, const H &) const;
  template<typename H> 
    std::pair< typename graph_traits< H >::adjacency_iterator, typename graph_traits< H >::adjacency_iterator > 
    adjacent_vertices(const typename graph_traits< H >::vertex_descriptor &, 
                      const H &) const;
  template<typename H> 
    graph_traits< H >::vertex_descriptor 
    vertex(typename graph_traits< H >::vertices_size_type, const H &) const;
  template<typename H> 
    graph_traits< H >::site_descriptor 
    source(const typename graph_traits< H >::bond_descriptor &, const H &) const;
  template<typename H> 
    graph_traits< H >::site_descriptor 
    target(const typename graph_traits< H >::bond_descriptor &, const H &) const;
  sites_size_type num_sites() const;
  bonds_size_type num_bonds() const;
  std::pair< site_iterator, site_iterator > sites() const;
  site_descriptor site(sites_size_type) const;
  std::pair< bond_iterator, bond_iterator > bonds() const;
  bond_descriptor bond(bonds_size_type) const;
  neighbors_size_type num_neighbors(const site_descriptor &) const;
  std::pair< neighbor_bond_iterator, neighbor_bond_iterator > 
  neighbor_bonds(const site_descriptor &) const;
  std::pair< neighbor_iterator, neighbor_iterator > 
  neighbors(const site_descriptor &) const;
  site_descriptor neighbor(const site_descriptor &, neighbors_size_type) const;
  template<typename H> 
    graph_traits< H >::sites_size_type num_sites(const H &) const;
  template<typename H> 
    graph_traits< H >::bonds_size_type num_bonds(const H &) const;
  template<typename H> 
    std::pair< typename graph_traits< H >::site_iterator, typename graph_traits< H >::site_iterator > 
    sites(const H &) const;
  template<typename H> 
    graph_traits< H >::site_descriptor 
    site(typename graph_traits< H >::sites_size_type, const H &) const;
  template<typename H> 
    std::pair< typename graph_traits< H >::bond_iterator, typename graph_traits< H >::bond_iterator > 
    bonds(const H &) const;
  template<typename H> 
    graph_traits< H >::bond_descriptor 
    bond(typename graph_traits< H >::bonds_size_type, const H &) const;
  template<typename H> 
    graph_traits< H >::neighbors_size_type 
    num_neighbors(const typename graph_traits< H >::site_descriptor &, 
                  const H &) const;
  template<typename H> 
    std::pair< typename graph_traits< H >::neighbor_bond_iterator, typename graph_traits< H >::neighbor_bond_iterator > 
    neighbor_bonds(const typename graph_traits< H >::site_descriptor &, 
                   const H &) const;
  template<typename H> 
    std::pair< typename graph_traits< H >::neighbor_iterator, typename graph_traits< H >::neighbor_iterator > 
    neighbors(const typename graph_traits< H >::site_descriptor &, const H &) const;
  template<typename H> 
    graph_traits< H >::site_descriptor 
    neighbor(const typename graph_traits< H >::site_descriptor &, 
             typename graph_traits< H >::neighbors_size_type, const H &) const;
  double parity(const site_descriptor &) const;
  bool is_bipartite() const;
  vertex_type_map_type vertex_type_map() const;
  site_type_map_type site_type_map() const;
  edge_type_map_type edge_type_map() const;
  bond_type_map_type bond_type_map() const;
  type_type vertex_type(const vertex_descriptor &) const;
  type_type site_type(const site_descriptor &) const;
  type_type edge_type(const edge_descriptor &) const;
  type_type bond_type(const bond_descriptor &) const;
  bool inhomogeneous() const;
  bool inhomogeneous_vertices() const;
  bool inhomogeneous_sites() const;
  bool inhomogeneous_edges() const;
  bool inhomogeneous_bonds() const;
  inhomogeneous_vertex_type_map_type inhomogeneous_vertex_type_map() const;
  inhomogeneous_site_type_map_type inhomogeneous_site_type_map() const;
  inhomogeneous_edge_type_map_type inhomogeneous_edge_type_map() const;
  inhomogeneous_bond_type_map_type inhomogeneous_bond_type_map() const;
  type_type inhomogeneous_vertex_type(const vertex_descriptor &) const;
  type_type inhomogeneous_site_type(const site_descriptor &) const;
  type_type inhomogeneous_edge_type(const edge_descriptor &) const;
  type_type inhomogeneous_bond_type(const bond_descriptor &) const;
  const vector_type & coordinate(const site_descriptor &) const;
  std::string coordinate_string(const site_descriptor &, int = 0) const;
  const vector_type & bond_vector(const bond_descriptor &) const;
  const vector_type & bond_vector_relative(const bond_descriptor &) const;
  std::size_t dimension() const;
  std::pair< momentum_iterator, momentum_iterator > momenta() const;
  void throw_if_xyz_defined(const Parameters &, const vertex_descriptor &) const;
  void throw_if_xyz_defined(const Parameters &, const edge_descriptor &) const;
  Parameters coordinate_as_parameter(const edge_descriptor &) const;
  Parameters coordinate_as_parameter(const vertex_descriptor &) const;
  size_type volume() const;
  const unit_cell_type & unit_cell() const;
  cell_descriptor cell(const offset_type &) const;
  std::pair< cell_iterator, cell_iterator > cells() const;
  const offset_type & offset(const cell_descriptor &) const;
  bool on_lattice(const offset_type &) const;
  std::pair< bool, boundary_crossing_type > 
  shift(offset_type &, const offset_type &) const;
  size_type cell_index(const cell_descriptor &) const;
  size_type vertex_index(const vertex_descriptor &) const;
  size_type edge_index(const edge_descriptor &) const;
  size_type index(const cell_descriptor &) const;
  size_type index(const vertex_descriptor &) const;
  size_type index(const edge_descriptor &) const;
  std::pair< basis_vector_iterator, basis_vector_iterator > 
  basis_vectors() const;
  std::pair< basis_vector_iterator, basis_vector_iterator > 
  reciprocal_basis_vectors() const;
  vector_type origin(const cell_descriptor &) const;
  vector_type coordinate(const cell_descriptor &, const vector_type &) const;
  vector_type momentum(const vector_type &) const;
  size_type num_distances() const;
  std::vector< unsigned int > distance_multiplicities() const;
  std::vector< std::string > momenta_labels(int = 0) const;
  std::vector< std::string > distance_labels(int = 0) const;
  std::string site_label(site_descriptor const &, int = 0) const;
  std::vector< std::string > site_labels(int = 0) const;
  std::string bond_labels(bond_descriptor const &, int = 0) const;
  std::vector< std::string > bond_labels(int = 0) const;
  size_type distance(vertex_descriptor, vertex_descriptor) const;
  void calculate_distances() const;
  std::vector< std::pair< std::complex< double >, std::vector< std::size_t > > > 
  translations(const vector_type &) const;
  std::vector< int > translation_directions() const;
  std::vector< vector_type > translation_momenta() const;

  // private member functions
  graph_type * make_graph(const Parameters &);
  const graph_type & const_graph() const;
};

Description

graph_helper public construct/copy/destruct

  1. graph_helper(std::istream & in, const Parameters & p);
  2. graph_helper(const alps::Parameters & p);
  3. graph_helper(const graph_helper & o);
  4. const graph_helper & operator=(const graph_helper &);
  5. ~graph_helper();

graph_helper public member functions

  1. graph_type & graph();
  2. const graph_type & graph() const;
  3. template<typename H> graph_traits< H >::graph_type & graph(H & g) const;
  4. template<typename H> 
      const graph_traits< H >::graph_type & graph(const H & g) const;
  5. lattice_type & lattice();
  6. const lattice_type & lattice() const;
  7. vertices_size_type num_vertices() const;
  8. edges_size_type num_edges() const;
  9. std::pair< vertex_iterator, vertex_iterator > vertices() const;
  10. std::pair< edge_iterator, edge_iterator > edges() const;
  11. degree_size_type out_degree(const vertex_descriptor & v) const;
  12. degree_size_type in_degree(const vertex_descriptor & v) const;
  13. degree_size_type degree(const vertex_descriptor & v) const;
  14. std::pair< out_edge_iterator, out_edge_iterator > 
    out_edges(const vertex_descriptor & v) const;
  15. std::pair< in_edge_iterator, in_edge_iterator > 
    in_edges(const vertex_descriptor & v) const;
  16. std::pair< adjacency_iterator, adjacency_iterator > 
    adjacent_vertices(const vertex_descriptor & v) const;
  17. vertex_descriptor vertex(vertices_size_type i) const;
  18. site_descriptor source(const bond_descriptor & b) const;
  19. site_descriptor target(const bond_descriptor & b) const;
  20. template<typename H> 
      graph_traits< H >::vertices_size_type num_vertices(const H & g) const;
  21. template<typename H> 
      graph_traits< H >::edges_size_type num_edges(const H & g) const;
  22. template<typename H> 
      std::pair< typename graph_traits< H >::vertex_iterator, typename graph_traits< H >::vertex_iterator > 
      vertices(const H & g) const;
  23. template<typename H> 
      std::pair< typename graph_traits< H >::edge_iterator, typename graph_traits< H >::edge_iterator > 
      edges(const H & g) const;
  24. template<typename H> 
      graph_traits< H >::degree_size_type 
      out_degree(const typename graph_traits< H >::vertex_descriptor & v, 
                 const H & g) const;
  25. template<typename H> 
      graph_traits< H >::degree_size_type 
      in_degree(const typename graph_traits< H >::vertex_descriptor & v, 
                const H & g) const;
  26. template<typename H> 
      graph_traits< H >::degree_size_type 
      degree(const typename graph_traits< H >::vertex_descriptor & v, const H & g) const;
  27. template<typename H> 
      std::pair< typename graph_traits< H >::out_edge_iterator, typename graph_traits< H >::out_edge_iterator > 
      out_edges(const typename graph_traits< H >::vertex_descriptor & v, 
                const H & g) const;
  28. template<typename H> 
      std::pair< typename graph_traits< H >::in_edge_iterator, typename graph_traits< H >::in_edge_iterator > 
      in_edges(const typename graph_traits< H >::vertex_descriptor & v, 
               const H & g) const;
  29. template<typename H> 
      std::pair< typename graph_traits< H >::adjacency_iterator, typename graph_traits< H >::adjacency_iterator > 
      adjacent_vertices(const typename graph_traits< H >::vertex_descriptor & v, 
                        const H & g) const;
  30. template<typename H> 
      graph_traits< H >::vertex_descriptor 
      vertex(typename graph_traits< H >::vertices_size_type i, const H & g) const;
  31. template<typename H> 
      graph_traits< H >::site_descriptor 
      source(const typename graph_traits< H >::bond_descriptor & b, const H & g) const;
  32. template<typename H> 
      graph_traits< H >::site_descriptor 
      target(const typename graph_traits< H >::bond_descriptor & b, const H & g) const;
  33. sites_size_type num_sites() const;
  34. bonds_size_type num_bonds() const;
  35. std::pair< site_iterator, site_iterator > sites() const;
  36. site_descriptor site(sites_size_type i) const;
  37. std::pair< bond_iterator, bond_iterator > bonds() const;
  38. bond_descriptor bond(bonds_size_type i) const;
  39. neighbors_size_type num_neighbors(const site_descriptor & v) const;
  40. std::pair< neighbor_bond_iterator, neighbor_bond_iterator > 
    neighbor_bonds(const site_descriptor & v) const;
  41. std::pair< neighbor_iterator, neighbor_iterator > 
    neighbors(const site_descriptor & v) const;
  42. site_descriptor 
    neighbor(const site_descriptor & v, neighbors_size_type i) const;
  43. template<typename H> 
      graph_traits< H >::sites_size_type num_sites(const H & g) const;
  44. template<typename H> 
      graph_traits< H >::bonds_size_type num_bonds(const H & g) const;
  45. template<typename H> 
      std::pair< typename graph_traits< H >::site_iterator, typename graph_traits< H >::site_iterator > 
      sites(const H & g) const;
  46. template<typename H> 
      graph_traits< H >::site_descriptor 
      site(typename graph_traits< H >::sites_size_type i, const H & g) const;
  47. template<typename H> 
      std::pair< typename graph_traits< H >::bond_iterator, typename graph_traits< H >::bond_iterator > 
      bonds(const H & g) const;
  48. template<typename H> 
      graph_traits< H >::bond_descriptor 
      bond(typename graph_traits< H >::bonds_size_type i, const H & g) const;
  49. template<typename H> 
      graph_traits< H >::neighbors_size_type 
      num_neighbors(const typename graph_traits< H >::site_descriptor & v, 
                    const H & g) const;
  50. template<typename H> 
      std::pair< typename graph_traits< H >::neighbor_bond_iterator, typename graph_traits< H >::neighbor_bond_iterator > 
      neighbor_bonds(const typename graph_traits< H >::site_descriptor & v, 
                     const H & g) const;
  51. template<typename H> 
      std::pair< typename graph_traits< H >::neighbor_iterator, typename graph_traits< H >::neighbor_iterator > 
      neighbors(const typename graph_traits< H >::site_descriptor & v, 
                const H & g) const;
  52. template<typename H> 
      graph_traits< H >::site_descriptor 
      neighbor(const typename graph_traits< H >::site_descriptor & v, 
               typename graph_traits< H >::neighbors_size_type i, const H & g) const;
  53. double parity(const site_descriptor & v) const;
  54. bool is_bipartite() const;
  55. vertex_type_map_type vertex_type_map() const;
  56. site_type_map_type site_type_map() const;
  57. edge_type_map_type edge_type_map() const;
  58. bond_type_map_type bond_type_map() const;
  59. type_type vertex_type(const vertex_descriptor & v) const;
  60. type_type site_type(const site_descriptor & s) const;
  61. type_type edge_type(const edge_descriptor & e) const;
  62. type_type bond_type(const bond_descriptor & b) const;
  63. bool inhomogeneous() const;
  64. bool inhomogeneous_vertices() const;
  65. bool inhomogeneous_sites() const;
  66. bool inhomogeneous_edges() const;
  67. bool inhomogeneous_bonds() const;
  68. inhomogeneous_vertex_type_map_type inhomogeneous_vertex_type_map() const;
  69. inhomogeneous_site_type_map_type inhomogeneous_site_type_map() const;
  70. inhomogeneous_edge_type_map_type inhomogeneous_edge_type_map() const;
  71. inhomogeneous_bond_type_map_type inhomogeneous_bond_type_map() const;
  72. type_type inhomogeneous_vertex_type(const vertex_descriptor & v) const;
  73. type_type inhomogeneous_site_type(const site_descriptor & s) const;
  74. type_type inhomogeneous_edge_type(const edge_descriptor & e) const;
  75. type_type inhomogeneous_bond_type(const bond_descriptor & b) const;
  76. const vector_type & coordinate(const site_descriptor & s) const;
  77. std::string coordinate_string(const site_descriptor & s, int precision = 0) const;
  78. const vector_type & bond_vector(const bond_descriptor & b) const;
  79. const vector_type & bond_vector_relative(const bond_descriptor & b) const;
  80. std::size_t dimension() const;
  81. std::pair< momentum_iterator, momentum_iterator > momenta() const;
  82. void throw_if_xyz_defined(const Parameters & p, const vertex_descriptor &) const;
  83. void throw_if_xyz_defined(const Parameters & p, const edge_descriptor &) const;
  84. Parameters coordinate_as_parameter(const edge_descriptor & e) const;
  85. Parameters coordinate_as_parameter(const vertex_descriptor & v) const;
  86. size_type volume() const;
  87. const unit_cell_type & unit_cell() const;
  88. cell_descriptor cell(const offset_type & o) const;
  89. std::pair< cell_iterator, cell_iterator > cells() const;
  90. const offset_type & offset(const cell_descriptor & c) const;
  91. bool on_lattice(const offset_type & o) const;
  92. std::pair< bool, boundary_crossing_type > 
    shift(offset_type & o, const offset_type & s) const;
  93. size_type cell_index(const cell_descriptor & c) const;
  94. size_type vertex_index(const vertex_descriptor & v) const;
  95. size_type edge_index(const edge_descriptor & e) const;
  96. size_type index(const cell_descriptor & c) const;
  97. size_type index(const vertex_descriptor & v) const;
  98. size_type index(const edge_descriptor & e) const;
  99. std::pair< basis_vector_iterator, basis_vector_iterator > 
    basis_vectors() const;
  100. std::pair< basis_vector_iterator, basis_vector_iterator > 
    reciprocal_basis_vectors() const;
  101. vector_type origin(const cell_descriptor & c) const;
  102. vector_type coordinate(const cell_descriptor & c, const vector_type & p) const;
  103. vector_type momentum(const vector_type & m) const;
  104. size_type num_distances() const;
  105. std::vector< unsigned int > distance_multiplicities() const;
  106. std::vector< std::string > momenta_labels(int precision = 0) const;
  107. std::vector< std::string > distance_labels(int precision = 0) const;
  108. std::string site_label(site_descriptor const & s, int precision = 0) const;
  109. std::vector< std::string > site_labels(int precision = 0) const;
  110. std::string bond_labels(bond_descriptor const & b, int precision = 0) const;
  111. std::vector< std::string > bond_labels(int precision = 0) const;
  112. size_type distance(vertex_descriptor x, vertex_descriptor y) const;
  113. void calculate_distances() const;
  114. std::vector< std::pair< std::complex< double >, std::vector< std::size_t > > > 
    translations(const vector_type & k) const;
  115. std::vector< int > translation_directions() const;
  116. std::vector< vector_type > translation_momenta() const;

graph_helper private member functions

  1. graph_type * make_graph(const Parameters & p);
  2. const graph_type & const_graph() const;
Copyright © 1994, 2002-2005 Matthias Troyer, Synge Todo

PrevUpHomeNext