Refreshed the code to compile without warning.
[universe.git] / map.h
1
2 // Written and (C) by Francois Fleuret
3 // Contact <francois.fleuret@idiap.ch> for comments & bug reports
4
5 #ifndef MAP_H
6 #define MAP_H
7
8 #include <iostream>
9 #include <cmath>
10
11 using namespace std;
12
13 #include "misc.h"
14
15 class Map {
16 public:
17   int nb_parameters;
18   scalar_t *parameters;
19   Map();
20   virtual ~Map();
21   virtual void init(int np);
22   virtual void update_map() = 0;
23 };
24
25 // A MapConcatener groups several maps and make them appear as a
26 // single one
27
28 class MapConcatener : public Map {
29   int _nb_max_maps, _nb_maps;
30   Map **_maps;
31 public:
32   MapConcatener(int nb_max_maps);
33   ~MapConcatener();
34   void load(istream &is);
35   void save(ostream &os);
36   void add_map(Map *map);
37   void init();
38   void update_map();
39 };
40
41 // A MapExpander is a map whose parameters are functions of the
42 // parameter of an input map
43
44 class MapExpander : public Map {
45   int _nb_units;
46   scalar_t *_unit_weights, *_state_switch;
47   Map *_input;
48 public:
49   MapExpander(int nb_units);
50   ~MapExpander();
51   void load(istream &is);
52   void save(ostream &os);
53   void set_input(Map *input);
54   void init();
55   void update_map();
56 };
57
58 #endif