- Main Page
- Classes
- Files

# variables.cpp

Go to the documentation of this file.

    00001 #include <map>
    00002
    00003 #include "variables.hpp"
    00004
    00005 namespace {
    00006   std::map<std::string, double> variables;
    00007
    00008   class initializer {
    00009   public:
    00010     initializer() {
    00011       variables["pi"] = 3.141592653589792;
    00012       variables["e"]  = 2.718281828459;
    00013     }
    00014   };
    00015   initializer init;
    00016 }
    00017
    00018 double get_variable(std::string const& name)
    00019 {
    00020   return variables[name];
    00021 }
    00022
    00023 void set_variable(std::string const& name, double value)
    00024 {
    00025   variables[name] = value;
    00026 }