Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "ModelAnalyzer"
name = "MathOptAnalyzer"
uuid = "d1179b25-476b-425c-b826-c7787f0fff83"
version = "0.1.0"

Expand All @@ -12,7 +12,7 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"

[extensions]
ModelAnalyzerJuMPExt = "JuMP"
MathOptAnalyzerJuMPExt = "JuMP"

[compat]
Dualization = "0.6.0"
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# ModelAnalyzer.jl
# MathOptAnalyzer.jl

[![Build Status](https://github.com/jump-dev/ModelAnalyzer.jl/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jump-dev/ModelAnalyzer.jl/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/jump-dev/ModelAnalyzer.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/jump-dev/ModelAnalyzer.jl)
[![Build Status](https://github.com/jump-dev/MathOptAnalyzer.jl/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jump-dev/MathOptAnalyzer.jl/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/jump-dev/MathOptAnalyzer.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/jump-dev/MathOptAnalyzer.jl)

[ModelAnalyzer.jl](https://github.com/jump-dev/ModelAnalyzer.jl) is an
[MathOptAnalyzer.jl](https://github.com/jump-dev/MathOptAnalyzer.jl) is an
experimental package with analysis and debugging tools for JuMP and
MathOptInterface.

## License

`ModelAnalyzer.jl` is licensed under the [MIT License](https://github.com/jump-dev/MultiObjectiveAlgorithms.jl/blob/main/LICENSE.md).
`MathOptAnalyzer.jl` is licensed under the [MIT License](https://github.com/jump-dev/MultiObjectiveAlgorithms.jl/blob/main/LICENSE.md).

## Getting help

If you need help, please ask a question on the [JuMP community forum](https://jump.dev/forum).

If you have a reproducible example of a bug, please [open a GitHub issue](https://github.com/jump-dev/ModelAnalyzer.jl/issues/new).
If you have a reproducible example of a bug, please [open a GitHub issue](https://github.com/jump-dev/MathOptAnalyzer.jl/issues/new).

## Installation

Install `ModelAnalyzer` using `Pkg.add`:
Install `MathOptAnalyzer` using `Pkg.add`:

```julia
import Pkg
Pkg.add(; url = "https://github.com/jump-dev/ModelAnalyzer.jl")
Pkg.add(; url = "https://github.com/jump-dev/MathOptAnalyzer.jl")
```

## Documentation

The [documentation for ModelAnalyzer.jl](https://jump.dev/ModelAnalyzer.jl/dev/)
The [documentation for MathOptAnalyzer.jl](https://jump.dev/MathOptAnalyzer.jl/dev/)
describes how to use the package.
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
ModelAnalyzer = "d1179b25-476b-425c-b826-c7787f0fff83"
MathOptAnalyzer = "d1179b25-476b-425c-b826-c7787f0fff83"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"

[compat]
Expand Down
6 changes: 3 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Documenter, ModelAnalyzer, JuMP
using Documenter, MathOptAnalyzer, JuMP

makedocs(; sitename = "ModelAnalyzer.jl documentation")
makedocs(; sitename = "MathOptAnalyzer.jl documentation")

deploydocs(;
repo = "github.com/jump-dev/ModelAnalyzer.jl.git",
repo = "github.com/jump-dev/MathOptAnalyzer.jl.git",
push_preview = true,
)
26 changes: 13 additions & 13 deletions docs/src/analyzer.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@

# ModelAnalyzer main API
# MathOptAnalyzer main API

All the analysis modules in `ModelAnalyzer` follow the same main API.
All the analysis modules in `MathOptAnalyzer` follow the same main API.
The main function to perform an analysis is:

```@docs
ModelAnalyzer.analyze
MathOptAnalyzer.analyze
```

Once the analysis is performed, the resulting data structure can be summarized
using:

```@docs
ModelAnalyzer.summarize
MathOptAnalyzer.summarize
```

Alternatively, you can also query the types of issues found in the analysis
and summarize them individually. The following functions are useful for this:

```@docs
ModelAnalyzer.list_of_issue_types
ModelAnalyzer.list_of_issues
MathOptAnalyzer.list_of_issue_types
MathOptAnalyzer.list_of_issues
```

It is possible to extract data from the issues with the methods:

```@docs
ModelAnalyzer.variables
ModelAnalyzer.variable
ModelAnalyzer.constraints
ModelAnalyzer.constraint
ModelAnalyzer.set
ModelAnalyzer.values
ModelAnalyzer.value
MathOptAnalyzer.variables
MathOptAnalyzer.variable
MathOptAnalyzer.constraints
MathOptAnalyzer.constraint
MathOptAnalyzer.set
MathOptAnalyzer.values
MathOptAnalyzer.value
```
24 changes: 12 additions & 12 deletions docs/src/feasibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@ This module provides functionality to perform feasibility analysis on a JuMP mod
This module follows the main API and is activated by the struct:

```@docs
ModelAnalyzer.Feasibility.Analyzer
MathOptAnalyzer.Feasibility.Analyzer
```

The analysis will return issues of the abstract type:

```@docs
ModelAnalyzer.Feasibility.AbstractFeasibilityIssue
MathOptAnalyzer.Feasibility.AbstractFeasibilityIssue
```
Specifically, the possible issues are:

```@docs
ModelAnalyzer.Feasibility.PrimalViolation
ModelAnalyzer.Feasibility.DualConstraintViolation
ModelAnalyzer.Feasibility.DualConstrainedVariableViolation
ModelAnalyzer.Feasibility.ComplemetarityViolation
ModelAnalyzer.Feasibility.DualObjectiveMismatch
ModelAnalyzer.Feasibility.PrimalObjectiveMismatch
ModelAnalyzer.Feasibility.PrimalDualMismatch
ModelAnalyzer.Feasibility.PrimalDualSolverMismatch
MathOptAnalyzer.Feasibility.PrimalViolation
MathOptAnalyzer.Feasibility.DualConstraintViolation
MathOptAnalyzer.Feasibility.DualConstrainedVariableViolation
MathOptAnalyzer.Feasibility.ComplemetarityViolation
MathOptAnalyzer.Feasibility.DualObjectiveMismatch
MathOptAnalyzer.Feasibility.PrimalObjectiveMismatch
MathOptAnalyzer.Feasibility.PrimalDualMismatch
MathOptAnalyzer.Feasibility.PrimalDualSolverMismatch
```

These issues are saved in the data structure that is returned from the
`ModelAnalyzer.analyze` function:
`MathOptAnalyzer.analyze` function:

```@docs
ModelAnalyzer.Feasibility.Data
MathOptAnalyzer.Feasibility.Data
```
44 changes: 22 additions & 22 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
```@meta
CurrentModule = ModelAnalyzer
CurrentModule = MathOptAnalyzer
DocTestSetup = quote
using ModelAnalyzer
using MathOptAnalyzer
end
```

# ModelAnalyzer.jl
# MathOptAnalyzer.jl

This package provides tools for analyzing (and debugging)
[JuMP](https://github.com/jump-dev/JuMP.jl) models.
Expand Down Expand Up @@ -39,7 +39,7 @@ run:

```julia
using Pkg
Pkg.add(url = "https://github.com/jump-dev/ModelAnalyzer.jl")
Pkg.add(url = "https://github.com/jump-dev/MathOptAnalyzer.jl")
```

## Usage
Expand All @@ -50,7 +50,7 @@ Here is a simple example of how to use the package:

```julia
using JuMP
using ModelAnalyzer
using MathOptAnalyzer
using HiGHS # or any other supported solver
# Create a simple JuMP model
model = Model(HiGHS.Optimizer)
Expand All @@ -65,39 +65,39 @@ optimize!(model)
# either

# Perform a numerical analysis of the model
data = ModelAnalyzer.analyze(ModelAnalyzer.Numerical.Analyzer(), model)
data = MathOptAnalyzer.analyze(MathOptAnalyzer.Numerical.Analyzer(), model)
# print report
ModelAnalyzer.summarize(data)
MathOptAnalyzer.summarize(data)

# or

# Check for solution feasibility and optimality
data = ModelAnalyzer.analyze(ModelAnalyzer.Feasibility.Analyzer(), model)
data = MathOptAnalyzer.analyze(MathOptAnalyzer.Feasibility.Analyzer(), model)
# print report
ModelAnalyzer.summarize(data)
MathOptAnalyzer.summarize(data)

# or

# Infeasibility analysis (if the model was infeasible)
data = ModelAnalyzer.analyze(
ModelAnalyzer.Infeasibility.Analyzer(),
data = MathOptAnalyzer.analyze(
MathOptAnalyzer.Infeasibility.Analyzer(),
model,
optimizer = HiGHS.Optimizer,
)

# print report to the screen
ModelAnalyzer.summarize(data)
MathOptAnalyzer.summarize(data)

# or print the report to a file

# open a file
open("my_report.txt", "w") do io
# print report
ModelAnalyzer.summarize(io, data)
MathOptAnalyzer.summarize(io, data)
end
```

The `ModelAnalyzer.analyze(...)` function can always take the keyword arguments:
The `MathOptAnalyzer.analyze(...)` function can always take the keyword arguments:
* `verbose = false` to condense the print output.
* `max_issues = n` to limit the maximum number of issues to report for each
type.
Expand All @@ -107,27 +107,27 @@ arguments.

### Advanced usage

After any `ModelAnalyzer.analyze(...)` call is performed, the resulting data
structure can be summarized using `ModelAnalyzer.summarize(data)` as show above,
After any `MathOptAnalyzer.analyze(...)` call is performed, the resulting data
structure can be summarized using `MathOptAnalyzer.summarize(data)` as show above,
or it can be further inspected programmatically.

```julia
# given a `data` object obtained from `ModelAnalyzer.analyze(...)`
# given a `data` object obtained from `MathOptAnalyzer.analyze(...)`

# query the types of issues found in the analysis
list = ModelAnalyzer.list_of_issue_types(data)
list = MathOptAnalyzer.list_of_issue_types(data)

# information about the types of issues found can be printed out
ModelAnalyzer.summarize(list[1])
MathOptAnalyzer.summarize(list[1])

# for each issue type, you can get the actual issues found in the analysis
issues = ModelAnalyzer.list_of_issues(data, list[1])
issues = MathOptAnalyzer.list_of_issues(data, list[1])

# the list of issues of the given type can be summarized with:
ModelAnalyzer.summarize(issues)
MathOptAnalyzer.summarize(issues)

# individual issues can also be summarized
ModelAnalyzer.summarize(issues[1])
MathOptAnalyzer.summarize(issues[1])
```

### Non JuMP (or MOI) models
Expand Down
16 changes: 8 additions & 8 deletions docs/src/infeasibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ This module provides functionality to perform infeasibility analysis on a JuMP m
This module follows the main API and is activated by the struct:

```@docs
ModelAnalyzer.Infeasibility.Analyzer
MathOptAnalyzer.Infeasibility.Analyzer
```

The analysis will return issues of the abstract type:

```@docs
ModelAnalyzer.Infeasibility.AbstractInfeasibilitylIssue
MathOptAnalyzer.Infeasibility.AbstractInfeasibilitylIssue
```

Specifically, the possible issues are:

```@docs
ModelAnalyzer.Infeasibility.InfeasibleBounds
ModelAnalyzer.Infeasibility.InfeasibleIntegrality
ModelAnalyzer.Infeasibility.InfeasibleConstraintRange
ModelAnalyzer.Infeasibility.IrreducibleInfeasibleSubset
MathOptAnalyzer.Infeasibility.InfeasibleBounds
MathOptAnalyzer.Infeasibility.InfeasibleIntegrality
MathOptAnalyzer.Infeasibility.InfeasibleConstraintRange
MathOptAnalyzer.Infeasibility.IrreducibleInfeasibleSubset
```

These issues are saved in the data structure that is returned from the
`ModelAnalyzer.analyze` function:
`MathOptAnalyzer.analyze` function:

```@docs
ModelAnalyzer.Infeasibility.Data
MathOptAnalyzer.Infeasibility.Data
```
44 changes: 22 additions & 22 deletions docs/src/numerical.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,40 @@ This module provides functionality to perform numerical analysis on a JuMP model
This module follows the main API and is activated by the struct:

```@docs
ModelAnalyzer.Numerical.Analyzer
MathOptAnalyzer.Numerical.Analyzer
```

The analysis will return issues of the abstract type:

```@docs
ModelAnalyzer.Numerical.AbstractNumericalIssue
MathOptAnalyzer.Numerical.AbstractNumericalIssue
```

Specifically the possible issues are:

```@docs
ModelAnalyzer.Numerical.VariableNotInConstraints
ModelAnalyzer.Numerical.EmptyConstraint
ModelAnalyzer.Numerical.VariableBoundAsConstraint
ModelAnalyzer.Numerical.DenseConstraint
ModelAnalyzer.Numerical.SmallMatrixCoefficient
ModelAnalyzer.Numerical.LargeMatrixCoefficient
ModelAnalyzer.Numerical.SmallBoundCoefficient
ModelAnalyzer.Numerical.LargeBoundCoefficient
ModelAnalyzer.Numerical.SmallRHSCoefficient
ModelAnalyzer.Numerical.LargeRHSCoefficient
ModelAnalyzer.Numerical.SmallObjectiveCoefficient
ModelAnalyzer.Numerical.LargeObjectiveCoefficient
ModelAnalyzer.Numerical.SmallObjectiveQuadraticCoefficient
ModelAnalyzer.Numerical.LargeObjectiveQuadraticCoefficient
ModelAnalyzer.Numerical.SmallMatrixQuadraticCoefficient
ModelAnalyzer.Numerical.LargeMatrixQuadraticCoefficient
ModelAnalyzer.Numerical.NonconvexQuadraticObjective
ModelAnalyzer.Numerical.NonconvexQuadraticConstraint
MathOptAnalyzer.Numerical.VariableNotInConstraints
MathOptAnalyzer.Numerical.EmptyConstraint
MathOptAnalyzer.Numerical.VariableBoundAsConstraint
MathOptAnalyzer.Numerical.DenseConstraint
MathOptAnalyzer.Numerical.SmallMatrixCoefficient
MathOptAnalyzer.Numerical.LargeMatrixCoefficient
MathOptAnalyzer.Numerical.SmallBoundCoefficient
MathOptAnalyzer.Numerical.LargeBoundCoefficient
MathOptAnalyzer.Numerical.SmallRHSCoefficient
MathOptAnalyzer.Numerical.LargeRHSCoefficient
MathOptAnalyzer.Numerical.SmallObjectiveCoefficient
MathOptAnalyzer.Numerical.LargeObjectiveCoefficient
MathOptAnalyzer.Numerical.SmallObjectiveQuadraticCoefficient
MathOptAnalyzer.Numerical.LargeObjectiveQuadraticCoefficient
MathOptAnalyzer.Numerical.SmallMatrixQuadraticCoefficient
MathOptAnalyzer.Numerical.LargeMatrixQuadraticCoefficient
MathOptAnalyzer.Numerical.NonconvexQuadraticObjective
MathOptAnalyzer.Numerical.NonconvexQuadraticConstraint
```

These issues are saved in the data structure that is returned from the `ModelAnalyzer.analyze` function:
These issues are saved in the data structure that is returned from the `MathOptAnalyzer.analyze` function:

```@docs
ModelAnalyzer.Numerical.Data
MathOptAnalyzer.Numerical.Data
```
Loading
Loading