muparser - fast math parser library
Version 2.2.3
beltoforion.de
beltoforion.de
google code project page
muparser
at google code

Open source initiative logo

Valid XHTML 1.0 Transitional

CSS ist valide!

About the parser

Many applications require the parsing of mathematical expressions. The main objective of this library is to provide a fast and easy way of doing this. muParser is an extensible high performance math expression parser library written in C++. It works by transforming a mathematical expression into bytecode and precalculating constant parts of the expression.

The library was designed with portability in mind and should compile on every standard compliant C++ compiler. Wrapper for C and C# exist. The parser archive contains ready to use project and makefiles files for a variety of platforms. The code runs on both 32 bit and 64 bit architechtures and has been tested using MS VC++ V10 and GCC V4.8.1. Code samples are provided in order to help you understand its usage. The library is open source and distributed under the MIT license.
muParser download

Release Notes

Rev 2.2.3: 22.12.2012

  • Removed features:
    • build files for msvc2005, borland and watcom compiler removed
  • Bugfixes:
    • Bugfix for Intel Compilers added: The power operator did not work properly with Intel C++ composer XE 2011.
    • Issue 3509860: Callbacks of functions with string parameters called twice
    • Issue 3570423: example1 shows slot number in hexadecimal
    • Fixes for compiling with the "MUP_MATH_EXCEPTIONS" macro definition:
      • division by zero in constant expressions was reported with the code "ec_GENERIC" instead of "ecDIV_BY_ZERO"
      • throwing of "ecDOMAIN_ERROR" added to sqrt and log functions

Rev 2.2.2: 18.02.2012

  • Bugfixes:
    • Optimizer did'nt work properly for division

Rev 2.2.1: 22.01.2012

  • Bugfixes:
    • Optimizer bug in 64 bit systems fixed

Rev 2.2.0: 22.01.2012

  • Improvements:
    • Optimizer rewritten and improved. In general: more optimizations are now applied to the bytecode. The downside is that callback Functions can no longer be flagged as non-optimizable. (The flag is still present but ignored) This is necessary since the optimizer had to call the functions in order to precalculate the result (see Bugfixes). These calls posed a problems for callback functions with side effects and if-then-else clauses in general since they undermined the shortcut evaluation prinziple.
  • Bugfixes:
    • Infix operators where not properly detected in the presence of a constant name starting with an underscore which is a valid character for infix operators too (i.e. "-_pi").
    • Issue 3463353: Callback functions are called twice during the first call to eval.
    • Issue 3447007: GetUsedVar unnecessaryly executes callback functions.

Rev 2.1.0: 19.11.2011

This is a service release incorporating minor bugfixes.
  • New feature
    • Function atan2 added.
  • Bugfixes
    • Issue 3438380: Changed behaviour of tellg with GCC >4.6 led to failures in value detection callbacks.
    • Issue 3438715: only "double" is a valid MUP_BASETYPE MUP_BASETYPE can now be any of: float, double, long double, short, unsigned short, unsigned int, long, unsigned long. Previousely only floating point types were allowed. Using "int" is still not allowed!
    • Custom value recognotion callbacks added with AddValIdent had lower priority than built in ones. Consequently hex value recognition using IsHexVal would fail since the built in IsVal would read the "0" from the hex prefix "0x".

Rev 2.0.0: 04.09.2011

This release introduces a new version numbering scheme in order to make future changes in the ABI apparent to users of the library. The number is now based on the SONAME property as used by GNU/Linux.
  • Changes
    • Beginning with this version all version numbers will be SONAME compliant.
    • Project files for MSVC2010 added.
    • Bytecode parsing engine cleaned up and rewritten.
    • Retrieving all results of expressions made up of comma separate subexpressions is now possible with a new Eval overload.
    • Callback functions with fixed number of arguments can now have up to 10 Parameters (previous limit was 5).
  • New features
    • ternary if-then-else operator added (C++ like; "(...) ? ... : ..." )
    • new intrinsic binary operators: "&&", "||" (logical and, or)
    • A new bulkmode allows submitting large arrays as variables to compute large numbers of expressions with a single call. This can drastically improve parsing performance when interfacing the library from managed languages like C#. (It doesn't bring any performance benefit for C++ users though...)
  • Removed features
    • Project files for MSVC2003 removed
    • intrinsic "and", "or" and "xor" operators have been removed. I'd like to let users the freedom of defining them on their own versions (either as logical or bitwise operators).
    • Implementation for complex numbers removed. This was merely a hack. If you need complex numbers try muParserX which provides native support for them. (see: muParserX)
  • Bugfixes
    • User defined operators could collide with built in operators that entirely contained their identifier. i.e. user defined "&" would not work with the built in "&&" operator since the user defined operator was detected with a higher priority resulting in a syntax error.
    • Detection of unknown variables did not work properly in case a postfix operator was defined which was part of the undefined variable. i.e. If a postfix operator "m" was defined expressions like "multi*1.0" did not detect "multi" as an undefined variable.
    • Postfix operators sharing the first few characters were causing bogus parsing exception.

© 2005-2014 Ingo Berg ^ TOP