NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
muParserDef.h File Reference

This file contains standard definitions used by the parser. More...

#include <iostream>
#include <string>
#include <sstream>
#include <map>
#include <complex>
#include <vector>
#include "muParserFixes.h"
Include dependency graph for muParserDef.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  mu
 Namespace for mathematical applications.
 

Macros

#define MUP_VERSION   _nrT("2.2.2")
 
#define MUP_VERSION_DATE   _nrT("20120218; SF")
 
#define MUP_CHARS   _nrT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
 
#define MUP_BASETYPE   std::complex<double>
 If this macro is defined mathematical exceptions (div by zero) will be thrown as exceptions. More...
 
#define _nrT(x)   x
 Activate this option in order to compile with OpenMP support. More...
 
#define _T(x)   x
 
#define MUP_STRING_TYPE   std::string
 Definition of the basic parser string type. More...
 
#define MUP_FAIL(MSG)
 
#define MUP_ASSERT(COND)
 

Typedefs

typedef MUP_BASETYPE mu::value_type
 The numeric datatype used by the parser. More...
 
typedef std::string mu::string_type
 The stringtype used by the parser. More...
 
typedef string_type::value_type mu::char_type
 The character type used by the parser. More...
 
typedef std::basic_stringstream< char_type, std::char_traits< char_type >, std::allocator< char_type > > mu::stringstream_type
 Typedef for easily using stringstream that respect the parser stringtype. More...
 
typedef std::map< string_type, value_type * > mu::varmap_type
 Type used for storing variables. More...
 
typedef std::map< string_type, value_type > mu::valmap_type
 Type used for storing constants. More...
 
typedef std::map< string_type, std::size_t > mu::strmap_type
 Type for assigning a string name to an index in the internal string table. More...
 
typedef std::vector< value_type > mu::valbuf_type
 Type used for storing an array of values. More...
 
typedef value_type(* mu::generic_fun_type) ()
 Callback type used for functions without arguments. More...
 
typedef value_type(* mu::fun_type0) ()
 Callback type used for functions without arguments. More...
 
typedef value_type(* mu::fun_type1) (const value_type &)
 Callback type used for functions with a single arguments. More...
 
typedef value_type(* mu::fun_type2) (const value_type &, const value_type &)
 Callback type used for functions with two arguments. More...
 
typedef value_type(* mu::fun_type3) (const value_type &, const value_type &, const value_type &)
 Callback type used for functions with three arguments. More...
 
typedef value_type(* mu::fun_type4) (const value_type &, const value_type &, const value_type &, const value_type &)
 Callback type used for functions with four arguments. More...
 
typedef value_type(* mu::fun_type5) (const value_type &, const value_type &, const value_type &, const value_type &, const value_type &)
 Callback type used for functions with five arguments. More...
 
typedef value_type(* mu::fun_type6) (const value_type &, const value_type &, const value_type &, const value_type &, const value_type &, const value_type &)
 Callback type used for functions with five arguments. More...
 
typedef value_type(* mu::fun_type7) (const value_type &, const value_type &, const value_type &, const value_type &, const value_type &, const value_type &, const value_type &)
 Callback type used for functions with five arguments. More...
 
typedef value_type(* mu::fun_type8) (const value_type &, const value_type &, const value_type &, const value_type &, const value_type &, const value_type &, const value_type &, const value_type &)
 Callback type used for functions with five arguments. More...
 
typedef value_type(* mu::fun_type9) (const value_type &, const value_type &, const value_type &, const value_type &, const value_type &, const value_type &, const value_type &, const value_type &, const value_type &)
 Callback type used for functions with five arguments. More...
 
typedef value_type(* mu::fun_type10) (const value_type &, const value_type &, const value_type &, const value_type &, const value_type &, const value_type &, const value_type &, const value_type &, const value_type &, const value_type &)
 Callback type used for functions with five arguments. More...
 
typedef value_type(* mu::bulkfun_type0) (int, int)
 Callback type used for functions without arguments. More...
 
typedef value_type(* mu::bulkfun_type1) (int, int, value_type)
 Callback type used for functions with a single arguments. More...
 
typedef value_type(* mu::bulkfun_type2) (int, int, value_type, value_type)
 Callback type used for functions with two arguments. More...
 
typedef value_type(* mu::bulkfun_type3) (int, int, value_type, value_type, value_type)
 Callback type used for functions with three arguments. More...
 
typedef value_type(* mu::bulkfun_type4) (int, int, value_type, value_type, value_type, value_type)
 Callback type used for functions with four arguments. More...
 
typedef value_type(* mu::bulkfun_type5) (int, int, value_type, value_type, value_type, value_type, value_type)
 Callback type used for functions with five arguments. More...
 
typedef value_type(* mu::bulkfun_type6) (int, int, value_type, value_type, value_type, value_type, value_type, value_type)
 Callback type used for functions with five arguments. More...
 
typedef value_type(* mu::bulkfun_type7) (int, int, value_type, value_type, value_type, value_type, value_type, value_type, value_type)
 Callback type used for functions with five arguments. More...
 
typedef value_type(* mu::bulkfun_type8) (int, int, value_type, value_type, value_type, value_type, value_type, value_type, value_type, value_type)
 Callback type used for functions with five arguments. More...
 
typedef value_type(* mu::bulkfun_type9) (int, int, value_type, value_type, value_type, value_type, value_type, value_type, value_type, value_type, value_type)
 Callback type used for functions with five arguments. More...
 
typedef value_type(* mu::bulkfun_type10) (int, int, value_type, value_type, value_type, value_type, value_type, value_type, value_type, value_type, value_type, value_type)
 Callback type used for functions with five arguments. More...
 
typedef value_type(* mu::multfun_type) (const value_type *, int)
 Callback type used for functions with a variable argument list. More...
 
typedef value_type(* mu::strfun_type1) (const char_type *)
 Callback type used for functions taking a string as an argument. More...
 
typedef value_type(* mu::strfun_type2) (const char_type *, value_type)
 Callback type used for functions taking a string and a value as arguments. More...
 
typedef value_type(* mu::strfun_type3) (const char_type *, value_type, value_type)
 Callback type used for functions taking a string and two values as arguments. More...
 
typedef int(* mu::identfun_type) (const char_type *sExpr, int *nPos, value_type *fVal)
 Callback used for functions that identify values in a string. More...
 
typedef value_type *(* mu::facfun_type) (const char_type *, void *)
 Callback used for variable creation factory functions. More...
 

Enumerations

enum  mu::ECmdCode {
  mu::cmLE , mu::cmGE , mu::cmNEQ , mu::cmEQ ,
  mu::cmLT , mu::cmGT , mu::cmADD , mu::cmSUB ,
  mu::cmMUL , mu::cmDIV , mu::cmPOW , mu::cmLAND ,
  mu::cmLOR , mu::cmASSIGN , mu::cmBO , mu::cmBC ,
  mu::cmIF , mu::cmELSE , mu::cmENDIF , mu::cmARG_SEP ,
  mu::cmVAL , mu::cmVAR , mu::cmVARPOW2 , mu::cmVARPOW3 ,
  mu::cmVARPOW4 , mu::cmVARPOWN , mu::cmVARMUL , mu::cmVAR_END ,
  mu::cmFUNC , mu::cmFUNC_STR , mu::cmFUNC_BULK , mu::cmSTRING ,
  mu::cmOPRT_BIN , mu::cmOPRT_POSTFIX , mu::cmOPRT_INFIX , mu::cmEND ,
  mu::cmUNKNOWN
}
 Bytecode values. More...
 
enum  mu::ETypeCode { mu::tpSTR = 0 , mu::tpDBL = 1 , mu::tpVOID = 2 }
 Types internally used by the parser. More...
 
enum  mu::EParserVersionInfo { mu::pviBRIEF , mu::pviFULL }
 
enum  mu::EOprtAssociativity { mu::oaLEFT = 0 , mu::oaRIGHT = 1 , mu::oaNONE = 2 }
 Parser operator precedence values. More...
 
enum  mu::EOprtPrecedence {
  mu::prLOR = 1 , mu::prLAND = 2 , mu::prLOGIC = 3 , mu::prCMP = 4 ,
  mu::prADD_SUB = 5 , mu::prMUL_DIV = 6 , mu::prPOW = 7 , mu::prINFIX = 6 ,
  mu::prPOSTFIX = 6
}
 Parser operator precedence values. More...
 

Functions

std::ostream & mu::console ()
 Encapsulate cout. More...
 
std::istream & mu::console_in ()
 Encapsulate cin. More...
 
bool mu::isinf (const value_type &v)
 
bool mu::isnan (const value_type &v)
 
bool mu::isreal (value_type *v, int nElem)
 
std::vector< double > mu::real (const std::vector< value_type > &vVec)
 
std::vector< double > mu::imag (const std::vector< value_type > &vVec)
 
value_type mu::rint (value_type v)
 

Detailed Description

This file contains standard definitions used by the parser.

Definition in file muParserDef.h.

Macro Definition Documentation

◆ _nrT

#define _nrT (   x)    x

Activate this option in order to compile with OpenMP support.

OpenMP is used only in the bulk mode it may increase the performance a bit.

Definition at line 62 of file muParserDef.h.

◆ _T

#define _T (   x)    x

Definition at line 72 of file muParserDef.h.

◆ MUP_ASSERT

#define MUP_ASSERT (   COND)

Definition at line 104 of file muParserDef.h.

◆ MUP_BASETYPE

#define MUP_BASETYPE   std::complex<double>

If this macro is defined mathematical exceptions (div by zero) will be thrown as exceptions.

Define the base datatype for values.

This datatype must be a built in value type. You can not use custom classes. It should be working with all types except "int"!

Definition at line 54 of file muParserDef.h.

◆ MUP_CHARS

#define MUP_CHARS   _nrT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")

Definition at line 44 of file muParserDef.h.

◆ MUP_FAIL

#define MUP_FAIL (   MSG)

Definition at line 103 of file muParserDef.h.

◆ MUP_STRING_TYPE

#define MUP_STRING_TYPE   std::string

Definition of the basic parser string type.

Definition at line 76 of file muParserDef.h.

◆ MUP_VERSION

#define MUP_VERSION   _nrT("2.2.2")

Definition at line 41 of file muParserDef.h.

◆ MUP_VERSION_DATE

#define MUP_VERSION_DATE   _nrT("20120218; SF")

Definition at line 42 of file muParserDef.h.