OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
mathexpr.h
Go to the documentation of this file.
1/******************************************************************************
2** MODULE: MATHEXPR.H
3** PROJECT: SWMM5
4** DESCRIPTION: header file for the math expression parser in mathexpr.c.
5** AUTHORS: L. Rossman, US EPA - NRMRL
6** F. Shang, University of Cincinnati
7** VERSION: 5.1.001
8** LAST UPDATE: 03/20/14
9******************************************************************************/
10
11#ifndef MATHEXPR_H
12#define MATHEXPR_H
13
14
15// Node in a tokenized math expression list
17{
18 int opcode; // operator code
19 int ivar; // variable index
20 double fvalue; // numerical value
21 struct ExprNode *prev; // previous node
22 struct ExprNode *next; // next node
23};
24typedef struct ExprNode MathExpr;
25
26// Creates a tokenized math expression from a string
27MathExpr* mathexpr_create(char* s, int (*getVar) (char *));
28
29// Evaluates a tokenized math expression
30double mathexpr_eval(MathExpr* expr, double (*getVal) (int));
31
32// Deletes a tokenized math expression
33void mathexpr_delete(MathExpr* expr);
34
35
36#endif //MATHEXPR_H
void mathexpr_delete(MathExpr *expr)
Definition mathexpr.c:735
double mathexpr_eval(MathExpr *expr, double(*getVal)(int))
Definition mathexpr.c:516
MathExpr * mathexpr_create(char *s, int(*getVar)(char *))
Definition mathexpr.c:743
Definition mathexpr.h:17
int ivar
Definition mathexpr.h:19
struct ExprNode * prev
Definition mathexpr.h:21
int opcode
Definition mathexpr.h:18
double fvalue
Definition mathexpr.h:20
struct ExprNode * next
Definition mathexpr.h:22