From 18a6f4c7ebe7dbb1d2a965bb3ff24711b236b9ae Mon Sep 17 00:00:00 2001
From: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
Date: Wed, 31 Jan 2024 19:00:37 +0000
Subject: [PATCH] apply constraints to vector variables

---
 src/building_blocks.jl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/building_blocks.jl b/src/building_blocks.jl
index f2219f4..08343c3 100644
--- a/src/building_blocks.jl
+++ b/src/building_blocks.jl
@@ -282,6 +282,7 @@ apply_simple_constraint!(model::Model, variable, value::Symbol) = apply_simple_c
 apply_simple_constraint!(model::Model, variable, ::Val{:min}) = @objective model Min objective_function(model) + variable
 apply_simple_constraint!(model::Model, variable, ::Val{:max}) = @objective model Min objective_function(model) - variable
 apply_simple_constraint!(model::Model, variable, value::VariableType) = @constraint model variable == value
+apply_simple_constraint!(model::Model, variable::AbstractVector, value::AbstractVector) = [apply_simple_constraint!(model, v1, v2) for (v1, v2) in zip(variable, value)]
 
 
 """
-- 
GitLab