graph_generator.hpp

Go to the documentation of this file.
00001 // $Id: graph_generator.hpp,v 1.4 2003/03/25 17:42:00 gottschling Exp $
00002 
00003 #ifndef         _graph_generator_include_
00004 #define         _graph_generator_include_
00005 
00006 
00007 //
00008 // random graph generator for DAGs similar to real program's c-graph
00009 //
00010 
00011 #include <vector>
00012 
00013 #include "angel_types.hpp"
00014 
00015 namespace angel {
00016 
00029 void random_statement (int inputs, int expr, const std::vector<double>& p,
00030                        c_graph_t& statement);
00031 
00041 void random_statement_vector (int max_expr, double unary, 
00042                               std::vector<c_graph_t>& statement_vector);
00043 
00050 void stats2block (int inputs, int outputs, const std::vector<c_graph_t>& stats, 
00051                   c_graph_t& block);
00052 
00061 void random_block (int inputs, int outputs, int stats, int max_exp, double unary,
00062                    c_graph_t& block);
00063 
00069 void block2loop (const c_graph_t& block, int loops,
00070                  c_graph_t& loop);
00071 
00072 
00073 // Initializes the random generator unless SAME_RANDOM_VALUES is defined
00074 struct random_init_t {
00075   int dummy;
00076   random_init_t () : dummy (7) { 
00077 #ifndef SAME_RANDOM_VALUES
00078     srand (time (0));
00079 #endif
00080   }
00081 };
00082   
00083 extern random_init_t random_init_object;
00084 
00085 } // namespace angel
00086 
00087 #endif  // _graph_generator_include_
00088 

Generated on Wed Mar 11 10:33:11 2009 for angel by  doxygen 1.5.3