Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00045 #ifndef __PARSE_1D_HPP__
00046 #define __PARSE_1D_HPP__
00047 #include <string>
00048 #include "oned/nicol.hpp"
00049 #include "oned/nicol_minus.hpp"
00050 #include "oned/rec_bisect.hpp"
00051 #include "oned/greedy_bisect.hpp"
00052 #include "oned/direct_cut.hpp"
00053 #include "oned/direct_ref_b.hpp"
00054 #include "oned/nicol_plus.hpp"
00055 #include "util/version.hpp"
00056
00057 namespace oned
00058 {
00064 template<typename T, typename Pr>
00065 class Parser
00066 {
00067 public:
00077 static T (*parseName(const std::string& name))(int, Pr const&,int, int *, T);
00078 };
00079 }
00080
00081 template<typename T, typename Pr>
00082 T (*oned::Parser<T,Pr>::parseName(const std::string& name))(int, Pr const&,int, int *, T)
00083 {
00084
00085 if(name == "NICOL-MINUS")
00086 {
00087 return oned::NicolMinus<T, Pr>::nicol_minus;
00088 }
00089 else if(name == "NICOL")
00090 {
00091 return oned::Nicol<T, Pr >::nicol;
00092 }
00093 else if(name == "NICOL-PLUS")
00094 {
00095 return oned::NicolPlus<T, Pr>::nicol_plus;
00096 }
00097 else if(name == "REC-BISECT")
00098 {
00099 return oned::RecursiveBisection<T, Pr>::rec_bisection;
00100 }
00101 else if(name == "GREEDY-BISECT")
00102 {
00103 return oned::GreedyBisection<T,Pr >::greedy_bisection;
00104 }
00105 else if(name == "DIRECT-CUT")
00106 {
00107 return oned::DirectCut<T, Pr >::direct_cut;
00108 }
00109 else if(name == "DIRECT-CUT-REF-B")
00110 {
00111 return oned::DirectCutRefB<T, Pr >::direct_ref_b;
00112 }
00113 else return NULL;
00114 }
00115
00116 #endif