1.程序源码
#include <iostream>
#include <ginac/ginac.h>
using namespace std;
using namespace GiNaC;
int main()
{
symbol x("x"), y("y");
ex poly;
poly = pow(x+y, 2);
cout << poly.subs(lst(x==1,y==2)) << endl;
return 0;
}
2.编译源码
$ g++ -o example example.c -lginac -lcln -I/usr/local/include -L/usr/local/lib64
3.运行结果
./example
9
网友评论