@@ -171,41 +171,39 @@ function RAMMatrices(
171171 # handle constants
172172 constants = Vector {RAMConstant} ()
173173
174- for i in 1 : length (partable)
175- from, parameter_type, to, free, value_fixed, param = partable[i]
176-
177- row_ind = positions[to]
178- col_ind = from != Symbol (" 1" ) ? positions[from] : nothing
179-
180- if ! free
181- if (parameter_type == :→ ) && (from == Symbol (" 1" ))
182- push! (constants, RAMConstant (:M , row_ind, value_fixed))
183- elseif (parameter_type == :→ )
174+ for r in partable
175+ row_ind = positions[r. to]
176+ col_ind = r. from != Symbol (" 1" ) ? positions[r. from] : nothing
177+
178+ if ! r. free
179+ if (r. parameter_type == :→ ) && (r. from == Symbol (" 1" ))
180+ push! (constants, RAMConstant (:M , row_ind, r. value_fixed))
181+ elseif r. parameter_type == :→
184182 push! (
185183 constants,
186- RAMConstant (:A , CartesianIndex (row_ind, col_ind), value_fixed),
184+ RAMConstant (:A , CartesianIndex (row_ind, col_ind), r . value_fixed),
187185 )
188- elseif ( parameter_type == :↔ )
186+ elseif r . parameter_type == :↔
189187 push! (
190188 constants,
191- RAMConstant (:S , CartesianIndex (row_ind, col_ind), value_fixed),
189+ RAMConstant (:S , CartesianIndex (row_ind, col_ind), r . value_fixed),
192190 )
193191 else
194- error (" Unsupported parameter type: $(parameter_type) " )
192+ error (" Unsupported parameter type: $(r . parameter_type) " )
195193 end
196194 else
197- par_ind = params_index[param]
198- if (parameter_type == :→ ) && (from == Symbol (" 1" ))
195+ par_ind = params_index[r . param]
196+ if (r . parameter_type == :→ ) && (r . from == Symbol (" 1" ))
199197 push! (M_ind[par_ind], row_ind)
200- elseif parameter_type == :→
198+ elseif r . parameter_type == :→
201199 push! (A_ind[par_ind], row_ind + (col_ind - 1 ) * n_node)
202- elseif parameter_type == :↔
200+ elseif r . parameter_type == :↔
203201 push! (S_ind[par_ind], row_ind + (col_ind - 1 ) * n_node)
204202 if row_ind != col_ind
205203 push! (S_ind[par_ind], col_ind + (row_ind - 1 ) * n_node)
206204 end
207205 else
208- error (" Unsupported parameter type: $(parameter_type) " )
206+ error (" Unsupported parameter type: $(r . parameter_type) " )
209207 end
210208 end
211209 end
0 commit comments