Computational Embodied Neuroscience Simulator  1.1
3D simulation library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
cens_utils.h
Go to the documentation of this file.
1 // Computational Embodied Neuroscience Simulator (CENS) Library
2 // Copyright (c) 2010 Francesco Mannella
3 //
4 // cens_utils.h
5 // Copyright (c) 2010 Francesco Mannella
6 //
7 // This file is part of CENS library.
8 //
9 // CENS library is free software: you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation, either version 3 of the License, or
12 // (at your option) any later version.
13 //
14 // CENS library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with CENS library. If not, see <http://www.gnu.org/licenses/>.
21 
22 #ifndef CENS_UTILS_H
23 #define CENS_UTILS_H
24 #include <vector>
25 #include <string>
26 #include <cmath>
27 #include <cstdlib>
28 #include <iostream>
29 #include <fstream>
30 #include <sstream>
31 
32 namespace cens {
33 
36 
37  typedef std::vector<std::string> strings;
38 
40 
41  inline float rad2degree(float grad){
42  return grad*(M_PI/180.0);
43  }
44 
45  inline float degree2rad(float degree){
46  return degree*(M_PI/180.0);
47  }
48 
49 
51 
52  float scalarFromString(std::string str);
53 
54  std::string str_replace(std::string str,
55  const std::string &searchString,
56  const std::string &replaceString );
57 
58  std::vector<std::string> str_split(std::string str,
59  const std::string &sep);
60 
61  bool str_match(const std::string &str,
62  const std::string &comp);
63 
64 }
65 
66 #endif
Computational Embodied Neuroscience Simulator library.
Definition: cens_engine.cpp:29
float degree2rad(float degree)
Definition: cens_utils.h:45
float rad2degree(float grad)
Definition: cens_utils.h:41
std::vector< std::string > strings
Definition: cens_types.h:45
std::string str_replace(std::string str, const std::string &searchString, const std::string &replaceString)
Definition: cens_utils.cpp:36
std::vector< std::string > str_split(std::string str, const std::string &sep)
Definition: cens_utils.cpp:55
float scalarFromString(std::string str)
Definition: cens_utils.cpp:31
bool str_match(const std::string &str, const std::string &comp)
Definition: cens_utils.cpp:77