美文网首页
ginac库代数展开式

ginac库代数展开式

作者: 一路向后 | 来源:发表于2020-10-13 21:31 被阅读0次

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.expand() << endl;

        return 0;
}

2.编译源码

$ g++ -o example example.c -lginac -lcln -I/usr/local/include -L/usr/local/lib64

3.运行结果

./example
x^2+y^2+2*x*y

相关文章

网友评论

      本文标题:ginac库代数展开式

      本文链接:https://www.haomeiwen.com/subject/waebpktx.html