updated to newer BOOST versions
This commit is contained in:
parent
ad383bad60
commit
5d7eec9b78
@ -29,7 +29,8 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include<cmath>
|
||||
#include <cstdio>
|
||||
#include <cmath>
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
@ -35,8 +35,15 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include <boost/spirit/tree/ast.hpp>
|
||||
using namespace boost::spirit;
|
||||
#include <boost/version.hpp>
|
||||
|
||||
#if BOOST_VERSION >= 103800
|
||||
# include <boost/spirit/include/classic_ast.hpp>
|
||||
using namespace BOOST_SPIRIT_CLASSIC_NS;
|
||||
#else
|
||||
# include <boost/spirit/tree/ast.hpp>
|
||||
using namespace boost::spirit;
|
||||
#endif
|
||||
|
||||
#include "PFunctionGrammar.h"
|
||||
|
||||
|
@ -37,6 +37,7 @@ using namespace std;
|
||||
|
||||
//#define BOOST_SPIRIT_DEBUG
|
||||
|
||||
#include <boost/version.hpp>
|
||||
#include <boost/spirit/version.hpp>
|
||||
|
||||
#if BOOST_VERSION >= 103800
|
||||
|
@ -146,11 +146,11 @@ PFunctionHandler::PFunctionHandler(vector<string> lines)
|
||||
|
||||
fValid = MapsAreValid();
|
||||
|
||||
if (fValid) {
|
||||
if (fValid) {
|
||||
cout << endl << "Functions: ";
|
||||
for (unsigned int i=0; i<fLines.size(); i++)
|
||||
cout << endl << fLines[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------
|
||||
@ -308,6 +308,8 @@ bool PFunctionHandler::ReadFile()
|
||||
while ( !f.eof() && !done) {
|
||||
f.getline(c_line, 128); // line of text excluding '\n'
|
||||
line = c_line;
|
||||
size_t pos = line.find('\r');
|
||||
line.resize(pos);
|
||||
if (line.find("#") == 0) // comment hence ignore
|
||||
continue;
|
||||
boost::to_upper(line);
|
||||
@ -367,11 +369,11 @@ bool PFunctionHandler::ReadFile()
|
||||
success = false;
|
||||
}
|
||||
|
||||
if (success) {
|
||||
if (success) {
|
||||
cout << endl << "Functions: ";
|
||||
for (unsigned int i=0; i<fLines.size(); i++)
|
||||
cout << endl << fLines[i];
|
||||
}
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ PAR 1.0 2.1 3.5 -0.87 0.87
|
||||
MAP 2 1 4 5
|
||||
FUNCTIONS
|
||||
fun0 = cos(par1)
|
||||
#fun0 = sin(par3/(par1+map2))
|
||||
#fun1 = sin(par3/(par1+map2))
|
||||
#fun0 = 1.2+pi
|
||||
#fun1 = gamma_mu
|
||||
#fun2 = -par1*(sin(par2)*cos(par3)+((map1)))
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include <cstring>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
using namespace std;
|
||||
@ -81,7 +83,6 @@ int main(int argc, char *argv[])
|
||||
} else {
|
||||
vector<string> lines;
|
||||
handle_input(lines);
|
||||
cout << endl << "lines.size() = " << lines.size();
|
||||
fcnHandler = new PFunctionHandler(lines);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user