107107# ############## Problem specific implementations ################
108108# ## independent set ###
109109function generate_tensors (fx, gp:: Independence )
110- ixs = collect_ixs (gp. code)
110+ ixs = getixsv (gp. code)
111111 n = length (unique! (vcat (ixs... )))
112112 T = typeof (fx (ixs[1 ][1 ]))
113113 return map (enumerate (ixs)) do (i, ix)
@@ -131,7 +131,7 @@ misv(val::T) where T = [one(T), val]
131131
132132# ## coloring ###
133133function generate_tensors (fx, c:: Coloring{K} ) where K
134- ixs = collect_ixs (c. code)
134+ ixs = getixsv (c. code)
135135 T = eltype (fx (ixs[1 ][1 ]))
136136 return map (ixs) do ix
137137 # if the tensor rank is 1, create a vertex tensor.
@@ -153,7 +153,7 @@ coloringv(vals::Vector{T}) where T = vals
153153
154154# ## matching ###
155155function generate_tensors (fx, m:: Matching )
156- ixs = collect_ixs (m. code)
156+ ixs = getixsv (m. code)
157157 T = typeof (fx (ixs[1 ][1 ]))
158158 n = length (unique! (vcat (ixs... ))) # number of vertices
159159 tensors = []
180180
181181# ## maximal independent set ###
182182function generate_tensors (fx, mi:: MaximalIndependence )
183- ixs = collect_ixs (mi. code)
183+ ixs = getixsv (mi. code)
184184 T = eltype (fx (ixs[1 ][end ]))
185185 return map (ixs) do ix
186186 neighbortensor (fx (ix[end ]), length (ix))
197197
198198# ## max cut/spin glass problem ###
199199function generate_tensors (fx, gp:: MaxCut )
200- ixs = collect_ixs (gp. code)
200+ ixs = getixsv (gp. code)
201201 return map (enumerate (ixs)) do (i, ix)
202202 maxcutb (fx (ix))
203203 end
0 commit comments