Boost Matheval
Evaluate mathematical expressions using Boost.Spirit
matheval Namespace Reference

Data Structures

class  Parser
 Parse a mathematical expression. More...
 

Functions

double parse (std::string const &expr, std::map< std::string, double > const &st=std::map< std::string, double >())
 Convenience function. More...
 

Function Documentation

◆ parse()

double matheval::parse ( std::string const &  expr,
std::map< std::string, double > const &  st = std::map<std::string, double>() 
)
inline

Convenience function.

This function builds the grammar, parses the iterator to an AST, evaluates it, and returns the result.

Parameters
[in]exprmathematical expression
[in]stthe symbol table for variables

Definition at line 58 of file matheval.hpp.

References matheval::Parser::evaluate(), and matheval::Parser::parse().