Skip to content

Commit 9bcc61f

Browse files
committed
cargo fmt
1 parent 9482b22 commit 9bcc61f

4 files changed

Lines changed: 16 additions & 9 deletions

File tree

src/alm/alm_factory.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,9 @@ where
353353
// = JF2(u)'*F2(u)
354354

355355
// grad += c * jf2u_times_f2u_aux
356-
grad.iter_mut().zip(jf2u_times_f2u_aux.iter()).for_each(
357-
|(gradi, jf2u_times_f2u_aux_i)| *gradi += c * *jf2u_times_f2u_aux_i,
358-
);
356+
grad.iter_mut()
357+
.zip(jf2u_times_f2u_aux.iter())
358+
.for_each(|(gradi, jf2u_times_f2u_aux_i)| *gradi += c * *jf2u_times_f2u_aux_i);
359359
}
360360
Ok(())
361361
}

src/alm/alm_optimizer.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,10 +1041,7 @@ mod tests {
10411041
DummyConstraint,
10421042
>;
10431043

1044-
fn make_dummy_alm_problem(
1045-
n1: usize,
1046-
n2: usize,
1047-
) -> DummyAlmProblem {
1044+
fn make_dummy_alm_problem(n1: usize, n2: usize) -> DummyAlmProblem {
10481045
// Main problem data
10491046
let psi: DummyParametricCost = void_parameteric_cost;
10501047
let d_psi: DummyParametricGradient = void_parameteric_gradient;

src/cholesky_factorizer.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,12 @@ mod tests {
241241
let _ = factorizer.factorize(&a);
242242
assert!(3 == factorizer.dimension(), "wrong dimension");
243243
let expected_l = [2.0, 0.0, 0.0, 6.0, 1.0, 0.0, -8.0, 5.0, 3.0];
244-
unit_test_utils::nearly_equal_array(&expected_l, factorizer.cholesky_factor(), 1e-10, 1e-12);
244+
unit_test_utils::nearly_equal_array(
245+
&expected_l,
246+
factorizer.cholesky_factor(),
247+
1e-10,
248+
1e-12,
249+
);
245250
}
246251

247252
#[test]

src/constraints/tests.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,12 @@ fn t_affine_space_f32() {
11451145
let mut x = [1.0_f32, -2.0, -0.3, 0.5];
11461146
affine_set.project(&mut x);
11471147

1148-
let x_correct = [1.888_564_3_f32, 5.629_857_f32, 1.796_204_9_f32, 2.888_363_f32];
1148+
let x_correct = [
1149+
1.888_564_3_f32,
1150+
5.629_857_f32,
1151+
1.796_204_9_f32,
1152+
2.888_363_f32,
1153+
];
11491154
assert!((x[0] - x_correct[0]).abs() < 1e-4_f32);
11501155
assert!((x[1] - x_correct[1]).abs() < 1e-4_f32);
11511156
assert!((x[2] - x_correct[2]).abs() < 1e-4_f32);

0 commit comments

Comments
 (0)