Skip to content

Support different ways to store the Hessian and Jacobian (apart of COO format) #2

Open
@frapac

Description

@frapac

Currently, MOI supports only passing the Jacobian and the Hessian in COO format:
https://github.com/jump-dev/MathOptInterface.jl/blob/master/src/nlp.jl#L123-L134
https://github.com/jump-dev/MathOptInterface.jl/blob/master/src/nlp.jl#L149-L157

Would it be possible to extend MOI to support other formats for the Jacobian/Hessian?

  • Dense format
  • Sparse CSC/CSR format

One idea would be to extend MOI.jacobian_structure to return the structure required by the current evaluator:

abstract type AbstractMatrixCallbackStructure end 

struct CSCStructure{VI} <: AbstractMatrixCallbackStructure
    rowval::VI
    colptr::VI
end

struct COOStructure{VI} <: AbstractMatrixCallbackStructure
    rows::VI
    cols::VI
end

struct DenseStructure <: AbstractMatrixCallbackFormat end

jacobian_structure(d::AbstractNLPEvaluator)::MOI.AbstractMatrixCallbackStructure

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions