Skip to content

Commit

Permalink
remove private methods; update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jalving committed Jul 17, 2024
1 parent cf96915 commit ec93d20
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The core data structure in Plasmo.jl is the `OptiGraph`. The optigraph contains

## License

Plasmo is licensed under the [MPL 2.0 license](https://github.com/plasmo-dev/Plasmo.jl/blob/main/LICENSE.md).
Plasmo.jl is licensed under the [MPL 2.0 license](https://github.com/plasmo-dev/Plasmo.jl/blob/main/LICENSE.md).

## Installation

Expand Down Expand Up @@ -98,8 +98,23 @@ If you find Plasmo.jl useful for your work, you may cite the [manuscript](https:
journal={Mathematical Programming Computation},
year={2022},
volume={14},
pages={699 - 747}
pages={699 - 747},
doi={10.1007/s12532-022-00223-3}
}
```
There is also a freely available [pre-print](https://arxiv.org/abs/2006.05378).

You can also access a freely available [pre-print](https://arxiv.org/abs/2006.05378).

There is also an earlier manuscript where we presented the initial ideas behind Plasmo.jl which you can find
[here](https://www.sciencedirect.com/science/article/abs/pii/S0098135418312687):
``` sourceCode
@article{JalvingCaoZavala2019,
author = {Jalving, Jordan and Cao, Yankai and Zavala, Victor M},
journal = {Computers {\&} Chemical Engineering},
pages = {134--154},
title = {Graph-based modeling and simulation of complex systems},
volume = {125},
year = {2019},
doi = {10.1016/j.compchemeng.2019.03.009}
}
```
A pre-print of this paper can be found [here](https://arxiv.org/abs/1812.04983)
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pages = {134--154},
title = {Graph-based modeling and simulation of complex systems},
volume = {125},
year = {2019},
doi = {https://doi.org/10.1016/j.compchemeng.2019.03.009}
doi = {10.1016/j.compchemeng.2019.03.009}
}
```
A pre-print of this paper can also be found [here](https://arxiv.org/abs/1812.04983)
10 changes: 7 additions & 3 deletions src/backends/moi_backend.jl
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,11 @@ function _copy_subgraph_edges!(backend::GraphMOIBackend, subgraph::OptiGraph)
end
end

# TODO: re-implement MOIU._is_variable_function
# copied from: https://github.com/jump-dev/MathOptInterface.jl/blob/a15b67fe47ad20caf316eb1bba0369a46ceb5a34/src/Utilities/copy.jl#L268-L270
_is_variable_function(::Type{MOI.VariableIndex}) = true
_is_variable_function(::Type{MOI.VectorOfVariables}) = true
_is_variable_function(::Any) = false

function _copy_node_to_backend!(backend::GraphMOIBackend, node::OptiNode)
dest = backend
index_map = MOIU.IndexMap()
Expand All @@ -715,13 +719,13 @@ function _copy_node_to_backend!(backend::GraphMOIBackend, node::OptiNode)
# we try to constrain variables on creation.
all_constraint_types = MOI.get(node, MOI.ListOfConstraintTypesPresent())
variable_constraint_types = filter(all_constraint_types) do (F, S)
return MOIU._is_variable_function(F)
return _is_variable_function(F)
end
_copy_element_constraints(dest, node, index_map, variable_constraint_types)

# copy non-variable constraints
nonvariable_constraint_types = filter(all_constraint_types) do (F, S)
return !MOIU._is_variable_function(F)
return !_is_variable_function(F)
end
_copy_element_constraints(dest, node, index_map, nonvariable_constraint_types)
return nothing
Expand Down

0 comments on commit ec93d20

Please sign in to comment.