Skip to content

Better printing of functions #2111

@blegat

Description

@blegat

It would be nice if we would have sprint(show, f) print the same as JuMP.function_string with MIME"text/plain" and sprint(show, "text/latex", f) print the same as JuMP.function_string with MIME"text/plain". We could also have sprint(print, f) print the suggestion of @odow in #2108 (comment).
Note that we already have all the code needed to do that in MOI.Utilities._to_string. We can just pass it a dummy

struct NoVariableNameModel <: MOI.ModelLike end
MOI.get(::NoVariableNameModel, ::MOI.VariableName, ::MOI.VariableIndex) = ""

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions