File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,21 @@ function remove_redundant_cuts!(Vts::Vector{PolyhedralFunction})
8686 end
8787end
8888
89+ """ Concatenate collection of arrays of PolyhedralFunction."""
90+ function catcutsarray (polyfunarray:: Vector{StochDynamicProgramming.PolyhedralFunction} ...)
91+ assert (length (polyfunarray) > 0 )
92+ ntimes = length (polyfunarray[1 ])
93+ return StochDynamicProgramming. PolyhedralFunction[catcuts ([V[t] for V in polyfunarray]. .. ) for t in 1 : ntimes]
94+ end
95+
96+
97+ """ Concatenate collection of PolyhedralFunction."""
98+ function catcuts (Vts:: StochDynamicProgramming.PolyhedralFunction... )
99+ betas = vcat ([V. betas for V in Vts]. .. )
100+ lambdas = vcat ([V. lambdas for V in Vts]. .. )
101+ numcuts = sum ([V. numCuts for V in Vts])
102+ return StochDynamicProgramming. PolyhedralFunction (betas, lambdas, numcuts)
103+ end
89104
90105"""
91106Extract a vector stored in a 3D Array
You can’t perform that action at this time.
0 commit comments