From ec93d20d36fd8c7181da09ed4f30eeb9299e3132 Mon Sep 17 00:00:00 2001 From: jalving Date: Wed, 17 Jul 2024 11:51:29 -0700 Subject: [PATCH] remove private methods; update readme --- README.md | 23 +++++++++++++++++++---- docs/src/index.md | 2 +- src/backends/moi_backend.jl | 10 +++++++--- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 1d5b327..11077df 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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) \ No newline at end of file diff --git a/docs/src/index.md b/docs/src/index.md index c65d146..a63d521 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -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) diff --git a/src/backends/moi_backend.jl b/src/backends/moi_backend.jl index 4ade6cc..028c69e 100644 --- a/src/backends/moi_backend.jl +++ b/src/backends/moi_backend.jl @@ -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() @@ -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