Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Factorize s_type and value instr class
[simgrid.git] / src / kernel / routing / FloydZone.hpp
1 /* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SURF_ROUTING_FLOYD_HPP_
7 #define SURF_ROUTING_FLOYD_HPP_
8
9 #include "src/kernel/routing/RoutedZone.hpp"
10
11 namespace simgrid {
12 namespace kernel {
13 namespace routing {
14
15 /** @ingroup ROUTING_API
16  *  @brief NetZone with an explicit routing computed at initialization with Floyd-Warshal
17  *
18  *  The path between components is computed at creation time from every one-hop links,
19  *  using the Floyd-Warshal algorithm.
20  *
21  *  This result in rather small platform file, slow initialization time,  and intermediate memory requirements
22  *  (somewhere between the one of @{DijkstraZone} and the one of @{FullZone}).
23  */
24 class XBT_PRIVATE FloydZone : public RoutedZone {
25 public:
26   explicit FloydZone(NetZone* father, const char* name);
27   ~FloydZone() override;
28
29   void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
30   void addRoute(sg_platf_route_cbarg_t route) override;
31   void seal() override;
32
33 private:
34   /* vars to compute the Floyd algorithm. */
35   int* predecessorTable_;
36   double* costTable_;
37   sg_platf_route_cbarg_t* linkTable_;
38 };
39 }
40 }
41 } // namespaces
42
43 #endif /* SURF_ROUTING_FLOYD_HPP_ */