diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2006-12-13 16:04:50 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2006-12-13 16:04:50 +0100 |
commit | e619c42079a7da741b4a1b5032a0e1d30ba3b0a1 (patch) | |
tree | dd24fb6fd8ab9307e95f80fb1ec4d2683072e873 | |
parent | 331c46f2865146f5221358b6849e1057677f33e8 (diff) |
make generated functions static
-rw-r--r-- | src/Makefile.lsq_funcs | 2 | ||||
-rw-r--r-- | src/lsq_funcs.mac | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/Makefile.lsq_funcs b/src/Makefile.lsq_funcs index 2d778af..f117e1e 100644 --- a/src/Makefile.lsq_funcs +++ b/src/Makefile.lsq_funcs @@ -1,4 +1,4 @@ all: lsq_funcs.c lsq_funcs.c: lsq_funcs.mac - maxima -b lsq_funcs.mac | grep "^double" > lsq_funcs.c + maxima -b lsq_funcs.mac | grep "^static" > lsq_funcs.c diff --git a/src/lsq_funcs.mac b/src/lsq_funcs.mac index d5f412e..cf86d7e 100644 --- a/src/lsq_funcs.mac +++ b/src/lsq_funcs.mac @@ -6,8 +6,8 @@ x_undist_unrot : tan(m_view - c_view) * scale$ y_undist_unrot : tan(m_nick - c_nick) * scale$ d : y_undist_unrot ^ 2 + x_undist_unrot ^ 2$ dist_fact : d ^2 * k1 + d * k0$ -x_unrot : x_undist_unrot * dist_fact$ -y_unrot : y_undist_unrot * dist_fact$ +x_unrot : x_undist_unrot * (1 + dist_fact)$ +y_unrot : y_undist_unrot * (1 + dist_fact)$ x : y_unrot * sin(c_tilt) + x_unrot * cos(c_tilt)$ y : y_unrot * cos(c_tilt) - x_unrot * sin(c_tilt)$ @@ -19,7 +19,8 @@ x_expand : trigexpand(x_unrot)$ y_expand : trigexpand(y_unrot)$ args: "(double c_view, double c_nick, double c_tilt, double scale, double k0, double k1, double m_view, double m_nick)"$ -printfunc(name, expression) := sprint("double", name, args, "{ return ", string(subst(pow, "^", expression)), ";}", " + +printfunc(name, expression) := sprint("static double", name, args, "{ return ", string(subst(pow, "^", expression)), ";}", " ")$ printfunc("mac_x", x_expand); |