Skip to content

Substitution of matrix values #117

@kbarros

Description

@kbarros

How can I make a polynomial matrix-valued? I tried this:

using DynamicPolynomials
@ncpolyvar u
subs(u, u => 2.0) # works
subs(u, u => ones(3,3)) # ERROR: MethodError: no method matching one(::Type{Any})

The problem may be related to the promote_rules defined in MultivariatePolynomials?

import MultivariatePolynomials as MP
promote_type(Float64, DynamicPolynomials.PolyVar{false}) # Term{false, Float64}
promote_type(Matrix{Float64}, DynamicPolynomials.PolyVar{false}) # Term{false, Any}

I suspect the latter case would need to be Term{false, Matrix{Float64}}. Help would be appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions