formula-calc.h
Go to the documentation of this file.
1 // Simple mathematical formula processing library
2 // Written by Atsushi Watanabe
3 // Intelligent Robot Laboratory, University of Tsukuba
4 //
5 // Copyright 2011 Atsushi Watanabe, All rights reserved.
6 //
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions are met:
9 //
10 // * Redistributions of source code must retain the above copyright notice, this
11 // list of conditions and the following disclaimer.
12 // * Redistributions in binary form must reproduce the above copyright notice,
13 // this list of conditions and the following disclaimer in the documentation
14 // and/or other materials provided with the distribution.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
17 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19 // EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
20 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 
27 #ifndef FORMULA_CALC_H
28 #define FORMULA_CALC_H
29 
30 #ifdef __cplusplus
31 // clang-format off
32 extern "C"
33 {
34 // clang-format on
35 #endif // __cplusplus
36 
37 #include <stdio.h>
38 
40 {
48 };
49 
50 struct rpf_t
51 {
53  void *value;
54  struct rpf_t *next;
55 };
56 
58 {
59  const char *name;
60  double *pointer;
61 };
62 
63 int formula(const char *expr, struct rpf_t **rpf, const struct variables_t *variable);
64 void formula_free(struct rpf_t *rpf);
65 double formula_eval(struct rpf_t *rpf);
66 struct rpf_t *formula_optimize(struct rpf_t *rpf);
67 void formula_print(FILE *stream, struct rpf_t *rpf);
68 
69 #ifdef __cplusplus
70 }
71 #endif // __cplusplus
72 #endif // FORMULA_CALC_H
struct rpf_t * next
Definition: formula-calc.h:54
rpf_type_t
Definition: formula-calc.h:39
enum rpf_type_t type
Definition: formula-calc.h:52
struct rpf_t * formula_optimize(struct rpf_t *rpf)
double formula_eval(struct rpf_t *rpf)
int formula(const char *expr, struct rpf_t **rpf, const struct variables_t *variable)
void formula_print(FILE *stream, struct rpf_t *rpf)
void * value
Definition: formula-calc.h:53
void formula_free(struct rpf_t *rpf)
const char * name
Definition: formula-calc.h:59
double * pointer
Definition: formula-calc.h:60


yp-spur
Author(s):
autogenerated on Sat May 11 2019 02:08:24