在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:JuliaAlgebra/MultivariatePolynomials.jl开源软件地址:https://github.com/JuliaAlgebra/MultivariatePolynomials.jl开源编程语言:Julia 100.0%开源软件介绍:Multivariate Polynomials
This package provides an interface for manipulating multivariate polynomials. Implementing algorithms on polynomials using this interface will allow the algorithm to work for all polynomials implementing the interface. The interface contains functions for accessing the coefficients, monomials, terms of the polynomial, defines arithmetic operations on them, rational functions, division with remainder, calculus/differentiation and evaluation/substitution. Documentation
ExamplesBelow is a simple usage example using TypedPolynomials
@polyvar x y # assigns x (resp. y) to a variable of name x (resp. y)
p = 2x + 3.0x*y^2 + y
@test differentiate(p, x) # compute the derivative of p with respect to x
@test differentiate.(p, (x, y)) # compute the gradient of p
@test p((x, y)=>(y, x)) # replace any x by y and y by x
@test subs(p, y=>x^2) # replace any occurence of y by x^2
@test p(x=>1, y=>2) # evaluate p at [1, 2] Below is an example with using TypedPolynomials
A = rand(3, 3)
@polyvar x[1:3] # assign x to a tuple of variables x1, x2, x3
p = sum(x .* x) # x_1^2 + x_2^2 + x_3^2
subs(p, x[1]=>2, x[3]=>3) # x_2^2 + 13
p(x=>A*vec(x)) # corresponds to dot(A*x, A*x), need vec to convert the tuple to a vector EcosystemThe following packages provides multivariate polynomials that implement the interface:
The following packages extend/use the interface:
See also
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论