graph_defs.hpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /**
  2. * @file tests/boost_graph/graph_defs.hpp
  3. * @author The PARADEVS Development Team
  4. * See the AUTHORS or Authors.txt file
  5. */
  6. /*
  7. * PARADEVS - the multimodeling and simulation environment
  8. * This file is a part of the PARADEVS environment
  9. *
  10. * Copyright (C) 2013-2015 ULCO http://www.univ-litoral.fr
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation, either version 3 of the License, or
  15. * (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. */
  25. #ifndef __TESTS_BOOST_GRAPH_GRAPH_DEFS_HPP
  26. #define __TESTS_BOOST_GRAPH_GRAPH_DEFS_HPP 1
  27. #include <boost/graph/adjacency_list.hpp>
  28. namespace paradevs { namespace tests { namespace boost_graph {
  29. struct VertexProperties
  30. {
  31. int _index;
  32. double _weight;
  33. int _type;
  34. VertexProperties() : _index(0), _weight(0), _type(0)
  35. { }
  36. VertexProperties(int index, double weight, int type) :
  37. _index(index), _weight(weight), _type(type)
  38. { }
  39. VertexProperties(const VertexProperties& vp) :
  40. _index(vp._index), _weight(vp._weight), _type(vp._type)
  41. { }
  42. };
  43. struct EdgeProperties
  44. {
  45. double _weight;
  46. EdgeProperties() : _weight(0)
  47. { }
  48. EdgeProperties(double weight) : _weight(weight)
  49. { }
  50. };
  51. typedef boost::adjacency_list < boost::vecS,
  52. boost::vecS,
  53. boost::bidirectionalS,
  54. VertexProperties,
  55. EdgeProperties > OrientedGraph;
  56. typedef boost::adjacency_list < boost::vecS,
  57. boost::vecS,
  58. boost::undirectedS,
  59. VertexProperties,
  60. EdgeProperties > UnorientedGraph;
  61. } } } // namespace paradevs tests boost_graph
  62. #endif