We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6825bfb commit 886a63dCopy full SHA for 886a63d
src/CMakeLists.txt
@@ -1,5 +1,6 @@
1
set(SRC
2
- basic.f90
+ wrapper.c
3
+ basic.f90
4
)
5
6
include_directories(BEFORE ${python_wrapper_BINARY_DIR}/symengine/lib)
src/wrapper.c
@@ -0,0 +1,19 @@
+#include <symengine/cwrapper.h>
+
+void f(int i)
+{
+ char *s;
+ basic x, y, e, n;
7
+ basic_new_stack(x);
8
+ basic_new_stack(y);
9
+ basic_new_stack(e);
10
+ basic_new_stack(n);
11
+ symbol_set(x, "x");
12
+ symbol_set(y, "y");
13
+ integer_set_si(n, i);
14
+ basic_mul(e, n, x);
15
+ basic_add(e, e, y);
16
+ s = basic_str(e);
17
+ printf("Result: %s", s);
18
+ basic_str_free(s);
19
+}
0 commit comments