We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 7 months ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
您是否尝试过使用FADBAD?这非常有用。
Have you tried to use FADBAD? It's quite useful.
我会编写自己的衍生类。同时有一些书籍记录了如何做到这一点。但假设你知道数学规则,这是相当微不足道的。
使用这样的导数类,您可以编写一个模板函数来生成多项式、导数、平方和积分,同时跟踪导数与系数。问题是你可能携带大量始终为零的导数。要避免这种情况相当复杂。
普通的派生类将包含一个值和一个派生值数组。
可能有一个构造函数通过值和索引创建自变量——通过传递的值和所有导数将值初始化为零,除了与索引匹配的值之外。
然后你为你需要的一切编写运算符和函数——假设你只处理多项式,这并不算多。
I would write my own derivative class. There are books available meanwhile which document how to do this. But assuming you know the math rules, it is rather trivial.
Using such a derivative class you can then write a template function to generate your polynomial and the derivative and the square and the integral while keeping track of the derivatives vs. the coefficients. The problem is that you may carry around a lot of derivatives which are always zero. To avoid this is rather complicated.
A normal derivative class would contain a value and an array of derivative values.
There may be a constructor to create an independent variable by value and index -- initializing the value by the passed value and all derivatives to zero except the one matching the index to 1.
Then you write operators and functions for everything you need -- which is not much assuming you're only dealing with polynomials.