Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.

Add @dantzig_wolfe macro for declarative decomposition - #4

Merged
guimarqu merged 6 commits into
mainfrom
feat/dw_macro
Aug 25, 2025
Merged

Add @dantzig_wolfe macro for declarative decomposition#4
guimarqu merged 6 commits into
mainfrom
feat/dw_macro

Conversation

@guimarqu

Copy link
Copy Markdown
Member

Summary

  • Add declarative syntax for Dantzig-Wolfe decomposition
  • Replace callback functions with pattern matching syntax
  • Generate multiple method definitions using Julia's dispatch

Example

@dantzig_wolfe model begin
    assignment[m, _] => subproblem(m)
    capacity[m] => subproblem(m)
    coverage[_] => master()
end

Implements declarative syntax for Dantzig-Wolfe decomposition using pattern matching:
- Pattern syntax: constraint[m, _] => subproblem(m), coverage[_] => master()
- Generates multiple method definitions using gensym() for unique function names
- Full integration with existing dantzig_wolfe_decomposition infrastructure
- Comprehensive test suite with error handling and compatibility validation
Comment thread test/ReformulationKitUnitTests/dantzig_wolfe/macro.jl Outdated
Comment thread test/ReformulationKitUnitTests/dantzig_wolfe/macro.jl Outdated
Comment thread test/ReformulationKitUnitTests/dantzig_wolfe/macro.jl Outdated
Updated partitionning.jl to use Set{Tuple{}} for scalar
elements instead of Set{Tuple} to match models.jl type
annotations. Changed function signatures to Dict{Symbol,Any}
for type flexibility while maintaining Set{Tuple{}} for
scalar variable/constraint indexes.

This ensures proper type alignment between partitioning
and registration components throughout the pipeline.
Added documentation for new declarative macro approach
alongside original function-based annotations. Shows
pattern matching examples and scalar variable support.
@guimarqu
guimarqu merged commit 874de15 into main Aug 25, 2025
@guimarqu
guimarqu deleted the feat/dw_macro branch August 25, 2025 21:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant