@@ -172,41 +172,39 @@ function RAMMatrices(
172172 # handle constants
173173 constants = Vector {RAMConstant} ()
174174
175- for i in 1 : length (partable)
176- from, parameter_type, to, free, value_fixed, param = partable[i]
177-
178- row_ind = positions[to]
179- col_ind = from != Symbol (" 1" ) ? positions[from] : nothing
180-
181- if ! free
182- if (parameter_type == :→ ) && (from == Symbol (" 1" ))
183- push! (constants, RAMConstant (:M , row_ind, value_fixed))
184- elseif (parameter_type == :→ )
175+ for r in partable
176+ row_ind = positions[r. to]
177+ col_ind = r. from != Symbol (" 1" ) ? positions[r. from] : nothing
178+
179+ if ! r. free
180+ if (r. parameter_type == :→ ) && (r. from == Symbol (" 1" ))
181+ push! (constants, RAMConstant (:M , row_ind, r. value_fixed))
182+ elseif r. parameter_type == :→
185183 push! (
186184 constants,
187- RAMConstant (:A , CartesianIndex (row_ind, col_ind), value_fixed),
185+ RAMConstant (:A , CartesianIndex (row_ind, col_ind), r . value_fixed),
188186 )
189- elseif ( parameter_type == :↔ )
187+ elseif r . parameter_type == :↔
190188 push! (
191189 constants,
192- RAMConstant (:S , CartesianIndex (row_ind, col_ind), value_fixed),
190+ RAMConstant (:S , CartesianIndex (row_ind, col_ind), r . value_fixed),
193191 )
194192 else
195- error (" Unsupported parameter type: $(parameter_type) " )
193+ error (" Unsupported parameter type: $(r . parameter_type) " )
196194 end
197195 else
198- par_ind = params_index[param]
199- if (parameter_type == :→ ) && (from == Symbol (" 1" ))
196+ par_ind = params_index[r . param]
197+ if (r . parameter_type == :→ ) && (r . from == Symbol (" 1" ))
200198 push! (M_ind[par_ind], row_ind)
201- elseif parameter_type == :→
199+ elseif r . parameter_type == :→
202200 push! (A_ind[par_ind], row_ind + (col_ind - 1 ) * n_node)
203- elseif parameter_type == :↔
201+ elseif r . parameter_type == :↔
204202 push! (S_ind[par_ind], row_ind + (col_ind - 1 ) * n_node)
205203 if row_ind != col_ind
206204 push! (S_ind[par_ind], col_ind + (row_ind - 1 ) * n_node)
207205 end
208206 else
209- error (" Unsupported parameter type: $(parameter_type) " )
207+ error (" Unsupported parameter type: $(r . parameter_type) " )
210208 end
211209 end
212210 end
0 commit comments