@@ -119,13 +119,10 @@ void YamlParser::parseAndSetGeneralConfiguration(const YAML::Node& generalConfig
119
119
this ->source_ = purify::utilities::vis_source::measurements;
120
120
this ->measurements_ = get_vector<std::vector<std::string>>(
121
121
generalConfigNode, {" InputOutput" , " input" , " measurements" , " measurements_files" });
122
- try
123
- {
124
- this ->w_term_ = get<bool >(
125
- generalConfigNode, {" InputOutput" , " input" , " measurements" , " w_term" });
126
- }
127
- catch (...)
128
- {
122
+ try {
123
+ this ->w_term_ =
124
+ get<bool >(generalConfigNode, {" InputOutput" , " input" , " measurements" , " w_term" });
125
+ } catch (...) {
129
126
PURIFY_LOW_LOG (" W-term flag not set for input measurements; defaulting to true." );
130
127
this ->w_term_ = true ;
131
128
}
@@ -210,8 +207,7 @@ void YamlParser::parseAndSetSARA(const YAML::Node& SARANode) {
210
207
211
208
void YamlParser::parseAndSetAlgorithmOptions (const YAML::Node& algorithmOptionsNode) {
212
209
this ->algorithm_ = get<std::string>(algorithmOptionsNode, {" algorithm" });
213
- if (this ->algorithm_ == " padmm" )
214
- {
210
+ if (this ->algorithm_ == " padmm" ) {
215
211
this ->epsilonConvergenceScaling_ =
216
212
get<t_real>(algorithmOptionsNode, {" padmm" , " epsilonConvergenceScaling" });
217
213
this ->mpiAlgorithm_ = factory::algo_distribution_string.at (
@@ -223,9 +219,7 @@ void YamlParser::parseAndSetAlgorithmOptions(const YAML::Node& algorithmOptionsN
223
219
get<t_real>(algorithmOptionsNode, {" padmm" , " stepsize" , " update_tolerance" });
224
220
this ->dualFBVarianceConvergence_ =
225
221
get<t_real>(algorithmOptionsNode, {" padmm" , " dualFBVarianceConvergence" });
226
- }
227
- else if (this ->algorithm_ == " fb" or this ->algorithm_ == " fb_joint_map" )
228
- {
222
+ } else if (this ->algorithm_ == " fb" or this ->algorithm_ == " fb_joint_map" ) {
229
223
this ->mpiAlgorithm_ = factory::algo_distribution_string.at (
230
224
get<std::string>(algorithmOptionsNode, {" fb" , " mpiAlgorithm" }));
231
225
this ->relVarianceConvergence_ =
@@ -238,17 +232,17 @@ void YamlParser::parseAndSetAlgorithmOptions(const YAML::Node& algorithmOptionsN
238
232
239
233
this ->nondiffFuncType_ = nondiff_type_string.at (
240
234
get<std::string>(algorithmOptionsNode, {" fb" , " nonDifferentiableFunctionType" }));
241
- if (this ->nondiffFuncType_ == nondiff_func_type::Denoiser)
242
- {
235
+ if (this ->nondiffFuncType_ == nondiff_func_type::Denoiser) {
243
236
this ->model_path_ = get<std::string>(algorithmOptionsNode, {" fb" , " modelPath" });
244
237
}
245
238
246
239
this ->diffFuncType_ = diff_type_string.at (
247
240
get<std::string>(algorithmOptionsNode, {" fb" , " differentiableFunctionType" }));
248
- if (this ->diffFuncType_ == diff_func_type::L2Norm_with_CRR)
249
- {
250
- this ->CRR_function_model_path_ = get<std::string>(algorithmOptionsNode, {" fb" , " CRR_function_model_path" });
251
- this ->CRR_gradient_model_path_ = get<std::string>(algorithmOptionsNode, {" fb" , " CRR_gradient_model_path" });
241
+ if (this ->diffFuncType_ == diff_func_type::L2Norm_with_CRR) {
242
+ this ->CRR_function_model_path_ =
243
+ get<std::string>(algorithmOptionsNode, {" fb" , " CRR_function_model_path" });
244
+ this ->CRR_gradient_model_path_ =
245
+ get<std::string>(algorithmOptionsNode, {" fb" , " CRR_gradient_model_path" });
252
246
this ->CRR_mu_ = get<t_real>(algorithmOptionsNode, {" fb" , " CRR_mu" });
253
247
this ->CRR_lambda_ = get<t_real>(algorithmOptionsNode, {" fb" , " CRR_lambda" });
254
248
}
@@ -264,9 +258,7 @@ void YamlParser::parseAndSetAlgorithmOptions(const YAML::Node& algorithmOptionsN
264
258
get<t_real>(algorithmOptionsNode, {" fb" , " joint_map_estimation" , " alpha" });
265
259
this ->jmap_beta_ = get<t_real>(algorithmOptionsNode, {" fb" , " joint_map_estimation" , " beta" });
266
260
}
267
- }
268
- else if (this ->algorithm_ == " primaldual" )
269
- {
261
+ } else if (this ->algorithm_ == " primaldual" ) {
270
262
this ->epsilonConvergenceScaling_ =
271
263
get<t_real>(algorithmOptionsNode, {" primaldual" , " epsilonConvergenceScaling" });
272
264
this ->mpiAlgorithm_ = factory::algo_distribution_string.at (
@@ -279,9 +271,7 @@ void YamlParser::parseAndSetAlgorithmOptions(const YAML::Node& algorithmOptionsN
279
271
get<t_real>(algorithmOptionsNode, {" primaldual" , " stepsize" , " update_tolerance" });
280
272
this ->precondition_iters_ =
281
273
get<t_int>(algorithmOptionsNode, {" primaldual" , " precondition_iters" });
282
- }
283
- else
284
- {
274
+ } else {
285
275
throw std::runtime_error (
286
276
" Only padmm algorithm configured for now. Please fill the appropriate block in the "
287
277
" configuration file." );
0 commit comments